From a3c1deaa9a88e75c67502a5f225a10d05b84d558 Mon Sep 17 00:00:00 2001 From: cookiecrumbs Date: Wed, 22 Aug 2012 06:01:10 +0000 Subject: Fixed bugreport:686 and bugreport:3603 where kaite magic reflected/reflecting damage (i.e. Reflect Shield) is directed to the Paladin (Devotion) instead of the player devoted. Per official standards, the player devoted should receive the damage in those instances. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16676 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/skill.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/map/skill.c b/src/map/skill.c index 001386dfd..89cb49e1a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2616,8 +2616,29 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds (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); + /** + * Check for devotion and change targetted dmg. + * [d_bl = paladin; bl = player; src = source of dmg] + **/ + bool devo_flag = false; /* false = paladin devoing; true = player */ + if ( src ) + { + struct status_change *tsc; + tsc = status_get_sc(src); + + /* Per official standards, following skills should reflect at the bl */ + if( (tsc->data[SC_KAITE] && attack_type == BF_MAGIC) || + (tsc->data[SC_REFLECTDAMAGE] && attack_type != BF_MAGIC) + ) + devo_flag = true; + } + + clif_damage( + ( (devo_flag) ? bl:d_bl), + ( (devo_flag) ? bl:d_bl), gettick(), 0, 0, damage, 0, 0, 0); + status_fix_damage( + ( (devo_flag) ? bl:NULL), + ( (devo_flag) ? bl:d_bl), damage, 0, 0); } else { status_change_end(bl, SC_DEVOTION, INVALID_TIMER); -- cgit v1.2.3-60-g2f50