From 488a874c136192e48e24afee710e7381b7cd5bd6 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Wed, 8 Jul 2015 03:44:39 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 16 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 4 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 105 +++++++++++++++++++++ 3 files changed, 125 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 09f33bff6..e35a4c81c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1345,6 +1345,14 @@ struct { struct HPMHookPoint *HP_clif_parse_roulette_db_post; struct HPMHookPoint *HP_clif_roulette_generate_ack_pre; struct HPMHookPoint *HP_clif_roulette_generate_ack_post; + struct HPMHookPoint *HP_clif_openmergeitem_pre; + struct HPMHookPoint *HP_clif_openmergeitem_post; + struct HPMHookPoint *HP_clif_cancelmergeitem_pre; + struct HPMHookPoint *HP_clif_cancelmergeitem_post; + struct HPMHookPoint *HP_clif_comparemergeitem_pre; + struct HPMHookPoint *HP_clif_comparemergeitem_post; + struct HPMHookPoint *HP_clif_ackmergeitems_pre; + struct HPMHookPoint *HP_clif_ackmergeitems_post; struct HPMHookPoint *HP_clif_pWantToConnection_pre; struct HPMHookPoint *HP_clif_pWantToConnection_post; struct HPMHookPoint *HP_clif_pLoadEndAck_pre; @@ -6552,6 +6560,14 @@ struct { int HP_clif_parse_roulette_db_post; int HP_clif_roulette_generate_ack_pre; int HP_clif_roulette_generate_ack_post; + int HP_clif_openmergeitem_pre; + int HP_clif_openmergeitem_post; + int HP_clif_cancelmergeitem_pre; + int HP_clif_cancelmergeitem_post; + int HP_clif_comparemergeitem_pre; + int HP_clif_comparemergeitem_post; + int HP_clif_ackmergeitems_pre; + int HP_clif_ackmergeitems_post; int HP_clif_pWantToConnection_pre; int HP_clif_pWantToConnection_post; int HP_clif_pLoadEndAck_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 8c1456412..6501c0943 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -683,6 +683,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->npc_market_purchase_ack, HP_clif_npc_market_purchase_ack) }, { HP_POP(clif->parse_roulette_db, HP_clif_parse_roulette_db) }, { HP_POP(clif->roulette_generate_ack, HP_clif_roulette_generate_ack) }, + { HP_POP(clif->openmergeitem, HP_clif_openmergeitem) }, + { HP_POP(clif->cancelmergeitem, HP_clif_cancelmergeitem) }, + { HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) }, + { HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) }, { HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) }, { HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) }, { HP_POP(clif->pTickSend, HP_clif_pTickSend) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index c623747aa..04f31aea5 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -17751,6 +17751,111 @@ void HP_clif_roulette_generate_ack(struct map_session_data *sd, unsigned char re } return; } +void HP_clif_openmergeitem(int fd, struct map_session_data *sd) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_openmergeitem_pre ) { + void (*preHookFunc) (int *fd, struct map_session_data *sd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openmergeitem_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_openmergeitem_pre[hIndex].func; + preHookFunc(&fd, sd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.openmergeitem(fd, sd); + } + if( HPMHooks.count.HP_clif_openmergeitem_post ) { + void (*postHookFunc) (int *fd, struct map_session_data *sd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openmergeitem_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_openmergeitem_post[hIndex].func; + postHookFunc(&fd, sd); + } + } + return; +} +void HP_clif_cancelmergeitem(int fd, struct map_session_data *sd) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_cancelmergeitem_pre ) { + void (*preHookFunc) (int *fd, struct map_session_data *sd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cancelmergeitem_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_cancelmergeitem_pre[hIndex].func; + preHookFunc(&fd, sd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.cancelmergeitem(fd, sd); + } + if( HPMHooks.count.HP_clif_cancelmergeitem_post ) { + void (*postHookFunc) (int *fd, struct map_session_data *sd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cancelmergeitem_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_cancelmergeitem_post[hIndex].func; + postHookFunc(&fd, sd); + } + } + return; +} +int HP_clif_comparemergeitem(const void *a, const void *b) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_clif_comparemergeitem_pre ) { + int (*preHookFunc) (const void *a, const void *b); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_comparemergeitem_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_comparemergeitem_pre[hIndex].func; + retVal___ = preHookFunc(a, b); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.comparemergeitem(a, b); + } + if( HPMHooks.count.HP_clif_comparemergeitem_post ) { + int (*postHookFunc) (int retVal___, const void *a, const void *b); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_comparemergeitem_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_comparemergeitem_post[hIndex].func; + retVal___ = postHookFunc(retVal___, a, b); + } + } + return retVal___; +} +void HP_clif_ackmergeitems(int fd, struct map_session_data *sd) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_ackmergeitems_pre ) { + void (*preHookFunc) (int *fd, struct map_session_data *sd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ackmergeitems_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_ackmergeitems_pre[hIndex].func; + preHookFunc(&fd, sd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ackmergeitems(fd, sd); + } + if( HPMHooks.count.HP_clif_ackmergeitems_post ) { + void (*postHookFunc) (int *fd, struct map_session_data *sd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ackmergeitems_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_ackmergeitems_post[hIndex].func; + postHookFunc(&fd, sd); + } + } + return; +} void HP_clif_pWantToConnection(int fd, struct map_session_data *sd) { int hIndex = 0; if( HPMHooks.count.HP_clif_pWantToConnection_pre ) { -- cgit v1.2.3-70-g09d2