From 9e68350a054d5ec181a40528728d8de185a4f43c Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 9 Feb 2020 20:56:28 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 2 ++ .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 ++++++++++++++++++++++ 4 files changed, 33 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 496da1518..206934222 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1514,6 +1514,8 @@ typedef void (*HPMHOOK_pre_clif_misceffect) (struct block_list **bl, int *type); typedef void (*HPMHOOK_post_clif_misceffect) (struct block_list *bl, int type); typedef void (*HPMHOOK_pre_clif_changeoption) (struct block_list **bl); typedef void (*HPMHOOK_post_clif_changeoption) (struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_changeoption_target) (struct block_list **bl, struct block_list **target_bl, enum send_target *target); +typedef void (*HPMHOOK_post_clif_changeoption_target) (struct block_list *bl, struct block_list *target_bl, enum send_target target); typedef void (*HPMHOOK_pre_clif_changeoption2) (struct block_list **bl); typedef void (*HPMHOOK_post_clif_changeoption2) (struct block_list *bl); typedef void (*HPMHOOK_pre_clif_emotion) (struct block_list **bl, int *type); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index f8a25a649..d70ee0024 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1104,6 +1104,8 @@ struct { struct HPMHookPoint *HP_clif_misceffect_post; struct HPMHookPoint *HP_clif_changeoption_pre; struct HPMHookPoint *HP_clif_changeoption_post; + struct HPMHookPoint *HP_clif_changeoption_target_pre; + struct HPMHookPoint *HP_clif_changeoption_target_post; struct HPMHookPoint *HP_clif_changeoption2_pre; struct HPMHookPoint *HP_clif_changeoption2_post; struct HPMHookPoint *HP_clif_emotion_pre; @@ -7967,6 +7969,8 @@ struct { int HP_clif_misceffect_post; int HP_clif_changeoption_pre; int HP_clif_changeoption_post; + int HP_clif_changeoption_target_pre; + int HP_clif_changeoption_target_post; int HP_clif_changeoption2_pre; int HP_clif_changeoption2_post; int HP_clif_emotion_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 7af336fdc..c755e0bec 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -576,6 +576,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->quitsave, HP_clif_quitsave) }, { HP_POP(clif->misceffect, HP_clif_misceffect) }, { HP_POP(clif->changeoption, HP_clif_changeoption) }, + { HP_POP(clif->changeoption_target, HP_clif_changeoption_target) }, { HP_POP(clif->changeoption2, HP_clif_changeoption2) }, { HP_POP(clif->emotion, HP_clif_emotion) }, { HP_POP(clif->talkiebox, HP_clif_talkiebox) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index ccc11d52b..d0ddcf28a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -14402,6 +14402,32 @@ void HP_clif_changeoption(struct block_list *bl) { } return; } +void HP_clif_changeoption_target(struct block_list *bl, struct block_list *target_bl, enum send_target target) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_changeoption_target_pre > 0) { + void (*preHookFunc) (struct block_list **bl, struct block_list **target_bl, enum send_target *target); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption_target_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_changeoption_target_pre[hIndex].func; + preHookFunc(&bl, &target_bl, &target); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.changeoption_target(bl, target_bl, target); + } + if (HPMHooks.count.HP_clif_changeoption_target_post > 0) { + void (*postHookFunc) (struct block_list *bl, struct block_list *target_bl, enum send_target target); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption_target_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_changeoption_target_post[hIndex].func; + postHookFunc(bl, target_bl, target); + } + } + return; +} void HP_clif_changeoption2(struct block_list *bl) { int hIndex = 0; if (HPMHooks.count.HP_clif_changeoption2_pre > 0) { -- cgit v1.2.3-70-g09d2