diff options
author | Hercules.ws <dev@herc.ws> | 2017-11-05 18:12:13 +0100 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2017-11-05 18:12:13 +0100 |
commit | fc5dc16c5d811df50aabe8f0614d440721773a3d (patch) | |
tree | 2abe053c4c9413bec451949f9c2c9db639a852db | |
parent | b236779fd1686d5f486eee3525d3368ac8680661 (diff) | |
download | hercules-fc5dc16c5d811df50aabe8f0614d440721773a3d.tar.gz hercules-fc5dc16c5d811df50aabe8f0614d440721773a3d.tar.bz2 hercules-fc5dc16c5d811df50aabe8f0614d440721773a3d.tar.xz hercules-fc5dc16c5d811df50aabe8f0614d440721773a3d.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
4 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index fed5810f4..9482e6c15 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5150,6 +5150,8 @@ typedef void (*HPMHOOK_pre_npc_market_delfromsql_sub) (const char **npcname, uns typedef void (*HPMHOOK_post_npc_market_delfromsql_sub) (const char *npcname, unsigned short index); typedef bool (*HPMHOOK_pre_npc_db_checkid) (const int *id); typedef bool (*HPMHOOK_post_npc_db_checkid) (bool retVal___, const int id); +typedef void (*HPMHOOK_pre_npc_refresh) (struct npc_data **nd); +typedef void (*HPMHOOK_post_npc_refresh) (struct npc_data *nd); typedef int (*HPMHOOK_pre_npc_secure_timeout_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_npc_secure_timeout_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); #endif // MAP_NPC_H diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 4bdc167f2..c3e6d5529 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3918,6 +3918,8 @@ struct { struct HPMHookPoint *HP_npc_market_delfromsql_sub_post; struct HPMHookPoint *HP_npc_db_checkid_pre; struct HPMHookPoint *HP_npc_db_checkid_post; + struct HPMHookPoint *HP_npc_refresh_pre; + struct HPMHookPoint *HP_npc_refresh_post; struct HPMHookPoint *HP_npc_secure_timeout_timer_pre; struct HPMHookPoint *HP_npc_secure_timeout_timer_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; @@ -10117,6 +10119,8 @@ struct { int HP_npc_market_delfromsql_sub_post; int HP_npc_db_checkid_pre; int HP_npc_db_checkid_post; + int HP_npc_refresh_pre; + int HP_npc_refresh_post; int HP_npc_secure_timeout_timer_pre; int HP_npc_secure_timeout_timer_post; int HP_nullpo_assert_report_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 34b79bff8..15052b7f1 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2009,6 +2009,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->market_delfromsql, HP_npc_market_delfromsql) }, { HP_POP(npc->market_delfromsql_sub, HP_npc_market_delfromsql_sub) }, { HP_POP(npc->db_checkid, HP_npc_db_checkid) }, + { HP_POP(npc->refresh, HP_npc_refresh) }, { HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index d0d062f4e..69658949c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -52089,6 +52089,32 @@ bool HP_npc_db_checkid(const int id) { } return retVal___; } +void HP_npc_refresh(struct npc_data *nd) { + int hIndex = 0; + if (HPMHooks.count.HP_npc_refresh_pre > 0) { + void (*preHookFunc) (struct npc_data **nd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_refresh_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_npc_refresh_pre[hIndex].func; + preHookFunc(&nd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc.refresh(nd); + } + if (HPMHooks.count.HP_npc_refresh_post > 0) { + void (*postHookFunc) (struct npc_data *nd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_refresh_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_npc_refresh_post[hIndex].func; + postHookFunc(nd); + } + } + return; +} int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) { int hIndex = 0; int retVal___ = 0; |