diff options
author | Hercules.ws <dev@herc.ws> | 2020-01-12 18:06:38 +0100 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2020-01-12 18:06:38 +0100 |
commit | a47f90111ce72726995b8f4ac4e4d52af839c1f1 (patch) | |
tree | 1fadde56118b4ff57087cda8f92f577776a5f5bb | |
parent | 45b8982191160dc5f5ffc28e0eb8b28c6b8a138b (diff) | |
download | hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.tar.gz hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.tar.bz2 hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.tar.xz hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
4 files changed, 42 insertions, 8 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 92d90caa5..b2c3e80ac 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -6424,8 +6424,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 int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, enum e_chain_cache *chain_cache_id); +typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_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); @@ -6442,6 +6442,8 @@ typedef bool (*HPMHOOK_pre_pc_has_second_costume) (struct map_session_data **sd) typedef bool (*HPMHOOK_post_pc_has_second_costume) (bool retVal___, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_pc_expandInventory) (struct map_session_data **sd, int *adjustSize); typedef bool (*HPMHOOK_post_pc_expandInventory) (bool retVal___, struct map_session_data *sd, int adjustSize); +typedef bool (*HPMHOOK_pre_pc_auto_exp_insurance) (struct map_session_data **sd); +typedef bool (*HPMHOOK_post_pc_auto_exp_insurance) (bool retVal___, struct map_session_data *sd); #endif // MAP_PC_H #ifdef MAP_NPC_H /* libpcre */ typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index c1f80aedf..16de79ecb 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -5026,6 +5026,8 @@ struct { struct HPMHookPoint *HP_pc_has_second_costume_post; struct HPMHookPoint *HP_pc_expandInventory_pre; struct HPMHookPoint *HP_pc_expandInventory_post; + struct HPMHookPoint *HP_pc_auto_exp_insurance_pre; + struct HPMHookPoint *HP_pc_auto_exp_insurance_post; struct HPMHookPoint *HP_libpcre_compile_pre; struct HPMHookPoint *HP_libpcre_compile_post; struct HPMHookPoint *HP_libpcre_study_pre; @@ -11869,6 +11871,8 @@ struct { int HP_pc_has_second_costume_post; int HP_pc_expandInventory_pre; int HP_pc_expandInventory_post; + int HP_pc_auto_exp_insurance_pre; + int HP_pc_auto_exp_insurance_post; int HP_libpcre_compile_pre; int HP_libpcre_compile_post; int HP_libpcre_study_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 79346272e..7b81bac49 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2571,6 +2571,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) }, { HP_POP(pc->has_second_costume, HP_pc_has_second_costume) }, { HP_POP(pc->expandInventory, HP_pc_expandInventory) }, + { HP_POP(pc->auto_exp_insurance, HP_pc_auto_exp_insurance) }, /* pcre_interface */ { HP_POP(libpcre->compile, HP_libpcre_compile) }, { HP_POP(libpcre->study, HP_libpcre_study) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index bdae21c21..7873e544a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -66643,15 +66643,15 @@ 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 HP_pc_have_item_chain(struct map_session_data *sd, enum e_chain_cache chain_cache_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); + int (*preHookFunc) (struct map_session_data **sd, enum e_chain_cache *chain_cache_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); + retVal___ = preHookFunc(&sd, &chain_cache_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -66659,13 +66659,13 @@ int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) } } { - retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_id); + retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_cache_id); } if (HPMHooks.count.HP_pc_have_item_chain_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short chain_id); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_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); + retVal___ = postHookFunc(retVal___, sd, chain_cache_id); } } return retVal___; @@ -66891,6 +66891,33 @@ bool HP_pc_expandInventory(struct map_session_data *sd, int adjustSize) { } return retVal___; } +bool HP_pc_auto_exp_insurance(struct map_session_data *sd) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_pc_auto_exp_insurance_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.auto_exp_insurance(sd); + } + if (HPMHooks.count.HP_pc_auto_exp_insurance_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} /* pcre_interface */ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { int hIndex = 0; |