Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheraf committed May 6, 2019
1 parent abe4b83 commit a321a26
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 46 deletions.
6 changes: 3 additions & 3 deletions src/common/HPMDataCheck.h
Expand Up @@ -571,9 +571,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "mapcell", sizeof(struct mapcell), SERVER_TYPE_MAP },
{ "mapflag_skill_adjust", sizeof(struct mapflag_skill_adjust), SERVER_TYPE_MAP },
{ "mapit_interface", sizeof(struct mapit_interface), SERVER_TYPE_MAP },
{ "questinfo", sizeof(struct questinfo), SERVER_TYPE_MAP },
{ "questinfo_itemreq", sizeof(struct questinfo_itemreq), SERVER_TYPE_MAP },
{ "questinfo_qreq", sizeof(struct questinfo_qreq), SERVER_TYPE_MAP },
{ "spawn_data", sizeof(struct spawn_data), SERVER_TYPE_MAP },
#else
#define MAP_MAP_H
Expand Down Expand Up @@ -889,6 +886,9 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "quest_dropitem", sizeof(struct quest_dropitem), SERVER_TYPE_MAP },
{ "quest_interface", sizeof(struct quest_interface), SERVER_TYPE_MAP },
{ "quest_objective", sizeof(struct quest_objective), SERVER_TYPE_MAP },
{ "questinfo", sizeof(struct questinfo), SERVER_TYPE_MAP },
{ "questinfo_itemreq", sizeof(struct questinfo_itemreq), SERVER_TYPE_MAP },
{ "questinfo_qreq", sizeof(struct questinfo_qreq), SERVER_TYPE_MAP },
#else
#define MAP_QUEST_H
#endif // MAP_QUEST_H
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Expand Up @@ -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) },
Expand Down Expand Up @@ -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) },
Expand Down
69 changes: 35 additions & 34 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a321a26

Please sign in to comment.