From 0a2097d8e295a329ad3d0e732fb74e77707dc2bb Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 31 May 2020 23:35:11 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 6 ++ .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 12 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 3 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 78 ++++++++++++++++++++++ 4 files changed, 99 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 107d0cc33..50e64e53c 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -6216,8 +6216,14 @@ 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 void (*HPMHOOK_pre_pc_autocast_clear_current) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_pc_autocast_clear_current) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_pc_autocast_clear) (struct map_session_data **sd); typedef void (*HPMHOOK_post_pc_autocast_clear) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_pc_autocast_set_current) (struct map_session_data **sd, int *skill_id); +typedef void (*HPMHOOK_post_pc_autocast_set_current) (struct map_session_data *sd, int skill_id); +typedef void (*HPMHOOK_pre_pc_autocast_remove) (struct map_session_data **sd, enum autocast_type *type, int *skill_id, int *skill_lv); +typedef void (*HPMHOOK_post_pc_autocast_remove) (struct map_session_data *sd, enum autocast_type type, int skill_id, int skill_lv); 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); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index df3a28bcb..0c245dee3 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4796,8 +4796,14 @@ struct { struct HPMHookPoint *HP_pc_checkitem_post; struct HPMHookPoint *HP_pc_useitem_pre; struct HPMHookPoint *HP_pc_useitem_post; + struct HPMHookPoint *HP_pc_autocast_clear_current_pre; + struct HPMHookPoint *HP_pc_autocast_clear_current_post; struct HPMHookPoint *HP_pc_autocast_clear_pre; struct HPMHookPoint *HP_pc_autocast_clear_post; + struct HPMHookPoint *HP_pc_autocast_set_current_pre; + struct HPMHookPoint *HP_pc_autocast_set_current_post; + struct HPMHookPoint *HP_pc_autocast_remove_pre; + struct HPMHookPoint *HP_pc_autocast_remove_post; struct HPMHookPoint *HP_pc_skillatk_bonus_pre; struct HPMHookPoint *HP_pc_skillatk_bonus_post; struct HPMHookPoint *HP_pc_skillheal_bonus_pre; @@ -11715,8 +11721,14 @@ struct { int HP_pc_checkitem_post; int HP_pc_useitem_pre; int HP_pc_useitem_post; + int HP_pc_autocast_clear_current_pre; + int HP_pc_autocast_clear_current_post; int HP_pc_autocast_clear_pre; int HP_pc_autocast_clear_post; + int HP_pc_autocast_set_current_pre; + int HP_pc_autocast_set_current_post; + int HP_pc_autocast_remove_pre; + int HP_pc_autocast_remove_post; int HP_pc_skillatk_bonus_pre; int HP_pc_skillatk_bonus_post; int HP_pc_skillheal_bonus_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 3720e8a51..2d35608f0 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2456,7 +2456,10 @@ 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->autocast_clear_current, HP_pc_autocast_clear_current) }, { HP_POP(pc->autocast_clear, HP_pc_autocast_clear) }, + { HP_POP(pc->autocast_set_current, HP_pc_autocast_set_current) }, + { HP_POP(pc->autocast_remove, HP_pc_autocast_remove) }, { 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) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 97997f7b8..08d807f1c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -63781,6 +63781,32 @@ int HP_pc_useitem(struct map_session_data *sd, int n) { } return retVal___; } +void HP_pc_autocast_clear_current(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_pc_autocast_clear_current_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autocast_clear_current_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_autocast_clear_current_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.autocast_clear_current(sd); + } + if (HPMHooks.count.HP_pc_autocast_clear_current_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autocast_clear_current_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_autocast_clear_current_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} void HP_pc_autocast_clear(struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_pc_autocast_clear_pre > 0) { @@ -63807,6 +63833,58 @@ void HP_pc_autocast_clear(struct map_session_data *sd) { } return; } +void HP_pc_autocast_set_current(struct map_session_data *sd, int skill_id) { + int hIndex = 0; + if (HPMHooks.count.HP_pc_autocast_set_current_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *skill_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autocast_set_current_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_autocast_set_current_pre[hIndex].func; + preHookFunc(&sd, &skill_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.autocast_set_current(sd, skill_id); + } + if (HPMHooks.count.HP_pc_autocast_set_current_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int skill_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autocast_set_current_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_autocast_set_current_post[hIndex].func; + postHookFunc(sd, skill_id); + } + } + return; +} +void HP_pc_autocast_remove(struct map_session_data *sd, enum autocast_type type, int skill_id, int skill_lv) { + int hIndex = 0; + if (HPMHooks.count.HP_pc_autocast_remove_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum autocast_type *type, int *skill_id, int *skill_lv); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autocast_remove_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_autocast_remove_pre[hIndex].func; + preHookFunc(&sd, &type, &skill_id, &skill_lv); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.autocast_remove(sd, type, skill_id, skill_lv); + } + if (HPMHooks.count.HP_pc_autocast_remove_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum autocast_type type, int skill_id, int skill_lv); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autocast_remove_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_autocast_remove_post[hIndex].func; + postHookFunc(sd, type, skill_id, skill_lv); + } + } + return; +} int HP_pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) { int hIndex = 0; int retVal___ = 0; -- cgit v1.2.3-60-g2f50