diff options
author | Guilherme G. Menaldo <guilherme.menaldo@outlook.com> | 2018-08-20 21:20:46 -0300 |
---|---|---|
committer | Guilherme G. Menaldo <guilherme.menaldo@outlook.com> | 2018-08-30 12:04:06 -0300 |
commit | 6a0d3d52dcb64a4e04d49336fa7bdf82874a7cc1 (patch) | |
tree | 554d7c0f25b7c44076a93da4507e74a697bcf09e /src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | |
parent | 7f7b8060cba8f0aba60f43cf343bdf3f773f3438 (diff) | |
download | hercules-6a0d3d52dcb64a4e04d49336fa7bdf82874a7cc1.tar.gz hercules-6a0d3d52dcb64a4e04d49336fa7bdf82874a7cc1.tar.bz2 hercules-6a0d3d52dcb64a4e04d49336fa7bdf82874a7cc1.tar.xz hercules-6a0d3d52dcb64a4e04d49336fa7bdf82874a7cc1.zip |
Makes trap damage possible to be reflected
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking_map.Hooks.inc')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index f2ce1505c..d220f78fd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -2806,6 +2806,32 @@ void HP_battle_reflect_damage(struct block_list *target, struct block_list *src, } return; } +void HP_battle_reflect_trap(struct block_list *target, struct block_list *src, struct Damage *md, uint16 skill_id) { + int hIndex = 0; + if (HPMHooks.count.HP_battle_reflect_trap_pre > 0) { + void (*preHookFunc) (struct block_list **target, struct block_list **src, struct Damage **md, uint16 *skill_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_reflect_trap_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_battle_reflect_trap_pre[hIndex].func; + preHookFunc(&target, &src, &md, &skill_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.battle.reflect_trap(target, src, md, skill_id); + } + if (HPMHooks.count.HP_battle_reflect_trap_post > 0) { + void (*postHookFunc) (struct block_list *target, struct block_list *src, struct Damage *md, uint16 skill_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_reflect_trap_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_battle_reflect_trap_post[hIndex].func; + postHookFunc(target, src, md, skill_id); + } + } + return; +} int HP_battle_attr_ratio(int atk_elem, int def_type, int def_lv) { int hIndex = 0; int retVal___ = 0; |