summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2020-02-09 20:56:28 +0100
committerHerculesWSAPI <dev@herc.ws>2020-02-09 20:56:28 +0100
commit9e68350a054d5ec181a40528728d8de185a4f43c (patch)
tree54781c08bdcea5e287cab25aaef973a74d269882 /src/plugins/HPMHooking
parent14655f4367656866b09b331359978c0af17916bd (diff)
downloadhercules-9e68350a054d5ec181a40528728d8de185a4f43c.tar.gz
hercules-9e68350a054d5ec181a40528728d8de185a4f43c.tar.bz2
hercules-9e68350a054d5ec181a40528728d8de185a4f43c.tar.xz
hercules-9e68350a054d5ec181a40528728d8de185a4f43c.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc26
4 files changed, 33 insertions, 0 deletions
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) {