summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-09-12 12:24:55 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-09-12 12:24:55 +0000
commit707ba8ba46715bb276310081b057b729b400262e (patch)
tree25b87381423698e593f0ca5c39d80b85a9dad43e /src/map/skill.c
parent81bd882bb564b34cfa7ac55eaf6551d46144938e (diff)
downloadhercules-707ba8ba46715bb276310081b057b729b400262e.tar.gz
hercules-707ba8ba46715bb276310081b057b729b400262e.tar.bz2
hercules-707ba8ba46715bb276310081b057b729b400262e.tar.xz
hercules-707ba8ba46715bb276310081b057b729b400262e.zip
All direct damages such as reflected damage or Tarot Card damage should not be redirected. (follow up to r14400)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14406 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 4e43ce6ba..2f1f9240e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1715,6 +1715,23 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
&& skillid != WS_CARTTERMINATION )
rdamage = battle_calc_return_damage(bl, damage, dmg.flag);
+ if( sc && sc->data[SC_DEVOTION] && skillid != PA_PRESSURE )
+ {
+ struct status_change_entry *sce = sc->data[SC_DEVOTION];
+ struct block_list *d_bl = map_id2bl(sce->val1);
+
+ if( d_bl && (
+ (d_bl->type == BL_MER && ((TBL_MER*)d_bl)->master && ((TBL_MER*)d_bl)->master->bl.id == bl->id) ||
+ (d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce->val2] == bl->id)
+ ) && check_distance_bl(bl, d_bl, sce->val3) )
+ {
+ clif_damage(d_bl, d_bl, gettick(), 0, 0, damage, 0, 0, 0);
+ status_fix_damage(NULL, d_bl, damage, 0);
+ }
+ else
+ status_change_end(bl, SC_DEVOTION, -1);
+ }
+
//Skill hit type
type=(skillid==0)?5:skill_get_hit(skillid);
@@ -1902,7 +1919,8 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if( !dmg.amotion )
{ //Instant damage
- status_fix_damage(src,bl,damage,dmg.dmotion); //Deal damage before knockback to allow stuff like firewall+storm gust combo.
+ if( !sc || !sc->data[SC_DEVOTION] )
+ status_fix_damage(src,bl,damage,dmg.dmotion); //Deal damage before knockback to allow stuff like firewall+storm gust combo.
if( !status_isdead(bl) )
skill_additional_effect(src,bl,skillid,skilllv,dmg.flag,dmg.dmg_lv,tick);
if( damage > 0 ) //Counter status effects [Skotlex]
@@ -1948,7 +1966,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if( rdamage > 0 )
{
if( dmg.amotion )
- battle_delay_damage(tick, dmg.amotion,bl,src,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,0); // also here the reflect shield, but for skills [icescope]
+ battle_delay_damage(tick, dmg.amotion,bl,src,0,0,0,rdamage,ATK_DEF,0);
else
status_fix_damage(bl,src,rdamage,0);
clif_damage(src,src,tick, dmg.amotion,0,rdamage,dmg.div_>1?dmg.div_:1,4,0);