diff options
author | rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-08-09 15:19:02 +0000 |
---|---|---|
committer | rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-08-09 15:19:02 +0000 |
commit | e205bcb44e1a060276b964b378e2e6d801242efa (patch) | |
tree | e9223b74126d0c1c7470483bfe29df0d63991362 | |
parent | 2e18502fb6607b8a8dc12363cea153535267807c (diff) | |
download | hercules-e205bcb44e1a060276b964b378e2e6d801242efa.tar.gz hercules-e205bcb44e1a060276b964b378e2e6d801242efa.tar.bz2 hercules-e205bcb44e1a060276b964b378e2e6d801242efa.tar.xz hercules-e205bcb44e1a060276b964b378e2e6d801242efa.zip |
Fixed bugreport:6443 where SC_AUTOSHADOWSPELL bypasses flag checking of ground type skills.
Follow up r16591 where using KG_GENWAKU on sitting targets the client doesn't sync with the server in sitting state.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16613 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/battle.c | 34 | ||||
-rw-r--r-- | src/map/skill.c | 2 |
2 files changed, 33 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 046e64eb0..e36befad7 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4810,12 +4810,42 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id != 0 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].flag == SKILL_FLAG_PLAGIARIZED ) { int r_skill = sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id, - r_lv = sc->data[SC__AUTOSHADOWSPELL]->val2; + r_lv = sc->data[SC__AUTOSHADOWSPELL]->val2, type; if (r_skill != AL_HOLYLIGHT && r_skill != PR_MAGNUS) { + if( (type = skill_get_casttype(r_skill)) == CAST_GROUND ) { + int maxcount = 0; + + if( !(BL_PC&battle_config.skill_reiteration) && + skill_get_unit_flag(r_skill)&UF_NOREITERATION ) + type = -1; + + if( BL_PC&battle_config.skill_nofootset && + skill_get_unit_flag(r_skill)&UF_NOFOOTSET ) + type = -1; + + if( BL_PC&battle_config.land_skill_limit && + (maxcount = skill_get_maxcount(r_skill, r_lv)) > 0 + ) { + int v; + for(v=0;v<MAX_SKILLUNITGROUP && sd->ud.skillunit[v] && maxcount;v++) { + if(sd->ud.skillunit[v]->skill_id == r_skill) + maxcount--; + } + if( maxcount == 0 ) + type = -1; + } + + if( type != CAST_GROUND ){ + clif_skill_fail(sd,r_skill,USESKILL_FAIL_LEVEL,0); + map_freeblock_unlock(); + return wd.dmg_lv; + } + } + sd->state.autocast = 1; skill_consume_requirement(sd,r_skill,r_lv,3); - switch( skill_get_casttype(r_skill) ) { + switch( type ) { case CAST_GROUND: skill_castend_pos2(src, target->x, target->y, r_skill, r_lv, tick, flag); break; diff --git a/src/map/skill.c b/src/map/skill.c index e6496a3e9..8a9fa9c19 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -8760,7 +8760,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (unit_movepos(bl,x,y,0,0)) { clif_skill_damage(bl,bl,tick, status_get_amotion(src), 0, -30000, 1, skillid, -1, 6); - if( sd && pc_issit(sd)) + if( bl->type == BL_PC && pc_issit((TBL_PC*)bl)) clif_sitting(bl); //Avoid sitting sync problem clif_slide(bl,x,y) ; sc_start(bl,SC_CONFUSION,80,skilllv,skill_get_time(skillid,skilllv)); |