diff options
author | Hercules.ws <dev@herc.ws> | 2019-09-22 19:30:03 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2019-09-22 19:30:03 +0200 |
commit | 63d93d45038ab070dcb8e4714fb72c99fdcf2e9c (patch) | |
tree | 299b72c8f3015db12e182f5a2aa325be9c4cce57 /src/plugins/HPMHooking | |
parent | 863aa757302070fa424fbc9019f6a71466537965 (diff) | |
download | hercules-63d93d45038ab070dcb8e4714fb72c99fdcf2e9c.tar.gz hercules-63d93d45038ab070dcb8e4714fb72c99fdcf2e9c.tar.bz2 hercules-63d93d45038ab070dcb8e4714fb72c99fdcf2e9c.tar.xz hercules-63d93d45038ab070dcb8e4714fb72c99fdcf2e9c.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins/HPMHooking')
4 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 63826753d..06d8d618a 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -6374,6 +6374,8 @@ typedef void (*HPMHOOK_pre_pc_update_idle_time) (struct map_session_data **sd, e typedef void (*HPMHOOK_post_pc_update_idle_time) (struct map_session_data *sd, enum e_battle_config_idletime type); typedef int (*HPMHOOK_pre_pc_have_magnifier) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_have_magnifier) (int retVal___, struct map_session_data *sd); +typedef int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, unsigned short *chain_id); +typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, unsigned short chain_id); typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **sd, const char **message); typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message); typedef int (*HPMHOOK_pre_pc_wis_message_to_gm) (const char **sender_name, int *permission, const char **message); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index adfac1a93..1bf974d28 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4958,6 +4958,8 @@ struct { struct HPMHookPoint *HP_pc_update_idle_time_post; struct HPMHookPoint *HP_pc_have_magnifier_pre; struct HPMHookPoint *HP_pc_have_magnifier_post; + struct HPMHookPoint *HP_pc_have_item_chain_pre; + struct HPMHookPoint *HP_pc_have_item_chain_post; struct HPMHookPoint *HP_pc_process_chat_message_pre; struct HPMHookPoint *HP_pc_process_chat_message_post; struct HPMHookPoint *HP_pc_wis_message_to_gm_pre; @@ -11737,6 +11739,8 @@ struct { int HP_pc_update_idle_time_post; int HP_pc_have_magnifier_pre; int HP_pc_have_magnifier_post; + int HP_pc_have_item_chain_pre; + int HP_pc_have_item_chain_post; int HP_pc_process_chat_message_pre; int HP_pc_process_chat_message_post; int HP_pc_wis_message_to_gm_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 2c7eabeff..290c27961 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2537,6 +2537,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->check_job_name, HP_pc_check_job_name) }, { HP_POP(pc->update_idle_time, HP_pc_update_idle_time) }, { HP_POP(pc->have_magnifier, HP_pc_have_magnifier) }, + { HP_POP(pc->have_item_chain, HP_pc_have_item_chain) }, { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) }, { HP_POP(pc->wis_message_to_gm, HP_pc_wis_message_to_gm) }, { HP_POP(pc->wis_message_to_gm_sub, HP_pc_wis_message_to_gm_sub) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 003219b47..e1a2560b7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -65984,6 +65984,33 @@ int HP_pc_have_magnifier(struct map_session_data *sd) { } return retVal___; } +int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_have_item_chain_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd, unsigned short *chain_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_have_item_chain_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &chain_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_id); + } + if (HPMHooks.count.HP_pc_have_item_chain_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short chain_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_have_item_chain_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, chain_id); + } + } + return retVal___; +} bool HP_pc_process_chat_message(struct map_session_data *sd, const char *message) { int hIndex = 0; bool retVal___ = false; |