diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-28 23:35:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-28 23:35:36 +0300 |
commit | 147b4a940387abb9cb5e0f1c13124168036968d7 (patch) | |
tree | aa86b138217b034c12cd5ee32e69f8359d27b78b /src/plugins | |
parent | 674092152236dca6784081e5e93540069b54549e (diff) | |
download | hercules-147b4a940387abb9cb5e0f1c13124168036968d7.tar.gz hercules-147b4a940387abb9cb5e0f1c13124168036968d7.tar.bz2 hercules-147b4a940387abb9cb5e0f1c13124168036968d7.tar.xz hercules-147b4a940387abb9cb5e0f1c13124168036968d7.zip |
Update HPM hooks.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 27 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index e1a98e510..6e98d1aad 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3301,6 +3301,8 @@ struct { struct HPMHookPoint *HP_npc_parseview_post; struct HPMHookPoint *HP_npc_viewisid_pre; struct HPMHookPoint *HP_npc_viewisid_post; + struct HPMHookPoint *HP_npc_create_npc_pre; + struct HPMHookPoint *HP_npc_create_npc_post; struct HPMHookPoint *HP_npc_add_warp_pre; struct HPMHookPoint *HP_npc_add_warp_post; struct HPMHookPoint *HP_npc_parse_warp_pre; @@ -8364,6 +8366,8 @@ struct { int HP_npc_parseview_post; int HP_npc_viewisid_pre; int HP_npc_viewisid_post; + int HP_npc_create_npc_pre; + int HP_npc_create_npc_post; int HP_npc_add_warp_pre; int HP_npc_add_warp_post; int HP_npc_parse_warp_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index f33f9868b..aec67b694 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1677,6 +1677,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->parsename, HP_npc_parsename) }, { HP_POP(npc->parseview, HP_npc_parseview) }, { HP_POP(npc->viewisid, HP_npc_viewisid) }, + { HP_POP(npc->create_npc, HP_npc_create_npc) }, { HP_POP(npc->add_warp, HP_npc_add_warp) }, { HP_POP(npc->parse_warp, HP_npc_parse_warp) }, { HP_POP(npc->parse_shop, HP_npc_parse_shop) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 6822d68e8..2e1c95573 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -44115,6 +44115,33 @@ bool HP_npc_viewisid(const char *viewid) { } return retVal___; } +struct npc_data* HP_npc_create_npc(int m, int x, int y) { + 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); + *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); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.create_npc(m, x, y); + } + if( HPMHooks.count.HP_npc_create_npc_post ) { + struct npc_data* (*postHookFunc) (struct npc_data* retVal___, int *m, int *x, int *y); + 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); + } + } + return retVal___; +} struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y) { int hIndex = 0; struct npc_data* retVal___ = NULL; |