diff options
author | Hercules.ws <dev@herc.ws> | 2019-11-17 15:05:22 +0100 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2019-11-17 15:05:22 +0100 |
commit | 174c5d284f5cd57e0125535ea31554038379690e (patch) | |
tree | 2749e84e8c1b9680ded641a1b8795a70851d3893 /src | |
parent | bfd2875be53dc620b47cc7c6f59e231175020d14 (diff) | |
download | hercules-174c5d284f5cd57e0125535ea31554038379690e.tar.gz hercules-174c5d284f5cd57e0125535ea31554038379690e.tar.bz2 hercules-174c5d284f5cd57e0125535ea31554038379690e.tar.xz hercules-174c5d284f5cd57e0125535ea31554038379690e.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src')
4 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 389d273e3..c6af15643 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2746,6 +2746,8 @@ typedef void (*HPMHOOK_pre_clif_plapineDdukDdak_ack) (int *fd, struct map_sessio typedef void (*HPMHOOK_post_clif_plapineDdukDdak_ack) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_plapineDdukDdak_close) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_plapineDdukDdak_close) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pReqGearOff) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pReqGearOff) (int fd, struct map_session_data *sd); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 1196e3a99..0eefe67ec 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2336,6 +2336,8 @@ struct { struct HPMHookPoint *HP_clif_plapineDdukDdak_ack_post; struct HPMHookPoint *HP_clif_plapineDdukDdak_close_pre; struct HPMHookPoint *HP_clif_plapineDdukDdak_close_post; + struct HPMHookPoint *HP_clif_pReqGearOff_pre; + struct HPMHookPoint *HP_clif_pReqGearOff_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -9165,6 +9167,8 @@ struct { int HP_clif_plapineDdukDdak_ack_post; int HP_clif_plapineDdukDdak_close_pre; int HP_clif_plapineDdukDdak_close_post; + int HP_clif_pReqGearOff_pre; + int HP_clif_pReqGearOff_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index da72b688a..2cb061b47 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1192,6 +1192,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->lapineDdukDdak_result, HP_clif_lapineDdukDdak_result) }, { HP_POP(clif->plapineDdukDdak_ack, HP_clif_plapineDdukDdak_ack) }, { HP_POP(clif->plapineDdukDdak_close, HP_clif_plapineDdukDdak_close) }, + { HP_POP(clif->pReqGearOff, HP_clif_pReqGearOff) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index c331d66a9..d11022aa6 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -30455,6 +30455,32 @@ void HP_clif_plapineDdukDdak_close(int fd, struct map_session_data *sd) { } return; } +void HP_clif_pReqGearOff(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pReqGearOff_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqGearOff_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pReqGearOff_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pReqGearOff(fd, sd); + } + if (HPMHooks.count.HP_clif_pReqGearOff_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqGearOff_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pReqGearOff_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; |