summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-10 04:59:53 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-10 04:59:53 +0000
commitd574e16397271aa01b5a8ce41738a89be911b0ac (patch)
treef61928bb6ac559f81a9263524b6a29206208bafd /src/map/skill.c
parenta1427a9fd0b12fd8da24e8e322917ab992c6252a (diff)
downloadhercules-d574e16397271aa01b5a8ce41738a89be911b0ac.tar.gz
hercules-d574e16397271aa01b5a8ce41738a89be911b0ac.tar.bz2
hercules-d574e16397271aa01b5a8ce41738a89be911b0ac.tar.xz
hercules-d574e16397271aa01b5a8ce41738a89be911b0ac.zip
- Fixed Auto Spell not working
- Fixed problems with skill level check - Added text job names support for @job - Added some new monster skills git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@527 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c63
1 files changed, 40 insertions, 23 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 542eb96b4..31464e932 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1,4 +1,4 @@
-// $Id: skill.c,v 1.8 2004/12/7 9:42:00 PM Celestia Exp $
+// $Id: skill.c,v 1.8 2004/12/9 8:14:18 PM Celestia Exp $
/* �X�L��?�W */
#include <stdio.h>
@@ -920,6 +920,7 @@ int skill_get_unit_id(int id,int flag)
case WZ_FROSTNOVA: return 0x86; /* �t���X�g�m���@ */
case WZ_STORMGUST: return 0x86; /* �X�g?���K�X�g(�Ƃ肠����LoV�Ɠ�����?��) */
case CR_GRANDCROSS: return 0x86; /* �O�����h�N���X */
+ case NPC_DARKGRANDCROSS: return 0x86; /*�ŃO�����h�N���X*/
case WZ_FIREPILLAR: return (flag==0)?0x87:0x88; /* �t�@�C�A?�s��? */
case HT_TALKIEBOX: return 0x99; /* �g?�L?�{�b�N�X */
case WZ_ICEWALL: return 0x8d; /* �A�C�X�E�H?�� */
@@ -1186,6 +1187,7 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s
break;
case CR_GRANDCROSS: /* �O�����h�N���X */
+ case NPC_DARKGRANDCROSS: /*�ŃO�����h�N���X*/
{
int race = battle_get_race(bl);
if( (battle_check_undead(race,battle_get_elem_type(bl)) || race == 6) && rand()%100 < 100000*sc_def_int/100) //?���t?�������S�ϐ��ɂ͖�?
@@ -1520,7 +1522,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
struct status_change *sc_data;
int type,lv,damage;
- if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0;
rdamage = 0;
nullpo_retr(0, src);
@@ -1606,7 +1608,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
if(damage <= 0 || damage < dmg.div_) //������΂�����H��
dmg.blewcount = 0;
- if(skillid == CR_GRANDCROSS) {//�O�����h�N���X
+ if(skillid == CR_GRANDCROSS||skillid == NPC_DARKGRANDCROSS) {//�O�����h�N���X
if(battle_config.gx_disptype) dsrc = src; // �G�_��?�W�������\��
if( src == bl) type = 4; // �����̓_��?�W��?�V�����Ȃ�
}
@@ -1983,7 +1985,8 @@ int skill_check_unit_range2(int m,int x,int y,int range)
/* ?�ۂ�?���J�E���g����B�iskill_area_temp[0]�����������Ă������Ɓj */
int skill_area_sub_count(struct block_list *src,struct block_list *target,int skillid,int skilllv,unsigned int tick,int flag)
{
- if(skilllv <= 0) return 0;
+ //if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0; // celest
if(skill_area_temp[0] < 0xffff)
skill_area_temp[0]++;
return 0;
@@ -2252,7 +2255,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
struct status_change *sc_data = battle_get_sc_data(src);
int i;
- if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0;
nullpo_retr(1, src);
nullpo_retr(1, bl);
@@ -2262,7 +2265,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
if(sd && pc_isdead(sd))
return 1;
- if((skillid == WZ_SIGHTRASHER || skillid == CR_GRANDCROSS) && src != bl)
+ if((skillid == WZ_SIGHTRASHER || skillid == CR_GRANDCROSS || skillid == NPC_DARKGRANDCROSS) && src != bl)
bl = src;
if(bl->prev == NULL)
return 1;
@@ -2577,14 +2580,16 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
/* ���@�n�X�L�� */
case MG_SOULSTRIKE: /* �\�E���X�g���C�N */
- case MG_COLDBOLT: /* �R?���h�{���g */
- case MG_FIREBOLT: /* �t�@�C�A?�{���g */
+ case NPC_DARKSOULSTRIKE: /*�Ń\�E���X�g���C�N*/
+ case MG_COLDBOLT: /* �R�[���h�{���g */
+ case MG_FIREBOLT: /* �t�@�C�A�[�{���g */
case MG_LIGHTNINGBOLT: /* ���C�g�j���O�{���g */
- case WZ_EARTHSPIKE: /* �A?�X�X�p�C�N */
- case AL_HEAL: /* �q?�� */
- case AL_HOLYLIGHT: /* �z?��?���C�g */
- case MG_FROSTDIVER: /* �t���X�g�_�C�o? */
- case WZ_JUPITEL: /* ���s�e���T���_? */
+ case WZ_EARTHSPIKE: /* �A�[�X�X�p�C�N */
+ case AL_HEAL: /* �q�[�� */
+ case AL_HOLYLIGHT: /* �z�[���[���C�g */
+ case MG_FROSTDIVER: /* �t���X�g�_�C�o�[ */
+ case WZ_JUPITEL: /* ���s�e���T���_�[ */
+ case NPC_DARKJUPITEL: /*���s�e��*/
case NPC_MAGICALATTACK: /* MOB:���@��?�U? */
case PR_ASPERSIO: /* �A�X�y���V�I */
// case HW_NAPALMVULCAN: /* �i�p�[���o���J�� */
@@ -2705,6 +2710,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
break;
case CR_GRANDCROSS: /* �O�����h�N���X */
+ case NPC_DARKGRANDCROSS: /*�ŃO�����h�N���X*/
/* �X�L�����j�b�g�z�u */
skill_castend_pos2(src,bl->x,bl->y,skillid,skilllv,tick,0);
if(sd)
@@ -2832,7 +2838,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
,1157,1159,1190,1272,1312,1373,1492};
int poringclass[]={1002};
- if(skilllv <= 0) return 0;
+ //if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0; // celest
nullpo_retr(1, src);
nullpo_retr(1, bl);
@@ -4327,9 +4334,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case NPC_SUMMONSLAVE: /* �艺���� */
case NPC_SUMMONMONSTER: /* MOB���� */
- if(md && !md->master_id){
+ if(md)
mob_summonslave(md,mob_db[md->class].skill[md->skillidx].val,skilllv,(skillid==NPC_SUMMONSLAVE)?1:0);
- }
break;
case NPC_TRANSFORMATION:
@@ -4850,7 +4856,8 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
struct map_session_data *sd=NULL;
int i,tmpx = 0,tmpy = 0, x1 = 0, y1 = 0;
- if(skilllv <= 0) return 0;
+ //if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0; // celest
nullpo_retr(0, src);
@@ -4893,8 +4900,12 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
case HT_DETECTING: /* �f�B�e�N�e�B���O */
{
const int range=7;
+ if(src->x!=x)
+ x+=(src->x-x>0)?-range:range;
+ if(src->y!=y)
+ y+=(src->y-y>0)?-range:range;
map_foreachinarea( skill_status_change_timer_sub,
- src->m, src->x-range, src->y-range, src->x+range,src->y+range,0,
+ src->m, x-range, y-range, x+range,y+range,0,
src,SC_SIGHT,tick);
}
break;
@@ -4914,6 +4925,7 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
case PR_SANCTUARY: /* �T���N�`���A�� */
case PR_MAGNUS: /* �}�O�k�X�G�N�\�V�Y�� */
case CR_GRANDCROSS: /* �O�����h�N���X */
+ case NPC_DARKGRANDCROSS: /*�ŃO�����h�N���X*/
case HT_SKIDTRAP: /* �X�L�b�h�g���b�v */
case HT_LANDMINE: /* �����h�}�C�� */
case HT_ANKLESNARE: /* �A���N���X�l�A */
@@ -5331,6 +5343,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
break;
case CR_GRANDCROSS: /* �O�����h�N���X */
+ case NPC_DARKGRANDCROSS: /*�ŃO�����h�N���X*/
count=29;
limit=1000;
interval=300;
@@ -5641,6 +5654,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
break;
case CR_GRANDCROSS: /* �O�����h�N���X */
+ case NPC_DARKGRANDCROSS: /*�ŃO�����h�N���X*/
{
static const int dx[]={
0, 0, -1,0,1, -2,-1,0,1,2, -4,-3,-2,-1,0,1,2,3,4, -2,-1,0,1,2, -1,0,1, 0, 0, };
@@ -6786,7 +6800,8 @@ static int skill_check_condition_use_sub(struct block_list *bl,va_list ap)
ss_class = pc_calc_base_job(ssd->status.class);
skillid=ssd->skillid;
skilllv=ssd->skilllv;
- if(skilllv <= 0) return 0;
+ //if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0; // celest
switch(skillid){
case PR_BENEDICTIO: /* ��?�~�� */
if(sd != ssd && (s_class.job == 4 || s_class.job == 8 || s_class.job == 15) &&
@@ -8284,7 +8299,8 @@ int skill_attack_area(struct block_list *bl,va_list ap)
return 0;
skillid=va_arg(ap,int);
skilllv=va_arg(ap,int);
- if(skilllv <= 0) return 0;
+ //if(skilllv <= 0) return 0;
+ if(skillid > 0 && skilllv <= 0) return 0; // celest
tick=va_arg(ap,unsigned int);
flag=va_arg(ap,int);
type=va_arg(ap,int);
@@ -8818,6 +8834,7 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data)
if(sc_data[type].timer != tid) {
if(battle_config.error_log)
printf("skill_status_change_timer %d != %d\n",tid,sc_data[type].timer);
+ return 0;
}
switch(type){ /* �����?���ɂȂ�ꍇ */
@@ -9096,7 +9113,7 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data)
case SC_MEMORIZE: /* �������C�Y */
case SC_BROKNWEAPON:
case SC_BROKNARMOR:
- if(sc_data[type].timer==tid)
+// if(sc_data[type].timer==tid)
sc_data[type].timer=add_timer( 1000*600+tick,skill_status_change_timer, bl->id, data );
return 0;
@@ -9373,7 +9390,7 @@ int skill_status_change_start(struct block_list *bl, int type, int val1, int val
type != SC_SPEEDPOTION0 && type != SC_SPEEDPOTION1 && type != SC_SPEEDPOTION2
&& type != SC_ATKPOT && type != SC_MATKPOT) // added atk and matk potions [Valaris]
return 0;
- if(type >=SC_STAN && type <= SC_BLIND)
+ if ((type >=SC_STAN && type <= SC_BLIND) || type == SC_DPOISON)
return 0;/* ?���������ł��Ȃ�?�Ԉُ�ł��鎞��?�Ԉُ���s��Ȃ� */
if(type == SC_GRAFFITI){ //�ُ풆�ɂ�����x?�Ԉُ�ɂȂ������ɉ������Ă���ēx������
skill_status_change_end(bl,type,-1);
@@ -9941,11 +9958,11 @@ int skill_status_change_start(struct block_list *bl, int type, int val1, int val
case SC_BERSERK:
calc_flag=1;
break;
+*/
case SC_ASSUMPTIO:
if(sc_data[SC_KYRIE].timer!=-1 )
skill_status_change_end(bl,SC_KYRIE,-1);
break;
-*/
case SC_WINDWALK: /* �E�C���h�E�H?�N */
calc_flag = 1;
val2 = (val1 / 2); //Flee�㏸��