diff options
author | Hercules.ws <dev@herc.ws> | 2018-04-08 19:59:17 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2018-04-08 19:59:17 +0200 |
commit | dd6655709ea9f61cec8229d98fe9e4a9bc31bf14 (patch) | |
tree | faeddfa34d92eca176033b6a558ab29edf2f5994 /src/plugins/HPMHooking | |
parent | 86ca30e4d6140479f66d8d9f75d3f8157b561815 (diff) | |
download | hercules-dd6655709ea9f61cec8229d98fe9e4a9bc31bf14.tar.gz hercules-dd6655709ea9f61cec8229d98fe9e4a9bc31bf14.tar.bz2 hercules-dd6655709ea9f61cec8229d98fe9e4a9bc31bf14.tar.xz hercules-dd6655709ea9f61cec8229d98fe9e4a9bc31bf14.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins/HPMHooking')
4 files changed, 67 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 4bd77f588..0fd459a63 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4906,6 +4906,10 @@ typedef int (*HPMHOOK_pre_mob_db_searchname) (const char **str); typedef int (*HPMHOOK_post_mob_db_searchname) (int retVal___, const char *str); typedef int (*HPMHOOK_pre_mob_db_searchname_array_sub) (struct mob_db **monster, const char **str, int *flag); typedef int (*HPMHOOK_post_mob_db_searchname_array_sub) (int retVal___, struct mob_db *monster, const char *str, int flag); +typedef void (*HPMHOOK_pre_mob_mvptomb_spawn_delayed) (struct npc_data **nd); +typedef void (*HPMHOOK_post_mob_mvptomb_spawn_delayed) (struct npc_data *nd); +typedef int (*HPMHOOK_pre_mob_mvptomb_delayspawn) (int *tid, int64 *tick, int *id, intptr_t *data); +typedef int (*HPMHOOK_post_mob_mvptomb_delayspawn) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_mob_mvptomb_create) (struct mob_data **md, char **killer, time_t *time); typedef void (*HPMHOOK_post_mob_mvptomb_create) (struct mob_data *md, char *killer, time_t time); typedef void (*HPMHOOK_pre_mob_mvptomb_destroy) (struct mob_data **md); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index c01f8000c..b037cbcd6 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3576,6 +3576,10 @@ struct { struct HPMHookPoint *HP_mob_db_searchname_post; struct HPMHookPoint *HP_mob_db_searchname_array_sub_pre; struct HPMHookPoint *HP_mob_db_searchname_array_sub_post; + struct HPMHookPoint *HP_mob_mvptomb_spawn_delayed_pre; + struct HPMHookPoint *HP_mob_mvptomb_spawn_delayed_post; + struct HPMHookPoint *HP_mob_mvptomb_delayspawn_pre; + struct HPMHookPoint *HP_mob_mvptomb_delayspawn_post; struct HPMHookPoint *HP_mob_mvptomb_create_pre; struct HPMHookPoint *HP_mob_mvptomb_create_post; struct HPMHookPoint *HP_mob_mvptomb_destroy_pre; @@ -9891,6 +9895,10 @@ struct { int HP_mob_db_searchname_post; int HP_mob_db_searchname_array_sub_pre; int HP_mob_db_searchname_array_sub_post; + int HP_mob_mvptomb_spawn_delayed_pre; + int HP_mob_mvptomb_spawn_delayed_post; + int HP_mob_mvptomb_delayspawn_pre; + int HP_mob_mvptomb_delayspawn_post; int HP_mob_mvptomb_create_pre; int HP_mob_mvptomb_create_post; int HP_mob_mvptomb_destroy_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 2e762a231..45658360d 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1836,6 +1836,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->skill_id2skill_idx, HP_mob_skill_id2skill_idx) }, { HP_POP(mob->db_searchname, HP_mob_db_searchname) }, { HP_POP(mob->db_searchname_array_sub, HP_mob_db_searchname_array_sub) }, + { HP_POP(mob->mvptomb_spawn_delayed, HP_mob_mvptomb_spawn_delayed) }, + { HP_POP(mob->mvptomb_delayspawn, HP_mob_mvptomb_delayspawn) }, { HP_POP(mob->mvptomb_create, HP_mob_mvptomb_create) }, { HP_POP(mob->mvptomb_destroy, HP_mob_mvptomb_destroy) }, { HP_POP(mob->db_searchname_array, HP_mob_db_searchname_array) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 6b89e4f65..9a844cb92 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -47346,6 +47346,59 @@ int HP_mob_db_searchname_array_sub(struct mob_db *monster, const char *str, int } return retVal___; } +void HP_mob_mvptomb_spawn_delayed(struct npc_data *nd) { + int hIndex = 0; + if (HPMHooks.count.HP_mob_mvptomb_spawn_delayed_pre > 0) { + void (*preHookFunc) (struct npc_data **nd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_spawn_delayed_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_mvptomb_spawn_delayed_pre[hIndex].func; + preHookFunc(&nd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.mvptomb_spawn_delayed(nd); + } + if (HPMHooks.count.HP_mob_mvptomb_spawn_delayed_post > 0) { + void (*postHookFunc) (struct npc_data *nd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_spawn_delayed_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_mvptomb_spawn_delayed_post[hIndex].func; + postHookFunc(nd); + } + } + return; +} +int HP_mob_mvptomb_delayspawn(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_mob_mvptomb_delayspawn_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_delayspawn_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_mvptomb_delayspawn_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mob.mvptomb_delayspawn(tid, tick, id, data); + } + if (HPMHooks.count.HP_mob_mvptomb_delayspawn_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_delayspawn_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_mvptomb_delayspawn_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} void HP_mob_mvptomb_create(struct mob_data *md, char *killer, time_t time) { int hIndex = 0; if (HPMHooks.count.HP_mob_mvptomb_create_pre > 0) { |