diff options
author | Hercules.ws <dev@herc.ws> | 2018-06-29 11:33:55 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2018-06-29 11:33:55 +0200 |
commit | d259adc39c1bd405da4fa5388747654b46a0d242 (patch) | |
tree | e9482818d17c0bc045548e5594b9634457951c31 /src/plugins/HPMHooking | |
parent | 9d24045d743a11eda0c825ea3c989fc5e78bc8af (diff) | |
download | hercules-d259adc39c1bd405da4fa5388747654b46a0d242.tar.gz hercules-d259adc39c1bd405da4fa5388747654b46a0d242.tar.bz2 hercules-d259adc39c1bd405da4fa5388747654b46a0d242.tar.xz hercules-d259adc39c1bd405da4fa5388747654b46a0d242.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 10 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 12 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 3 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 84 |
4 files changed, 104 insertions, 5 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 9ae123779..6d184d082 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1266,8 +1266,8 @@ typedef void (*HPMHOOK_pre_clif_feel_hate_reset) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_feel_hate_reset) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_partytickack) (struct map_session_data **sd, bool *flag); typedef void (*HPMHOOK_post_clif_partytickack) (struct map_session_data *sd, bool flag); -typedef void (*HPMHOOK_pre_clif_zc_config) (struct map_session_data **sd, int *type, int *flag); -typedef void (*HPMHOOK_post_clif_zc_config) (struct map_session_data *sd, int type, int flag); +typedef void (*HPMHOOK_pre_clif_zc_config) (struct map_session_data **sd, enum CZ_CONFIG *type, int *flag); +typedef void (*HPMHOOK_post_clif_zc_config) (struct map_session_data *sd, enum CZ_CONFIG type, int flag); typedef void (*HPMHOOK_pre_clif_viewequip_ack) (struct map_session_data **sd, struct map_session_data **tsd); typedef void (*HPMHOOK_post_clif_viewequip_ack) (struct map_session_data *sd, struct map_session_data *tsd); typedef void (*HPMHOOK_pre_clif_equpcheckbox) (struct map_session_data **sd); @@ -2450,6 +2450,10 @@ typedef void (*HPMHOOK_pre_clif_cz_req_style_change_sub) (struct map_session_dat typedef void (*HPMHOOK_post_clif_cz_req_style_change_sub) (struct map_session_data *sd, int type, int16 idx, bool isitem); typedef void (*HPMHOOK_pre_clif_style_change_response) (struct map_session_data **sd, enum stylist_shop *flag); typedef void (*HPMHOOK_post_clif_style_change_response) (struct map_session_data *sd, enum stylist_shop flag); +typedef void (*HPMHOOK_pre_clif_pPetEvolution) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pPetEvolution) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_petEvolutionResult) (int *fd, enum pet_evolution_result *result); +typedef void (*HPMHOOK_post_clif_petEvolutionResult) (int fd, enum pet_evolution_result result); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -6110,6 +6114,8 @@ typedef bool (*HPMHOOK_pre_pet_read_db_sub_intimacy) (int *idx, struct config_se typedef bool (*HPMHOOK_post_pet_read_db_sub_intimacy) (bool retVal___, int idx, struct config_setting_t *t); typedef void (*HPMHOOK_pre_pet_read_db_clear) (void); typedef void (*HPMHOOK_post_pet_read_db_clear) (void); +typedef void (*HPMHOOK_pre_pet_read_db_sub_evolution) (struct config_setting_t **t, int *n); +typedef void (*HPMHOOK_post_pet_read_db_sub_evolution) (struct config_setting_t *t, int n); #endif // MAP_PET_H #ifdef CHAR_PINCODE_H /* pincode */ typedef void (*HPMHOOK_pre_pincode_handle) (int *fd, struct char_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index d17955db7..671a9cb5c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2046,6 +2046,10 @@ struct { struct HPMHookPoint *HP_clif_cz_req_style_change_sub_post; struct HPMHookPoint *HP_clif_style_change_response_pre; struct HPMHookPoint *HP_clif_style_change_response_post; + struct HPMHookPoint *HP_clif_pPetEvolution_pre; + struct HPMHookPoint *HP_clif_pPetEvolution_post; + struct HPMHookPoint *HP_clif_petEvolutionResult_pre; + struct HPMHookPoint *HP_clif_petEvolutionResult_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -4762,6 +4766,8 @@ struct { struct HPMHookPoint *HP_pet_read_db_sub_intimacy_post; struct HPMHookPoint *HP_pet_read_db_clear_pre; struct HPMHookPoint *HP_pet_read_db_clear_post; + struct HPMHookPoint *HP_pet_read_db_sub_evolution_pre; + struct HPMHookPoint *HP_pet_read_db_sub_evolution_post; struct HPMHookPoint *HP_quest_init_pre; struct HPMHookPoint *HP_quest_init_post; struct HPMHookPoint *HP_quest_final_pre; @@ -8421,6 +8427,10 @@ struct { int HP_clif_cz_req_style_change_sub_post; int HP_clif_style_change_response_pre; int HP_clif_style_change_response_post; + int HP_clif_pPetEvolution_pre; + int HP_clif_pPetEvolution_post; + int HP_clif_petEvolutionResult_pre; + int HP_clif_petEvolutionResult_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -11137,6 +11147,8 @@ struct { int HP_pet_read_db_sub_intimacy_post; int HP_pet_read_db_clear_pre; int HP_pet_read_db_clear_post; + int HP_pet_read_db_sub_evolution_pre; + int HP_pet_read_db_sub_evolution_post; int HP_quest_init_pre; int HP_quest_init_post; int HP_quest_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index c9463b1b8..942693da8 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1046,6 +1046,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pReqStyleChange, HP_clif_pReqStyleChange) }, { HP_POP(clif->cz_req_style_change_sub, HP_clif_cz_req_style_change_sub) }, { HP_POP(clif->style_change_response, HP_clif_style_change_response) }, + { HP_POP(clif->pPetEvolution, HP_clif_pPetEvolution) }, + { HP_POP(clif->petEvolutionResult, HP_clif_petEvolutionResult) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -2439,6 +2441,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pet->read_db_sub, HP_pet_read_db_sub) }, { HP_POP(pet->read_db_sub_intimacy, HP_pet_read_db_sub_intimacy) }, { HP_POP(pet->read_db_clear, HP_pet_read_db_clear) }, + { HP_POP(pet->read_db_sub_evolution, HP_pet_read_db_sub_evolution) }, /* quest_interface */ { HP_POP(quest->init, HP_quest_init) }, { HP_POP(quest->final, HP_quest_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index a74fc4edb..5cd54ba22 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11221,10 +11221,10 @@ void HP_clif_partytickack(struct map_session_data *sd, bool flag) { } return; } -void HP_clif_zc_config(struct map_session_data *sd, int type, int flag) { +void HP_clif_zc_config(struct map_session_data *sd, enum CZ_CONFIG type, int flag) { int hIndex = 0; if (HPMHooks.count.HP_clif_zc_config_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int *type, int *flag); + void (*preHookFunc) (struct map_session_data **sd, enum CZ_CONFIG *type, int *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_zc_config_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_zc_config_pre[hIndex].func; @@ -11239,7 +11239,7 @@ void HP_clif_zc_config(struct map_session_data *sd, int type, int flag) { HPMHooks.source.clif.zc_config(sd, type, flag); } if (HPMHooks.count.HP_clif_zc_config_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int type, int flag); + void (*postHookFunc) (struct map_session_data *sd, enum CZ_CONFIG type, int flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_zc_config_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_zc_config_post[hIndex].func; postHookFunc(sd, type, flag); @@ -26649,6 +26649,58 @@ void HP_clif_style_change_response(struct map_session_data *sd, enum stylist_sho } return; } +void HP_clif_pPetEvolution(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pPetEvolution_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPetEvolution_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pPetEvolution_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pPetEvolution(fd, sd); + } + if (HPMHooks.count.HP_clif_pPetEvolution_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPetEvolution_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pPetEvolution_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_petEvolutionResult(int fd, enum pet_evolution_result result) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_petEvolutionResult_pre > 0) { + void (*preHookFunc) (int *fd, enum pet_evolution_result *result); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_petEvolutionResult_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_petEvolutionResult_pre[hIndex].func; + preHookFunc(&fd, &result); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.petEvolutionResult(fd, result); + } + if (HPMHooks.count.HP_clif_petEvolutionResult_post > 0) { + void (*postHookFunc) (int fd, enum pet_evolution_result result); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_petEvolutionResult_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_petEvolutionResult_post[hIndex].func; + postHookFunc(fd, result); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -63447,6 +63499,32 @@ void HP_pet_read_db_clear(void) { } return; } +void HP_pet_read_db_sub_evolution(struct config_setting_t *t, int n) { + int hIndex = 0; + if (HPMHooks.count.HP_pet_read_db_sub_evolution_pre > 0) { + void (*preHookFunc) (struct config_setting_t **t, int *n); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_read_db_sub_evolution_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pet_read_db_sub_evolution_pre[hIndex].func; + preHookFunc(&t, &n); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pet.read_db_sub_evolution(t, n); + } + if (HPMHooks.count.HP_pet_read_db_sub_evolution_post > 0) { + void (*postHookFunc) (struct config_setting_t *t, int n); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_read_db_sub_evolution_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pet_read_db_sub_evolution_post[hIndex].func; + postHookFunc(t, n); + } + } + return; +} /* quest_interface */ void HP_quest_init(bool minimal) { int hIndex = 0; |