diff options
-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)); |