diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 18 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 12 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 3 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 98 |
4 files changed, 116 insertions, 15 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index f231180d0..7139bfa6c 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4458,6 +4458,8 @@ typedef void (*HPMHOOK_pre_map_zone_init) (void); typedef void (*HPMHOOK_post_map_zone_init) (void); typedef void (*HPMHOOK_pre_map_zone_remove) (int *m); typedef void (*HPMHOOK_post_map_zone_remove) (int m); +typedef void (*HPMHOOK_pre_map_zone_remove_all) (int *m); +typedef void (*HPMHOOK_post_map_zone_remove_all) (int m); typedef void (*HPMHOOK_pre_map_zone_apply) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath); typedef void (*HPMHOOK_post_map_zone_apply) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath); typedef void (*HPMHOOK_pre_map_zone_change) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath); @@ -7594,12 +7596,12 @@ typedef int (*HPMHOOK_pre_status_charge) (struct block_list **bl, int64 *hp, int typedef int (*HPMHOOK_post_status_charge) (int retVal___, struct block_list *bl, int64 hp, int64 sp); typedef int (*HPMHOOK_pre_status_percent_change) (struct block_list **src, struct block_list **target, signed char *hp_rate, signed char *sp_rate, int *flag); typedef int (*HPMHOOK_post_status_percent_change) (int retVal___, struct block_list *src, struct block_list *target, signed char hp_rate, signed char sp_rate, int flag); -typedef int (*HPMHOOK_pre_status_set_hp) (struct block_list **bl, unsigned int *hp, int *flag); -typedef int (*HPMHOOK_post_status_set_hp) (int retVal___, struct block_list *bl, unsigned int hp, int flag); -typedef int (*HPMHOOK_pre_status_set_sp) (struct block_list **bl, unsigned int *sp, int *flag); -typedef int (*HPMHOOK_post_status_set_sp) (int retVal___, struct block_list *bl, unsigned int sp, int flag); -typedef int (*HPMHOOK_pre_status_heal) (struct block_list **bl, int64 *hp, int64 *sp, int *flag); -typedef int (*HPMHOOK_post_status_heal) (int retVal___, struct block_list *bl, int64 hp, int64 sp, int flag); +typedef int (*HPMHOOK_pre_status_set_hp) (struct block_list **bl, unsigned int *hp, enum status_heal_flag *flag); +typedef int (*HPMHOOK_post_status_set_hp) (int retVal___, struct block_list *bl, unsigned int hp, enum status_heal_flag flag); +typedef int (*HPMHOOK_pre_status_set_sp) (struct block_list **bl, unsigned int *sp, enum status_heal_flag *flag); +typedef int (*HPMHOOK_post_status_set_sp) (int retVal___, struct block_list *bl, unsigned int sp, enum status_heal_flag flag); +typedef int (*HPMHOOK_pre_status_heal) (struct block_list **bl, int64 *hp, int64 *sp, enum status_heal_flag *flag); +typedef int (*HPMHOOK_post_status_heal) (int retVal___, struct block_list *bl, int64 hp, int64 sp, enum status_heal_flag flag); typedef int (*HPMHOOK_pre_status_revive) (struct block_list **bl, unsigned char *per_hp, unsigned char *per_sp); typedef int (*HPMHOOK_post_status_revive) (int retVal___, struct block_list *bl, unsigned char per_hp, unsigned char per_sp); typedef int (*HPMHOOK_pre_status_fixed_revive) (struct block_list **bl, unsigned int *per_hp, unsigned int *per_sp); @@ -7742,6 +7744,10 @@ typedef unsigned int (*HPMHOOK_pre_status_get_base_maxhp) (const struct map_sess typedef unsigned int (*HPMHOOK_post_status_get_base_maxhp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st); typedef unsigned int (*HPMHOOK_pre_status_get_base_maxsp) (const struct map_session_data **sd, const struct status_data **st); typedef unsigned int (*HPMHOOK_post_status_get_base_maxsp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st); +typedef unsigned int (*HPMHOOK_pre_status_get_restart_hp) (const struct map_session_data **sd, const struct status_data **st); +typedef unsigned int (*HPMHOOK_post_status_get_restart_hp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st); +typedef unsigned int (*HPMHOOK_pre_status_get_restart_sp) (const struct map_session_data **sd, const struct status_data **st); +typedef unsigned int (*HPMHOOK_post_status_get_restart_sp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st); typedef int (*HPMHOOK_pre_status_calc_npc_) (struct npc_data **nd, enum e_status_calc_opt *opt); typedef int (*HPMHOOK_post_status_calc_npc_) (int retVal___, struct npc_data *nd, enum e_status_calc_opt opt); typedef unsigned short (*HPMHOOK_pre_status_calc_str) (struct block_list **bl, struct status_change **sc, int *str); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 42c2dc3a1..b1dfbed80 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3388,6 +3388,8 @@ struct { struct HPMHookPoint *HP_map_zone_init_post; struct HPMHookPoint *HP_map_zone_remove_pre; struct HPMHookPoint *HP_map_zone_remove_post; + struct HPMHookPoint *HP_map_zone_remove_all_pre; + struct HPMHookPoint *HP_map_zone_remove_all_post; struct HPMHookPoint *HP_map_zone_apply_pre; struct HPMHookPoint *HP_map_zone_apply_post; struct HPMHookPoint *HP_map_zone_change_pre; @@ -6250,6 +6252,10 @@ struct { struct HPMHookPoint *HP_status_get_base_maxhp_post; struct HPMHookPoint *HP_status_get_base_maxsp_pre; struct HPMHookPoint *HP_status_get_base_maxsp_post; + struct HPMHookPoint *HP_status_get_restart_hp_pre; + struct HPMHookPoint *HP_status_get_restart_hp_post; + struct HPMHookPoint *HP_status_get_restart_sp_pre; + struct HPMHookPoint *HP_status_get_restart_sp_post; struct HPMHookPoint *HP_status_calc_npc__pre; struct HPMHookPoint *HP_status_calc_npc__post; struct HPMHookPoint *HP_status_calc_str_pre; @@ -10001,6 +10007,8 @@ struct { int HP_map_zone_init_post; int HP_map_zone_remove_pre; int HP_map_zone_remove_post; + int HP_map_zone_remove_all_pre; + int HP_map_zone_remove_all_post; int HP_map_zone_apply_pre; int HP_map_zone_apply_post; int HP_map_zone_change_pre; @@ -12863,6 +12871,10 @@ struct { int HP_status_get_base_maxhp_post; int HP_status_get_base_maxsp_pre; int HP_status_get_base_maxsp_post; + int HP_status_get_restart_hp_pre; + int HP_status_get_restart_hp_post; + int HP_status_get_restart_sp_pre; + int HP_status_get_restart_sp_post; int HP_status_calc_npc__pre; int HP_status_calc_npc__post; int HP_status_calc_str_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 092a9831b..378eb77eb 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1737,6 +1737,7 @@ struct HookingPointData HookingPoints[] = { /* map_interface */ { HP_POP(map->zone_init, HP_map_zone_init) }, { HP_POP(map->zone_remove, HP_map_zone_remove) }, + { HP_POP(map->zone_remove_all, HP_map_zone_remove_all) }, { HP_POP(map->zone_apply, HP_map_zone_apply) }, { HP_POP(map->zone_change, HP_map_zone_change) }, { HP_POP(map->zone_change2, HP_map_zone_change2) }, @@ -3195,6 +3196,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->base_atk, HP_status_base_atk) }, { HP_POP(status->get_base_maxhp, HP_status_get_base_maxhp) }, { HP_POP(status->get_base_maxsp, HP_status_get_base_maxsp) }, + { HP_POP(status->get_restart_hp, HP_status_get_restart_hp) }, + { HP_POP(status->get_restart_sp, HP_status_get_restart_sp) }, { HP_POP(status->calc_npc_, HP_status_calc_npc_) }, { HP_POP(status->calc_str, HP_status_calc_str) }, { HP_POP(status->calc_agi, HP_status_calc_agi) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index ea53227bf..db191064c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -44624,6 +44624,32 @@ void HP_map_zone_remove(int m) { } return; } +void HP_map_zone_remove_all(int m) { + int hIndex = 0; + if (HPMHooks.count.HP_map_zone_remove_all_pre > 0) { + void (*preHookFunc) (int *m); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_all_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_map_zone_remove_all_pre[hIndex].func; + preHookFunc(&m); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.map.zone_remove_all(m); + } + if (HPMHooks.count.HP_map_zone_remove_all_post > 0) { + void (*postHookFunc) (int m); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_all_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_map_zone_remove_all_post[hIndex].func; + postHookFunc(m); + } + } + return; +} void HP_map_zone_apply(int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath) { int hIndex = 0; if (HPMHooks.count.HP_map_zone_apply_pre > 0) { @@ -81645,11 +81671,11 @@ int HP_status_percent_change(struct block_list *src, struct block_list *target, } return retVal___; } -int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) { +int HP_status_set_hp(struct block_list *bl, unsigned int hp, enum status_heal_flag flag) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_status_set_hp_pre > 0) { - int (*preHookFunc) (struct block_list **bl, unsigned int *hp, int *flag); + int (*preHookFunc) (struct block_list **bl, unsigned int *hp, enum status_heal_flag *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_set_hp_pre[hIndex].func; @@ -81664,7 +81690,7 @@ int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) { retVal___ = HPMHooks.source.status.set_hp(bl, hp, flag); } if (HPMHooks.count.HP_status_set_hp_post > 0) { - int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int hp, int flag); + int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int hp, enum status_heal_flag flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_set_hp_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl, hp, flag); @@ -81672,11 +81698,11 @@ int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) { } return retVal___; } -int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) { +int HP_status_set_sp(struct block_list *bl, unsigned int sp, enum status_heal_flag flag) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_status_set_sp_pre > 0) { - int (*preHookFunc) (struct block_list **bl, unsigned int *sp, int *flag); + int (*preHookFunc) (struct block_list **bl, unsigned int *sp, enum status_heal_flag *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_set_sp_pre[hIndex].func; @@ -81691,7 +81717,7 @@ int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) { retVal___ = HPMHooks.source.status.set_sp(bl, sp, flag); } if (HPMHooks.count.HP_status_set_sp_post > 0) { - int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int sp, int flag); + int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int sp, enum status_heal_flag flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_set_sp_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl, sp, flag); @@ -81699,11 +81725,11 @@ int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) { } return retVal___; } -int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) { +int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, enum status_heal_flag flag) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_status_heal_pre > 0) { - int (*preHookFunc) (struct block_list **bl, int64 *hp, int64 *sp, int *flag); + int (*preHookFunc) (struct block_list **bl, int64 *hp, int64 *sp, enum status_heal_flag *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_heal_pre[hIndex].func; @@ -81718,7 +81744,7 @@ int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) { retVal___ = HPMHooks.source.status.heal(bl, hp, sp, flag); } if (HPMHooks.count.HP_status_heal_post > 0) { - int (*postHookFunc) (int retVal___, struct block_list *bl, int64 hp, int64 sp, int flag); + int (*postHookFunc) (int retVal___, struct block_list *bl, int64 hp, int64 sp, enum status_heal_flag flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_heal_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl, hp, sp, flag); @@ -83636,6 +83662,60 @@ unsigned int HP_status_get_base_maxsp(const struct map_session_data *sd, const s } return retVal___; } +unsigned int HP_status_get_restart_hp(const struct map_session_data *sd, const struct status_data *st) { + int hIndex = 0; + unsigned int retVal___ = 0; + if (HPMHooks.count.HP_status_get_restart_hp_pre > 0) { + unsigned int (*preHookFunc) (const struct map_session_data **sd, const struct status_data **st); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_hp_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_get_restart_hp_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &st); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.get_restart_hp(sd, st); + } + if (HPMHooks.count.HP_status_get_restart_hp_post > 0) { + unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_hp_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_get_restart_hp_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, st); + } + } + return retVal___; +} +unsigned int HP_status_get_restart_sp(const struct map_session_data *sd, const struct status_data *st) { + int hIndex = 0; + unsigned int retVal___ = 0; + if (HPMHooks.count.HP_status_get_restart_sp_pre > 0) { + unsigned int (*preHookFunc) (const struct map_session_data **sd, const struct status_data **st); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_sp_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_get_restart_sp_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &st); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.get_restart_sp(sd, st); + } + if (HPMHooks.count.HP_status_get_restart_sp_post > 0) { + unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_sp_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_get_restart_sp_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, st); + } + } + return retVal___; +} int HP_status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) { int hIndex = 0; int retVal___ = 0; |