summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorcookiecrumbs <cookiecrumbs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-22 06:01:10 +0000
committercookiecrumbs <cookiecrumbs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-22 06:01:10 +0000
commita3c1deaa9a88e75c67502a5f225a10d05b84d558 (patch)
treeaa2f5ffa125e30f79b5a5831242eb8301a5f211b /src/map/skill.c
parentb89584e8396e7a3fc90e94109570f9ebf9c79d27 (diff)
downloadhercules-a3c1deaa9a88e75c67502a5f225a10d05b84d558.tar.gz
hercules-a3c1deaa9a88e75c67502a5f225a10d05b84d558.tar.bz2
hercules-a3c1deaa9a88e75c67502a5f225a10d05b84d558.tar.xz
hercules-a3c1deaa9a88e75c67502a5f225a10d05b84d558.zip
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
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c25
1 files 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);