summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2019-10-19 16:47:07 +0200
committerHerculesWSAPI <dev@herc.ws>2019-10-19 16:47:07 +0200
commita7f67d0513cc6f55056a37d2f6ae55bcf58af174 (patch)
treecdeda16cb903f3c8ff57c2d0c922529546d3ec73 /src/plugins
parent660830898b83342ab4eb822c7a61c604d37d645c (diff)
downloadhercules-a7f67d0513cc6f55056a37d2f6ae55bcf58af174.tar.gz
hercules-a7f67d0513cc6f55056a37d2f6ae55bcf58af174.tar.bz2
hercules-a7f67d0513cc6f55056a37d2f6ae55bcf58af174.tar.xz
hercules-a7f67d0513cc6f55056a37d2f6ae55bcf58af174.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins')
-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.inc27
4 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 0f76ba4b0..31e0ca536 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5348,6 +5348,8 @@ typedef int (*HPMHOOK_pre_mob_ai_sub_hard_lootsearch) (struct block_list **bl, v
typedef int (*HPMHOOK_post_mob_ai_sub_hard_lootsearch) (int retVal___, struct block_list *bl, va_list ap);
typedef int (*HPMHOOK_pre_mob_warpchase_sub) (struct block_list **bl, va_list ap);
typedef int (*HPMHOOK_post_mob_warpchase_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef bool (*HPMHOOK_pre_mob_is_in_battle_state) (const struct mob_data **md);
+typedef bool (*HPMHOOK_post_mob_is_in_battle_state) (bool retVal___, const struct mob_data *md);
typedef int (*HPMHOOK_pre_mob_ai_sub_hard_slavemob) (struct mob_data **md, int64 *tick);
typedef int (*HPMHOOK_post_mob_ai_sub_hard_slavemob) (int retVal___, struct mob_data *md, int64 tick);
typedef int (*HPMHOOK_pre_mob_unlocktarget) (struct mob_data **md, int64 *tick);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 266ca74f3..42ab189f1 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -3950,6 +3950,8 @@ struct {
struct HPMHookPoint *HP_mob_ai_sub_hard_lootsearch_post;
struct HPMHookPoint *HP_mob_warpchase_sub_pre;
struct HPMHookPoint *HP_mob_warpchase_sub_post;
+ struct HPMHookPoint *HP_mob_is_in_battle_state_pre;
+ struct HPMHookPoint *HP_mob_is_in_battle_state_post;
struct HPMHookPoint *HP_mob_ai_sub_hard_slavemob_pre;
struct HPMHookPoint *HP_mob_ai_sub_hard_slavemob_post;
struct HPMHookPoint *HP_mob_unlocktarget_pre;
@@ -10769,6 +10771,8 @@ struct {
int HP_mob_ai_sub_hard_lootsearch_post;
int HP_mob_warpchase_sub_pre;
int HP_mob_warpchase_sub_post;
+ int HP_mob_is_in_battle_state_pre;
+ int HP_mob_is_in_battle_state_post;
int HP_mob_ai_sub_hard_slavemob_pre;
int HP_mob_ai_sub_hard_slavemob_post;
int HP_mob_unlocktarget_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 712cd4168..e6dcdec42 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2024,6 +2024,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mob->ai_sub_hard_bg_ally, HP_mob_ai_sub_hard_bg_ally) },
{ HP_POP(mob->ai_sub_hard_lootsearch, HP_mob_ai_sub_hard_lootsearch) },
{ HP_POP(mob->warpchase_sub, HP_mob_warpchase_sub) },
+ { HP_POP(mob->is_in_battle_state, HP_mob_is_in_battle_state) },
{ HP_POP(mob->ai_sub_hard_slavemob, HP_mob_ai_sub_hard_slavemob) },
{ HP_POP(mob->unlocktarget, HP_mob_unlocktarget) },
{ HP_POP(mob->randomwalk, HP_mob_randomwalk) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 7a817f45d..8eefa292a 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -52322,6 +52322,33 @@ int HP_mob_warpchase_sub(struct block_list *bl, va_list ap) {
}
return retVal___;
}
+bool HP_mob_is_in_battle_state(const struct mob_data *md) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mob_is_in_battle_state_pre > 0) {
+ bool (*preHookFunc) (const struct mob_data **md);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_is_in_battle_state_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mob_is_in_battle_state_pre[hIndex].func;
+ retVal___ = preHookFunc(&md);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mob.is_in_battle_state(md);
+ }
+ if (HPMHooks.count.HP_mob_is_in_battle_state_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct mob_data *md);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_is_in_battle_state_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mob_is_in_battle_state_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, md);
+ }
+ }
+ return retVal___;
+}
int HP_mob_ai_sub_hard_slavemob(struct mob_data *md, int64 tick) {
int hIndex = 0;
int retVal___ = 0;