summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 04:59:21 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 04:59:21 +0000
commit3c28bcdb276c7edaebfa39db390c8d55652a8525 (patch)
tree14772dfee1a8efa11f32af0a385ef675de02c7ec /src/map/battle.c
parentf1ab59626ff04306a8009c98566631d81d95c33b (diff)
downloadhercules-3c28bcdb276c7edaebfa39db390c8d55652a8525.tar.gz
hercules-3c28bcdb276c7edaebfa39db390c8d55652a8525.tar.bz2
hercules-3c28bcdb276c7edaebfa39db390c8d55652a8525.tar.xz
hercules-3c28bcdb276c7edaebfa39db390c8d55652a8525.zip
Fixed bugreport:5356 Shadow Shaser's Shadow Form. Skill now redirects damage properly and is removed upon either caster or target leaving skill range
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15755 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 34e651af8..afefe3d7e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -647,6 +647,26 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( sc->data[SC__DEADLYINFECT] && damage > 0 && rand()%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 ) { // If the shadow form target is not present remove the sc.
+ status_change_end(bl, SC__SHADOWFORM, -1);
+ } 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, -1);
+ 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, -1);
+ if( s_bl->type == BL_PC )
+ ((TBL_PC*)s_bl)->shadowform_id = 0;
+ } else {
+ status_damage(src, s_bl, damage, 0, clif_damage(s_bl, s_bl, gettick(), 500, 500, damage, -1, 0, 0), 0);
+ return ATK_NONE;
+ }
+ }
+ }
+
}
//SC effects from caster side.
@@ -736,25 +756,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
pc_overheat(sd,element == ELE_FIRE ? 1 : -1);
}
}
- if( sc && sc->data[SC__SHADOWFORM] ) {
- struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2);
- if( !s_bl ) { // If the shadow form target is not present remove the sc.
- status_change_end(bl, SC__SHADOWFORM, -1);
- } 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, -1);
- 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, -1);
- if( s_bl->type == BL_PC )
- ((TBL_PC*)s_bl)->shadowform_id = 0;
- } else {
- status_damage(src, s_bl, damage, 0, clif_damage(s_bl, s_bl, gettick(), 500, 500, damage, -1, 0, 0), 0);
- return ATK_NONE;
- }
- }
- }
+
return damage;
}