diff options
author | Hercules.ws <Hercules@efficiently.awesome> | 2016-07-05 20:33:24 +0200 |
---|---|---|
committer | HerculesWSAPI <Hercules@efficiently.awesome> | 2016-07-05 20:33:24 +0200 |
commit | 6437c36105b8c107b178a914961485833c68032b (patch) | |
tree | 4ff6d1142ce4eb44b54f3d3971bd7e659a347324 | |
parent | b1dafc3e15322518c4ec0847ac81055297c91721 (diff) | |
download | hercules-6437c36105b8c107b178a914961485833c68032b.tar.gz hercules-6437c36105b8c107b178a914961485833c68032b.tar.bz2 hercules-6437c36105b8c107b178a914961485833c68032b.tar.xz hercules-6437c36105b8c107b178a914961485833c68032b.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 18 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 28 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 7 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 216 |
4 files changed, 259 insertions, 10 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 12e6d8ed3..07782571d 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5894,8 +5894,8 @@ typedef void (*HPMHOOK_pre_script_op_2) (struct script_state **st, int *op); typedef void (*HPMHOOK_post_script_op_2) (struct script_state *st, int op); typedef void (*HPMHOOK_pre_script_op_1) (struct script_state **st, int *op); typedef void (*HPMHOOK_post_script_op_1) (struct script_state *st, int op); -typedef void (*HPMHOOK_pre_script_check_buildin_argtype) (struct script_state **st, int *func); -typedef void (*HPMHOOK_post_script_check_buildin_argtype) (struct script_state *st, int func); +typedef bool (*HPMHOOK_pre_script_check_buildin_argtype) (struct script_state **st, int *func); +typedef bool (*HPMHOOK_post_script_check_buildin_argtype) (bool retVal___, struct script_state *st, int func); typedef void (*HPMHOOK_pre_script_detach_state) (struct script_state **st, bool *dequeue_event); typedef void (*HPMHOOK_post_script_detach_state) (struct script_state *st, bool dequeue_event); typedef int (*HPMHOOK_pre_script_db_free_code_sub) (union DBKey *key, struct DBData **data, va_list ap); @@ -6478,6 +6478,12 @@ typedef bool (*HPMHOOK_pre_skill_get_requirement_item_unknown) (struct status_ch typedef bool (*HPMHOOK_post_skill_get_requirement_item_unknown) (bool retVal___, struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i); typedef void (*HPMHOOK_pre_skill_get_requirement_unknown) (struct status_change **sc, struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv, struct skill_condition **req); typedef void (*HPMHOOK_post_skill_get_requirement_unknown) (struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req); +typedef int (*HPMHOOK_pre_skill_splash_target) (struct block_list **bl); +typedef int (*HPMHOOK_post_skill_splash_target) (int retVal___, struct block_list *bl); +typedef int (*HPMHOOK_pre_skill_check_npc_chaospanic) (struct block_list **bl, va_list args); +typedef int (*HPMHOOK_post_skill_check_npc_chaospanic) (int retVal___, struct block_list *bl, va_list args); +typedef int (*HPMHOOK_pre_skill_count_wos) (struct block_list **bl, va_list ap); +typedef int (*HPMHOOK_post_skill_count_wos) (int retVal___, struct block_list *bl, va_list ap); #endif // MAP_SKILL_H #ifdef COMMON_SOCKET_H /* sockt */ typedef void (*HPMHOOK_pre_sockt_init) (void); @@ -6828,6 +6834,14 @@ 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_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 unsigned short (*HPMHOOK_pre_status_base_matk_min) (const struct status_data **st); +typedef unsigned short (*HPMHOOK_post_status_base_matk_min) (unsigned short retVal___, const struct status_data *st); +typedef unsigned short (*HPMHOOK_pre_status_base_matk_max) (const struct status_data **st); +typedef unsigned short (*HPMHOOK_post_status_base_matk_max) (unsigned short retVal___, const struct status_data *st); #endif // MAP_STATUS_H #ifdef MAP_STORAGE_H /* storage */ typedef void (*HPMHOOK_pre_storage_reconnect) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 0ffcf9538..0b224127e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -5308,6 +5308,12 @@ struct { struct HPMHookPoint *HP_skill_get_requirement_item_unknown_post; struct HPMHookPoint *HP_skill_get_requirement_unknown_pre; struct HPMHookPoint *HP_skill_get_requirement_unknown_post; + struct HPMHookPoint *HP_skill_splash_target_pre; + struct HPMHookPoint *HP_skill_splash_target_post; + struct HPMHookPoint *HP_skill_check_npc_chaospanic_pre; + struct HPMHookPoint *HP_skill_check_npc_chaospanic_post; + struct HPMHookPoint *HP_skill_count_wos_pre; + struct HPMHookPoint *HP_skill_count_wos_post; struct HPMHookPoint *HP_sockt_init_pre; struct HPMHookPoint *HP_sockt_init_post; struct HPMHookPoint *HP_sockt_final_pre; @@ -5652,6 +5658,14 @@ struct { struct HPMHookPoint *HP_status_read_job_db_post; struct HPMHookPoint *HP_status_read_job_db_sub_pre; struct HPMHookPoint *HP_status_read_job_db_sub_post; + struct HPMHookPoint *HP_status_set_sc_pre; + struct HPMHookPoint *HP_status_set_sc_post; + struct HPMHookPoint *HP_status_copy_pre; + struct HPMHookPoint *HP_status_copy_post; + struct HPMHookPoint *HP_status_base_matk_min_pre; + struct HPMHookPoint *HP_status_base_matk_min_post; + struct HPMHookPoint *HP_status_base_matk_max_pre; + struct HPMHookPoint *HP_status_base_matk_max_post; struct HPMHookPoint *HP_storage_reconnect_pre; struct HPMHookPoint *HP_storage_reconnect_post; struct HPMHookPoint *HP_storage_delitem_pre; @@ -11221,6 +11235,12 @@ struct { int HP_skill_get_requirement_item_unknown_post; int HP_skill_get_requirement_unknown_pre; int HP_skill_get_requirement_unknown_post; + int HP_skill_splash_target_pre; + int HP_skill_splash_target_post; + int HP_skill_check_npc_chaospanic_pre; + int HP_skill_check_npc_chaospanic_post; + int HP_skill_count_wos_pre; + int HP_skill_count_wos_post; int HP_sockt_init_pre; int HP_sockt_init_post; int HP_sockt_final_pre; @@ -11565,6 +11585,14 @@ struct { int HP_status_read_job_db_post; int HP_status_read_job_db_sub_pre; int HP_status_read_job_db_sub_post; + int HP_status_set_sc_pre; + int HP_status_set_sc_post; + int HP_status_copy_pre; + int HP_status_copy_post; + int HP_status_base_matk_min_pre; + int HP_status_base_matk_min_post; + int HP_status_base_matk_max_pre; + int HP_status_base_matk_max_post; int HP_storage_reconnect_pre; int HP_storage_reconnect_post; int HP_storage_delitem_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index ae18cc55e..cc3f9f303 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2713,6 +2713,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->get_requirement_off_unknown, HP_skill_get_requirement_off_unknown) }, { HP_POP(skill->get_requirement_item_unknown, HP_skill_get_requirement_item_unknown) }, { HP_POP(skill->get_requirement_unknown, HP_skill_get_requirement_unknown) }, + { HP_POP(skill->splash_target, HP_skill_splash_target) }, + { HP_POP(skill->check_npc_chaospanic, HP_skill_check_npc_chaospanic) }, + { HP_POP(skill->count_wos, HP_skill_count_wos) }, /* socket_interface */ { HP_POP(sockt->init, HP_sockt_init) }, { HP_POP(sockt->final, HP_sockt_final) }, @@ -2888,6 +2891,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->readdb_scconfig, HP_status_readdb_scconfig) }, { HP_POP(status->read_job_db, HP_status_read_job_db) }, { HP_POP(status->read_job_db_sub, HP_status_read_job_db_sub) }, + { HP_POP(status->set_sc, HP_status_set_sc) }, + { HP_POP(status->copy, HP_status_copy) }, + { HP_POP(status->base_matk_min, HP_status_base_matk_min) }, + { HP_POP(status->base_matk_max, HP_status_base_matk_max) }, /* storage_interface */ { HP_POP(storage->reconnect, HP_storage_reconnect) }, { HP_POP(storage->delitem, HP_storage_delitem) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 9685bb810..14b724f63 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -63041,31 +63041,32 @@ void HP_script_op_1(struct script_state *st, int op) { } return; } -void HP_script_check_buildin_argtype(struct script_state *st, int func) { +bool HP_script_check_buildin_argtype(struct script_state *st, int func) { int hIndex = 0; + bool retVal___ = false; if( HPMHooks.count.HP_script_check_buildin_argtype_pre ) { - void (*preHookFunc) (struct script_state **st, int *func); + bool (*preHookFunc) (struct script_state **st, int *func); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_script_check_buildin_argtype_pre[hIndex].func; - preHookFunc(&st, &func); + retVal___ = preHookFunc(&st, &func); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.script.check_buildin_argtype(st, func); + retVal___ = HPMHooks.source.script.check_buildin_argtype(st, func); } if( HPMHooks.count.HP_script_check_buildin_argtype_post ) { - void (*postHookFunc) (struct script_state *st, int func); + bool (*postHookFunc) (bool retVal___, struct script_state *st, int func); for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_script_check_buildin_argtype_post[hIndex].func; - postHookFunc(st, func); + retVal___ = postHookFunc(retVal___, st, func); } } - return; + return retVal___; } void HP_script_detach_state(struct script_state *st, bool dequeue_event) { int hIndex = 0; @@ -71083,6 +71084,99 @@ void HP_skill_get_requirement_unknown(struct status_change *sc, struct map_sessi } return; } +int HP_skill_splash_target(struct block_list *bl) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_splash_target_pre ) { + int (*preHookFunc) (struct block_list **bl); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_splash_target_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_splash_target_pre[hIndex].func; + retVal___ = preHookFunc(&bl); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.splash_target(bl); + } + if( HPMHooks.count.HP_skill_splash_target_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_splash_target_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_splash_target_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl); + } + } + return retVal___; +} +int HP_skill_check_npc_chaospanic(struct block_list *bl, va_list args) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_check_npc_chaospanic_pre ) { + int (*preHookFunc) (struct block_list **bl, va_list args); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_npc_chaospanic_pre; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + preHookFunc = HPMHooks.list.HP_skill_check_npc_chaospanic_pre[hIndex].func; + retVal___ = preHookFunc(&bl, args___copy); + va_end(args___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list args___copy; va_copy(args___copy, args); + retVal___ = HPMHooks.source.skill.check_npc_chaospanic(bl, args___copy); + va_end(args___copy); + } + if( HPMHooks.count.HP_skill_check_npc_chaospanic_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_npc_chaospanic_post; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + postHookFunc = HPMHooks.list.HP_skill_check_npc_chaospanic_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, args___copy); + va_end(args___copy); + } + } + return retVal___; +} +int HP_skill_count_wos(struct block_list *bl, va_list ap) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_count_wos_pre ) { + int (*preHookFunc) (struct block_list **bl, va_list ap); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_count_wos_pre; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + preHookFunc = HPMHooks.list.HP_skill_count_wos_pre[hIndex].func; + retVal___ = preHookFunc(&bl, ap___copy); + va_end(ap___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list ap___copy; va_copy(ap___copy, ap); + retVal___ = HPMHooks.source.skill.count_wos(bl, ap___copy); + va_end(ap___copy); + } + if( HPMHooks.count.HP_skill_count_wos_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_count_wos_post; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + postHookFunc = HPMHooks.list.HP_skill_count_wos_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, ap___copy); + va_end(ap___copy); + } + } + return retVal___; +} /* socket_interface */ void HP_sockt_init(void) { int hIndex = 0; @@ -75722,6 +75816,112 @@ 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) { + int hIndex = 0; + if( HPMHooks.count.HP_status_set_sc_pre ) { + void (*preHookFunc) (uint16 *skill_id, sc_type *sc, int *icon, 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); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.set_sc(skill_id, sc, icon, flag); + } + if( HPMHooks.count.HP_status_set_sc_post ) { + void (*postHookFunc) (uint16 skill_id, sc_type sc, int icon, 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); + } + } + return; +} +void HP_status_copy(struct status_data *a, const struct status_data *b) { + int hIndex = 0; + if( HPMHooks.count.HP_status_copy_pre ) { + void (*preHookFunc) (struct status_data **a, const struct status_data **b); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_copy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_copy_pre[hIndex].func; + preHookFunc(&a, &b); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.copy(a, b); + } + if( HPMHooks.count.HP_status_copy_post ) { + void (*postHookFunc) (struct status_data *a, const struct status_data *b); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_copy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_copy_post[hIndex].func; + postHookFunc(a, b); + } + } + return; +} +unsigned short HP_status_base_matk_min(const struct status_data *st) { + int hIndex = 0; + unsigned short retVal___ = 0; + if( HPMHooks.count.HP_status_base_matk_min_pre ) { + unsigned short (*preHookFunc) (const struct status_data **st); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_min_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_base_matk_min_pre[hIndex].func; + retVal___ = preHookFunc(&st); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.base_matk_min(st); + } + if( HPMHooks.count.HP_status_base_matk_min_post ) { + unsigned short (*postHookFunc) (unsigned short retVal___, const struct status_data *st); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_min_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_base_matk_min_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st); + } + } + return retVal___; +} +unsigned short HP_status_base_matk_max(const struct status_data *st) { + int hIndex = 0; + unsigned short retVal___ = 0; + if( HPMHooks.count.HP_status_base_matk_max_pre ) { + unsigned short (*preHookFunc) (const struct status_data **st); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_max_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_base_matk_max_pre[hIndex].func; + retVal___ = preHookFunc(&st); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.status.base_matk_max(st); + } + if( HPMHooks.count.HP_status_base_matk_max_post ) { + unsigned short (*postHookFunc) (unsigned short retVal___, const struct status_data *st); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_max_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_base_matk_max_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st); + } + } + return retVal___; +} /* storage_interface */ void HP_storage_reconnect(void) { int hIndex = 0; |