summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIbrahim Zidan <brahem@aotsw.com>2019-05-07 08:12:48 +0200
committerIbrahim Zidan <brahem@aotsw.com>2019-09-22 23:45:41 +0200
commitad19056bfcc1e98129bf25e14b58dcd0d438f9f9 (patch)
tree691dd707e2c2166d6471bdbfddeae6db1c71c6b6 /src
parent5d8e006fb85df2b3bbc32f2348bbcaad950546ba (diff)
downloadhercules-ad19056bfcc1e98129bf25e14b58dcd0d438f9f9.tar.gz
hercules-ad19056bfcc1e98129bf25e14b58dcd0d438f9f9.tar.bz2
hercules-ad19056bfcc1e98129bf25e14b58dcd0d438f9f9.tar.xz
hercules-ad19056bfcc1e98129bf25e14b58dcd0d438f9f9.zip
HPM Hooks update
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc52
4 files changed, 66 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 5e79b3fe3..5fb0c1555 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -7062,6 +7062,10 @@ typedef void (*HPMHOOK_pre_script_run_item_equip_script) (struct map_session_dat
typedef void (*HPMHOOK_post_script_run_item_equip_script) (struct map_session_data *sd, struct item_data *data, int oid);
typedef void (*HPMHOOK_pre_script_run_item_unequip_script) (struct map_session_data **sd, struct item_data **data, int *oid);
typedef void (*HPMHOOK_post_script_run_item_unequip_script) (struct map_session_data *sd, struct item_data *data, int oid);
+typedef void (*HPMHOOK_pre_script_run_item_rental_end_script) (struct map_session_data **sd, struct item_data **data, int *oid);
+typedef void (*HPMHOOK_post_script_run_item_rental_end_script) (struct map_session_data *sd, struct item_data *data, int oid);
+typedef void (*HPMHOOK_pre_script_run_item_rental_start_script) (struct map_session_data **sd, struct item_data **data, int *oid);
+typedef void (*HPMHOOK_post_script_run_item_rental_start_script) (struct map_session_data *sd, struct item_data *data, int oid);
#endif // MAP_SCRIPT_H
#ifdef MAP_SEARCHSTORE_H /* searchstore */
typedef bool (*HPMHOOK_pre_searchstore_open) (struct map_session_data **sd, unsigned int *uses, unsigned short *effect);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index f45ec4cc2..aa73d8748 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -5596,6 +5596,10 @@ struct {
struct HPMHookPoint *HP_script_run_item_equip_script_post;
struct HPMHookPoint *HP_script_run_item_unequip_script_pre;
struct HPMHookPoint *HP_script_run_item_unequip_script_post;
+ struct HPMHookPoint *HP_script_run_item_rental_end_script_pre;
+ struct HPMHookPoint *HP_script_run_item_rental_end_script_post;
+ struct HPMHookPoint *HP_script_run_item_rental_start_script_pre;
+ struct HPMHookPoint *HP_script_run_item_rental_start_script_post;
struct HPMHookPoint *HP_searchstore_open_pre;
struct HPMHookPoint *HP_searchstore_open_post;
struct HPMHookPoint *HP_searchstore_query_pre;
@@ -12389,6 +12393,10 @@ struct {
int HP_script_run_item_equip_script_post;
int HP_script_run_item_unequip_script_pre;
int HP_script_run_item_unequip_script_post;
+ int HP_script_run_item_rental_end_script_pre;
+ int HP_script_run_item_rental_end_script_post;
+ int HP_script_run_item_rental_start_script_pre;
+ int HP_script_run_item_rental_start_script_post;
int HP_searchstore_open_pre;
int HP_searchstore_open_post;
int HP_searchstore_query_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index ea22350a6..ddc3e643c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2864,6 +2864,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->run_use_script, HP_script_run_use_script) },
{ HP_POP(script->run_item_equip_script, HP_script_run_item_equip_script) },
{ HP_POP(script->run_item_unequip_script, HP_script_run_item_unequip_script) },
+ { HP_POP(script->run_item_rental_end_script, HP_script_run_item_rental_end_script) },
+ { HP_POP(script->run_item_rental_start_script, HP_script_run_item_rental_start_script) },
/* searchstore_interface */
{ HP_POP(searchstore->open, HP_searchstore_open) },
{ HP_POP(searchstore->query, HP_searchstore_query) },
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;