From 11595c1ead1494189ecd8bbed1fa6252649b84f1 Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 14 Feb 2006 21:35:53 +0000 Subject: - Hiding cancels Close Confine. - Added the move enable condition to High Jump and Jump Kick. - ST_MOVE_ENABLE now also checks for pc_can_move(), and only perform a walk check if the skill is ground targetted. - Moved the berserk_cancel_buffs code to status_change_start. - Moved most checks of status_isimmune() to status_get_sc_def - Allowed Endow skills to go through status_isinmune characters. - Added variable type to skill_castend_nodamage_id which holds the value of SkillStatusChangeTable[skillid] to simplify code reading afterwards. - Fixed PR_BENEDICTIO not taking away all SP - Fixed the most horrible typo ever. (SC_STAN -> SC_STUN) - Added StatusSkillChangeTable which returns the Skill for a given SC. Used in skill_additional_effect for SC cards. - Removed the whole ugly static implementation of SkillStatusChangeTable, see status_initChangeTables() for new format which is much easier to read. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5278 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 4 +- src/map/mob.c | 2 +- src/map/skill.c | 465 ++++++++++++----------------- src/map/status.c | 893 ++++++++++++++++++++----------------------------------- src/map/status.h | 5 +- 5 files changed, 514 insertions(+), 855 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index 35bc48183..a5b711bab 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1386,7 +1386,7 @@ static struct Damage battle_calc_weapon_attack( } if ((tsc && !flag.hit) && (tsc->data[SC_SLEEP].timer!=-1 || - tsc->data[SC_STAN].timer!=-1 || + tsc->data[SC_STUN].timer!=-1 || tsc->data[SC_FREEZE].timer!=-1 || (tsc->data[SC_STONE].timer!=-1 && tsc->data[SC_STONE].val2==0)) ) @@ -2808,7 +2808,7 @@ struct Damage battle_calc_misc_attack( struct status_change *sc = status_get_sc(target); int hitrate=status_get_hit(bl) - status_get_flee(target) + 80; hitrate = ( (hitrate>95)?95: ((hitrate<5)?5:hitrate) ); - if(sc && sc->count && (sc->data[SC_SLEEP].timer!=-1 || sc->data[SC_STAN].timer!=-1 || + if(sc && sc->count && (sc->data[SC_SLEEP].timer!=-1 || sc->data[SC_STUN].timer!=-1 || sc->data[SC_FREEZE].timer!=-1 || (sc->data[SC_STONE].timer!=-1 && sc->data[SC_STONE].val2==0) ) ) hitrate = 1000000; if(rand()%100 < hitrate) { diff --git a/src/map/mob.c b/src/map/mob.c index ac53f77c2..1c9ec49f3 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -4572,7 +4572,7 @@ static int mob_readskilldb(void) { "anybad", -1 }, { "stone", SC_STONE }, { "freeze", SC_FREEZE }, - { "stan", SC_STAN }, + { "stan", SC_STUN }, { "sleep", SC_SLEEP }, { "poison", SC_POISON }, { "curse", SC_CURSE }, diff --git a/src/map/skill.c b/src/map/skill.c index 6809b3ce8..b1836c6bc 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -777,18 +777,6 @@ struct skill_unit_layout *skill_get_unit_layout (int skillid, int skilllv, struc */ int skill_additional_effect (struct block_list* src, struct block_list *bl, int skillid, int skilllv, int attack_type, unsigned int tick) { - /* MOB追加?果スキル用 */ - const int scl[]={ - SC_POISON, SC_BLIND, SC_SILENCE, SC_STAN, - SC_STONE, SC_CURSE, SC_SLEEP - }; - const int sc2l[]={ //Note: We use Sonic Blow's stun duration for the confusion lasting time (dummy value): 12 secs at lv7 - MG_STONECURSE,MG_FROSTDIVER,NPC_STUNATTACK, - NPC_SLEEPATTACK,TF_POISON,NPC_CURSEATTACK, - NPC_SILENCEATTACK,AS_SONICBLOW,NPC_BLINDATTACK, - LK_HEADCRUSH - }; - struct map_session_data *sd=NULL; struct map_session_data *dstsd=NULL; struct status_change *sc; @@ -911,7 +899,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int case SM_BASH: /* バッシュ?i急??U??j */ if( sd && skilllv > 5 && pc_checkskill(sd,SM_FATALBLOW)>0 ){ //TODO: How much % per base level it actually is? - status_change_start(bl,SC_STAN,(5*(skilllv-5)+(int)sd->status.base_level/10), + status_change_start(bl,SC_STUN,(5*(skilllv-5)+(int)sd->status.base_level/10), skilllv,0,0,0,skill_get_time2(SM_FATALBLOW,skilllv),0); } break; @@ -929,7 +917,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case AS_SONICBLOW: /* ソニックブ?? */ - status_change_start(bl,SC_STAN,(2*skilllv+10), + status_change_start(bl,SC_STUN,(2*skilllv+10), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; @@ -959,7 +947,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case WZ_METEOR: - status_change_start(bl,SC_STAN,3*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STUN,3*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case WZ_VERMILION: @@ -978,7 +966,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case HT_LANDMINE: /* ランドマイン */ - status_change_start(bl,SC_STAN,(5*skilllv+30), + status_change_start(bl,SC_STUN,(5*skilllv+30), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; @@ -999,7 +987,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case TF_THROWSTONE: /* ?ホ投げ */ - status_change_start(bl,SC_STAN,3,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STUN,3,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); status_change_start(bl,SC_BLIND,3,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; @@ -1032,7 +1020,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case CR_SHIELDCHARGE: /* シ?ルドチャ?ジ */ - status_change_start(bl,SC_STAN,(15+skilllv*5), + status_change_start(bl,SC_STUN,(15+skilllv*5), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; @@ -1044,7 +1032,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case RG_RAID: /* サプライズアタック */ - status_change_start(bl,SC_STAN,(10+3*skilllv), + status_change_start(bl,SC_STUN,(10+3*skilllv), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); status_change_start(bl,SC_BLIND,(10+3*skilllv), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); @@ -1056,7 +1044,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case DC_SCREAM: - status_change_start(bl,SC_STAN,(25+5*skilllv), + status_change_start(bl,SC_STUN,(25+5*skilllv), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; @@ -1077,7 +1065,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case SL_STUN: if (status_get_size(bl)==1) //Only stuns mid-sized mobs. - status_change_start(bl,SC_STAN,(30+10*skilllv),skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SC_STUN,(30+10*skilllv),skilllv,0,0,0,skill_get_time(skillid,skilllv),0); break; case SG_SUN_WARM: case SG_MOON_WARM: @@ -1095,15 +1083,11 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int case NPC_CURSEATTACK: case NPC_SLEEPATTACK: case NPC_BLINDATTACK: - status_change_start(bl,scl[skillid-NPC_POISON],100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); - break; case NPC_POISON: case NPC_SILENCEATTACK: case NPC_STUNATTACK: - if(src->type==BL_PET) - status_change_start(bl,scl[skillid-NPC_POISON],100,skilllv,0,0,0,skilllv*1000,0); - else - status_change_start(bl,scl[skillid-NPC_POISON],100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SkillStatusChangeTable[skillid],100,skilllv,0,0,0, + src->type==BL_PET?skilllv*1000:skill_get_time2(skillid,skilllv),0); break; case NPC_MENTALBREAKER: @@ -1183,7 +1167,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int status_change_start(bl,SC_BLIND,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,1),0); break; case 1: - status_change_start(bl,SC_STAN,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,2),0); + status_change_start(bl,SC_STUN,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,2),0); break; default: status_change_start(bl,SC_BLEEDING,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,3),0); @@ -1196,7 +1180,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case WS_CARTTERMINATION: // Cart termination - status_change_start(bl,SC_STAN,5*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STUN,5*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case CR_ACIDDEMONSTRATION: @@ -1210,7 +1194,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case TK_DOWNKICK: - status_change_start(bl,SC_STAN,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SC_STUN,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); break; case TK_JUMPKICK: @@ -1237,7 +1221,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; case MO_BALKYOUNG: //Note: attack_type is passed as BF_WEAPON for the actual target, BF_MISC for the splash-affected mobs. if(attack_type == BF_MISC) //70% base stun chance... - status_change_start(bl,SC_STAN,70,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STUN,70,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; } @@ -1255,7 +1239,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int continue; //Code Speedup. rate/=100; //For some reason user effects are on a 10000 scale... - status_change_start(bl,i,rate,7,0,0,0,skill_get_time2(sc2l[type],7),0); + status_change_start(bl,i,rate,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0); } } @@ -1317,12 +1301,6 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int */ int skill_counter_additional_effect (struct block_list* src, struct block_list *bl, int skillid, int skilllv, int attack_type, unsigned int tick) { - const int sc2[]={ - MG_STONECURSE,MG_FROSTDIVER,NPC_STUNATTACK, - NPC_SLEEPATTACK,TF_POISON,NPC_CURSEATTACK, - NPC_SILENCEATTACK,AS_SONICBLOW,NPC_BLINDATTACK, - LK_HEADCRUSH - }; int rate; struct map_session_data *sd=NULL; struct map_session_data *dstsd=NULL; @@ -1384,11 +1362,11 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list * rate = sd?(sd->addeff2[type]+(sd->state.arrow_atk?sd->arrow_addeff2[type]:0)):0; if (rate) //Self infliced status from attacking. - status_change_start(src,i,rate/100,7,0,0,0,skill_get_time2(sc2[type],7),0); + status_change_start(src,i,rate/100,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0); rate = dstsd?dstsd->addeff3[type]:0; if (rate && (dstsd->addeff3_type[type] == 1 || ((sd && sd->state.arrow_atk) || (status_get_range(src)>2)))) - status_change_start(src,i,rate/100,7,0,0,0,skill_get_time2(sc2[type],7),0); + status_change_start(src,i,rate/100,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0); } } @@ -2476,16 +2454,14 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s if (src->m != bl->m) return 1; - - if (src->type == BL_PC) { - nullpo_retr(1, sd = (struct map_session_data *)src); - } if (bl->prev == NULL) return 1; - if (bl->type == BL_PC) { - nullpo_retr(1, tsd = (struct map_session_data *)bl); - } + + if (src->type == BL_PC) + sd = (struct map_session_data *)src; + if (bl->type == BL_PC) + tsd = (struct map_session_data *)bl; if ((skillid == CR_GRANDCROSS || skillid == NPC_GRANDDARKNESS) && src != bl) bl = src; @@ -2493,6 +2469,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s if (status_isdead(src) || (src != bl && status_isdead(bl))) return 1; + if (skillid && skill_get_type(skillid) == BF_MAGIC && status_isimmune(bl)) + //GTB makes all targetted skills silently fail. + return 1; + sc = status_get_sc(src); if (sc && !sc->count) sc = NULL; //Unneeded @@ -3001,7 +2981,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s case SL_STUN: case SL_SMA: if (sd && bl->type != BL_MOB) { - status_change_start(src,SC_STAN,100,skilllv,0,0,0,3000,8); + status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8); clif_skill_fail(sd,skillid,0,0); break; } @@ -3154,10 +3134,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in struct status_change *tsc; struct mob_data *md = NULL; struct mob_data *dstmd = NULL; - int i; -// int sc_dex, sc_luk; + int i,type=-1; - if(skillid < 0) + if(skillid < 0 || skillid > MAX_SKILL) { // remove the debug print when this case is finished ShowDebug("skill_castend_damage_id: skillid=%i\ncall: %p %p %i %i %i %i",skillid, src, bl,skillid,skilllv,tick,flag); @@ -3172,23 +3151,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in return 1; if (src->type == BL_PC) { - nullpo_retr (1, sd = (struct map_session_data *)src); + sd = (struct map_session_data *)src; } else if (src->type == BL_MOB) { - nullpo_retr (1, md = (struct mob_data *)src); + md = (struct mob_data *)src; } if (bl->type == BL_PC){ - nullpo_retr (1, dstsd = (struct map_session_data *)bl); + dstsd = (struct map_session_data *)bl; } else if (bl->type == BL_MOB){ - nullpo_retr (1, dstmd = (struct mob_data *)bl); + dstmd = (struct mob_data *)bl; } if(bl->prev == NULL) return 1; - if(sd && pc_isdead(sd)) + if(status_isdead(src) && skillid != NPC_REBIRTH) return 1; - if(dstsd && pc_isdead(dstsd) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO) + if(status_isdead(bl) && skillid != NPC_REBIRTH && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO) return 1; + + if (skillid >= 0 && skillid < sizeof(SkillStatusChangeTable)/sizeof(SkillStatusChangeTable[0])) + type = SkillStatusChangeTable[skillid]; //Shouldn't be needed, skillnotok's return value is highly unlikely to have changed after you started casting. [Skotlex] // if (sd && skillnotok(skillid, sd)) // [MouseJstr] // return 0; @@ -3283,7 +3265,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_updatestatus(sd,SP_BASEEXP); clif_updatestatus(sd,SP_JOBEXP); } - status_change_start(src,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,0,0); //SC_COMA :P + pc_heal(sd, 1-sd->status.hp, 1-sd->status.sp); break; } else if (dstsd && pc_isdead(dstsd) && flag&1) { //Revive skill_area_temp[0]++; //Count it in, then fall-through to the Resurrection code. @@ -3340,12 +3322,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case AL_DECAGI: /* 速度減?ュ */ - if (status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } clif_skill_nodamage (src, bl, skillid, skilllv, - status_change_start (bl, SkillStatusChangeTable[skillid], + status_change_start (bl, type, (40 + skilllv * 2 + (status_get_lv(src) + status_get_int(src))/5), skilllv, 0, 0, 0, skill_get_time(skillid,skilllv),0)); break; @@ -3354,7 +3332,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (flag & 1) { int race = status_get_race (bl), ele = status_get_elem_type (bl); if (battle_check_target (src, bl, BCT_ENEMY) && (race == 6 || battle_check_undead (race, ele))) { - status_change_start(bl,SkillStatusChangeTable[skillid], + status_change_start(bl,type, 23+skilllv*4 +status_get_lv(src) -status_get_lv(bl), skilllv,0,0,0,0,0); } @@ -3368,16 +3346,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case PR_LEXDIVINA: /* レックスディビ?ナ */ - if (status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } - if (tsc && tsc->count && tsc->data[SC_SILENCE].timer != -1) { - status_change_end(bl,SC_SILENCE, -1); + if (tsc && tsc->count && tsc->data[type].timer != -1) { + status_change_end(bl,type, -1); clif_skill_nodamage (src, bl, skillid, skilllv, 1); } else clif_skill_nodamage (src, bl, skillid, skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid], + status_change_start(bl,type, 100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; @@ -3424,12 +3398,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case SA_COMA: - if (status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time2(skillid,skilllv),0 )); break; case SA_FULLRECOVERY: @@ -3479,7 +3449,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case SA_REVERSEORCISH: clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl, SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid, skilllv),0)); break; case SA_FORTUNE: @@ -3505,48 +3475,39 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case PR_LEXAETERNA: /* レックスエ?テルナ */ case PR_SUFFRAGIUM: /* サフラギウム */ case PR_BENEDICTIO: /* ?ケ??~福 */ - if (status_isimmune(bl)) - clif_skill_nodamage(src,bl,skillid,skilllv,0); - else { - clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, - skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); - } + clif_skill_nodamage(src,bl,skillid,skilllv, + status_change_start(bl,type,100, + skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; case CR_PROVIDENCE: /* プ?ヴィデンス */ - if (status_isimmune(bl)) - clif_skill_nodamage(src,bl,skillid,skilllv,1); - else { - if(sd && dstsd){ //Check they are not another crusader [Skotlex] - if ((dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER) { - clif_skill_fail(sd,skillid,0,0); - map_freeblock_unlock(); - return 1; - } + if(sd && dstsd){ //Check they are not another crusader [Skotlex] + if ((dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER) { + clif_skill_fail(sd,skillid,0,0); + map_freeblock_unlock(); + return 1; } - clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid], - 100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } + clif_skill_nodamage(src,bl,skillid,skilllv, + status_change_start(bl,type, + 100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; case CG_MARIONETTE: /* マリオネットコント??ル */ { struct status_change *sc= status_get_sc(src); - int sc1 = SkillStatusChangeTable[skillid]; - int sc2 = SC_MARIONETTE2; + int type2 = SC_MARIONETTE2; if(sc && tsc){ - if (sc->data[sc1].timer == -1 && tsc->data[sc2].timer == -1) { - status_change_start (src,sc1,100,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0); - status_change_start (bl,sc2,100,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0); + if (sc->data[type].timer == -1 && tsc->data[type2].timer == -1) { + status_change_start (src,type,100,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0); + status_change_start (bl,type2,100,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0); clif_marionette(src, bl); } - else if (sc->data[sc1].timer != -1 && tsc->data[sc2].timer != -1 && - sc->data[sc1].val3 == bl->id && tsc->data[sc2].val3 == src->id) { - status_change_end(src, sc1, -1); - status_change_end(bl, sc2, -1); + else if (sc->data[type].timer != -1 && tsc->data[type2].timer != -1 && + sc->data[type].val3 == bl->id && tsc->data[type2].val3 == src->id) { + status_change_end(src, type, -1); + status_change_end(bl, type2, -1); clif_marionette(src, 0); } else { @@ -3560,23 +3521,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case RG_CLOSECONFINE: - if (status_isimmune(bl)) - clif_skill_nodamage(src,bl,skillid,skilllv,0); - else { - clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start (bl,SkillStatusChangeTable[skillid],100, - skilllv,src->id,0,0,skill_get_time(skillid,skilllv),0)); - } + clif_skill_nodamage(src,bl,skillid,skilllv, + status_change_start (bl,type,100, + skilllv,src->id,0,0,skill_get_time(skillid,skilllv),0)); break; case SA_FLAMELAUNCHER: // added failure chance and chance to break weapon if turned on [Valaris] case SA_FROSTWEAPON: case SA_LIGHTNINGLOADER: case SA_SEISMICWEAPON: if (dstsd) { - if (status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } if(dstsd->status.weapon == 0 || (dstsd->sc.count && ( dstsd->sc.data[SC_FIREWEAPON].timer != -1 || @@ -3603,7 +3556,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } // 100% success rate at lv4 & 5, but lasts longer at lv5 i = skilllv <4?(60+skilllv*10):100; - i = status_change_start(bl,SkillStatusChangeTable[skillid],100, + i = status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0); if(!i) { if (sd) clif_skill_fail(sd,skillid,0,0); @@ -3615,66 +3568,51 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case PR_ASPERSIO: /* アスペルシオ */ - if (status_isimmune(bl) || dstmd) { + if (sd && dstmd) { clif_skill_nodamage(src,bl,skillid,skilllv,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; case TK_SEVENWIND: - { - int sci=-1; switch(skilllv){ case 1: - sci=SC_EARTHWEAPON; + type=SC_EARTHWEAPON; break; case 2: - sci=SC_WINDWEAPON; + type=SC_WINDWEAPON; break; case 3: - sci=SC_WATERWEAPON; + type=SC_WATERWEAPON; break; case 4: - sci=SC_FIREWEAPON; + type=SC_FIREWEAPON; break; case 5: - sci=SC_GHOSTWEAPON; + type=SC_GHOSTWEAPON; break; case 6: - sci=SC_SHADOWWEAPON; + type=SC_SHADOWWEAPON; break; case 7: - sci=SC_ASPERSIO; + type=SC_ASPERSIO; break; } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,sci,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); + status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } break; case PR_KYRIE: /* キリエエレイソン */ - if (status_isimmune(bl)) { - clif_skill_nodamage(bl,bl,skillid,skilllv,0); - break; - } clif_skill_nodamage(bl,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; case LK_BERSERK: /* バ?サ?ク */ - if(battle_config.berserk_cancels_buffs) - { - status_change_end(bl,SC_ONEHAND,-1); - status_change_end(bl,SC_TWOHANDQUICKEN,-1); - status_change_end(bl,SC_CONCENTRATION,-1); - status_change_end(bl,SC_PARRYING,-1); - status_change_end(bl,SC_ENDURE,-1); - status_change_end(bl,SC_AURABLADE,-1); - } case KN_AUTOCOUNTER: /* オ?トカウンタ? */ case KN_TWOHANDQUICKEN: /* ツ?ハンドクイッケン */ case KN_ONEHAND: @@ -3705,7 +3643,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SG_MOON_COMFORT: case SG_STAR_COMFORT: clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; @@ -3713,7 +3651,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SG_MOON_WARM: case SG_STAR_WARM: clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,skillid,skill_get_range(skillid,skilllv),skill_get_time(skillid,skilllv),0)); break; @@ -3728,7 +3666,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case HP_ASSUMPTIO: if (flag&1) - status_change_start(bl,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); else { map_foreachinarea(skill_area_sub, @@ -3741,14 +3679,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SM_ENDURE: /* インデュア */ clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); if (sd) pc_blockskill_start (sd, skillid, 10000); break; case AS_ENCHANTPOISON: // Prevent spamming [Valaris] - if (dstsd && dstsd->sc.count) { + if (sd && dstsd && dstsd->sc.count) { if(dstsd->sc.data[SC_FIREWEAPON].timer != -1 || dstsd->sc.data[SC_WATERWEAPON].timer != -1 || dstsd->sc.data[SC_WINDWEAPON].timer != -1 || @@ -3762,7 +3700,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; @@ -3772,7 +3710,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_sitting(sd); } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; @@ -3805,11 +3743,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in { int range = 1; clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); map_foreachinarea( status_change_timer_sub, src->m, src->x-range, src->y-range, src->x+range,src->y+range,BL_CHAR, - src,status_get_sc(src),SkillStatusChangeTable[skillid],tick); + src,status_get_sc(src),type,tick); } break; @@ -3821,7 +3759,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } //TODO: How much does base level affects? Dummy value of 1% per level difference used. [Skotlex] clif_skill_nodamage(src,bl,skillid,skilllv, - (i=status_change_start(bl,SkillStatusChangeTable[skillid], + (i=status_change_start(bl,type, 50 +3*skilllv +status_get_lv(src) -status_get_lv(bl), skilllv,0,0,0,skill_get_time(skillid,skilllv),0))); if (!i) @@ -3860,7 +3798,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in int lv = sd->status.base_level - dstsd->status.base_level; if (lv < 0) lv = -lv; if (lv > battle_config.devotion_level_difference || - (dstsd->sc.data[SC_DEVOTION].timer != -1 && dstsd->sc.data[SC_DEVOTION].val1 != src->id) || //Avoid overriding [Skotlex] + (dstsd->sc.data[type].timer != -1 && dstsd->sc.data[type].val1 != src->id) || //Avoid overriding [Skotlex] (dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER) { clif_skill_fail(sd,skillid,0,0); map_freeblock_unlock(); @@ -3876,7 +3814,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } sd->devotion[i] = bl->id; clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, src->id,i,skill_get_range2(src,skillid,skilllv),skill_get_time2(skillid, skilllv),1000,0)); clif_devotion(sd); } @@ -3916,7 +3854,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case MO_BLADESTOP: // 白?n取り clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(src,SkillStatusChangeTable[skillid],100, + status_change_start(src,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; @@ -3977,7 +3915,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; //Land Protector blocks Hammer Fall [Skotlex] clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SC_STAN,(20 + 10 * skilllv), + status_change_start(bl,SC_STUN,(20 + 10 * skilllv), skilllv,0,0,0,skill_get_time2(skillid,skilllv),0)); break; case RG_RAID: /* サプライズアタック */ @@ -4053,13 +3991,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case PR_GLORIA: /* グ?リア */ case SN_WINDWALK: /* ウインドウォ?ク */ if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) { - /* 個別の?? */ - if(status_isimmune(bl)) { - clif_skill_nodamage(bl,bl,skillid,skilllv,0); - break; - } clif_skill_nodamage(bl,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } else if (sd) { /* パ?ティ全?への?? */ @@ -4077,7 +4010,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) { /* 個別の?? */ clif_skill_nodamage(bl,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,(src == bl)? 1:0,0,0,skill_get_time(skillid,skilllv),0)); } else if (sd) { /* パ?ティ全?への?? */ @@ -4100,14 +4033,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case CR_SHRINK: case ST_PRESERVE: case SG_FUSION: - { - int sci = SkillStatusChangeTable[skillid]; - if (tsc && tsc->data[sci].timer != -1) - i = status_change_end(bl, sci, -1); - else - i = status_change_start(bl,sci,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + if (tsc && tsc->data[type].timer != -1) + i = status_change_end(bl, type, -1); + else + i = status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); clif_skill_nodamage(src,bl,skillid,skilllv,i); - } break; case SL_KAITE: case SL_KAAHI: @@ -4120,58 +4050,46 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in dstsd->char_id == sd->status.partner_id || dstsd->char_id == sd->status.child )) { - status_change_start(src,SC_STAN,100,skilllv,0,0,0,3000,8); + status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8); clif_skill_fail(sd,skillid,0,0); break; } } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid, skilllv),0)); break; case SM_AUTOBERSERK: // Celest - { - int sc = SkillStatusChangeTable[skillid]; - if (tsc && tsc->data[sc].timer != -1) - i = status_change_end(bl, sc, -1); - else - i = status_change_start(bl,sc,100,skilllv,0,0,0,0,0); - clif_skill_nodamage(src,bl,skillid,skilllv,i); - } + if (tsc && tsc->data[type].timer != -1) + i = status_change_end(bl, type, -1); + else + i = status_change_start(bl,type,100,skilllv,0,0,0,0,0); + clif_skill_nodamage(src,bl,skillid,skilllv,i); break; case TF_HIDING: /* ハイディング */ case ST_CHASEWALK: /* ハイディング */ - { - int sc = SkillStatusChangeTable[skillid]; - if (tsc && tsc->data[sc].timer != -1) - i = status_change_end(bl, sc, -1); - else - i = status_change_start(bl,sc,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); - clif_skill_nodamage(src,bl,skillid,-1,i); // Don't display the skill name as it is a hiding skill - } + if (tsc && tsc->data[type].timer != -1) + i = status_change_end(bl, type, -1); + else + i = status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + clif_skill_nodamage(src,bl,skillid,-1,i); // Don't display the skill name as it is a hiding skill break; case TK_RUN: - { - int sci = SkillStatusChangeTable[skillid]; - if (tsc && tsc->data[sci].timer != -1) - i = status_change_end(bl, sci, -1); + if (tsc && tsc->data[type].timer != -1) + i = status_change_end(bl, type, -1); else - i = status_change_start(bl,sci,100,skilllv,status_get_dir(bl),0,0,0,0); + i = status_change_start(bl,type,100,skilllv,status_get_dir(bl),0,0,0,0); clif_skill_nodamage(src,bl,skillid,skilllv,i); - } break; case AS_CLOAKING: /* ク??キング */ - { - int sci=SkillStatusChangeTable[skillid]; - if(tsc && tsc->data[sci].timer!=-1 ) - /* 解?怩キる */ - i = status_change_end(bl, sci, -1); - else - i = status_change_start(bl,sci,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); - clif_skill_nodamage(src,bl,skillid,-1,i); - if (!i && sd) - clif_skill_fail(sd,skillid,0,0); - } + if(tsc && tsc->data[type].timer!=-1 ) + /* 解?怩キる */ + i = status_change_end(bl, type, -1); + else + i = status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + clif_skill_nodamage(src,bl,skillid,-1,i); + if (!i && sd) + clif_skill_fail(sd,skillid,0,0); break; /* ?地スキル */ @@ -4208,7 +4126,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in i = status_change_start(src,SC_DANCING,100, skillid,0,0,sg->group_id,skill_get_time(skillid,skilllv),0); else - i = status_change_start(src,SkillStatusChangeTable[skillid],100, + i = status_change_start(src,type,100, skilllv,0,BCT_SELF,sg->group_id, skill_get_time(skillid,skilllv),0); clif_skill_nodamage(src,bl,skillid,skilllv,i); @@ -4217,13 +4135,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case PA_GOSPEL: /* ゴスペル */ if (!tsc) break; - if (tsc->data[SC_GOSPEL].timer != -1 && tsc->data[SC_GOSPEL].val4 == BCT_SELF) { - i = status_change_end(bl,SC_GOSPEL,-1); + if (tsc->data[type].timer != -1 && tsc->data[type].val4 == BCT_SELF) { + i = status_change_end(bl,SC_GOSPEL,-1); } else { struct skill_unit_group *sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0); - if (tsc->data[SC_GOSPEL].timer != -1) - status_change_end(bl,SC_GOSPEL,-1); //Was under someone else's Gospel. [Skotlex] - i = status_change_start(bl,SkillStatusChangeTable[skillid],100,skilllv,0,(int)sg,BCT_SELF,skill_get_time(skillid,skilllv),0); + if (tsc->data[type].timer != -1) + status_change_end(bl,type,-1); //Was under someone else's Gospel. [Skotlex] + i = status_change_start(bl,type,100,skilllv,0,(int)sg,BCT_SELF,skill_get_time(skillid,skilllv),0); } clif_skill_nodamage(src,bl,skillid,skilllv,i); break; @@ -4265,7 +4183,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in int race = status_get_race(bl); if(status_get_lv(src)>status_get_lv(bl) && (race == 6 || race == 7 || race == 8)) { clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],70, + status_change_start(bl,type,70, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } else{ clif_skill_nodamage(src,bl,skillid,skilllv,0); @@ -4354,31 +4272,28 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case PR_STRECOVERY: /* リカバリ? */ - { - if(status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } - status_change_end(bl, SC_FREEZE , -1 ); - status_change_end(bl, SC_STONE , -1 ); - status_change_end(bl, SC_SLEEP , -1 ); - status_change_end(bl, SC_STAN , -1 ); - //Is this equation really right? It looks so... special. - if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ){//アンデッドなら暗闇?果 - status_change_start(bl, SC_BLIND, - (100-(status_get_int(bl)/2+status_get_vit(bl)/3+status_get_luk(bl)/10)), - 1,0,0,0, - 1000 * 30 * (100-(status_get_int(bl)+status_get_vit(bl))/2)/100,10); - } - } - clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(dstmd){ - dstmd->attacked_id=0; - dstmd->target_id=0; - dstmd->state.targettype = NONE_ATTACKABLE; - dstmd->state.skillstate=MSS_IDLE; - dstmd->next_walktime=tick+rand()%3000+3000; - } + if(status_isimmune(bl)) { + clif_skill_nodamage(src,bl,skillid,skilllv,0); + break; + } + status_change_end(bl, SC_FREEZE , -1 ); + status_change_end(bl, SC_STONE , -1 ); + status_change_end(bl, SC_SLEEP , -1 ); + status_change_end(bl, SC_STUN , -1 ); + //Is this equation really right? It looks so... special. + if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ){//アンデッドなら暗闇?果 + status_change_start(bl, SC_BLIND, + (100-(status_get_int(bl)/2+status_get_vit(bl)/3+status_get_luk(bl)/10)), + 1,0,0,0, + 1000 * 30 * (100-(status_get_int(bl)+status_get_vit(bl))/2)/100,10); + } + clif_skill_nodamage(src,bl,skillid,skilllv,1); + if(dstmd){ + dstmd->attacked_id=0; + dstmd->target_id=0; + dstmd->state.targettype = NONE_ATTACKABLE; + dstmd->state.skillstate=MSS_IDLE; + dstmd->next_walktime=tick+rand()%3000+3000; } break; @@ -4624,7 +4539,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if(tsc && tsc->data[scid].timer != -1) status_change_end(bl, scid, -1 ); clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } break; @@ -4701,8 +4616,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in { int x,y, dir = status_get_dir(src); - if (sd && !pc_can_move(sd)) - return 0; if (md && !mob_can_move(md)) return 0; @@ -4816,9 +4729,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } break; case SA_MAGICROD: - if (status_isimmune(bl)) - break; - status_change_start(bl,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case SA_AUTOSPELL: /* オ?トスペル */ clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -4903,12 +4814,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case NPC_HALLUCINATION: - if(status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; @@ -4917,7 +4824,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in { int skill_time = skill_get_time(skillid,skilllv); clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_time,0)); if (md) mob_changestate(md,MS_DELAY,skill_time); @@ -4928,19 +4835,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case NPC_REBIRTH: //New rebirth System uses Kaizel lv1. [Skotlex] - status_change_start(bl,SkillStatusChangeTable[skillid],100,1,0,0,0,skill_get_time(SL_KAIZEL,skilllv),0); + status_change_start(bl,type,100,1,0,0,0,skill_get_time(SL_KAIZEL,skilllv),0); break; case NPC_DARKBLESSING: - { - if(status_isimmune(bl)) { - clif_skill_nodamage(src,bl,skillid,skilllv,0); - break; - } - clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid], - (50+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0)); - } + clif_skill_nodamage(src,bl,skillid,skilllv, + status_change_start(bl,type, + (50+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0)); break; case NPC_LICK: @@ -4952,7 +4853,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in pc_heal(dstsd,0,-100); } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid], + status_change_start(bl,type, (skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0)); break; @@ -5132,9 +5033,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in map_freeblock_unlock(); return 0; } - status_change_start(bl,SC_STAN,100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),8); - if (f_sd) status_change_start(&f_sd->bl,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); - if (m_sd) status_change_start(&m_sd->bl,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SC_STUN,100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),8); + if (f_sd) status_change_start(&f_sd->bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + if (m_sd) status_change_start(&m_sd->bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); } break; @@ -5282,7 +5183,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in return 1; } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,skillid,src->id,skill_get_time(skillid,skilllv),1000,0)); break; @@ -5297,7 +5198,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in //Has a 55% + skilllv*5% success chance. if (!clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],55 +5*skilllv, + status_change_start(bl,type,55 +5*skilllv, skilllv,0,0,0,skill_get_time(skillid,skilllv),0))) { if (sd) clif_skill_fail(sd,skillid,0,0); @@ -5401,7 +5302,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case PF_DOUBLECASTING: if (!clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid], + status_change_start(bl,type, 30+ 10*skilllv,skilllv,0,0,0,skill_get_time(skillid,skilllv),0))) if (sd) clif_skill_fail(sd,skillid,0,0); break; @@ -5412,7 +5313,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in && tsc->data[SC_DANCING].val1 != CG_MOONLIT) //Can't use Longing for Freedom while under Moonlight Petals. [Skotlex] { clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } } @@ -5488,7 +5389,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_damage(src,bl,tick,0,0,4444,0,0,0); break; case 12: // stun - status_change_start(bl,SC_STAN,100,skilllv,0,0,0,5000,0); + status_change_start(bl,SC_STUN,100,skilllv,0,0,0,5000,0); break; case 13: // atk,matk,hit,flee,def reduced status_change_start(bl,SC_INCATKRATE,100,-20,0,0,0,30000,0); @@ -5520,7 +5421,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SL_STAR: case SL_SUPERNOVICE: case SL_WIZARD: - if (sd && !(dstsd && (dstsd->class_&MAPID_UPPERMASK) == SkillStatusChangeTable[skillid])) { + if (sd && !(dstsd && (dstsd->class_&MAPID_UPPERMASK) == type)) { clif_skill_fail(sd,skillid,0,0); break; } @@ -5535,14 +5436,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0)); status_change_start(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv),0); break; case SL_SKA: // [marquis007] if (sd && bl->type != BL_MOB) { - status_change_start(src,SC_STAN,100,skilllv,0,0,0,3000,8); + status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8); clif_skill_fail(sd,skillid,0,0); break; } @@ -5551,29 +5452,29 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in else { clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); } break; case SL_SWOO: if (sd && bl->type != BL_MOB) { - status_change_start(src,SC_STAN,100,skilllv,0,0,0,3000,8); + status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8); clif_skill_fail(sd,skillid,0,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,0,0,0,skill_get_time(skillid,skilllv),0)); break; case SL_SKE: if (sd && bl->type != BL_MOB) { - status_change_start(src,SC_STAN,100,skilllv,0,0,0,3000,8); + status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8); clif_skill_fail(sd,skillid,0,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv, - status_change_start(bl,SkillStatusChangeTable[skillid],100, + status_change_start(bl,type,100, skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0)); status_change_start(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv),0); break; @@ -6796,8 +6697,6 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int break; case UNT_QUAGMIRE: - if(status_isimmune(bl)) - break; if(sc && sc->data[type].timer==-1) status_change_start(bl,type,100,sg->skill_lv,sg->group_id,0,0,sg->limit,0); break; @@ -7554,7 +7453,7 @@ static int skill_check_condition_char_sub (struct block_list *bl, va_list ap) if(pc_isdead(tsd)) return 0; - if (tsd->sc.count && (tsd->sc.data[SC_SILENCE].timer != -1 || tsd->sc.data[SC_STAN].timer != -1)) + if (tsd->sc.count && (tsd->sc.data[SC_SILENCE].timer != -1 || tsd->sc.data[SC_STUN].timer != -1)) return 0; switch(skillid) @@ -8296,7 +8195,11 @@ int skill_check_condition(struct map_session_data *sd,int type) case ST_MOVE_ENABLE: { struct walkpath_data wpd; - if(path_search(&wpd,sd->bl.m,sd->bl.x,sd->bl.y,sd->skillx,sd->skilly,1)==-1) { + if(!pc_can_move(sd)) { + clif_skill_fail(sd,skill,0,0); + return 0; + } + if (skill_get_inf(skill)&INF_GROUND_SKILL && path_search(&wpd,sd->bl.m,sd->bl.x,sd->bl.y,sd->skillx,sd->skilly,1)==-1) { clif_skill_fail(sd,skill,0,0); return 0; } diff --git a/src/map/status.c b/src/map/status.c index 3efe688be..856e0d4f5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -25,450 +25,9 @@ #include "script.h" #include "showmsg.h" -int SkillStatusChangeTable[]={ - -1,-1,-1,-1,-1,-1, - SC_PROVOKE, - SC_WATK_ELEMENT, //Adds part of your final attack as elemental damage. [Skotlex] - SC_ENDURE, - -1, -/* 10- */ - SC_SIGHT, /* サイト */ - -1, - SC_SAFETYWALL, /* セーフティーウォール */ - -1,-1,-1, - SC_FREEZE, /* フロストダイバ? */ - SC_STONE, /* スト?ンカ?ス */ - -1,-1, -/* 20- */ - -1,-1,-1,-1, - SC_RUWACH, /* ルアフ */ - -1,//SC_PNEUMA, Pneuma is no longer a status change. It is a cell type. - -1,-1,-1, - SC_INCREASEAGI, /* 速度?加 */ -/* 30- */ - SC_DECREASEAGI, /* 速度減少 */ - -1, - SC_SIGNUMCRUCIS, /* シグナムクルシス */ - SC_ANGELUS, /* エンジェラス */ - SC_BLESSING, /* ブレッシング */ - -1,-1,-1,-1,-1, -/* 40- */ - -1,-1,-1,-1,-1, - SC_CONCENTRATE, /* 集中力向上 */ - -1,-1,-1,-1, -/* 50- */ - -1, - SC_HIDING, /* ハイディング */ - -1,-1,-1,-1,-1,-1,-1,-1, -/* 60- */ - SC_TWOHANDQUICKEN, /* 2HQ */ - SC_AUTOCOUNTER, - -1,-1,-1,-1, - SC_IMPOSITIO, /* インポシティオマヌス */ - SC_SUFFRAGIUM, /* サフラギウム */ - SC_ASPERSIO, /* アスペルシオ */ - SC_BENEDICTIO, /* 聖?降福 */ -/* 70- */ - -1, - SC_SLOWPOISON, - -1, - SC_KYRIE, /* キリエエレイソン */ - SC_MAGNIFICAT, /* マグニフィカ?ト */ - SC_GLORIA, /* グロリア */ - SC_SILENCE, /* レックスディビ?ナ */ - -1, - SC_AETERNA, /* レックスエ?テルナ */ - -1, -/* 80- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 90- */ - -1,-1, - SC_QUAGMIRE, /* クァグマイア */ - -1,-1,-1,-1,-1,-1,-1, -/* 100- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 110- */ - -1, - SC_ADRENALINE, /* アドレナリンラッシュ */ - SC_WEAPONPERFECTION,/* ウェポンパ?フェクション */ - SC_OVERTHRUST, /* オ?バ?トラスト */ - SC_MAXIMIZEPOWER, /* マキシマイズパワ? */ - -1,-1,-1,-1,-1, -/* 120- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 130- */ - -1,-1,-1,-1,-1, - SC_CLOAKING, /* クロ?キング */ - SC_STAN, /* ソニックブロ? */ - -1, - SC_ENCPOISON, /* エンチャントポイズン */ - SC_POISONREACT, /* ポイズンリアクト */ -/* 140- */ - SC_POISON, /* ベノムダスト */ - SC_SPLASHER, /* ベナムスプラッシャ? */ - -1, - SC_TRICKDEAD, /* 死んだふり */ - -1,-1, - SC_AUTOBERSERK, - -1,-1,-1, -/* 150- */ - -1,-1,-1,-1,-1, - SC_LOUD, /* ラウドボイス */ - -1, - SC_ENERGYCOAT, /* エナジ?コ?ト */ - -1,-1, -/* 160- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 200 */ - -1, - SC_KEEPING, - -1, - SC_COMA, - SC_BARRIER, - -1, - SC_STAN, - SC_HALLUCINATION, - SC_KAIZEL, - -1, -/* 210- */ - -1,-1,-1,-1,-1, - SC_STRIPWEAPON, - SC_STRIPSHIELD, - SC_STRIPARMOR, - SC_STRIPHELM, - -1, -/* 220- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 230- */ - -1,-1,-1,-1, - SC_CP_WEAPON, - SC_CP_SHIELD, - SC_CP_ARMOR, - SC_CP_HELM, - -1,-1, -/* 240- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1, - SC_AUTOGUARD, -/* 250- */ - -1,-1, - SC_REFLECTSHIELD, - -1,-1, - SC_DEVOTION, - SC_PROVIDENCE, - SC_DEFENDER, - SC_SPEARSQUICKEN, - -1, -/* 260- */ - -1,-1,-1,-1,-1,-1,-1,-1, - SC_STEELBODY, - SC_BLADESTOP_WAIT, -/* 270- */ - SC_EXPLOSIONSPIRITS, - SC_EXTREMITYFIST, - -1,-1,-1,-1, - SC_MAGICROD, - -1,-1,-1, -/* 280- */ - SC_FIREWEAPON, - SC_WATERWEAPON, - SC_WINDWEAPON, - SC_EARTHWEAPON, - -1, - SC_VOLCANO, - SC_DELUGE, - SC_VIOLENTGALE, - SC_LANDPROTECTOR, - -1, -/* 290- */ - -1,-1,-1,-1, - SC_ORCISH, - -1,-1,-1,-1,-1, -/* 300- */ - -1,-1,-1, - SC_COMA, - -1,-1, - SC_LULLABY, - SC_RICHMANKIM, - SC_ETERNALCHAOS, - SC_DRUMBATTLE, -/* 310- */ - SC_NIBELUNGEN, - SC_ROKISWEIL, - SC_INTOABYSS, - SC_SIEGFRIED, - -1,-1,-1,-1,-1, - SC_WHISTLE, -/* 320- */ - SC_ASSNCROS, - SC_POEMBRAGI, - SC_APPLEIDUN, - -1,-1, - SC_UGLYDANCE, - -1, - SC_HUMMING, - SC_DONTFORGETME, - SC_FORTUNE, -/* 330- */ - SC_SERVICE4U, - -1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 340- */ - -1,-1, - SC_STOP, - -1,-1,-1,-1,-1,-1,-1, -/* 350- */ - -1,-1,-1,-1,-1, - SC_AURABLADE, - SC_PARRYING, - SC_CONCENTRATION, - SC_TENSIONRELAX, - SC_BERSERK, -/* 360- */ - -1, - SC_ASSUMPTIO, - SC_BASILICA, - -1,-1,-1, - SC_MAGICPOWER, - -1, - SC_SACRIFICE, - SC_GOSPEL, -/* 370- */ - -1,-1,-1,-1,-1,-1,-1,-1, - SC_EDP, - -1, -/* 380- */ - SC_TRUESIGHT, - -1,-1, - SC_WINDWALK, - SC_MELTDOWN, - -1,-1, - SC_CARTBOOST, - -1, - SC_CHASEWALK, -/* 390- */ - SC_REJECTSWORD, - -1,-1,-1,-1, - SC_MOONLIT, - SC_MARIONETTE, - -1, - SC_BLEEDING, - SC_JOINTBEAT, -/* 400 */ - -1,-1, - SC_MINDBREAKER, - SC_MEMORIZE, - SC_FOGWALL, - SC_SPIDERWEB, - -1,-1, - SC_BABY, - -1, -/* 410- */ - -1, - SC_RUN, - SC_READYSTORM, - -1, - SC_READYDOWN, - -1, - SC_READYTURN, - -1, - SC_READYCOUNTER, - -1, -/* 420- */ - SC_DODGE, - -1,-1, - SC_TKDORI, - -1,-1,-1,-1, - SC_WARM, - SC_WARM, -/* 430- */ - SC_WARM, - SC_SUN_COMFORT, - SC_MOON_COMFORT, - SC_STAR_COMFORT, - -1,-1,-1,-1,-1,-1, -/* 440- */ - -1,-1,-1,-1, - SC_FUSION, - MAPID_ALCHEMIST, // Storing the target job rather than simply SC_SPIRIT simplifies code later on. - -1, - MAPID_MONK, - MAPID_STAR_GLADIATOR, - MAPID_SAGE, -/* 450- */ - MAPID_CRUSADER, - MAPID_SUPER_NOVICE, - MAPID_KNIGHT, - MAPID_WIZARD, - MAPID_PRIEST, - MAPID_BARDDANCER, - MAPID_ROGUE, - MAPID_ASSASSIN, - MAPID_BLACKSMITH, - SC_ADRENALINE2, -/* 460- */ - MAPID_HUNTER, - MAPID_SOUL_LINKER, - SC_KAIZEL, - SC_KAAHI, - SC_KAUPE, - SC_KAITE, - -1,-1,-1,-1, -/* 470- */ - SC_SWOO, // [marquis007] - SC_SKE, - SC_SKA, // [marquis007] - -1,-1, - SC_PRESERVE, - -1,-1,-1,-1, -/* 480- */ - -1,-1, - SC_DOUBLECAST, - -1, - SC_GRAVITATION, - -1, - SC_MAXOVERTHRUST, - SC_LONGING, - SC_HERMODE, - -1, -/* 490- */ - -1,-1,-1,-1, - SC_SPIRIT, - SC_ONEHAND, - -1,-1,-1,-1, -/* 500- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 510- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 520- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 530- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 540- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 550- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 560- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 570- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 580- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 590- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 600- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 610- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 620- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 630- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 640- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 650- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 660- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 670- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 680- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 690- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 700- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 710- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 720- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 730- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 740- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 750- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 760- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 770- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 780- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 790- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 800- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 810- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 820- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 830- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 840- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 850- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 860- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 870- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 880- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 890- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 900- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 910- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 920- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 930- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 940- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 950- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 960- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 970- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 980- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 990- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1000- */ - -1,-1, - SC_SHRINK, - -1,-1, - SC_CLOSECONFINE2, - SC_SIGHTBLASTER, - -1,-1,-1, -/* 1010- */ - -1, - SC_WINKCHARM, - -1,-1, - SC_COMA, - -1,-1,-1,-1,-1, -/* 1020- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1030- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1040- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1050- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1060- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1070- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1080- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -/* 1090- */ - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -}; - -int StatusIconChangeTable[SC_MAX]; +int SkillStatusChangeTable[MAX_SKILL]; //Stores the status that should be associated to this skill. +int StatusIconChangeTable[SC_MAX]; //Stores the icon that should be associated to this status change. +int StatusSkillChangeTable[SC_MAX]; //Stores the skill that should be considered associated to this status change. static int max_weight_base[MAX_PC_CLASS]; static int hp_coefficient[MAX_PC_CLASS]; @@ -488,122 +47,271 @@ int current_equip_item_index; //Contains inventory index of an equipped item. To //Initializes the StatusIconChangeTable variable. May seem somewhat slower than directly defining the array, //but it is much less prone to errors. [Skotlex] -void initStatusIconChangeTable(void) { +void initChangeTables(void) { int i; for (i = 0; i < SC_MAX; i++) StatusIconChangeTable[i] = SI_BLANK; - - StatusIconChangeTable[SC_PROVOKE] = SI_PROVOKE; - StatusIconChangeTable[SC_ENDURE] = SI_ENDURE; - StatusIconChangeTable[SC_TWOHANDQUICKEN] = SI_TWOHANDQUICKEN; - StatusIconChangeTable[SC_CONCENTRATE] = SI_CONCENTRATE; - StatusIconChangeTable[SC_HIDING] = SI_HIDING; - StatusIconChangeTable[SC_CLOAKING] = SI_CLOAKING; - StatusIconChangeTable[SC_ENCPOISON] = SI_ENCPOISON; - StatusIconChangeTable[SC_POISONREACT] = SI_POISONREACT; - StatusIconChangeTable[SC_QUAGMIRE] = SI_QUAGMIRE; - StatusIconChangeTable[SC_ANGELUS] = SI_ANGELUS; - StatusIconChangeTable[SC_BLESSING] = SI_BLESSING; - StatusIconChangeTable[SC_SIGNUMCRUCIS] = SI_SIGNUMCRUCIS; - StatusIconChangeTable[SC_INCREASEAGI] = SI_INCREASEAGI; - StatusIconChangeTable[SC_DECREASEAGI] = SI_DECREASEAGI; - StatusIconChangeTable[SC_SLOWPOISON] = SI_SLOWPOISON; - StatusIconChangeTable[SC_IMPOSITIO] = SI_IMPOSITIO; - StatusIconChangeTable[SC_SUFFRAGIUM] = SI_SUFFRAGIUM; - StatusIconChangeTable[SC_ASPERSIO] = SI_ASPERSIO; - StatusIconChangeTable[SC_BENEDICTIO] = SI_BENEDICTIO; - StatusIconChangeTable[SC_KYRIE] = SI_KYRIE; - StatusIconChangeTable[SC_MAGNIFICAT] = SI_MAGNIFICAT; - StatusIconChangeTable[SC_GLORIA] = SI_GLORIA; - StatusIconChangeTable[SC_AETERNA] = SI_AETERNA; - StatusIconChangeTable[SC_ADRENALINE] = SI_ADRENALINE; - StatusIconChangeTable[SC_WEAPONPERFECTION] = SI_WEAPONPERFECTION; - StatusIconChangeTable[SC_OVERTHRUST] = SI_OVERTHRUST; - StatusIconChangeTable[SC_MAXIMIZEPOWER] = SI_MAXIMIZEPOWER; - StatusIconChangeTable[SC_TRICKDEAD] = SI_TRICKDEAD; - StatusIconChangeTable[SC_LOUD] = SI_LOUD; - StatusIconChangeTable[SC_ENERGYCOAT] = SI_ENERGYCOAT; - StatusIconChangeTable[SC_BROKENARMOR] = SI_BROKENARMOR; - StatusIconChangeTable[SC_BROKENWEAPON] = SI_BROKENWEAPON; - StatusIconChangeTable[SC_HALLUCINATION] = SI_HALLUCINATION; - StatusIconChangeTable[SC_WEIGHT50 ] = SI_WEIGHT50; - StatusIconChangeTable[SC_WEIGHT90] = SI_WEIGHT90; + for (i = 0; i < MAX_SKILL; i++) + SkillStatusChangeTable[i] = -1; + memset(StatusSkillChangeTable, 0, sizeof(StatusSkillChangeTable)); + + //First we define the skill for common ailments. These are used in + //skill_additional_effect through sc cards. [Skotlex] + StatusSkillChangeTable[SC_STONE] = MG_STONECURSE; + StatusSkillChangeTable[SC_FREEZE] = MG_FROSTDIVER; + StatusSkillChangeTable[SC_STUN] = NPC_STUNATTACK; + StatusSkillChangeTable[SC_SLEEP] = NPC_SLEEPATTACK; + StatusSkillChangeTable[SC_POISON] = NPC_POISON; + StatusSkillChangeTable[SC_CURSE] = NPC_CURSEATTACK; + StatusSkillChangeTable[SC_SILENCE] = NPC_SILENCEATTACK; + StatusSkillChangeTable[SC_CONFUSION] = DC_WINKCHARM; + StatusSkillChangeTable[SC_BLIND] = NPC_BLINDATTACK; + StatusSkillChangeTable[SC_BLEEDING] = LK_HEADCRUSH; + StatusSkillChangeTable[SC_DPOISON] = NPC_POISON; + +#define set_sc(skill, sc, icon) \ + if (SkillStatusChangeTable[skill]==-1) SkillStatusChangeTable[skill] = sc; \ + if (StatusSkillChangeTable[sc]==0) StatusSkillChangeTable[sc] = skill; \ + if (StatusIconChangeTable[sc]==SI_BLANK) StatusIconChangeTable[sc] = icon; + + set_sc(SM_BASH, SC_STUN, SI_BLANK); + set_sc(SM_PROVOKE, SC_PROVOKE, SI_BLANK); + set_sc(SM_MAGNUM, SC_WATK_ELEMENT, SI_BLANK); + set_sc(SM_ENDURE, SC_ENDURE, SI_ENDURE); + set_sc(MG_SIGHT, SC_SIGHT, SI_BLANK); + set_sc(MG_SAFETYWALL, SC_SAFETYWALL, SI_BLANK); + set_sc(MG_FROSTDIVER, SC_FREEZE, SI_BLANK); + set_sc(MG_STONECURSE, SC_STONE, SI_BLANK); + set_sc(AL_RUWACH, SC_RUWACH, SI_BLANK); + set_sc(AL_INCAGI, SC_INCREASEAGI, SI_INCREASEAGI); + set_sc(AL_DECAGI, SC_DECREASEAGI, SI_DECREASEAGI); + set_sc(AL_CRUCIS, SC_SIGNUMCRUCIS, SI_SIGNUMCRUCIS); + set_sc(AL_ANGELUS, SC_ANGELUS, SI_ANGELUS); + set_sc(AL_BLESSING, SC_BLESSING, SI_BLESSING); + set_sc(AC_CONCENTRATION, SC_CONCENTRATE, SI_CONCENTRATE); + set_sc(TF_HIDING, SC_HIDING, SI_HIDING); + set_sc(TF_POISON, SC_POISON, SI_BLANK); + set_sc(KN_TWOHANDQUICKEN, SC_TWOHANDQUICKEN, SI_TWOHANDQUICKEN); + set_sc(KN_AUTOCOUNTER, SC_AUTOCOUNTER, SI_BLANK); + set_sc(PR_IMPOSITIO, SC_IMPOSITIO, SI_IMPOSITIO); + set_sc(PR_SUFFRAGIUM, SC_SUFFRAGIUM, SI_SUFFRAGIUM); + set_sc(PR_ASPERSIO, SC_ASPERSIO, SI_ASPERSIO); + set_sc(PR_BENEDICTIO, SC_BENEDICTIO, SI_BENEDICTIO); + set_sc(PR_SLOWPOISON, SC_SLOWPOISON, SI_SLOWPOISON); + set_sc(PR_KYRIE, SC_KYRIE, SI_KYRIE); + set_sc(PR_MAGNIFICAT, SC_MAGNIFICAT, SI_MAGNIFICAT); + set_sc(PR_GLORIA, SC_GLORIA, SI_GLORIA); + set_sc(PR_LEXDIVINA, SC_SILENCE, SI_BLANK); + set_sc(PR_LEXAETERNA, SC_AETERNA, SI_AETERNA); + set_sc(WZ_METEOR, SC_STUN, SI_BLANK); + set_sc(WZ_VERMILION, SC_BLIND, SI_BLANK); + set_sc(WZ_FROSTNOVA, SC_FREEZE, SI_BLANK); + set_sc(WZ_STORMGUST, SC_FREEZE, SI_BLANK); + set_sc(WZ_QUAGMIRE, SC_QUAGMIRE, SI_QUAGMIRE); + set_sc(BS_ADRENALINE, SC_ADRENALINE, SI_ADRENALINE); + set_sc(BS_WEAPONPERFECT, SC_WEAPONPERFECTION, SI_WEAPONPERFECTION); + set_sc(BS_OVERTHRUST, SC_OVERTHRUST, SI_OVERTHRUST); + set_sc(BS_MAXIMIZE, SC_MAXIMIZEPOWER, SI_MAXIMIZEPOWER); + set_sc(HT_LANDMINE, SC_STUN, SI_BLANK); + set_sc(HT_SANDMAN, SC_SLEEP, SI_BLANK); + set_sc(HT_FLASHER, SC_BLIND, SI_BLANK); + set_sc(HT_FREEZINGTRAP, SC_FREEZE, SI_BLANK); + set_sc(AS_CLOAKING, SC_CLOAKING, SI_CLOAKING); + set_sc(AS_SONICBLOW, SC_STUN, SI_BLANK); + set_sc(AS_GRIMTOOTH, SC_SLOWDOWN, SI_BLANK); + set_sc(AS_ENCHANTPOISON, SC_ENCPOISON, SI_ENCPOISON); + set_sc(AS_POISONREACT, SC_POISONREACT, SI_POISONREACT); + set_sc(AS_VENOMDUST, SC_POISON, SI_BLANK); + set_sc(AS_SPLASHER, SC_SPLASHER, SI_BLANK); + set_sc(NV_TRICKDEAD, SC_TRICKDEAD, SI_TRICKDEAD); + set_sc(SM_AUTOBERSERK, SC_AUTOBERSERK, SI_BLANK); + set_sc(TF_SPRINKLESAND, SC_BLIND, SI_BLANK); + set_sc(TF_THROWSTONE, SC_STUN, SI_BLANK); + set_sc(MC_LOUD, SC_LOUD, SI_LOUD); + set_sc(MG_ENERGYCOAT, SC_ENERGYCOAT, SI_ENERGYCOAT); + set_sc(NPC_POISON, SC_POISON, SI_BLANK); + set_sc(NPC_BLINDATTACK, SC_BLIND, SI_BLANK); + set_sc(NPC_SILENCEATTACK, SC_SILENCE, SI_BLANK); + set_sc(NPC_STUNATTACK, SC_STUN, SI_BLANK); + set_sc(NPC_PETRIFYATTACK, SC_STONE, SI_BLANK); + set_sc(NPC_CURSEATTACK, SC_CURSE, SI_BLANK); + set_sc(NPC_SLEEPATTACK, SC_SLEEP, SI_BLANK); + set_sc(NPC_KEEPING, SC_KEEPING, SI_BLANK); + set_sc(NPC_DARKBLESSING, SC_COMA, SI_BLANK); + set_sc(NPC_BARRIER, SC_BARRIER, SI_BLANK); + set_sc(NPC_LICK, SC_STUN, SI_BLANK); + set_sc(NPC_HALLUCINATION, SC_HALLUCINATION, SI_HALLUCINATION); + set_sc(NPC_REBIRTH, SC_KAIZEL, SI_KAIZEL); + set_sc(RG_RAID, SC_STUN, SI_BLANK); + set_sc(RG_STRIPWEAPON, SC_STRIPWEAPON, SI_STRIPWEAPON); + set_sc(RG_STRIPSHIELD, SC_STRIPSHIELD, SI_STRIPSHIELD); + set_sc(RG_STRIPARMOR, SC_STRIPARMOR, SI_STRIPARMOR); + set_sc(RG_STRIPHELM, SC_STRIPHELM, SI_STRIPHELM); + set_sc(AM_ACIDTERROR, SC_BLEEDING, SI_BLEEDING); + set_sc(AM_CP_WEAPON, SC_CP_WEAPON, SI_CP_WEAPON); + set_sc(AM_CP_SHIELD, SC_CP_SHIELD, SI_CP_SHIELD); + set_sc(AM_CP_ARMOR, SC_CP_ARMOR, SI_CP_ARMOR); + set_sc(AM_CP_HELM, SC_CP_HELM, SI_CP_HELM); + set_sc(CR_AUTOGUARD, SC_AUTOGUARD, SI_AUTOGUARD); + set_sc(CR_SHIELDCHARGE, SC_STUN, SI_AUTOGUARD); + set_sc(CR_REFLECTSHIELD, SC_REFLECTSHIELD, SI_REFLECTSHIELD); + set_sc(CR_HOLYCROSS, SC_BLIND, SI_BLANK); + set_sc(CR_GRANDCROSS, SC_BLIND, SI_BLANK); + set_sc(CR_DEVOTION, SC_DEVOTION, SI_DEVOTION); + set_sc(CR_PROVIDENCE, SC_PROVIDENCE, SI_PROVIDENCE); + set_sc(CR_DEFENDER, SC_DEFENDER, SI_DEFENDER); + set_sc(CR_SPEARQUICKEN, SC_SPEARSQUICKEN, SI_SPEARQUICKEN); + set_sc(MO_STEELBODY, SC_STEELBODY, SI_STEELBODY); + set_sc(MO_BLADESTOP, SC_BLADESTOP_WAIT, SI_BLANK); + set_sc(MO_EXPLOSIONSPIRITS, SC_EXPLOSIONSPIRITS, SI_EXPLOSIONSPIRITS); + set_sc(MO_EXTREMITYFIST, SC_EXTREMITYFIST, SI_BLANK); + set_sc(SA_MAGICROD, SC_MAGICROD, SI_BLANK); + set_sc(SA_AUTOSPELL, SC_AUTOSPELL, SI_AUTOSPELL); + set_sc(SA_FLAMELAUNCHER, SC_FIREWEAPON, SI_FIREWEAPON); + set_sc(SA_FROSTWEAPON, SC_WATERWEAPON, SI_WATERWEAPON); + set_sc(SA_LIGHTNINGLOADER, SC_WINDWEAPON, SI_WINDWEAPON); + set_sc(SA_SEISMICWEAPON, SC_EARTHWEAPON, SI_EARTHWEAPON); + set_sc(SA_VOLCANO, SC_VOLCANO, SI_BLANK); + set_sc(SA_DELUGE, SC_DELUGE, SI_BLANK); + set_sc(SA_VIOLENTGALE, SC_VIOLENTGALE, SI_BLANK); + set_sc(SA_LANDPROTECTOR, SC_LANDPROTECTOR, SI_BLANK); + set_sc(SA_REVERSEORCISH, SC_ORCISH, SI_BLANK); + set_sc(SA_COMA, SC_COMA, SI_BLANK); + set_sc(BD_LULLABY, SC_LULLABY, SI_BLANK); + set_sc(BD_RICHMANKIM, SC_RICHMANKIM, SI_BLANK); + set_sc(BD_ETERNALCHAOS, SC_ETERNALCHAOS, SI_BLANK); + set_sc(BD_DRUMBATTLEFIELD, SC_DRUMBATTLE, SI_BLANK); + set_sc(BD_RINGNIBELUNGEN, SC_NIBELUNGEN, SI_BLANK); + set_sc(BD_ROKISWEIL, SC_ROKISWEIL, SI_BLANK); + set_sc(BD_INTOABYSS, SC_INTOABYSS, SI_BLANK); + set_sc(BD_SIEGFRIED, SC_SIEGFRIED, SI_BLANK); + set_sc(BA_FROSTJOKE, SC_FREEZE, SI_BLANK); + set_sc(BA_WHISTLE, SC_WHISTLE, SI_BLANK); + set_sc(BA_ASSASSINCROSS, SC_ASSNCROS, SI_BLANK); + set_sc(BA_POEMBRAGI, SC_POEMBRAGI, SI_BLANK); + set_sc(BA_APPLEIDUN, SC_APPLEIDUN, SI_BLANK); + set_sc(DC_UGLYDANCE, SC_UGLYDANCE, SI_BLANK); + set_sc(DC_SCREAM, SC_STUN, SI_BLANK); + set_sc(DC_HUMMING, SC_HUMMING, SI_BLANK); + set_sc(DC_DONTFORGETME, SC_DONTFORGETME, SI_BLANK); + set_sc(DC_FORTUNEKISS, SC_FORTUNE, SI_BLANK); + set_sc(DC_SERVICEFORYOU, SC_SERVICE4U, SI_BLANK); + set_sc(NPC_DARKCROSS, SC_BLIND, SI_BLANK); + set_sc(NPC_GRANDDARKNESS, SC_BLIND, SI_BLANK); + set_sc(NPC_STOP, SC_STOP, SI_BLANK); + set_sc(NPC_BREAKWEAPON, SC_BROKENWEAPON, SI_BROKENWEAPON); + set_sc(NPC_BREAKARMOR, SC_BROKENARMOR, SI_BROKENARMOR); + set_sc(LK_AURABLADE, SC_AURABLADE, SI_AURABLADE); + set_sc(LK_PARRYING, SC_PARRYING, SI_PARRYING); + set_sc(LK_CONCENTRATION, SC_CONCENTRATION, SI_CONCENTRATION); + set_sc(LK_TENSIONRELAX, SC_TENSIONRELAX, SI_TENSIONRELAX); + set_sc(LK_BERSERK, SC_BERSERK, SI_BERSERK); + set_sc(LK_FURY, SC_FURY, SI_FURY); + set_sc(HP_ASSUMPTIO, SC_ASSUMPTIO, SI_ASSUMPTIO); + set_sc(HP_BASILICA, SC_BASILICA, SI_BLANK); + set_sc(HW_MAGICPOWER, SC_MAGICPOWER, SI_MAGICPOWER); + set_sc(PA_SACRIFICE, SC_SACRIFICE, SI_BLANK); + set_sc(PA_GOSPEL, SC_GOSPEL, SI_BLANK); + set_sc(CH_TIGERFIST, SC_STOP, SI_BLANK); + set_sc(ASC_EDP, SC_EDP, SI_EDP); + set_sc(SN_SIGHT, SC_TRUESIGHT, SI_TRUESIGHT); + set_sc(SN_WINDWALK, SC_WINDWALK, SI_WINDWALK); + set_sc(WS_MELTDOWN, SC_MELTDOWN, SI_MELTDOWN); + set_sc(WS_CARTBOOST, SC_CARTBOOST, SI_CARTBOOST); + set_sc(ST_CHASEWALK, SC_CHASEWALK, SI_CHASEWALK); + set_sc(ST_REJECTSWORD, SC_REJECTSWORD, SI_REJECTSWORD); + set_sc(ST_REJECTSWORD, SC_AUTOCOUNTER, SI_BLANK); + set_sc(CG_MOONLIT, SC_MOONLIT, SI_MOONLIT); + set_sc(CG_MARIONETTE, SC_MARIONETTE, SI_MARIONETTE); + set_sc(CG_MARIONETTE, SC_MARIONETTE2, SI_MARIONETTE2); + set_sc(LK_SPIRALPIERCE, SC_STOP, SI_BLANK); + set_sc(LK_HEADCRUSH, SC_BLEEDING, SI_BLEEDING); + set_sc(LK_JOINTBEAT, SC_JOINTBEAT, SI_BLANK); + set_sc(HW_NAPALMVULCAN, SC_CURSE, SI_BLANK); + set_sc(PF_MINDBREAKER, SC_MINDBREAKER, SI_BLANK); + set_sc(PF_MEMORIZE, SC_MEMORIZE, SI_BLANK); + set_sc(PF_FOGWALL, SC_FOGWALL, SI_BLANK); + set_sc(PF_SPIDERWEB, SC_SPIDERWEB, SI_BLANK); + set_sc(WE_BABY, SC_BABY, SI_BLANK); + set_sc(TK_RUN, SC_RUN, SI_BLANK); + set_sc(TK_RUN, SC_SPURT, SI_SPURT); + set_sc(TK_READYSTORM, SC_READYSTORM, SI_READYSTORM); + set_sc(TK_READYDOWN, SC_READYDOWN, SI_READYDOWN); + set_sc(TK_DOWNKICK, SC_STUN, SI_BLANK); + set_sc(TK_READYTURN, SC_READYTURN, SI_READYTURN); + set_sc(TK_READYCOUNTER, SC_READYCOUNTER, SI_READYCOUNTER); + set_sc(TK_DODGE, SC_DODGE, SI_DODGE); + set_sc(TK_SPTIME, SC_TKDORI, SI_BLANK); + set_sc(TK_SEVENWIND, SC_GHOSTWEAPON, SI_GHOSTWEAPON); + set_sc(TK_SEVENWIND, SC_SHADOWWEAPON, SI_SHADOWWEAPON); + set_sc(SG_SUN_WARM, SC_WARM, SI_WARM); + set_sc(SG_MOON_WARM, SC_WARM, SI_WARM); + set_sc(SG_STAR_WARM, SC_WARM, SI_WARM); + set_sc(SG_SUN_COMFORT, SC_SUN_COMFORT, SI_SUN_COMFORT); + set_sc(SG_MOON_COMFORT, SC_MOON_COMFORT, SI_MOON_COMFORT); + set_sc(SG_STAR_COMFORT, SC_STAR_COMFORT, SI_STAR_COMFORT); + set_sc(SG_FUSION, SC_FUSION, SI_BLANK); + set_sc(BS_ADRENALINE2, SC_ADRENALINE2, SI_ADRENALINE2); + set_sc(SL_KAIZEL, SC_KAIZEL, SI_KAIZEL); + set_sc(SL_KAAHI, SC_KAAHI, SI_KAAHI); + set_sc(SL_KAUPE, SC_KAUPE, SI_KAUPE); + set_sc(SL_KAITE, SC_KAITE, SI_KAITE); + set_sc(SL_STUN, SC_STUN, SI_BLANK); + set_sc(SL_SWOO, SC_SWOO, SI_BLANK); + set_sc(SL_SKE, SC_SKE, SI_BLANK); + set_sc(SL_SKA, SC_SKA, SI_BLANK); + set_sc(ST_PRESERVE, SC_PRESERVE, SI_PRESERVE); + set_sc(PF_DOUBLECASTING, SC_DOUBLECAST, SI_DOUBLECAST); + set_sc(HW_GRAVITATION, SC_GRAVITATION, SI_BLANK); + set_sc(WS_CARTTERMINATION, SC_STUN, SI_BLANK); + set_sc(WS_OVERTHRUSTMAX, SC_MAXOVERTHRUST, SI_MAXOVERTHRUST); + set_sc(CG_LONGINGFREEDOM, SC_LONGING, SI_BLANK); + set_sc(CG_HERMODE, SC_HERMODE, SI_BLANK); + set_sc(SL_HIGH, SC_SPIRIT, SI_SPIRIT); + set_sc(KN_ONEHAND, SC_ONEHAND, SI_ONEHAND); + set_sc(CR_SHRINK, SC_SHRINK, SI_SHRINK); + set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE2, SI_CLOSECONFINE2); + set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE, SI_CLOSECONFINE); + set_sc(WZ_SIGHTBLASTER, SC_SIGHTBLASTER, SI_SIGHTBLASTER); + set_sc(DC_WINKCHARM, SC_WINKCHARM, SI_WINKCHARM); + set_sc(MO_BALKYOUNG, SC_STUN, SI_BLANK); + + // Storing the target job rather than simply SC_SPIRIT simplifies code later on. + SkillStatusChangeTable[SL_ALCHEMIST] = MAPID_ALCHEMIST, + SkillStatusChangeTable[SL_MONK] = MAPID_MONK, + SkillStatusChangeTable[SL_STAR] = MAPID_STAR_GLADIATOR, + SkillStatusChangeTable[SL_SAGE] = MAPID_SAGE, + SkillStatusChangeTable[SL_CRUSADER] = MAPID_CRUSADER, + SkillStatusChangeTable[SL_SUPERNOVICE] = MAPID_SUPER_NOVICE, + SkillStatusChangeTable[SL_KNIGHT] = MAPID_KNIGHT, + SkillStatusChangeTable[SL_WIZARD] = MAPID_WIZARD, + SkillStatusChangeTable[SL_PRIEST] = MAPID_PRIEST, + SkillStatusChangeTable[SL_BARDDANCER] = MAPID_BARDDANCER, + SkillStatusChangeTable[SL_ROGUE] = MAPID_ROGUE, + SkillStatusChangeTable[SL_ASSASIN] = MAPID_ASSASSIN, + SkillStatusChangeTable[SL_BLACKSMITH] = MAPID_BLACKSMITH, + SkillStatusChangeTable[SL_HUNTER] = MAPID_HUNTER, + SkillStatusChangeTable[SL_SOULLINKER] = MAPID_SOUL_LINKER, + + //Status that don't have a skill associated. + StatusIconChangeTable[SC_WEIGHT50 ] = SI_WEIGHT50; + StatusIconChangeTable[SC_WEIGHT90] = SI_WEIGHT90; StatusIconChangeTable[SC_ASPDPOTION0] = SI_ASPDPOTION; StatusIconChangeTable[SC_ASPDPOTION1] = SI_ASPDPOTION; StatusIconChangeTable[SC_ASPDPOTION2] = SI_ASPDPOTION; StatusIconChangeTable[SC_ASPDPOTION3] = SI_ASPDPOTION; - StatusIconChangeTable[SC_SPEEDUP0] = SI_SPEEDPOTION; - StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION; - StatusIconChangeTable[SC_STRIPWEAPON] = SI_STRIPWEAPON; - StatusIconChangeTable[SC_STRIPSHIELD] = SI_STRIPSHIELD; - StatusIconChangeTable[SC_STRIPARMOR] = SI_STRIPARMOR; - StatusIconChangeTable[SC_STRIPHELM] = SI_STRIPHELM; - StatusIconChangeTable[SC_CP_WEAPON] = SI_CP_WEAPON; - StatusIconChangeTable[SC_CP_SHIELD] = SI_CP_SHIELD; - StatusIconChangeTable[SC_CP_ARMOR] = SI_CP_ARMOR; - StatusIconChangeTable[SC_CP_HELM] = SI_CP_HELM; - StatusIconChangeTable[SC_AUTOGUARD] = SI_AUTOGUARD; - StatusIconChangeTable[SC_REFLECTSHIELD] = SI_REFLECTSHIELD; - StatusIconChangeTable[SC_PROVIDENCE] = SI_PROVIDENCE; - StatusIconChangeTable[SC_DEFENDER] = SI_DEFENDER; - StatusIconChangeTable[SC_AUTOSPELL] = SI_AUTOSPELL; - StatusIconChangeTable[SC_SPEARSQUICKEN] = SI_SPEARQUICKEN; - StatusIconChangeTable[SC_EXPLOSIONSPIRITS] = SI_EXPLOSIONSPIRITS; - StatusIconChangeTable[SC_FURY] = SI_FURY; - StatusIconChangeTable[SC_FIREWEAPON] = SI_FIREWEAPON; - StatusIconChangeTable[SC_WATERWEAPON] = SI_WATERWEAPON; - StatusIconChangeTable[SC_WINDWEAPON] = SI_WINDWEAPON; - StatusIconChangeTable[SC_EARTHWEAPON] = SI_EARTHWEAPON; - StatusIconChangeTable[SC_AURABLADE] = SI_AURABLADE; - StatusIconChangeTable[SC_PARRYING] = SI_PARRYING; - StatusIconChangeTable[SC_CONCENTRATION] = SI_CONCENTRATION; - StatusIconChangeTable[SC_TENSIONRELAX] = SI_TENSIONRELAX; - StatusIconChangeTable[SC_BERSERK] = SI_BERSERK; - StatusIconChangeTable[SC_ASSUMPTIO] = SI_ASSUMPTIO; - StatusIconChangeTable[SC_GUILDAURA] = SI_GUILDAURA; - StatusIconChangeTable[SC_MAGICPOWER] = SI_MAGICPOWER; - StatusIconChangeTable[SC_EDP] = SI_EDP; - StatusIconChangeTable[SC_TRUESIGHT] = SI_TRUESIGHT; - StatusIconChangeTable[SC_WINDWALK] = SI_WINDWALK; - StatusIconChangeTable[SC_MELTDOWN] = SI_MELTDOWN; - StatusIconChangeTable[SC_CARTBOOST] = SI_CARTBOOST; - StatusIconChangeTable[SC_CHASEWALK] = SI_CHASEWALK; - StatusIconChangeTable[SC_REJECTSWORD] = SI_REJECTSWORD; - StatusIconChangeTable[SC_MARIONETTE] = SI_MARIONETTE; - StatusIconChangeTable[SC_MARIONETTE2] = SI_MARIONETTE2; - StatusIconChangeTable[SC_BLEEDING] = SI_BLEEDING; - StatusIconChangeTable[SC_MOONLIT] = SI_MOONLIT; - StatusIconChangeTable[SC_DEVOTION] = SI_DEVOTION; - StatusIconChangeTable[SC_STEELBODY] = SI_STEELBODY; - StatusIconChangeTable[SC_SPURT] = SI_SPURT; - StatusIconChangeTable[SC_SPIRIT] = SI_SPIRIT; - StatusIconChangeTable[SC_READYSTORM] = SI_READYSTORM; - StatusIconChangeTable[SC_READYDOWN] = SI_READYDOWN; - StatusIconChangeTable[SC_READYTURN] = SI_READYTURN; - StatusIconChangeTable[SC_READYCOUNTER] = SI_READYCOUNTER; - StatusIconChangeTable[SC_DODGE] = SI_DODGE; - StatusIconChangeTable[SC_SHADOWWEAPON] = SI_SHADOWWEAPON; - StatusIconChangeTable[SC_WARM] = SI_WARM; - StatusIconChangeTable[SC_SUN_COMFORT] = SI_SUN_COMFORT; - StatusIconChangeTable[SC_MOON_COMFORT] = SI_MOON_COMFORT; - StatusIconChangeTable[SC_STAR_COMFORT] = SI_STAR_COMFORT; - StatusIconChangeTable[SC_ADRENALINE2] = SI_ADRENALINE2; - StatusIconChangeTable[SC_GHOSTWEAPON] = SI_GHOSTWEAPON; - StatusIconChangeTable[SC_KAITE] = SI_KAITE; - StatusIconChangeTable[SC_KAIZEL] = SI_KAIZEL; - StatusIconChangeTable[SC_KAAHI] = SI_KAAHI; - StatusIconChangeTable[SC_KAUPE] = SI_KAUPE; - StatusIconChangeTable[SC_ONEHAND] = SI_ONEHAND; - StatusIconChangeTable[SC_PRESERVE] = SI_PRESERVE; + StatusIconChangeTable[SC_SPEEDUP0] = SI_SPEEDPOTION; + StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION; + + //Guild skills don't fit due to their range being beyond MAX_SKILL + StatusIconChangeTable[SC_GUILDAURA] = SI_GUILDAURA; StatusIconChangeTable[SC_BATTLEORDERS] = SI_BATTLEORDERS; - StatusIconChangeTable[SC_DOUBLECAST] = SI_DOUBLECAST; - StatusIconChangeTable[SC_MAXOVERTHRUST] = SI_MAXOVERTHRUST; - StatusIconChangeTable[SC_SHRINK] = SI_SHRINK; - StatusIconChangeTable[SC_SIGHTBLASTER] = SI_SIGHTBLASTER; - StatusIconChangeTable[SC_WINKCHARM] = SI_WINKCHARM; - StatusIconChangeTable[SC_CLOSECONFINE] = SI_CLOSECONFINE; - StatusIconChangeTable[SC_CLOSECONFINE2] = SI_CLOSECONFINE2; +#undef set_sc + + if (!battle_config.display_hallucination) //Disable Hallucination. + StatusIconChangeTable[SC_HALLUCINATION] = SI_BLANK; } + /*========================================== * 精錬ボーナス *------------------------------------------ @@ -3520,13 +3228,12 @@ int status_isdead(struct block_list *bl) } int status_isimmune(struct block_list *bl) { - struct map_session_data *sd = (struct map_session_data *)bl; - if (bl->type == BL_PC) { - if (sd->special_state.no_magic_damage) - return 1; - if (sd->sc.count && sd->sc.data[SC_HERMODE].timer != -1) - return 1; - } + struct status_change *sc =status_get_sc(bl); + if (bl->type == BL_PC && + ((struct map_session_data *)bl)->special_state.no_magic_damage) + return 1; + if (sc && sc->count && sc->data[SC_HERMODE].timer != -1) + return 1; return 0; } @@ -3548,6 +3255,34 @@ int status_get_sc_def(struct block_list *bl, int type) struct status_change* sc; struct map_session_data *sd; nullpo_retr(0, bl); + + //Status that are blocked by Golden Thief Bug card or Wand of Hermod + if (status_isimmune(bl)) + switch (type) + { + case SC_DECREASEAGI: + case SC_SILENCE: + case SC_COMA: + case SC_INCREASEAGI: + case SC_BLESSING: + case SC_SLOWPOISON: + case SC_IMPOSITIO: + case SC_AETERNA: + case SC_SUFFRAGIUM: + case SC_BENEDICTIO: + case SC_PROVIDENCE: + case SC_KYRIE: + case SC_ASSUMPTIO: + case SC_ANGELUS: + case SC_MAGNIFICAT: + case SC_GLORIA: + case SC_WINDWALK: + case SC_MAGICROD: + case SC_HALLUCINATION: + case SC_STONE: + case SC_QUAGMIRE: + return 10000; + } switch (type) { @@ -3566,7 +3301,7 @@ int status_get_sc_def(struct block_list *bl, int type) sc_def = 3 + status_get_def(bl) + status_get_luk(bl)/3; break; case SP_DEF2: // vit - case SC_STAN: + case SC_STUN: case SC_POISON: case SC_SILENCE: case SC_STOP: @@ -3583,6 +3318,7 @@ int status_get_sc_def(struct block_list *bl, int type) break; case SC_COMA: sc_def = 3 + status_get_mdef(bl); + break; default: return 0; //Effect that cannot be reduced? Likely a buff. } @@ -3635,7 +3371,7 @@ int status_get_sc_tick(struct block_list *bl, int type, int tick) case SC_FREEZE: /* 凍結 */ tick -= tick*status_get_mdef(bl)/100; break; - case SC_STAN: /* スタン(val2にミリ秒セット) */ + case SC_STUN: /* スタン(val2にミリ秒セット) */ tick -= tick*status_get_sc_def_vit(bl)/10000; break; case SC_DPOISON: /* 猛毒 */ @@ -3747,7 +3483,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val if (undead_flag && !(flag&1)) return 0; case SC_SLEEP: - case SC_STAN: + case SC_STUN: if (sc->opt1) return 0; //Cannot override other opt1 status changes. [Skotlex] break; @@ -3843,7 +3579,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val //Must not override a casting gospel char. if (sc->data[type].val4 == BCT_SELF) return 0; - case SC_STAN: + case SC_STUN: case SC_SLEEP: case SC_POISON: case SC_CURSE: @@ -4219,6 +3955,10 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val /* option */ case SC_HIDING: /* ハイディング */ calc_flag = 1; + if(sc->data[SC_CLOSECONFINE].timer != -1) + status_change_end(bl, SC_CLOSECONFINE, -1); + if(sc->data[SC_CLOSECONFINE2].timer != -1) + status_change_end(bl, SC_CLOSECONFINE2, -1); if(bl->type == BL_PC && !(flag&4)) { val2 = tick / 1000; /* 持?時間 */ tick = 1000; @@ -4315,6 +4055,21 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break; case SC_BERSERK: /* バ?サ?ク */ + if(battle_config.berserk_cancels_buffs) + { + if (sc->data[SC_ONEHAND].timer != -1) + status_change_end(bl,SC_ONEHAND,-1); + if (sc->data[SC_TWOHANDQUICKEN].timer != -1) + status_change_end(bl,SC_TWOHANDQUICKEN,-1); + if (sc->data[SC_CONCENTRATION].timer != -1) + status_change_end(bl,SC_CONCENTRATION,-1); + if (sc->data[SC_PARRYING].timer != -1) + status_change_end(bl,SC_PARRYING,-1); + if (sc->data[SC_ENDURE].timer != -1) + status_change_end(bl,SC_ENDURE,-1); + if (sc->data[SC_AURABLADE].timer != -1) + status_change_end(bl,SC_AURABLADE,-1); + } if(sd && !(flag&4)){ sd->status.hp = sd->status.max_hp * 3; sd->status.sp = 0; @@ -4577,7 +4332,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val case SC_WEAPONPERFECTION: /* ウェポンパ?フェクション */ case SC_TRICKDEAD: /* 死んだふり */ case SC_FREEZE: /* 凍結 */ - case SC_STAN: /* スタン(val2にミリ秒セット) */ + case SC_STUN: /* スタン(val2にミリ秒セット) */ case SC_ENERGYCOAT: /* エナジ?コ?ト */ case SC_SAFETYWALL: case SC_OVERTHRUST: /* オ?バ?スラスト */ @@ -4627,7 +4382,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val //Those that make you stop attacking/walking.... switch (type) { case SC_FREEZE: - case SC_STAN: + case SC_STUN: case SC_SLEEP: case SC_STONE: if (sd && pc_issit(sd)) //Avoid sprite sync problems. @@ -4652,7 +4407,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val } - if (bl->type == BL_PC && (battle_config.display_hallucination || type != SC_HALLUCINATION)) + if (bl->type == BL_PC) { if (flag&4) clif_status_load(bl,StatusIconChangeTable[type],1); //Sending to owner since they aren't in the map yet. [Skotlex] @@ -4665,7 +4420,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val //OPT1 case SC_STONE: case SC_FREEZE: - case SC_STAN: + case SC_STUN: case SC_SLEEP: if(type == SC_STONE) sc->opt1 = OPT1_STONEWAIT; @@ -5173,13 +4928,13 @@ int status_change_end( struct block_list* bl , int type,int tid ) } - if (sd && (battle_config.display_hallucination || type != SC_HALLUCINATION)) + if (sd) clif_status_change(bl,StatusIconChangeTable[type],0); switch(type){ /* 正常に?るときなにか?理が必要 */ case SC_STONE: case SC_FREEZE: - case SC_STAN: + case SC_STUN: case SC_SLEEP: sc->opt1 = 0; opt_flag = 1; @@ -6009,7 +5764,7 @@ int do_init_status(void) exit(1); } add_timer_func_list(status_change_timer,"status_change_timer"); - initStatusIconChangeTable(); + initChangeTables(); status_readdb(); status_calc_sigma(); return 0; diff --git a/src/map/status.h b/src/map/status.h index e4774a4f8..2ad97bf9b 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -11,7 +11,7 @@ enum { //First we enumerate common status ailments which are often used around. SC_STONE = 0, SC_FREEZE, - SC_STAN, + SC_STUN, SC_SLEEP, SC_POISON, SC_CURSE, @@ -232,7 +232,8 @@ enum { // SC_MAX, //Automatically updated max, used in for's and at startup to check we are within bounds. [Skotlex] }; -extern int SkillStatusChangeTable[]; +extern int SkillStatusChangeTable[MAX_SKILL]; +extern int StatusSkillChangeTable[SC_MAX]; //Numerates the Number for the status changes (client-dependent), imported from jA enum { -- cgit v1.2.3-70-g09d2