Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKeiKun committed Apr 6, 2021
1 parent 8b9ec2a commit e373006
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6244,6 +6244,8 @@ typedef void (*HPMHOOK_pre_pc_autocast_remove) (struct map_session_data **sd, en
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_sub_skillatk_bonus) (struct map_session_data **sd, uint16 *skill_id);
typedef int (*HPMHOOK_post_pc_sub_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);
typedef int (*HPMHOOK_post_pc_skillheal_bonus) (int retVal___, struct map_session_data *sd, uint16 skill_id);
typedef int (*HPMHOOK_pre_pc_skillheal2_bonus) (struct map_session_data **sd, uint16 *skill_id);
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4824,6 +4824,8 @@ struct {
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_sub_skillatk_bonus_pre;
struct HPMHookPoint *HP_pc_sub_skillatk_bonus_post;
struct HPMHookPoint *HP_pc_skillheal_bonus_pre;
struct HPMHookPoint *HP_pc_skillheal_bonus_post;
struct HPMHookPoint *HP_pc_skillheal2_bonus_pre;
Expand Down Expand Up @@ -11913,6 +11915,8 @@ struct {
int HP_pc_autocast_remove_post;
int HP_pc_skillatk_bonus_pre;
int HP_pc_skillatk_bonus_post;
int HP_pc_sub_skillatk_bonus_pre;
int HP_pc_sub_skillatk_bonus_post;
int HP_pc_skillheal_bonus_pre;
int HP_pc_skillheal_bonus_post;
int HP_pc_skillheal2_bonus_pre;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,7 @@ struct HookingPointData HookingPoints[] = {
{ 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->sub_skillatk_bonus, HP_pc_sub_skillatk_bonus) },
{ HP_POP(pc->skillheal_bonus, HP_pc_skillheal_bonus) },
{ HP_POP(pc->skillheal2_bonus, HP_pc_skillheal2_bonus) },
{ HP_POP(pc->damage, HP_pc_damage) },
Expand Down
27 changes: 27 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64159,6 +64159,33 @@ int HP_pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) {
}
return retVal___;
}
int HP_pc_sub_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_pc_sub_skillatk_bonus_pre > 0) {
int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_sub_skillatk_bonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_sub_skillatk_bonus_pre[hIndex].func;
retVal___ = preHookFunc(&sd, &skill_id);
}
if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
retVal___ = HPMHooks.source.pc.sub_skillatk_bonus(sd, skill_id);
}
if (HPMHooks.count.HP_pc_sub_skillatk_bonus_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_sub_skillatk_bonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_sub_skillatk_bonus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
}
int HP_pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
Expand Down

0 comments on commit e373006

Please sign in to comment.