From a540af6966eda71caca8b9767c968d00281dde5e Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Mon, 17 Aug 2015 01:04:44 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) (limited to 'src/plugins/HPMHooking') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 28892e84d..c37a8d663 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1813,6 +1813,8 @@ struct { struct HPMHookPoint *HP_clif_pNPCMarketClosed_post; struct HPMHookPoint *HP_clif_pNPCMarketPurchase_pre; struct HPMHookPoint *HP_clif_pNPCMarketPurchase_post; + struct HPMHookPoint *HP_clif_add_random_options_pre; + struct HPMHookPoint *HP_clif_add_random_options_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -7522,6 +7524,8 @@ struct { int HP_clif_pNPCMarketClosed_post; int HP_clif_pNPCMarketPurchase_pre; int HP_clif_pNPCMarketPurchase_post; + int HP_clif_add_random_options_pre; + int HP_clif_add_random_options_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index cc96d3171..03127500d 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -918,6 +918,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pNPCShopClosed, HP_clif_pNPCShopClosed) }, { HP_POP(clif->pNPCMarketClosed, HP_clif_pNPCMarketClosed) }, { HP_POP(clif->pNPCMarketPurchase, HP_clif_pNPCMarketPurchase) }, + { HP_POP(clif->add_random_options, HP_clif_add_random_options) }, /* cmdline */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index bc2235b02..2ecbf425c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -23839,6 +23839,32 @@ void HP_clif_pNPCMarketPurchase(int fd, struct map_session_data *sd) { } return; } +void HP_clif_add_random_options(unsigned char *buf, struct item *item) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_add_random_options_pre ) { + void (*preHookFunc) (unsigned char *buf, struct item *item); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_add_random_options_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_add_random_options_pre[hIndex].func; + preHookFunc(buf, item); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.add_random_options(buf, item); + } + if( HPMHooks.count.HP_clif_add_random_options_post ) { + void (*postHookFunc) (unsigned char *buf, struct item *item); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_add_random_options_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_add_random_options_post[hIndex].func; + postHookFunc(buf, item); + } + } + return; +} /* cmdline */ void HP_cmdline_init(void) { int hIndex = 0; -- cgit v1.2.3-60-g2f50