diff options
author | Hercules.ws <dev@herc.ws> | 2018-04-07 23:35:32 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2018-04-07 23:35:32 +0200 |
commit | 1248aa338a366d03d530c323b12de6f0ba61736a (patch) | |
tree | af2d753ef52649a3eab9eb33b2df176395bd499e /src/plugins | |
parent | 189f2ecf6a52937806a8921673c9be6b4157ebf1 (diff) | |
download | hercules-1248aa338a366d03d530c323b12de6f0ba61736a.tar.gz hercules-1248aa338a366d03d530c323b12de6f0ba61736a.tar.bz2 hercules-1248aa338a366d03d530c323b12de6f0ba61736a.tar.xz hercules-1248aa338a366d03d530c323b12de6f0ba61736a.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 16 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 32 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 213 |
4 files changed, 269 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 88e57455a..4bd77f588 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2414,6 +2414,22 @@ typedef void (*HPMHOOK_pre_clif_hat_effect) (struct block_list **bl, struct bloc typedef void (*HPMHOOK_post_clif_hat_effect) (struct block_list *bl, struct block_list *tbl, enum send_target target); typedef void (*HPMHOOK_pre_clif_hat_effect_single) (struct block_list **bl, uint16 *effectId, bool *enable); typedef void (*HPMHOOK_post_clif_hat_effect_single) (struct block_list *bl, uint16 effectId, bool enable); +typedef bool (*HPMHOOK_pre_clif_pAttendanceDB) (void); +typedef bool (*HPMHOOK_post_clif_pAttendanceDB) (bool retVal___); +typedef bool (*HPMHOOK_pre_clif_attendancedb_libconfig_sub) (struct config_setting_t **it, int *n, const char **source); +typedef bool (*HPMHOOK_post_clif_attendancedb_libconfig_sub) (bool retVal___, struct config_setting_t *it, int n, const char *source); +typedef bool (*HPMHOOK_pre_clif_attendance_timediff) (struct map_session_data **sd); +typedef bool (*HPMHOOK_post_clif_attendance_timediff) (bool retVal___, struct map_session_data *sd); +typedef time_t (*HPMHOOK_pre_clif_attendance_getendtime) (void); +typedef time_t (*HPMHOOK_post_clif_attendance_getendtime) (time_t retVal___); +typedef void (*HPMHOOK_pre_clif_pOpenUIRequest) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pOpenUIRequest) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_open_ui) (struct map_session_data **sd, int8 *UIType); +typedef void (*HPMHOOK_post_clif_open_ui) (struct map_session_data *sd, int8 UIType); +typedef void (*HPMHOOK_pre_clif_pAttendanceRewardRequest) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pAttendanceRewardRequest) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_ui_action) (struct map_session_data **sd, int32 *UIType, int32 *data); +typedef void (*HPMHOOK_post_clif_ui_action) (struct map_session_data *sd, int32 UIType, int32 data); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 00bfb650c..c01f8000c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2008,6 +2008,22 @@ struct { struct HPMHookPoint *HP_clif_hat_effect_post; struct HPMHookPoint *HP_clif_hat_effect_single_pre; struct HPMHookPoint *HP_clif_hat_effect_single_post; + struct HPMHookPoint *HP_clif_pAttendanceDB_pre; + struct HPMHookPoint *HP_clif_pAttendanceDB_post; + struct HPMHookPoint *HP_clif_attendancedb_libconfig_sub_pre; + struct HPMHookPoint *HP_clif_attendancedb_libconfig_sub_post; + struct HPMHookPoint *HP_clif_attendance_timediff_pre; + struct HPMHookPoint *HP_clif_attendance_timediff_post; + struct HPMHookPoint *HP_clif_attendance_getendtime_pre; + struct HPMHookPoint *HP_clif_attendance_getendtime_post; + struct HPMHookPoint *HP_clif_pOpenUIRequest_pre; + struct HPMHookPoint *HP_clif_pOpenUIRequest_post; + struct HPMHookPoint *HP_clif_open_ui_pre; + struct HPMHookPoint *HP_clif_open_ui_post; + struct HPMHookPoint *HP_clif_pAttendanceRewardRequest_pre; + struct HPMHookPoint *HP_clif_pAttendanceRewardRequest_post; + struct HPMHookPoint *HP_clif_ui_action_pre; + struct HPMHookPoint *HP_clif_ui_action_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -8307,6 +8323,22 @@ struct { int HP_clif_hat_effect_post; int HP_clif_hat_effect_single_pre; int HP_clif_hat_effect_single_post; + int HP_clif_pAttendanceDB_pre; + int HP_clif_pAttendanceDB_post; + int HP_clif_attendancedb_libconfig_sub_pre; + int HP_clif_attendancedb_libconfig_sub_post; + int HP_clif_attendance_timediff_pre; + int HP_clif_attendance_timediff_post; + int HP_clif_attendance_getendtime_pre; + int HP_clif_attendance_getendtime_post; + int HP_clif_pOpenUIRequest_pre; + int HP_clif_pOpenUIRequest_post; + int HP_clif_open_ui_pre; + int HP_clif_open_ui_post; + int HP_clif_pAttendanceRewardRequest_pre; + int HP_clif_pAttendanceRewardRequest_post; + int HP_clif_ui_action_pre; + int HP_clif_ui_action_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index fa6de9ff0..2e762a231 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1027,6 +1027,14 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pClanMessage, HP_clif_pClanMessage) }, { HP_POP(clif->hat_effect, HP_clif_hat_effect) }, { HP_POP(clif->hat_effect_single, HP_clif_hat_effect_single) }, + { HP_POP(clif->pAttendanceDB, HP_clif_pAttendanceDB) }, + { HP_POP(clif->attendancedb_libconfig_sub, HP_clif_attendancedb_libconfig_sub) }, + { HP_POP(clif->attendance_timediff, HP_clif_attendance_timediff) }, + { HP_POP(clif->attendance_getendtime, HP_clif_attendance_getendtime) }, + { HP_POP(clif->pOpenUIRequest, HP_clif_pOpenUIRequest) }, + { HP_POP(clif->open_ui, HP_clif_open_ui) }, + { HP_POP(clif->pAttendanceRewardRequest, HP_clif_pAttendanceRewardRequest) }, + { HP_POP(clif->ui_action, HP_clif_ui_action) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 743e03300..6b89e4f65 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -26148,6 +26148,219 @@ void HP_clif_hat_effect_single(struct block_list *bl, uint16 effectId, bool enab } return; } +bool HP_clif_pAttendanceDB(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clif_pAttendanceDB_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAttendanceDB_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pAttendanceDB_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.pAttendanceDB(); + } + if (HPMHooks.count.HP_clif_pAttendanceDB_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAttendanceDB_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pAttendanceDB_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_clif_attendancedb_libconfig_sub(struct config_setting_t *it, int n, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clif_attendancedb_libconfig_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *n, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_attendancedb_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_attendancedb_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &n, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.attendancedb_libconfig_sub(it, n, source); + } + if (HPMHooks.count.HP_clif_attendancedb_libconfig_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int n, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_attendancedb_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_attendancedb_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, n, source); + } + } + return retVal___; +} +bool HP_clif_attendance_timediff(struct map_session_data *sd) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clif_attendance_timediff_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_attendance_timediff_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_attendance_timediff_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.attendance_timediff(sd); + } + if (HPMHooks.count.HP_clif_attendance_timediff_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_attendance_timediff_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_attendance_timediff_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} +time_t HP_clif_attendance_getendtime(void) { +/* Unknown return type 'time_t'. Initializing to '0'. */ + int hIndex = 0; + time_t retVal___ = 0; + if (HPMHooks.count.HP_clif_attendance_getendtime_pre > 0) { + time_t (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_attendance_getendtime_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_attendance_getendtime_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.attendance_getendtime(); + } + if (HPMHooks.count.HP_clif_attendance_getendtime_post > 0) { + time_t (*postHookFunc) (time_t retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_attendance_getendtime_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_attendance_getendtime_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_clif_pOpenUIRequest(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pOpenUIRequest_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOpenUIRequest_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pOpenUIRequest_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pOpenUIRequest(fd, sd); + } + if (HPMHooks.count.HP_clif_pOpenUIRequest_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOpenUIRequest_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pOpenUIRequest_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_open_ui(struct map_session_data *sd, int8 UIType) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_open_ui_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int8 *UIType); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_ui_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_open_ui_pre[hIndex].func; + preHookFunc(&sd, &UIType); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.open_ui(sd, UIType); + } + if (HPMHooks.count.HP_clif_open_ui_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int8 UIType); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_ui_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_open_ui_post[hIndex].func; + postHookFunc(sd, UIType); + } + } + return; +} +void HP_clif_pAttendanceRewardRequest(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pAttendanceRewardRequest_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAttendanceRewardRequest_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pAttendanceRewardRequest_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pAttendanceRewardRequest(fd, sd); + } + if (HPMHooks.count.HP_clif_pAttendanceRewardRequest_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAttendanceRewardRequest_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pAttendanceRewardRequest_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_ui_action(struct map_session_data *sd, int32 UIType, int32 data) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_ui_action_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int32 *UIType, int32 *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ui_action_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_ui_action_pre[hIndex].func; + preHookFunc(&sd, &UIType, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ui_action(sd, UIType, data); + } + if (HPMHooks.count.HP_clif_ui_action_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int32 UIType, int32 data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ui_action_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_ui_action_post[hIndex].func; + postHookFunc(sd, UIType, data); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; |