summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2020-06-28 01:58:28 +0200
committerHerculesWSAPI <dev@herc.ws>2020-06-28 01:58:28 +0200
commit44db4ecf056d23a114c033eecd7f907a92217a77 (patch)
tree1c6953b7ebf6092db9c1ae1592cc2b52bfdc84f0
parentc580e48275dd57d0eedc824b5230bac335c8f334 (diff)
downloadhercules-44db4ecf056d23a114c033eecd7f907a92217a77.tar.gz
hercules-44db4ecf056d23a114c033eecd7f907a92217a77.tar.bz2
hercules-44db4ecf056d23a114c033eecd7f907a92217a77.tar.xz
hercules-44db4ecf056d23a114c033eecd7f907a92217a77.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
-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 c04eedb05..9ce99fbe7 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -7264,6 +7264,8 @@ typedef int (*HPMHOOK_pre_skill_get_state) (int *skill_id, int *skill_lv);
typedef int (*HPMHOOK_post_skill_get_state) (int retVal___, int skill_id, int skill_lv);
typedef int (*HPMHOOK_pre_skill_get_spiritball) (int *skill_id, int *skill_lv);
typedef int (*HPMHOOK_post_skill_get_spiritball) (int retVal___, int skill_id, int skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_item_index) (int *skill_id, int *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_item_index) (int retVal___, int skill_id, int skill_lv);
typedef int (*HPMHOOK_pre_skill_get_itemid) (int *skill_id, int *item_idx);
typedef int (*HPMHOOK_post_skill_get_itemid) (int retVal___, int skill_id, int item_idx);
typedef int (*HPMHOOK_pre_skill_get_itemqty) (int *skill_id, int *item_idx, int *skill_lv);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 60d8b7e20..c0627fa5c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -5788,6 +5788,8 @@ struct {
struct HPMHookPoint *HP_skill_get_state_post;
struct HPMHookPoint *HP_skill_get_spiritball_pre;
struct HPMHookPoint *HP_skill_get_spiritball_post;
+ struct HPMHookPoint *HP_skill_get_item_index_pre;
+ struct HPMHookPoint *HP_skill_get_item_index_post;
struct HPMHookPoint *HP_skill_get_itemid_pre;
struct HPMHookPoint *HP_skill_get_itemid_post;
struct HPMHookPoint *HP_skill_get_itemqty_pre;
@@ -12819,6 +12821,8 @@ struct {
int HP_skill_get_state_post;
int HP_skill_get_spiritball_pre;
int HP_skill_get_spiritball_post;
+ int HP_skill_get_item_index_pre;
+ int HP_skill_get_item_index_post;
int HP_skill_get_itemid_pre;
int HP_skill_get_itemid_post;
int HP_skill_get_itemqty_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 899f443d1..c35e9b3d6 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2963,6 +2963,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->get_sp_rate, HP_skill_get_sp_rate) },
{ HP_POP(skill->get_state, HP_skill_get_state) },
{ HP_POP(skill->get_spiritball, HP_skill_get_spiritball) },
+ { HP_POP(skill->get_item_index, HP_skill_get_item_index) },
{ HP_POP(skill->get_itemid, HP_skill_get_itemid) },
{ HP_POP(skill->get_itemqty, HP_skill_get_itemqty) },
{ HP_POP(skill->get_item_any_flag, HP_skill_get_item_any_flag) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index f6f1b3839..4ef6c21eb 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -77228,6 +77228,33 @@ int HP_skill_get_spiritball(int skill_id, int skill_lv) {
}
return retVal___;
}
+int HP_skill_get_item_index(int skill_id, int skill_lv) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_get_item_index_pre > 0) {
+ int (*preHookFunc) (int *skill_id, int *skill_lv);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_item_index_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_get_item_index_pre[hIndex].func;
+ retVal___ = preHookFunc(&skill_id, &skill_lv);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.skill.get_item_index(skill_id, skill_lv);
+ }
+ if (HPMHooks.count.HP_skill_get_item_index_post > 0) {
+ int (*postHookFunc) (int retVal___, int skill_id, int skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_item_index_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_get_item_index_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
+ }
+ }
+ return retVal___;
+}
int HP_skill_get_itemid(int skill_id, int item_idx) {
int hIndex = 0;
int retVal___ = 0;