summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2019-07-28 19:15:55 +0200
committerHerculesWSAPI <dev@herc.ws>2019-07-28 19:15:55 +0200
commit8964a0c278390bd87f34cad5ad0ddd5f3d002f06 (patch)
treea06a9cb43df2b347d891319c899665a809a0c30d /src/plugins/HPMHooking
parentbc827a10f838c78a051c064d41c27f4c478e7d69 (diff)
downloadhercules-8964a0c278390bd87f34cad5ad0ddd5f3d002f06.tar.gz
hercules-8964a0c278390bd87f34cad5ad0ddd5f3d002f06.tar.bz2
hercules-8964a0c278390bd87f34cad5ad0ddd5f3d002f06.tar.xz
hercules-8964a0c278390bd87f34cad5ad0ddd5f3d002f06.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.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc33
4 files changed, 40 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 16cbc8b03..2f3642a18 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5302,6 +5302,8 @@ typedef int (*HPMHOOK_pre_mob_final) (void);
typedef int (*HPMHOOK_post_mob_final) (int retVal___);
typedef void (*HPMHOOK_pre_mob_reload) (void);
typedef void (*HPMHOOK_post_mob_reload) (void);
+typedef int (*HPMHOOK_pre_mob_reload_sub_mob) (struct mob_data **md, va_list args);
+typedef int (*HPMHOOK_post_mob_reload_sub_mob) (int retVal___, struct mob_data *md, va_list args);
typedef struct mob_db* (*HPMHOOK_pre_mob_db) (int *index);
typedef struct mob_db* (*HPMHOOK_post_mob_db) (struct mob_db* retVal___, int index);
typedef struct mob_chat* (*HPMHOOK_pre_mob_chat) (short *id);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index aa78e5447..fa5bb7cc2 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -3870,6 +3870,8 @@ struct {
struct HPMHookPoint *HP_mob_final_post;
struct HPMHookPoint *HP_mob_reload_pre;
struct HPMHookPoint *HP_mob_reload_post;
+ struct HPMHookPoint *HP_mob_reload_sub_mob_pre;
+ struct HPMHookPoint *HP_mob_reload_sub_mob_post;
struct HPMHookPoint *HP_mob_db_pre;
struct HPMHookPoint *HP_mob_db_post;
struct HPMHookPoint *HP_mob_chat_pre;
@@ -10661,6 +10663,8 @@ struct {
int HP_mob_final_post;
int HP_mob_reload_pre;
int HP_mob_reload_post;
+ int HP_mob_reload_sub_mob_pre;
+ int HP_mob_reload_sub_mob_post;
int HP_mob_db_pre;
int HP_mob_db_post;
int HP_mob_chat_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index a36fc1243..07bbbb4d8 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1984,6 +1984,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mob->init, HP_mob_init) },
{ HP_POP(mob->final, HP_mob_final) },
{ HP_POP(mob->reload, HP_mob_reload) },
+ { HP_POP(mob->reload_sub_mob, HP_mob_reload_sub_mob) },
{ HP_POP(mob->db, HP_mob_db) },
{ HP_POP(mob->chat, HP_mob_chat) },
{ HP_POP(mob->makedummymobdb, HP_mob_makedummymobdb) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 5c14af024..30bc8b8ca 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -51206,6 +51206,39 @@ void HP_mob_reload(void) {
}
return;
}
+int HP_mob_reload_sub_mob(struct mob_data *md, va_list args) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_mob_reload_sub_mob_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, va_list args);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_sub_mob_pre; hIndex++) {
+ va_list args___copy; va_copy(args___copy, args);
+ preHookFunc = HPMHooks.list.HP_mob_reload_sub_mob_pre[hIndex].func;
+ retVal___ = preHookFunc(&md, args___copy);
+ va_end(args___copy);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ va_list args___copy; va_copy(args___copy, args);
+ retVal___ = HPMHooks.source.mob.reload_sub_mob(md, args___copy);
+ va_end(args___copy);
+ }
+ if (HPMHooks.count.HP_mob_reload_sub_mob_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_sub_mob_post; hIndex++) {
+ va_list args___copy; va_copy(args___copy, args);
+ postHookFunc = HPMHooks.list.HP_mob_reload_sub_mob_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, md, args___copy);
+ va_end(args___copy);
+ }
+ }
+ return retVal___;
+}
struct mob_db* HP_mob_db(int index) {
int hIndex = 0;
struct mob_db* retVal___ = NULL;