diff options
author | Hercules.ws <dev@herc.ws> | 2018-10-22 03:39:42 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2018-10-22 03:39:42 +0200 |
commit | 1fa79a5242a7bc41ef912dfba2dbc17ee4dcc776 (patch) | |
tree | eb3caf67522651b280246c7051d2a331981ee1db /src/plugins/HPMHooking | |
parent | 58afe047cd566fd58a2f8c9ca04ac4d76aa3e102 (diff) | |
download | hercules-1fa79a5242a7bc41ef912dfba2dbc17ee4dcc776.tar.gz hercules-1fa79a5242a7bc41ef912dfba2dbc17ee4dcc776.tar.bz2 hercules-1fa79a5242a7bc41ef912dfba2dbc17ee4dcc776.tar.xz hercules-1fa79a5242a7bc41ef912dfba2dbc17ee4dcc776.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins/HPMHooking')
4 files changed, 67 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index c60946baf..81e25f033 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2630,6 +2630,8 @@ typedef void (*HPMHOOK_pre_clif_camera_showWindow) (struct map_session_data **sd typedef void (*HPMHOOK_post_clif_camera_showWindow) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_camera_change) (struct map_session_data **sd, float *range, float *rotation, float *latitude, enum send_target *target); typedef void (*HPMHOOK_post_clif_camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target); +typedef void (*HPMHOOK_pre_clif_item_preview) (struct map_session_data **sd, int *n); +typedef void (*HPMHOOK_post_clif_item_preview) (struct map_session_data *sd, int n); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -6482,6 +6484,8 @@ typedef bool (*HPMHOOK_pre_quest_questinfo_validate_homunculus_type) (struct map typedef bool (*HPMHOOK_post_quest_questinfo_validate_homunculus_type) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); typedef bool (*HPMHOOK_pre_quest_questinfo_validate_quests) (struct map_session_data **sd, struct questinfo **qi); typedef bool (*HPMHOOK_post_quest_questinfo_validate_quests) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); +typedef bool (*HPMHOOK_pre_quest_questinfo_validate_mercenary_class) (struct map_session_data **sd, struct questinfo **qi); +typedef bool (*HPMHOOK_post_quest_questinfo_validate_mercenary_class) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); typedef void (*HPMHOOK_pre_quest_questinfo_vector_clear) (int *m); typedef void (*HPMHOOK_post_quest_questinfo_vector_clear) (int m); #endif // MAP_QUEST_H diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 2a2290d6f..b0b2e7a32 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2222,6 +2222,8 @@ struct { struct HPMHookPoint *HP_clif_camera_showWindow_post; struct HPMHookPoint *HP_clif_camera_change_pre; struct HPMHookPoint *HP_clif_camera_change_post; + struct HPMHookPoint *HP_clif_item_preview_pre; + struct HPMHookPoint *HP_clif_item_preview_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -5010,6 +5012,8 @@ struct { struct HPMHookPoint *HP_quest_questinfo_validate_homunculus_type_post; struct HPMHookPoint *HP_quest_questinfo_validate_quests_pre; struct HPMHookPoint *HP_quest_questinfo_validate_quests_post; + struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_pre; + struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_post; struct HPMHookPoint *HP_quest_questinfo_vector_clear_pre; struct HPMHookPoint *HP_quest_questinfo_vector_clear_post; struct HPMHookPoint *HP_rnd_init_pre; @@ -8821,6 +8825,8 @@ struct { int HP_clif_camera_showWindow_post; int HP_clif_camera_change_pre; int HP_clif_camera_change_post; + int HP_clif_item_preview_pre; + int HP_clif_item_preview_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -11609,6 +11615,8 @@ struct { int HP_quest_questinfo_validate_homunculus_type_post; int HP_quest_questinfo_validate_quests_pre; int HP_quest_questinfo_validate_quests_post; + int HP_quest_questinfo_validate_mercenary_class_pre; + int HP_quest_questinfo_validate_mercenary_class_post; int HP_quest_questinfo_vector_clear_pre; int HP_quest_questinfo_vector_clear_post; int HP_rnd_init_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 051e6fbe2..508465411 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1135,6 +1135,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pMemorialDungeonCommand, HP_clif_pMemorialDungeonCommand) }, { HP_POP(clif->camera_showWindow, HP_clif_camera_showWindow) }, { HP_POP(clif->camera_change, HP_clif_camera_change) }, + { HP_POP(clif->item_preview, HP_clif_item_preview) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -2565,6 +2566,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(quest->questinfo_validate_homunculus_level, HP_quest_questinfo_validate_homunculus_level) }, { HP_POP(quest->questinfo_validate_homunculus_type, HP_quest_questinfo_validate_homunculus_type) }, { HP_POP(quest->questinfo_validate_quests, HP_quest_questinfo_validate_quests) }, + { HP_POP(quest->questinfo_validate_mercenary_class, HP_quest_questinfo_validate_mercenary_class) }, { HP_POP(quest->questinfo_vector_clear, HP_quest_questinfo_vector_clear) }, /* rnd_interface */ { HP_POP(rnd->init, HP_rnd_init) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index b177c12c0..fa80a68fd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -28965,6 +28965,32 @@ void HP_clif_camera_change(struct map_session_data *sd, float range, float rotat } return; } +void HP_clif_item_preview(struct map_session_data *sd, int n) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_item_preview_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *n); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_preview_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_item_preview_pre[hIndex].func; + preHookFunc(&sd, &n); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.item_preview(sd, n); + } + if (HPMHooks.count.HP_clif_item_preview_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int n); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_preview_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_item_preview_post[hIndex].func; + postHookFunc(sd, n); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -66735,6 +66761,33 @@ bool HP_quest_questinfo_validate_quests(struct map_session_data *sd, struct ques } return retVal___; } +bool HP_quest_questinfo_validate_mercenary_class(struct map_session_data *sd, struct questinfo *qi) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_quest_questinfo_validate_mercenary_class_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, struct questinfo **qi); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_questinfo_validate_mercenary_class_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_quest_questinfo_validate_mercenary_class_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &qi); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.quest.questinfo_validate_mercenary_class(sd, qi); + } + if (HPMHooks.count.HP_quest_questinfo_validate_mercenary_class_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); + for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_questinfo_validate_mercenary_class_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_quest_questinfo_validate_mercenary_class_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, qi); + } + } + return retVal___; +} void HP_quest_questinfo_vector_clear(int m) { int hIndex = 0; if (HPMHooks.count.HP_quest_questinfo_vector_clear_pre > 0) { |