diff options
Diffstat (limited to 'src/plugins')
4 files changed, 44 insertions, 43 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 920f81ca5..d8bf3fae9 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4816,8 +4816,8 @@ typedef void (*HPMHOOK_pre_map_update_cell_bl) (struct block_list **bl, bool *in typedef void (*HPMHOOK_post_map_update_cell_bl) (struct block_list *bl, bool increase); typedef int (*HPMHOOK_pre_map_get_new_bonus_id) (void); typedef int (*HPMHOOK_post_map_get_new_bonus_id) (int retVal___); -typedef void (*HPMHOOK_pre_map_add_questinfo) (int *m, struct questinfo **qi); -typedef void (*HPMHOOK_post_map_add_questinfo) (int m, struct questinfo *qi); +typedef bool (*HPMHOOK_pre_map_add_questinfo) (int *m, struct npc_data **nd); +typedef bool (*HPMHOOK_post_map_add_questinfo) (bool retVal___, int m, struct npc_data *nd); typedef bool (*HPMHOOK_pre_map_remove_questinfo) (int *m, struct npc_data **nd); typedef bool (*HPMHOOK_post_map_remove_questinfo) (bool retVal___, int m, struct npc_data *nd); typedef struct map_zone_data* (*HPMHOOK_pre_map_merge_zone) (struct map_zone_data **main, struct map_zone_data **other); @@ -5794,6 +5794,8 @@ typedef bool (*HPMHOOK_pre_npc_db_checkid) (const int *id); typedef bool (*HPMHOOK_post_npc_db_checkid) (bool retVal___, const int id); typedef void (*HPMHOOK_pre_npc_refresh) (struct npc_data **nd); typedef void (*HPMHOOK_post_npc_refresh) (struct npc_data *nd); +typedef void (*HPMHOOK_pre_npc_questinfo_clear) (struct npc_data **nd); +typedef void (*HPMHOOK_post_npc_questinfo_clear) (struct npc_data *nd); typedef int (*HPMHOOK_pre_npc_secure_timeout_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_npc_secure_timeout_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); #endif // MAP_NPC_H @@ -6626,8 +6628,6 @@ typedef bool (*HPMHOOK_pre_quest_questinfo_validate_quests) (struct map_session_ typedef bool (*HPMHOOK_post_quest_questinfo_validate_quests) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); typedef bool (*HPMHOOK_pre_quest_questinfo_validate_mercenary_class) (struct map_session_data **sd, struct questinfo **qi); typedef bool (*HPMHOOK_post_quest_questinfo_validate_mercenary_class) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); -typedef void (*HPMHOOK_pre_quest_questinfo_vector_clear) (int *m); -typedef void (*HPMHOOK_post_quest_questinfo_vector_clear) (int m); #endif // MAP_QUEST_H #ifdef MAP_REFINE_H /* refine */ typedef int (*HPMHOOK_pre_refine_init) (bool *minimal); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 9c0b1905e..1044b7592 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4356,6 +4356,8 @@ struct { struct HPMHookPoint *HP_npc_db_checkid_post; struct HPMHookPoint *HP_npc_refresh_pre; struct HPMHookPoint *HP_npc_refresh_post; + struct HPMHookPoint *HP_npc_questinfo_clear_pre; + struct HPMHookPoint *HP_npc_questinfo_clear_post; struct HPMHookPoint *HP_npc_secure_timeout_timer_pre; struct HPMHookPoint *HP_npc_secure_timeout_timer_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; @@ -5136,8 +5138,6 @@ struct { struct HPMHookPoint *HP_quest_questinfo_validate_quests_post; struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_pre; struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_post; - struct HPMHookPoint *HP_quest_questinfo_vector_clear_pre; - struct HPMHookPoint *HP_quest_questinfo_vector_clear_post; struct HPMHookPoint *HP_refine_init_pre; struct HPMHookPoint *HP_refine_init_post; struct HPMHookPoint *HP_refine_final_pre; @@ -11137,6 +11137,8 @@ struct { int HP_npc_db_checkid_post; int HP_npc_refresh_pre; int HP_npc_refresh_post; + int HP_npc_questinfo_clear_pre; + int HP_npc_questinfo_clear_post; int HP_npc_secure_timeout_timer_pre; int HP_npc_secure_timeout_timer_post; int HP_nullpo_assert_report_pre; @@ -11917,8 +11919,6 @@ struct { int HP_quest_questinfo_validate_quests_post; int HP_quest_questinfo_validate_mercenary_class_pre; int HP_quest_questinfo_validate_mercenary_class_post; - int HP_quest_questinfo_vector_clear_pre; - int HP_quest_questinfo_vector_clear_post; int HP_refine_init_pre; int HP_refine_init_post; int HP_refine_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 6c0b6db36..a817b2023 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2230,6 +2230,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->barter_delfromsql_sub, HP_npc_barter_delfromsql_sub) }, { HP_POP(npc->db_checkid, HP_npc_db_checkid) }, { HP_POP(npc->refresh, HP_npc_refresh) }, + { HP_POP(npc->questinfo_clear, HP_npc_questinfo_clear) }, { HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, @@ -2629,7 +2630,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(quest->questinfo_validate_homunculus_type, HP_quest_questinfo_validate_homunculus_type) }, { HP_POP(quest->questinfo_validate_quests, HP_quest_questinfo_validate_quests) }, { HP_POP(quest->questinfo_validate_mercenary_class, HP_quest_questinfo_validate_mercenary_class) }, - { HP_POP(quest->questinfo_vector_clear, HP_quest_questinfo_vector_clear) }, /* refine_interface */ { HP_POP(refine->init, HP_refine_init) }, { HP_POP(refine->final, HP_refine_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 9cc986922..9636d67c7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -49379,31 +49379,32 @@ int HP_map_get_new_bonus_id(void) { } return retVal___; } -void HP_map_add_questinfo(int m, struct questinfo *qi) { +bool HP_map_add_questinfo(int m, struct npc_data *nd) { int hIndex = 0; + bool retVal___ = false; if (HPMHooks.count.HP_map_add_questinfo_pre > 0) { - void (*preHookFunc) (int *m, struct questinfo **qi); + bool (*preHookFunc) (int *m, struct npc_data **nd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_add_questinfo_pre[hIndex].func; - preHookFunc(&m, &qi); + retVal___ = preHookFunc(&m, &nd); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.map.add_questinfo(m, qi); + retVal___ = HPMHooks.source.map.add_questinfo(m, nd); } if (HPMHooks.count.HP_map_add_questinfo_post > 0) { - void (*postHookFunc) (int m, struct questinfo *qi); + bool (*postHookFunc) (bool retVal___, int m, struct npc_data *nd); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_add_questinfo_post[hIndex].func; - postHookFunc(m, qi); + retVal___ = postHookFunc(retVal___, m, nd); } } - return; + return retVal___; } bool HP_map_remove_questinfo(int m, struct npc_data *nd) { int hIndex = 0; @@ -57872,6 +57873,32 @@ void HP_npc_refresh(struct npc_data *nd) { } return; } +void HP_npc_questinfo_clear(struct npc_data *nd) { + int hIndex = 0; + if (HPMHooks.count.HP_npc_questinfo_clear_pre > 0) { + void (*preHookFunc) (struct npc_data **nd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_questinfo_clear_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_npc_questinfo_clear_pre[hIndex].func; + preHookFunc(&nd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc.questinfo_clear(nd); + } + if (HPMHooks.count.HP_npc_questinfo_clear_post > 0) { + void (*postHookFunc) (struct npc_data *nd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_questinfo_clear_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_npc_questinfo_clear_post[hIndex].func; + postHookFunc(nd); + } + } + return; +} int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) { int hIndex = 0; int retVal___ = 0; @@ -68395,32 +68422,6 @@ bool HP_quest_questinfo_validate_mercenary_class(struct map_session_data *sd, st } return retVal___; } -void HP_quest_questinfo_vector_clear(int m) { - int hIndex = 0; - if (HPMHooks.count.HP_quest_questinfo_vector_clear_pre > 0) { - void (*preHookFunc) (int *m); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_questinfo_vector_clear_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_quest_questinfo_vector_clear_pre[hIndex].func; - preHookFunc(&m); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.quest.questinfo_vector_clear(m); - } - if (HPMHooks.count.HP_quest_questinfo_vector_clear_post > 0) { - void (*postHookFunc) (int m); - for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_questinfo_vector_clear_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_quest_questinfo_vector_clear_post[hIndex].func; - postHookFunc(m); - } - } - return; -} /* refine_interface */ int HP_refine_init(bool minimal) { int hIndex = 0; |