From 7a56179426d488a351f05088d03ace75d6aca4f8 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sat, 14 Nov 2015 16:59:00 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 28 +++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 7 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 199 ++++++++++++++++++++- 3 files changed, 228 insertions(+), 6 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 258fc0512..c74cc8b7f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3593,6 +3593,10 @@ struct { struct HPMHookPoint *HP_npc_addsrcfile_post; struct HPMHookPoint *HP_npc_delsrcfile_pre; struct HPMHookPoint *HP_npc_delsrcfile_post; + struct HPMHookPoint *HP_npc_retainpathreference_pre; + struct HPMHookPoint *HP_npc_retainpathreference_post; + struct HPMHookPoint *HP_npc_releasepathreference_pre; + struct HPMHookPoint *HP_npc_releasepathreference_post; struct HPMHookPoint *HP_npc_parsename_pre; struct HPMHookPoint *HP_npc_parsename_post; struct HPMHookPoint *HP_npc_parseview_pre; @@ -3615,6 +3619,16 @@ struct { struct HPMHookPoint *HP_npc_skip_script_post; struct HPMHookPoint *HP_npc_parse_script_pre; struct HPMHookPoint *HP_npc_parse_script_post; + struct HPMHookPoint *HP_npc_add_to_location_pre; + struct HPMHookPoint *HP_npc_add_to_location_post; + struct HPMHookPoint *HP_npc_duplicate_script_sub_pre; + struct HPMHookPoint *HP_npc_duplicate_script_sub_post; + struct HPMHookPoint *HP_npc_duplicate_shop_sub_pre; + struct HPMHookPoint *HP_npc_duplicate_shop_sub_post; + struct HPMHookPoint *HP_npc_duplicate_warp_sub_pre; + struct HPMHookPoint *HP_npc_duplicate_warp_sub_post; + struct HPMHookPoint *HP_npc_duplicate_sub_pre; + struct HPMHookPoint *HP_npc_duplicate_sub_post; struct HPMHookPoint *HP_npc_parse_duplicate_pre; struct HPMHookPoint *HP_npc_parse_duplicate_post; struct HPMHookPoint *HP_npc_duplicate4instance_pre; @@ -9358,6 +9372,10 @@ struct { int HP_npc_addsrcfile_post; int HP_npc_delsrcfile_pre; int HP_npc_delsrcfile_post; + int HP_npc_retainpathreference_pre; + int HP_npc_retainpathreference_post; + int HP_npc_releasepathreference_pre; + int HP_npc_releasepathreference_post; int HP_npc_parsename_pre; int HP_npc_parsename_post; int HP_npc_parseview_pre; @@ -9380,6 +9398,16 @@ struct { int HP_npc_skip_script_post; int HP_npc_parse_script_pre; int HP_npc_parse_script_post; + int HP_npc_add_to_location_pre; + int HP_npc_add_to_location_post; + int HP_npc_duplicate_script_sub_pre; + int HP_npc_duplicate_script_sub_post; + int HP_npc_duplicate_shop_sub_pre; + int HP_npc_duplicate_shop_sub_post; + int HP_npc_duplicate_warp_sub_pre; + int HP_npc_duplicate_warp_sub_post; + int HP_npc_duplicate_sub_pre; + int HP_npc_duplicate_sub_post; int HP_npc_parse_duplicate_pre; int HP_npc_parse_duplicate_post; int HP_npc_duplicate4instance_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index f793c9505..a3f7f6b3e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1832,6 +1832,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->clearsrcfile, HP_npc_clearsrcfile) }, { HP_POP(npc->addsrcfile, HP_npc_addsrcfile) }, { HP_POP(npc->delsrcfile, HP_npc_delsrcfile) }, + { HP_POP(npc->retainpathreference, HP_npc_retainpathreference) }, + { HP_POP(npc->releasepathreference, HP_npc_releasepathreference) }, { HP_POP(npc->parsename, HP_npc_parsename) }, { HP_POP(npc->parseview, HP_npc_parseview) }, { HP_POP(npc->viewisid, HP_npc_viewisid) }, @@ -1843,6 +1845,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->convertlabel_db, HP_npc_convertlabel_db) }, { HP_POP(npc->skip_script, HP_npc_skip_script) }, { HP_POP(npc->parse_script, HP_npc_parse_script) }, + { HP_POP(npc->add_to_location, HP_npc_add_to_location) }, + { HP_POP(npc->duplicate_script_sub, HP_npc_duplicate_script_sub) }, + { HP_POP(npc->duplicate_shop_sub, HP_npc_duplicate_shop_sub) }, + { HP_POP(npc->duplicate_warp_sub, HP_npc_duplicate_warp_sub) }, + { HP_POP(npc->duplicate_sub, HP_npc_duplicate_sub) }, { HP_POP(npc->parse_duplicate, HP_npc_parse_duplicate) }, { HP_POP(npc->duplicate4instance, HP_npc_duplicate4instance) }, { HP_POP(npc->setcells, HP_npc_setcells) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index b0bc853b3..d6e4a85cc 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -48031,6 +48031,59 @@ void HP_npc_delsrcfile(const char *name) { } return; } +const char* HP_npc_retainpathreference(const char *filepath) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_npc_retainpathreference_pre ) { + const char* (*preHookFunc) (const char *filepath); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_retainpathreference_pre[hIndex].func; + retVal___ = preHookFunc(filepath); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.retainpathreference(filepath); + } + if( HPMHooks.count.HP_npc_retainpathreference_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *filepath); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_retainpathreference_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filepath); + } + } + return retVal___; +} +void HP_npc_releasepathreference(const char *filepath) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_releasepathreference_pre ) { + void (*preHookFunc) (const char *filepath); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_releasepathreference_pre[hIndex].func; + preHookFunc(filepath); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc.releasepathreference(filepath); + } + if( HPMHooks.count.HP_npc_releasepathreference_post ) { + void (*postHookFunc) (const char *filepath); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_releasepathreference_post[hIndex].func; + postHookFunc(filepath); + } + } + return; +} void HP_npc_parsename(struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath) { int hIndex = 0; if( HPMHooks.count.HP_npc_parsename_pre ) { @@ -48111,15 +48164,15 @@ bool HP_npc_viewisid(const char *viewid) { } return retVal___; } -struct npc_data* HP_npc_create_npc(int m, int x, int y) { +struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_) { int hIndex = 0; struct npc_data* retVal___ = NULL; if( HPMHooks.count.HP_npc_create_npc_pre ) { - struct npc_data* (*preHookFunc) (int *m, int *x, int *y); + struct npc_data* (*preHookFunc) (enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_npc_create_npc_pre[hIndex].func; - retVal___ = preHookFunc(&m, &x, &y); + retVal___ = preHookFunc(&subtype, &m, &x, &y, &dir, &class_); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -48127,13 +48180,13 @@ struct npc_data* HP_npc_create_npc(int m, int x, int y) { } } { - retVal___ = HPMHooks.source.npc.create_npc(m, x, y); + retVal___ = HPMHooks.source.npc.create_npc(subtype, m, x, y, dir, class_); } if( HPMHooks.count.HP_npc_create_npc_post ) { - struct npc_data* (*postHookFunc) (struct npc_data* retVal___, int *m, int *x, int *y); + struct npc_data* (*postHookFunc) (struct npc_data* retVal___, enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_); for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_npc_create_npc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, &m, &x, &y); + retVal___ = postHookFunc(retVal___, &subtype, &m, &x, &y, &dir, &class_); } } return retVal___; @@ -48326,6 +48379,140 @@ const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const ch } return retVal___; } +void HP_npc_add_to_location(struct npc_data *nd) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_add_to_location_pre ) { + void (*preHookFunc) (struct npc_data *nd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_add_to_location_pre[hIndex].func; + preHookFunc(nd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc.add_to_location(nd); + } + if( HPMHooks.count.HP_npc_add_to_location_post ) { + void (*postHookFunc) (struct npc_data *nd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_add_to_location_post[hIndex].func; + postHookFunc(nd); + } + } + return; +} +bool HP_npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_npc_duplicate_script_sub_pre ) { + bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_duplicate_script_sub_pre[hIndex].func; + retVal___ = preHookFunc(nd, snd, &xs, &ys, &options); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.duplicate_script_sub(nd, snd, xs, ys, options); + } + if( HPMHooks.count.HP_npc_duplicate_script_sub_post ) { + bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_duplicate_script_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options); + } + } + return retVal___; +} +bool HP_npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_npc_duplicate_shop_sub_pre ) { + bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_duplicate_shop_sub_pre[hIndex].func; + retVal___ = preHookFunc(nd, snd, &xs, &ys, &options); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.duplicate_shop_sub(nd, snd, xs, ys, options); + } + if( HPMHooks.count.HP_npc_duplicate_shop_sub_post ) { + bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_duplicate_shop_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options); + } + } + return retVal___; +} +bool HP_npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_npc_duplicate_warp_sub_pre ) { + bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_duplicate_warp_sub_pre[hIndex].func; + retVal___ = preHookFunc(nd, snd, &xs, &ys, &options); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.duplicate_warp_sub(nd, snd, xs, ys, options); + } + if( HPMHooks.count.HP_npc_duplicate_warp_sub_post ) { + bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_duplicate_warp_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options); + } + } + return retVal___; +} +bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_npc_duplicate_sub_pre ) { + bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_duplicate_sub_pre[hIndex].func; + retVal___ = preHookFunc(nd, snd, &xs, &ys, &options); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.duplicate_sub(nd, snd, xs, ys, options); + } + if( HPMHooks.count.HP_npc_duplicate_sub_post ) { + bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_duplicate_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options); + } + } + return retVal___; +} const char* HP_npc_parse_duplicate(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { int hIndex = 0; const char* retVal___ = NULL; -- cgit v1.2.3-60-g2f50