summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-10-19 00:45:20 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-10-19 00:45:20 +0800
commit9de926c247a89e0d5d338e26f178aef443b4066d (patch)
tree3f050f1bff60b87fa39fac8276ac19ca57cb10ad /src/map/battle.c
parent9128feccf3bddda94a7f8a170305565416815b40 (diff)
downloadhercules-9de926c247a89e0d5d338e26f178aef443b4066d.tar.gz
hercules-9de926c247a89e0d5d338e26f178aef443b4066d.tar.bz2
hercules-9de926c247a89e0d5d338e26f178aef443b4066d.tar.xz
hercules-9de926c247a89e0d5d338e26f178aef443b4066d.zip
Fixed Bug#7737
-http://hercules.ws/board/tracker/issue-7737-shadow-form-and-interaction-with-multi-hit-skills/?gopid=20576#entry20576 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index fb950860e..0406500b7 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2938,27 +2938,6 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
status->change_spread(bl, src); // Deadly infect attacked side
-
- if( sc && sc->data[SC__SHADOWFORM] ) {
- struct block_list *s_bl = map->id2bl(sc->data[SC__SHADOWFORM]->val2);
- if( !s_bl || s_bl->m != bl->m ) { // If the shadow form target is not present remove the sc.
- status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
- } else if( status->isdead(s_bl) || !battle->check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
- status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
- if( s_bl->type == BL_PC )
- ((TBL_PC*)s_bl)->shadowform_id = 0;
- } else {
- if( (--sc->data[SC__SHADOWFORM]->val3) < 0 ) { // If you have exceded max hits supported, remove the sc in both.
- status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
- if( s_bl->type == BL_PC )
- ((TBL_PC*)s_bl)->shadowform_id = 0;
- } else {
- status->damage(bl, s_bl, damage, 0, clif->damage(s_bl, s_bl, timer->gettick(), 500, 500, damage, -1, 0, 0), 0);
- return ATK_NONE;
- }
- }
- }
-
}
//SC effects from caster side.
@@ -5533,7 +5512,13 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
map->freeblock_lock();
- battle->delay_damage(tick, wd.amotion, src, target, wd.flag, 0, 0, damage, wd.dmg_lv, wd.dmotion, true);
+ if( skill->check_shadowform(target, damage, wd.div_) ){
+ if( !status->isdead(target) )
+ skill->additional_effect(src, target, 0, 0, wd.flag, wd.dmg_lv, tick);
+ if( wd.dmg_lv > ATK_BLOCK)
+ skill->counter_additional_effect(src, target, 0, 0, wd.flag,tick);
+ }else
+ battle->delay_damage(tick, wd.amotion, src, target, wd.flag, 0, 0, damage, wd.dmg_lv, wd.dmotion, true);
if( tsc ) {
if( tsc->data[SC_DEVOTION] ) {
struct status_change_entry *sce = tsc->data[SC_DEVOTION];