From ad19056bfcc1e98129bf25e14b58dcd0d438f9f9 Mon Sep 17 00:00:00 2001 From: Ibrahim Zidan Date: Tue, 7 May 2019 08:12:48 +0200 Subject: HPM Hooks update Signed-off-by: Ibrahim Zidan --- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'src/plugins/HPMHooking/HPMHooking_map.Hooks.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 247087159..f62cb4733 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -74672,6 +74672,58 @@ void HP_script_run_item_unequip_script(struct map_session_data *sd, struct item_ } return; } +void HP_script_run_item_rental_end_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if (HPMHooks.count.HP_script_run_item_rental_end_script_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_end_script_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_run_item_rental_end_script_pre[hIndex].func; + preHookFunc(&sd, &data, &oid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_rental_end_script(sd, data, oid); + } + if (HPMHooks.count.HP_script_run_item_rental_end_script_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_end_script_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_run_item_rental_end_script_post[hIndex].func; + postHookFunc(sd, data, oid); + } + } + return; +} +void HP_script_run_item_rental_start_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if (HPMHooks.count.HP_script_run_item_rental_start_script_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_start_script_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_run_item_rental_start_script_pre[hIndex].func; + preHookFunc(&sd, &data, &oid); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_rental_start_script(sd, data, oid); + } + if (HPMHooks.count.HP_script_run_item_rental_start_script_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_rental_start_script_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_run_item_rental_start_script_post[hIndex].func; + postHookFunc(sd, data, oid); + } + } + return; +} /* searchstore_interface */ bool HP_searchstore_open(struct map_session_data *sd, unsigned int uses, unsigned short effect) { int hIndex = 0; -- cgit v1.2.3-70-g09d2