diff options
author | Hercules.ws <dev@herc.ws> | 2016-10-22 02:31:53 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2016-10-22 02:31:53 +0200 |
commit | 21468b7ed14784913a1d244c8918cd007bef0d22 (patch) | |
tree | 38488c2af7251cc31c8eb1a08f8c490d31a6b8d2 | |
parent | f072f3c9771cf0154f3b207970d86cc857708050 (diff) | |
download | hercules-21468b7ed14784913a1d244c8918cd007bef0d22.tar.gz hercules-21468b7ed14784913a1d244c8918cd007bef0d22.tar.bz2 hercules-21468b7ed14784913a1d244c8918cd007bef0d22.tar.xz hercules-21468b7ed14784913a1d244c8918cd007bef0d22.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
4 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 2ff104ed6..af90b1fcc 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5574,6 +5574,8 @@ typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **s typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message); typedef void (*HPMHOOK_pre_pc_check_supernovice_call) (struct map_session_data **sd, const char **message); typedef void (*HPMHOOK_post_pc_check_supernovice_call) (struct map_session_data *sd, const char *message); +typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, int *level); +typedef bool (*HPMHOOK_post_pc_check_basicskill) (bool retVal___, struct map_session_data *sd, int level); #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 cbaf14715..22f0b3a8a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4402,6 +4402,8 @@ struct { struct HPMHookPoint *HP_pc_process_chat_message_post; struct HPMHookPoint *HP_pc_check_supernovice_call_pre; struct HPMHookPoint *HP_pc_check_supernovice_call_post; + struct HPMHookPoint *HP_pc_check_basicskill_pre; + struct HPMHookPoint *HP_pc_check_basicskill_post; struct HPMHookPoint *HP_libpcre_compile_pre; struct HPMHookPoint *HP_libpcre_compile_post; struct HPMHookPoint *HP_libpcre_study_pre; @@ -10437,6 +10439,8 @@ struct { int HP_pc_process_chat_message_post; int HP_pc_check_supernovice_call_pre; int HP_pc_check_supernovice_call_post; + int HP_pc_check_basicskill_pre; + int HP_pc_check_basicskill_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 989296011..0a3dc10fe 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2256,6 +2256,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->have_magnifier, HP_pc_have_magnifier) }, { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) }, { HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) }, + { HP_POP(pc->check_basicskill, HP_pc_check_basicskill) }, /* 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 e5712b34d..acf554d12 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -58647,6 +58647,33 @@ void HP_pc_check_supernovice_call(struct map_session_data *sd, const char *messa } return; } +bool HP_pc_check_basicskill(struct map_session_data *sd, int level) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pc_check_basicskill_pre ) { + bool (*preHookFunc) (struct map_session_data **sd, int *level); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_basicskill_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pc_check_basicskill_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &level); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.check_basicskill(sd, level); + } + if( HPMHooks.count.HP_pc_check_basicskill_post ) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int level); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_basicskill_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pc_check_basicskill_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, level); + } + } + 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; |