summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-02-09 23:58:26 +0100
committerHaru <haru@dotalux.com>2020-02-09 23:58:26 +0100
commitcaae14cae60f27594a2dbf4c41076330be1afd5e (patch)
tree3be31ba3a73295bd3d655d27643a248e9abe60a6 /src/plugins/HPMHooking
parent1d0bd5baf6364822e48ba64010a52377c6abb776 (diff)
downloadhercules-caae14cae60f27594a2dbf4c41076330be1afd5e.tar.gz
hercules-caae14cae60f27594a2dbf4c41076330be1afd5e.tar.bz2
hercules-caae14cae60f27594a2dbf4c41076330be1afd5e.tar.xz
hercules-caae14cae60f27594a2dbf4c41076330be1afd5e.zip
HPM Hooks Update
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/plugins/HPMHooking')
-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.inc54
4 files changed, 68 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index c1fb15810..7996a59f9 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -6184,6 +6184,8 @@ typedef int (*HPMHOOK_pre_pc_checkitem) (struct map_session_data **sd);
typedef int (*HPMHOOK_post_pc_checkitem) (int retVal___, struct map_session_data *sd);
typedef int (*HPMHOOK_pre_pc_useitem) (struct map_session_data **sd, int *n);
typedef int (*HPMHOOK_post_pc_useitem) (int retVal___, struct map_session_data *sd, int n);
+typedef int (*HPMHOOK_pre_pc_itemskill_clear) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_itemskill_clear) (int retVal___, struct map_session_data *sd);
typedef int (*HPMHOOK_pre_pc_skillatk_bonus) (struct map_session_data **sd, uint16 *skill_id);
typedef int (*HPMHOOK_post_pc_skillatk_bonus) (int retVal___, struct map_session_data *sd, uint16 skill_id);
typedef int (*HPMHOOK_pre_pc_skillheal_bonus) (struct map_session_data **sd, uint16 *skill_id);
@@ -7330,6 +7332,8 @@ typedef int (*HPMHOOK_pre_skill_vf_cast_fix) (struct block_list **bl, double *ti
typedef int (*HPMHOOK_post_skill_vf_cast_fix) (int retVal___, struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv);
typedef int (*HPMHOOK_pre_skill_delay_fix) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
typedef int (*HPMHOOK_post_skill_delay_fix) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+typedef bool (*HPMHOOK_pre_skill_is_item_skill) (struct map_session_data **sd, int *skill_id, int *skill_lv);
+typedef bool (*HPMHOOK_post_skill_is_item_skill) (bool retVal___, struct map_session_data *sd, int skill_id, int skill_lv);
typedef int (*HPMHOOK_pre_skill_check_condition_castbegin) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
typedef int (*HPMHOOK_post_skill_check_condition_castbegin) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
typedef int (*HPMHOOK_pre_skill_check_condition_castend) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 53ba3403c..6d8776f18 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4764,6 +4764,8 @@ struct {
struct HPMHookPoint *HP_pc_checkitem_post;
struct HPMHookPoint *HP_pc_useitem_pre;
struct HPMHookPoint *HP_pc_useitem_post;
+ struct HPMHookPoint *HP_pc_itemskill_clear_pre;
+ struct HPMHookPoint *HP_pc_itemskill_clear_post;
struct HPMHookPoint *HP_pc_skillatk_bonus_pre;
struct HPMHookPoint *HP_pc_skillatk_bonus_post;
struct HPMHookPoint *HP_pc_skillheal_bonus_pre;
@@ -5854,6 +5856,8 @@ struct {
struct HPMHookPoint *HP_skill_vf_cast_fix_post;
struct HPMHookPoint *HP_skill_delay_fix_pre;
struct HPMHookPoint *HP_skill_delay_fix_post;
+ struct HPMHookPoint *HP_skill_is_item_skill_pre;
+ struct HPMHookPoint *HP_skill_is_item_skill_post;
struct HPMHookPoint *HP_skill_check_condition_castbegin_pre;
struct HPMHookPoint *HP_skill_check_condition_castbegin_post;
struct HPMHookPoint *HP_skill_check_condition_castend_pre;
@@ -11631,6 +11635,8 @@ struct {
int HP_pc_checkitem_post;
int HP_pc_useitem_pre;
int HP_pc_useitem_post;
+ int HP_pc_itemskill_clear_pre;
+ int HP_pc_itemskill_clear_post;
int HP_pc_skillatk_bonus_pre;
int HP_pc_skillatk_bonus_post;
int HP_pc_skillheal_bonus_pre;
@@ -12721,6 +12727,8 @@ struct {
int HP_skill_vf_cast_fix_post;
int HP_skill_delay_fix_pre;
int HP_skill_delay_fix_post;
+ int HP_skill_is_item_skill_pre;
+ int HP_skill_is_item_skill_post;
int HP_skill_check_condition_castbegin_pre;
int HP_skill_check_condition_castbegin_post;
int HP_skill_check_condition_castend_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 0904a1dac..672b94dd8 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2440,6 +2440,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->unequipitem_pos, HP_pc_unequipitem_pos) },
{ HP_POP(pc->checkitem, HP_pc_checkitem) },
{ HP_POP(pc->useitem, HP_pc_useitem) },
+ { HP_POP(pc->itemskill_clear, HP_pc_itemskill_clear) },
{ HP_POP(pc->skillatk_bonus, HP_pc_skillatk_bonus) },
{ HP_POP(pc->skillheal_bonus, HP_pc_skillheal_bonus) },
{ HP_POP(pc->skillheal2_bonus, HP_pc_skillheal2_bonus) },
@@ -2996,6 +2997,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->cast_fix_sc, HP_skill_cast_fix_sc) },
{ HP_POP(skill->vf_cast_fix, HP_skill_vf_cast_fix) },
{ HP_POP(skill->delay_fix, HP_skill_delay_fix) },
+ { HP_POP(skill->is_item_skill, HP_skill_is_item_skill) },
{ HP_POP(skill->check_condition_castbegin, HP_skill_check_condition_castbegin) },
{ HP_POP(skill->check_condition_castend, HP_skill_check_condition_castend) },
{ HP_POP(skill->consume_requirement, HP_skill_consume_requirement) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 78702bedb..b50d86180 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -63360,6 +63360,33 @@ int HP_pc_useitem(struct map_session_data *sd, int n) {
}
return retVal___;
}
+int HP_pc_itemskill_clear(struct map_session_data *sd) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_itemskill_clear_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemskill_clear_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_itemskill_clear_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.itemskill_clear(sd);
+ }
+ if (HPMHooks.count.HP_pc_itemskill_clear_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemskill_clear_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_itemskill_clear_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd);
+ }
+ }
+ return retVal___;
+}
int HP_pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
@@ -78137,6 +78164,33 @@ int HP_skill_delay_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
}
return retVal___;
}
+bool HP_skill_is_item_skill(struct map_session_data *sd, int skill_id, int skill_lv) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_skill_is_item_skill_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *skill_id, int *skill_lv);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_is_item_skill_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_is_item_skill_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.skill.is_item_skill(sd, skill_id, skill_lv);
+ }
+ if (HPMHooks.count.HP_skill_is_item_skill_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int skill_id, int skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_is_item_skill_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_is_item_skill_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv);
+ }
+ }
+ return retVal___;
+}
int HP_skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;