diff options
author | Hercules.ws <Hercules@efficiently.awesome> | 2013-10-26 06:11:42 +0200 |
---|---|---|
committer | HerculesWSAPI <Hercules@efficiently.awesome> | 2013-10-26 06:11:42 +0200 |
commit | d39918017d4416add066fb78ab7f23cb4436c614 (patch) | |
tree | 7294d9d0e2bb8f829a7a4453207825eed5b61a9d /src/plugins | |
parent | 1ab0017183e910271f4590beee37530fa3ce8ba0 (diff) | |
download | hercules-d39918017d4416add066fb78ab7f23cb4436c614.tar.gz hercules-d39918017d4416add066fb78ab7f23cb4436c614.tar.bz2 hercules-d39918017d4416add066fb78ab7f23cb4436c614.tar.xz hercules-d39918017d4416add066fb78ab7f23cb4436c614.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 2 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 51 |
3 files changed, 61 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 8d5449b4b..f6d566bc5 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -2859,6 +2859,10 @@ struct { struct HPMHookPoint *HP_map_delblcell_post; struct HPMHookPoint *HP_map_get_new_bonus_id_pre; struct HPMHookPoint *HP_map_get_new_bonus_id_post; + struct HPMHookPoint *HP_map_add_questinfo_pre; + struct HPMHookPoint *HP_map_add_questinfo_post; + struct HPMHookPoint *HP_map_remove_questinfo_pre; + struct HPMHookPoint *HP_map_remove_questinfo_post; struct HPMHookPoint *HP_mapit_alloc_pre; struct HPMHookPoint *HP_mapit_alloc_post; struct HPMHookPoint *HP_mapit_free_pre; @@ -7750,6 +7754,10 @@ struct { int HP_map_delblcell_post; int HP_map_get_new_bonus_id_pre; int HP_map_get_new_bonus_id_post; + int HP_map_add_questinfo_pre; + int HP_map_add_questinfo_post; + int HP_map_remove_questinfo_pre; + int HP_map_remove_questinfo_post; int HP_mapit_alloc_pre; int HP_mapit_alloc_post; int HP_mapit_free_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index 4db9e28f2..e8568d5f3 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -1451,6 +1451,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->addblcell, HP_map_addblcell) }, { HP_POP(map->delblcell, HP_map_delblcell) }, { HP_POP(map->get_new_bonus_id, HP_map_get_new_bonus_id) }, + { HP_POP(map->add_questinfo, HP_map_add_questinfo) }, + { HP_POP(map->remove_questinfo, HP_map_remove_questinfo) }, /* mapit */ { HP_POP(mapit->alloc, HP_mapit_alloc) }, { HP_POP(mapit->free, HP_mapit_free) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 67a3ae731..5e3c63a27 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -36638,6 +36638,57 @@ int HP_map_get_new_bonus_id(void) { } return retVal___; } +void HP_map_add_questinfo(int m, struct questinfo *qi) { + int hIndex = 0; + if( HPMHooks.count.HP_map_add_questinfo_pre ) { + void (*preHookFunc) (int *m, struct questinfo *qi); + 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); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.map.add_questinfo(m, qi); + } + if( HPMHooks.count.HP_map_add_questinfo_post ) { + void (*postHookFunc) (int *m, struct questinfo *qi); + 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); + } + } + return; +} +bool HP_map_remove_questinfo(int m, struct npc_data *nd) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_map_remove_questinfo_pre ) { + bool (*preHookFunc) (int *m, struct npc_data *nd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_remove_questinfo_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_remove_questinfo_pre[hIndex].func; + retVal___ = preHookFunc(&m, nd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.map.remove_questinfo(m, nd); + } + if( HPMHooks.count.HP_map_remove_questinfo_post ) { + bool (*postHookFunc) (bool retVal___, int *m, struct npc_data *nd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_remove_questinfo_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_remove_questinfo_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &m, nd); + } + } + return retVal___; +} /* mapit */ struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types) { int hIndex = 0; |