From 9a712eea333bd44605355beb9c2d431b4bf2f7fc Mon Sep 17 00:00:00 2001 From: Asheraf Date: Wed, 6 Nov 2019 17:18:04 +0100 Subject: HPM Hooks Update --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 18 ++--- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 12 ++-- .../HPMHooking/HPMHooking_map.HookingPoints.inc | 3 +- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 83 ++++++++++++++-------- 4 files changed, 75 insertions(+), 41 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 389d273e3..78166f714 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1330,10 +1330,10 @@ typedef void (*HPMHOOK_pre_clif_autospell) (struct map_session_data **sd, uint16 typedef void (*HPMHOOK_post_clif_autospell) (struct map_session_data *sd, uint16 skill_lv); typedef void (*HPMHOOK_pre_clif_combo_delay) (struct block_list **bl, int *wait); typedef void (*HPMHOOK_post_clif_combo_delay) (struct block_list *bl, int wait); -typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *type, int *flag, int *total_tick, int *val1, int *val2, int *val3); -typedef void (*HPMHOOK_post_clif_status_change) (struct block_list *bl, int type, int flag, int total_tick, int val1, int val2, int val3); -typedef void (*HPMHOOK_pre_clif_status_change_sub) (struct block_list **bl, int *type, int *flag, int *tick, int *total_tick, int *val1, int *val2, int *val3); -typedef void (*HPMHOOK_post_clif_status_change_sub) (struct block_list *bl, int type, int flag, int tick, int total_tick, int val1, int val2, int val3); +typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *relevant_bl, int *type, int *flag, int *total_tick, int *val1, int *val2, int *val3); +typedef void (*HPMHOOK_post_clif_status_change) (struct block_list *bl, int relevant_bl, int type, int flag, int total_tick, int val1, int val2, int val3); +typedef void (*HPMHOOK_pre_clif_status_change_sub) (struct block_list **bl, int *type, int *relevant_bl, int *flag, int *tick, int *total_tick, int *val1, int *val2, int *val3); +typedef void (*HPMHOOK_post_clif_status_change_sub) (struct block_list *bl, int type, int relevant_bl, int flag, int tick, int total_tick, int val1, int val2, int val3); typedef void (*HPMHOOK_pre_clif_insert_card) (struct map_session_data **sd, int *idx_equip, int *idx_card, int *flag); typedef void (*HPMHOOK_post_clif_insert_card) (struct map_session_data *sd, int idx_equip, int idx_card, int flag); typedef void (*HPMHOOK_pre_clif_inventoryList) (struct map_session_data **sd); @@ -7760,10 +7760,12 @@ typedef int (*HPMHOOK_pre_status_sc2skill) (sc_type *sc); typedef int (*HPMHOOK_post_status_sc2skill) (int retVal___, sc_type sc); typedef unsigned int (*HPMHOOK_pre_status_sc2scb_flag) (sc_type *sc); typedef unsigned int (*HPMHOOK_post_status_sc2scb_flag) (unsigned int retVal___, sc_type sc); -typedef int (*HPMHOOK_pre_status_type2relevant_bl_types) (int *type); -typedef int (*HPMHOOK_post_status_type2relevant_bl_types) (int retVal___, int type); +typedef int (*HPMHOOK_pre_status_get_sc_relevant_bl_types) (sc_type *type); +typedef int (*HPMHOOK_post_status_get_sc_relevant_bl_types) (int retVal___, sc_type type); typedef int (*HPMHOOK_pre_status_get_sc_type) (sc_type *idx); typedef int (*HPMHOOK_post_status_get_sc_type) (int retVal___, sc_type idx); +typedef int (*HPMHOOK_pre_status_get_sc_icon) (sc_type *type); +typedef int (*HPMHOOK_post_status_get_sc_icon) (int retVal___, sc_type type); typedef int (*HPMHOOK_pre_status_damage) (struct block_list **src, struct block_list **target, int64 *hp, int64 *sp, int *walkdelay, int *flag); typedef int (*HPMHOOK_post_status_damage) (int retVal___, struct block_list *src, struct block_list *target, int64 hp, int64 sp, int walkdelay, int flag); typedef int (*HPMHOOK_pre_status_charge) (struct block_list **bl, int64 *hp, int64 *sp); @@ -7998,8 +8000,8 @@ typedef void (*HPMHOOK_pre_status_read_job_db) (void); typedef void (*HPMHOOK_post_status_read_job_db) (void); typedef void (*HPMHOOK_pre_status_read_job_db_sub) (int *idx, const char **name, struct config_setting_t **jdb); typedef void (*HPMHOOK_post_status_read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb); -typedef void (*HPMHOOK_pre_status_set_sc) (uint16 *skill_id, sc_type *sc, int *icon, unsigned int *flag); -typedef void (*HPMHOOK_post_status_set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); +typedef void (*HPMHOOK_pre_status_set_sc) (uint16 *skill_id, sc_type *sc, unsigned int *flag); +typedef void (*HPMHOOK_post_status_set_sc) (uint16 skill_id, sc_type sc, unsigned int flag); typedef void (*HPMHOOK_pre_status_copy) (struct status_data **a, const struct status_data **b); typedef void (*HPMHOOK_post_status_copy) (struct status_data *a, const struct status_data *b); typedef int (*HPMHOOK_pre_status_base_matk_min) (const struct status_data **st); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 1196e3a99..920c4e58d 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -6282,10 +6282,12 @@ struct { struct HPMHookPoint *HP_status_sc2skill_post; struct HPMHookPoint *HP_status_sc2scb_flag_pre; struct HPMHookPoint *HP_status_sc2scb_flag_post; - struct HPMHookPoint *HP_status_type2relevant_bl_types_pre; - struct HPMHookPoint *HP_status_type2relevant_bl_types_post; + struct HPMHookPoint *HP_status_get_sc_relevant_bl_types_pre; + struct HPMHookPoint *HP_status_get_sc_relevant_bl_types_post; struct HPMHookPoint *HP_status_get_sc_type_pre; struct HPMHookPoint *HP_status_get_sc_type_post; + struct HPMHookPoint *HP_status_get_sc_icon_pre; + struct HPMHookPoint *HP_status_get_sc_icon_post; struct HPMHookPoint *HP_status_damage_pre; struct HPMHookPoint *HP_status_damage_post; struct HPMHookPoint *HP_status_charge_pre; @@ -13111,10 +13113,12 @@ struct { int HP_status_sc2skill_post; int HP_status_sc2scb_flag_pre; int HP_status_sc2scb_flag_post; - int HP_status_type2relevant_bl_types_pre; - int HP_status_type2relevant_bl_types_post; + int HP_status_get_sc_relevant_bl_types_pre; + int HP_status_get_sc_relevant_bl_types_post; int HP_status_get_sc_type_pre; int HP_status_get_sc_type_post; + int HP_status_get_sc_icon_pre; + int HP_status_get_sc_icon_post; int HP_status_damage_pre; int HP_status_damage_post; int HP_status_charge_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index da72b688a..6bf3ced67 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -3213,8 +3213,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->skill2sc, HP_status_skill2sc) }, { HP_POP(status->sc2skill, HP_status_sc2skill) }, { HP_POP(status->sc2scb_flag, HP_status_sc2scb_flag) }, - { HP_POP(status->type2relevant_bl_types, HP_status_type2relevant_bl_types) }, + { HP_POP(status->get_sc_relevant_bl_types, HP_status_get_sc_relevant_bl_types) }, { HP_POP(status->get_sc_type, HP_status_get_sc_type) }, + { HP_POP(status->get_sc_icon, HP_status_get_sc_icon) }, { HP_POP(status->damage, HP_status_damage) }, { HP_POP(status->charge, HP_status_charge) }, { HP_POP(status->percent_change, HP_status_percent_change) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index c331d66a9..5c552a9ee 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11995,14 +11995,14 @@ void HP_clif_combo_delay(struct block_list *bl, int wait) { } return; } -void HP_clif_status_change(struct block_list *bl, int type, int flag, int total_tick, int val1, int val2, int val3) { +void HP_clif_status_change(struct block_list *bl, int relevant_bl, int type, int flag, int total_tick, int val1, int val2, int val3) { int hIndex = 0; if (HPMHooks.count.HP_clif_status_change_pre > 0) { - void (*preHookFunc) (struct block_list **bl, int *type, int *flag, int *total_tick, int *val1, int *val2, int *val3); + void (*preHookFunc) (struct block_list **bl, int *relevant_bl, int *type, int *flag, int *total_tick, int *val1, int *val2, int *val3); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_status_change_pre[hIndex].func; - preHookFunc(&bl, &type, &flag, &total_tick, &val1, &val2, &val3); + preHookFunc(&bl, &relevant_bl, &type, &flag, &total_tick, &val1, &val2, &val3); } if (*HPMforce_return) { *HPMforce_return = false; @@ -12010,25 +12010,25 @@ void HP_clif_status_change(struct block_list *bl, int type, int flag, int total_ } } { - HPMHooks.source.clif.status_change(bl, type, flag, total_tick, val1, val2, val3); + HPMHooks.source.clif.status_change(bl, relevant_bl, type, flag, total_tick, val1, val2, val3); } if (HPMHooks.count.HP_clif_status_change_post > 0) { - void (*postHookFunc) (struct block_list *bl, int type, int flag, int total_tick, int val1, int val2, int val3); + void (*postHookFunc) (struct block_list *bl, int relevant_bl, int type, int flag, int total_tick, int val1, int val2, int val3); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_status_change_post[hIndex].func; - postHookFunc(bl, type, flag, total_tick, val1, val2, val3); + postHookFunc(bl, relevant_bl, type, flag, total_tick, val1, val2, val3); } } return; } -void HP_clif_status_change_sub(struct block_list *bl, int type, int flag, int tick, int total_tick, int val1, int val2, int val3) { +void HP_clif_status_change_sub(struct block_list *bl, int type, int relevant_bl, int flag, int tick, int total_tick, int val1, int val2, int val3) { int hIndex = 0; if (HPMHooks.count.HP_clif_status_change_sub_pre > 0) { - void (*preHookFunc) (struct block_list **bl, int *type, int *flag, int *tick, int *total_tick, int *val1, int *val2, int *val3); + void (*preHookFunc) (struct block_list **bl, int *type, int *relevant_bl, int *flag, int *tick, int *total_tick, int *val1, int *val2, int *val3); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_sub_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_status_change_sub_pre[hIndex].func; - preHookFunc(&bl, &type, &flag, &tick, &total_tick, &val1, &val2, &val3); + preHookFunc(&bl, &type, &relevant_bl, &flag, &tick, &total_tick, &val1, &val2, &val3); } if (*HPMforce_return) { *HPMforce_return = false; @@ -12036,13 +12036,13 @@ void HP_clif_status_change_sub(struct block_list *bl, int type, int flag, int ti } } { - HPMHooks.source.clif.status_change_sub(bl, type, flag, tick, total_tick, val1, val2, val3); + HPMHooks.source.clif.status_change_sub(bl, type, relevant_bl, flag, tick, total_tick, val1, val2, val3); } if (HPMHooks.count.HP_clif_status_change_sub_post > 0) { - void (*postHookFunc) (struct block_list *bl, int type, int flag, int tick, int total_tick, int val1, int val2, int val3); + void (*postHookFunc) (struct block_list *bl, int type, int relevant_bl, int flag, int tick, int total_tick, int val1, int val2, int val3); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_sub_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_status_change_sub_post[hIndex].func; - postHookFunc(bl, type, flag, tick, total_tick, val1, val2, val3); + postHookFunc(bl, type, relevant_bl, flag, tick, total_tick, val1, val2, val3); } } return; @@ -84029,14 +84029,14 @@ unsigned int HP_status_sc2scb_flag(sc_type sc) { } return retVal___; } -int HP_status_type2relevant_bl_types(int type) { +int HP_status_get_sc_relevant_bl_types(sc_type type) { int hIndex = 0; int retVal___ = 0; - if (HPMHooks.count.HP_status_type2relevant_bl_types_pre > 0) { - int (*preHookFunc) (int *type); + if (HPMHooks.count.HP_status_get_sc_relevant_bl_types_pre > 0) { + int (*preHookFunc) (sc_type *type); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_type2relevant_bl_types_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_status_type2relevant_bl_types_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_relevant_bl_types_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_get_sc_relevant_bl_types_pre[hIndex].func; retVal___ = preHookFunc(&type); } if (*HPMforce_return) { @@ -84045,12 +84045,12 @@ int HP_status_type2relevant_bl_types(int type) { } } { - retVal___ = HPMHooks.source.status.type2relevant_bl_types(type); + retVal___ = HPMHooks.source.status.get_sc_relevant_bl_types(type); } - if (HPMHooks.count.HP_status_type2relevant_bl_types_post > 0) { - int (*postHookFunc) (int retVal___, int type); - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_type2relevant_bl_types_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_status_type2relevant_bl_types_post[hIndex].func; + if (HPMHooks.count.HP_status_get_sc_relevant_bl_types_post > 0) { + int (*postHookFunc) (int retVal___, sc_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_relevant_bl_types_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_get_sc_relevant_bl_types_post[hIndex].func; retVal___ = postHookFunc(retVal___, type); } } @@ -84083,6 +84083,33 @@ int HP_status_get_sc_type(sc_type idx) { } return retVal___; } +int HP_status_get_sc_icon(sc_type type) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_status_get_sc_icon_pre > 0) { + int (*preHookFunc) (sc_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_icon_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_get_sc_icon_pre[hIndex].func; + retVal___ = preHookFunc(&type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.get_sc_icon(type); + } + if (HPMHooks.count.HP_status_get_sc_icon_post > 0) { + int (*postHookFunc) (int retVal___, sc_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_icon_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_get_sc_icon_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type); + } + } + return retVal___; +} int HP_status_damage(struct block_list *src, struct block_list *target, int64 hp, int64 sp, int walkdelay, int flag) { int hIndex = 0; int retVal___ = 0; @@ -87236,14 +87263,14 @@ void HP_status_read_job_db_sub(int idx, const char *name, struct config_setting_ } return; } -void HP_status_set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag) { +void HP_status_set_sc(uint16 skill_id, sc_type sc, unsigned int flag) { int hIndex = 0; if (HPMHooks.count.HP_status_set_sc_pre > 0) { - void (*preHookFunc) (uint16 *skill_id, sc_type *sc, int *icon, unsigned int *flag); + void (*preHookFunc) (uint16 *skill_id, sc_type *sc, unsigned int *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_set_sc_pre[hIndex].func; - preHookFunc(&skill_id, &sc, &icon, &flag); + preHookFunc(&skill_id, &sc, &flag); } if (*HPMforce_return) { *HPMforce_return = false; @@ -87251,13 +87278,13 @@ void HP_status_set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag) } } { - HPMHooks.source.status.set_sc(skill_id, sc, icon, flag); + HPMHooks.source.status.set_sc(skill_id, sc, flag); } if (HPMHooks.count.HP_status_set_sc_post > 0) { - void (*postHookFunc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); + void (*postHookFunc) (uint16 skill_id, sc_type sc, unsigned int flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_set_sc_post[hIndex].func; - postHookFunc(skill_id, sc, icon, flag); + postHookFunc(skill_id, sc, flag); } } return; -- cgit v1.2.3-60-g2f50