diff options
author | shennetsind <ind@henn.et> | 2013-12-18 14:26:20 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-12-18 14:26:20 -0200 |
commit | 36d0c789633da074f7e1a6add901278af513ad4b (patch) | |
tree | da2cd48f6edfe5b4766d67feffaaea2410c72594 | |
parent | fbf96e6eaed6220fd7aba0594a32396bab1da70b (diff) | |
download | hercules-36d0c789633da074f7e1a6add901278af513ad4b.tar.gz hercules-36d0c789633da074f7e1a6add901278af513ad4b.tar.bz2 hercules-36d0c789633da074f7e1a6add901278af513ad4b.tar.xz hercules-36d0c789633da074f7e1a6add901278af513ad4b.zip |
Implementing #define DEVOTION_REFLECT_DAMAGE
When enabled, reflect damage doesn't bypass devotion (and thus damage is passed to crusader)
Configurable in src/config/general.h
As requested by the community (in http://hercules.ws/board/topic/421-suggestion-d/ ) and provided in pull request #209 by Jedzkie. (Committing on his behalf due to issue with automatic merge)
Closes #209
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | src/config/classes/general.h | 10 | ||||
-rw-r--r-- | src/map/status.c | 15 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/config/classes/general.h b/src/config/classes/general.h index 206f57b37..147fddb55 100644 --- a/src/config/classes/general.h +++ b/src/config/classes/general.h @@ -10,8 +10,8 @@ /** * Default Magical Reflection Behavior - * - When reflecting, reflected damage depends on gears caster is wearing, not target - * - When disabled damage depends on gears target is wearing, not caster. + * - When reflecting, reflected damage depends on gears caster is wearing, not target (official) + * - When disabled damage depends on gears target is wearing, not caster. (old/eathena) * @values 1 (enabled) or 0 (disabled) **/ #define MAGIC_REFLECTION_TYPE 1 @@ -22,6 +22,12 @@ #define MAX_SPIRITBALL 15 /** + * when enabled, reflect damage doesn't bypass devotion (and thus damage is passed to crusader) + * uncomment to enable + **/ +//#define DEVOTION_REFLECT_DAMAGE + +/** * No settings past this point **/ diff --git a/src/map/status.c b/src/map/status.c index 6cfd799f1..f6ca1ff00 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1168,6 +1168,21 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, if( hp && !(flag&1) ) { if( sc ) { struct status_change_entry *sce; + +#ifdef DEVOTION_REFLECT_DAMAGE + if(src && (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 == target->id) + || (d_bl->type == BL_PC && ((TBL_PC *)d_bl)->devotion[sce->val2] == target->id)) && check_distance_bl(target, d_bl, sce->val3)) { + clif->damage(d_bl, d_bl, 0, 0, hp, 0, 0, 0); + status_fix_damage(NULL, d_bl, hp, 0); + return 0; + } + status_change_end(target, SC_DEVOTION, INVALID_TIMER); + } +#endif + if (sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) status_change_end(target, SC_STONE, INVALID_TIMER); status_change_end(target, SC_FREEZE, INVALID_TIMER); |