summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2020-05-03 21:22:19 +0200
committerHerculesWSAPI <dev@herc.ws>2020-05-03 21:22:19 +0200
commit45e936c096e40300bbf57e352bb3e307e5b0c8de (patch)
treeca70d091117d6c1f465270c909d696e394e82668 /src
parent9a39a12ab85f783456ae87f7b79214b351e1607b (diff)
downloadhercules-45e936c096e40300bbf57e352bb3e307e5b0c8de.tar.gz
hercules-45e936c096e40300bbf57e352bb3e307e5b0c8de.tar.bz2
hercules-45e936c096e40300bbf57e352bb3e307e5b0c8de.tar.xz
hercules-45e936c096e40300bbf57e352bb3e307e5b0c8de.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc52
4 files changed, 66 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index b8aa5ae61..8192889c9 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -6210,6 +6210,10 @@ typedef int (*HPMHOOK_pre_pc_percentheal) (struct map_session_data **sd, int *hp
typedef int (*HPMHOOK_post_pc_percentheal) (int retVal___, struct map_session_data *sd, int hp, int sp);
typedef int (*HPMHOOK_pre_pc_jobchange) (struct map_session_data **sd, int *class, int *upper);
typedef int (*HPMHOOK_post_pc_jobchange) (int retVal___, struct map_session_data *sd, int class, int upper);
+typedef void (*HPMHOOK_pre_pc_hide) (struct map_session_data **sd, bool *show_msg);
+typedef void (*HPMHOOK_post_pc_hide) (struct map_session_data *sd, bool show_msg);
+typedef void (*HPMHOOK_pre_pc_unhide) (struct map_session_data **sd, bool *show_msg);
+typedef void (*HPMHOOK_post_pc_unhide) (struct map_session_data *sd, bool show_msg);
typedef int (*HPMHOOK_pre_pc_setoption) (struct map_session_data **sd, int *type);
typedef int (*HPMHOOK_post_pc_setoption) (int retVal___, struct map_session_data *sd, int type);
typedef int (*HPMHOOK_pre_pc_setcart) (struct map_session_data **sd, int *type);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 109c30885..13633807c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4790,6 +4790,10 @@ struct {
struct HPMHookPoint *HP_pc_percentheal_post;
struct HPMHookPoint *HP_pc_jobchange_pre;
struct HPMHookPoint *HP_pc_jobchange_post;
+ struct HPMHookPoint *HP_pc_hide_pre;
+ struct HPMHookPoint *HP_pc_hide_post;
+ struct HPMHookPoint *HP_pc_unhide_pre;
+ struct HPMHookPoint *HP_pc_unhide_post;
struct HPMHookPoint *HP_pc_setoption_pre;
struct HPMHookPoint *HP_pc_setoption_post;
struct HPMHookPoint *HP_pc_setcart_pre;
@@ -11671,6 +11675,10 @@ struct {
int HP_pc_percentheal_post;
int HP_pc_jobchange_pre;
int HP_pc_jobchange_post;
+ int HP_pc_hide_pre;
+ int HP_pc_hide_post;
+ int HP_pc_unhide_pre;
+ int HP_pc_unhide_post;
int HP_pc_setoption_pre;
int HP_pc_setoption_post;
int HP_pc_setcart_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index ac30b97d4..673dcc67a 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2453,6 +2453,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->itemheal, HP_pc_itemheal) },
{ HP_POP(pc->percentheal, HP_pc_percentheal) },
{ HP_POP(pc->jobchange, HP_pc_jobchange) },
+ { HP_POP(pc->hide, HP_pc_hide) },
+ { HP_POP(pc->unhide, HP_pc_unhide) },
{ HP_POP(pc->setoption, HP_pc_setoption) },
{ HP_POP(pc->setcart, HP_pc_setcart) },
{ HP_POP(pc->setfalcon, HP_pc_setfalcon) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 940f96ca2..1e76d9eb5 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -63705,6 +63705,58 @@ int HP_pc_jobchange(struct map_session_data *sd, int class, int upper) {
}
return retVal___;
}
+void HP_pc_hide(struct map_session_data *sd, bool show_msg) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_pc_hide_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *show_msg);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_hide_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_hide_pre[hIndex].func;
+ preHookFunc(&sd, &show_msg);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.hide(sd, show_msg);
+ }
+ if (HPMHooks.count.HP_pc_hide_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool show_msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_hide_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_hide_post[hIndex].func;
+ postHookFunc(sd, show_msg);
+ }
+ }
+ return;
+}
+void HP_pc_unhide(struct map_session_data *sd, bool show_msg) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_pc_unhide_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *show_msg);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_unhide_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_unhide_pre[hIndex].func;
+ preHookFunc(&sd, &show_msg);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.unhide(sd, show_msg);
+ }
+ if (HPMHooks.count.HP_pc_unhide_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool show_msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_unhide_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_unhide_post[hIndex].func;
+ postHookFunc(sd, show_msg);
+ }
+ }
+ return;
+}
int HP_pc_setoption(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;