diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-08 21:26:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-12 01:03:21 +0300 |
commit | cc21e11ed548e79a0f26516abe2cfb19045fc323 (patch) | |
tree | 3ec5318eb5b2a6923cadbb8db4678bba4258ea3b /src/plugins/HPMHooking | |
parent | fcffa6cafb701073995107748aaab9d6adb97224 (diff) | |
download | hercules-cc21e11ed548e79a0f26516abe2cfb19045fc323.tar.gz hercules-cc21e11ed548e79a0f26516abe2cfb19045fc323.tar.bz2 hercules-cc21e11ed548e79a0f26516abe2cfb19045fc323.tar.xz hercules-cc21e11ed548e79a0f26516abe2cfb19045fc323.zip |
Update HPM hooks.
Diffstat (limited to 'src/plugins/HPMHooking')
4 files changed, 49 insertions, 16 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index c020d3130..6b88ddf43 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1396,8 +1396,8 @@ typedef void (*HPMHOOK_pre_clif_buyvending) (struct map_session_data **sd, int * typedef void (*HPMHOOK_post_clif_buyvending) (struct map_session_data *sd, int index, int amount, int fail); typedef void (*HPMHOOK_pre_clif_openvending) (struct map_session_data **sd, int *id, struct s_vending **vending_list); typedef void (*HPMHOOK_post_clif_openvending) (struct map_session_data *sd, int id, struct s_vending *vending_list); -typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount); -typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount); +typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); +typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); typedef void (*HPMHOOK_pre_clif_storagelist) (struct map_session_data **sd, struct item **items, int *items_length); typedef void (*HPMHOOK_post_clif_storagelist) (struct map_session_data *sd, struct item *items, int items_length); typedef void (*HPMHOOK_pre_clif_updatestorageamount) (struct map_session_data **sd, int *amount, int *max_amount); @@ -1684,8 +1684,8 @@ typedef void (*HPMHOOK_pre_clif_buyingstore_itemlist) (struct map_session_data * typedef void (*HPMHOOK_post_clif_buyingstore_itemlist) (struct map_session_data *sd, struct map_session_data *pl_sd); typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_buyer) (struct map_session_data **sd, short *result); typedef void (*HPMHOOK_post_clif_buyingstore_trade_failed_buyer) (struct map_session_data *sd, short result); -typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount); -typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount); +typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny); +typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); typedef void (*HPMHOOK_pre_clif_buyingstore_delete_item) (struct map_session_data **sd, short *index, unsigned short *amount, int *price); typedef void (*HPMHOOK_post_clif_buyingstore_delete_item) (struct map_session_data *sd, short index, unsigned short amount, int price); typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_seller) (struct map_session_data **sd, short *result, unsigned short *nameid); @@ -1764,6 +1764,8 @@ typedef void (*HPMHOOK_pre_clif_ackmergeitems) (int *fd, struct map_session_data typedef void (*HPMHOOK_post_clif_ackmergeitems) (int fd, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_clif_isdisguised) (struct block_list **bl); typedef bool (*HPMHOOK_post_clif_isdisguised) (bool retVal___, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_navigate_to) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); +typedef void (*HPMHOOK_post_clif_navigate_to) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); typedef unsigned char (*HPMHOOK_pre_clif_bl_type) (struct block_list **bl); typedef unsigned char (*HPMHOOK_post_clif_bl_type) (unsigned char retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_pWantToConnection) (int *fd, struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index c0b0fa9f6..d71ecc52f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1402,6 +1402,8 @@ struct { struct HPMHookPoint *HP_clif_ackmergeitems_post; struct HPMHookPoint *HP_clif_isdisguised_pre; struct HPMHookPoint *HP_clif_isdisguised_post; + struct HPMHookPoint *HP_clif_navigate_to_pre; + struct HPMHookPoint *HP_clif_navigate_to_post; struct HPMHookPoint *HP_clif_bl_type_pre; struct HPMHookPoint *HP_clif_bl_type_post; struct HPMHookPoint *HP_clif_pWantToConnection_pre; @@ -7463,6 +7465,8 @@ struct { int HP_clif_ackmergeitems_post; int HP_clif_isdisguised_pre; int HP_clif_isdisguised_post; + int HP_clif_navigate_to_pre; + int HP_clif_navigate_to_post; int HP_clif_bl_type_pre; int HP_clif_bl_type_post; int HP_clif_pWantToConnection_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 9f05884a4..b6ee443a3 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -723,6 +723,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) }, { HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) }, { HP_POP(clif->isdisguised, HP_clif_isdisguised) }, + { HP_POP(clif->navigate_to, HP_clif_navigate_to) }, { HP_POP(clif->bl_type, HP_clif_bl_type) }, { HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) }, { HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index b1bc0ce34..0c81e557f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -13447,14 +13447,14 @@ void HP_clif_openvending(struct map_session_data *sd, int id, struct s_vending * } return; } -void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) { +void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny) { int hIndex = 0; if( HPMHooks.count.HP_clif_vendingreport_pre ) { - void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount); + void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_vendingreport_pre[hIndex].func; - preHookFunc(&sd, &index, &amount); + preHookFunc(&sd, &index, &amount, &char_id, &zeny); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -13462,13 +13462,13 @@ void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) { } } { - HPMHooks.source.clif.vendingreport(sd, index, amount); + HPMHooks.source.clif.vendingreport(sd, index, amount, char_id, zeny); } if( HPMHooks.count.HP_clif_vendingreport_post ) { - void (*postHookFunc) (struct map_session_data *sd, int index, int amount); + void (*postHookFunc) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_vendingreport_post[hIndex].func; - postHookFunc(sd, index, amount); + postHookFunc(sd, index, amount, char_id, zeny); } } return; @@ -17200,14 +17200,14 @@ void HP_clif_buyingstore_trade_failed_buyer(struct map_session_data *sd, short r } return; } -void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount) { +void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) { int hIndex = 0; if( HPMHooks.count.HP_clif_buyingstore_update_item_pre ) { - void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount); + void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_pre[hIndex].func; - preHookFunc(&sd, &nameid, &amount); + preHookFunc(&sd, &nameid, &amount, &char_id, &zeny); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -17215,13 +17215,13 @@ void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short } } { - HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount); + HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount, char_id, zeny); } if( HPMHooks.count.HP_clif_buyingstore_update_item_post ) { - void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount); + void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_post[hIndex].func; - postHookFunc(sd, nameid, amount); + postHookFunc(sd, nameid, amount, char_id, zeny); } } return; @@ -18246,6 +18246,32 @@ bool HP_clif_isdisguised(struct block_list *bl) { } return retVal___; } +void HP_clif_navigate_to(struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_navigate_to_pre ) { + void (*preHookFunc) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_navigate_to_pre[hIndex].func; + preHookFunc(&sd, &mapname, &x, &y, &flag, &hideWindow, &mob_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.navigate_to(sd, mapname, x, y, flag, hideWindow, mob_id); + } + if( HPMHooks.count.HP_clif_navigate_to_post ) { + void (*postHookFunc) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_navigate_to_post[hIndex].func; + postHookFunc(sd, mapname, x, y, flag, hideWindow, mob_id); + } + } + return; +} unsigned char HP_clif_bl_type(struct block_list *bl) { int hIndex = 0; unsigned char retVal___ = 0; |