diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-28 20:54:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-12 21:18:07 +0300 |
commit | 8303cb08c04564feb16993be4491c4904bd5b071 (patch) | |
tree | ae1913b2200ce2e656c9ec572f380f271819c0d8 | |
parent | b0143067c797a502ffe2cf122fa8e364a0634571 (diff) | |
download | hercules-8303cb08c04564feb16993be4491c4904bd5b071.tar.gz hercules-8303cb08c04564feb16993be4491c4904bd5b071.tar.bz2 hercules-8303cb08c04564feb16993be4491c4904bd5b071.tar.xz hercules-8303cb08c04564feb16993be4491c4904bd5b071.zip |
Update HPM
-rw-r--r-- | src/common/HPMDataCheck.h | 41 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 2 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 59 |
5 files changed, 96 insertions, 22 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index e24ec04b8..0e9be9b60 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -344,21 +344,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #define LOGIN_LCLIF_H #endif // LOGIN_LCLIF_H #ifdef LOGIN_LCLIF_P_H - { "PACKET_AC_ACCEPT_LOGIN", sizeof(struct PACKET_AC_ACCEPT_LOGIN), SERVER_TYPE_LOGIN }, - { "PACKET_AC_REFUSE_LOGIN", sizeof(struct PACKET_AC_REFUSE_LOGIN), SERVER_TYPE_LOGIN }, - { "PACKET_AC_REFUSE_LOGIN_R2", sizeof(struct PACKET_AC_REFUSE_LOGIN_R2), SERVER_TYPE_LOGIN }, - { "PACKET_CA_CHARSERVERCONNECT", sizeof(struct PACKET_CA_CHARSERVERCONNECT), SERVER_TYPE_LOGIN }, - { "PACKET_CA_CONNECT_INFO_CHANGED", sizeof(struct PACKET_CA_CONNECT_INFO_CHANGED), SERVER_TYPE_LOGIN }, - { "PACKET_CA_EXE_HASHCHECK", sizeof(struct PACKET_CA_EXE_HASHCHECK), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN", sizeof(struct PACKET_CA_LOGIN), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN2", sizeof(struct PACKET_CA_LOGIN2), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN3", sizeof(struct PACKET_CA_LOGIN3), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN4", sizeof(struct PACKET_CA_LOGIN4), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN_HAN", sizeof(struct PACKET_CA_LOGIN_HAN), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN_OTP", sizeof(struct PACKET_CA_LOGIN_OTP), SERVER_TYPE_LOGIN }, - { "PACKET_CA_LOGIN_PCBANG", sizeof(struct PACKET_CA_LOGIN_PCBANG), SERVER_TYPE_LOGIN }, - { "PACKET_CA_SSO_LOGIN_REQ", sizeof(struct PACKET_CA_SSO_LOGIN_REQ), SERVER_TYPE_LOGIN }, - { "PACKET_SC_NOTIFY_BAN", sizeof(struct PACKET_SC_NOTIFY_BAN), SERVER_TYPE_LOGIN }, { "lclif_interface_dbs", sizeof(struct lclif_interface_dbs), SERVER_TYPE_LOGIN }, { "lclif_interface_private", sizeof(struct lclif_interface_private), SERVER_TYPE_LOGIN }, #else @@ -383,6 +368,29 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #else #define LOGIN_LOGIN_H #endif // LOGIN_LOGIN_H + #ifdef LOGIN_PACKETS_AC_STRUCT_H + { "PACKET_AC_ACCEPT_LOGIN", sizeof(struct PACKET_AC_ACCEPT_LOGIN), SERVER_TYPE_LOGIN }, + { "PACKET_AC_REFUSE_LOGIN", sizeof(struct PACKET_AC_REFUSE_LOGIN), SERVER_TYPE_LOGIN }, + { "PACKET_AC_REFUSE_LOGIN_R2", sizeof(struct PACKET_AC_REFUSE_LOGIN_R2), SERVER_TYPE_LOGIN }, + { "PACKET_SC_NOTIFY_BAN", sizeof(struct PACKET_SC_NOTIFY_BAN), SERVER_TYPE_LOGIN }, + #else + #define LOGIN_PACKETS_AC_STRUCT_H + #endif // LOGIN_PACKETS_AC_STRUCT_H + #ifdef LOGIN_PACKETS_CA_STRUCT_H + { "PACKET_CA_CHARSERVERCONNECT", sizeof(struct PACKET_CA_CHARSERVERCONNECT), SERVER_TYPE_LOGIN }, + { "PACKET_CA_CONNECT_INFO_CHANGED", sizeof(struct PACKET_CA_CONNECT_INFO_CHANGED), SERVER_TYPE_LOGIN }, + { "PACKET_CA_EXE_HASHCHECK", sizeof(struct PACKET_CA_EXE_HASHCHECK), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN", sizeof(struct PACKET_CA_LOGIN), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN2", sizeof(struct PACKET_CA_LOGIN2), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN3", sizeof(struct PACKET_CA_LOGIN3), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN4", sizeof(struct PACKET_CA_LOGIN4), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN_HAN", sizeof(struct PACKET_CA_LOGIN_HAN), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN_OTP", sizeof(struct PACKET_CA_LOGIN_OTP), SERVER_TYPE_LOGIN }, + { "PACKET_CA_LOGIN_PCBANG", sizeof(struct PACKET_CA_LOGIN_PCBANG), SERVER_TYPE_LOGIN }, + { "PACKET_CA_SSO_LOGIN_REQ", sizeof(struct PACKET_CA_SSO_LOGIN_REQ), SERVER_TYPE_LOGIN }, + #else + #define LOGIN_PACKETS_CA_STRUCT_H + #endif // LOGIN_PACKETS_CA_STRUCT_H #ifdef MAP_ACHIEVEMENT_H { "achievement_data", sizeof(struct achievement_data), SERVER_TYPE_MAP }, { "achievement_interface", sizeof(struct achievement_interface), SERVER_TYPE_MAP }, @@ -665,8 +673,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_ZC_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ADD_ITEM_TO_STORE", sizeof(struct PACKET_ZC_ADD_ITEM_TO_STORE), SERVER_TYPE_MAP }, { "PACKET_ZC_ADD_MEMBER_TO_GROUP", sizeof(struct PACKET_ZC_ADD_MEMBER_TO_GROUP), SERVER_TYPE_MAP }, - { "PACKET_ZC_AUTOSPELLLIST1", sizeof(struct PACKET_ZC_AUTOSPELLLIST1), SERVER_TYPE_MAP }, - { "PACKET_ZC_AUTOSPELLLIST2", sizeof(struct PACKET_ZC_AUTOSPELLLIST2), SERVER_TYPE_MAP }, + { "PACKET_ZC_AUTOSPELLLIST", sizeof(struct PACKET_ZC_AUTOSPELLLIST), SERVER_TYPE_MAP }, { "PACKET_ZC_CAMERA_INFO", sizeof(struct PACKET_ZC_CAMERA_INFO), SERVER_TYPE_MAP }, { "PACKET_ZC_CASH_ITEM_DELETE", sizeof(struct PACKET_ZC_CASH_ITEM_DELETE), SERVER_TYPE_MAP }, { "PACKET_ZC_CASH_TIME_COUNTER", sizeof(struct PACKET_ZC_CASH_TIME_COUNTER), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index eb81ed693..9b913331a 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1572,6 +1572,8 @@ typedef void (*HPMHOOK_pre_clif_messagecolor_self) (int *fd, uint32 *color, cons typedef void (*HPMHOOK_post_clif_messagecolor_self) (int fd, uint32 color, const char *msg); typedef void (*HPMHOOK_pre_clif_messagecolor) (struct block_list **bl, uint32 *color, const char **msg); typedef void (*HPMHOOK_post_clif_messagecolor) (struct block_list *bl, uint32 color, const char *msg); +typedef void (*HPMHOOK_pre_clif_serviceMessageColor) (struct map_session_data **sd, uint32 *color, const char **msg); +typedef void (*HPMHOOK_post_clif_serviceMessageColor) (struct map_session_data *sd, uint32 color, const char *msg); typedef void (*HPMHOOK_pre_clif_disp_overhead) (struct block_list **bl, const char **mes, enum send_target *target, struct block_list **target_bl); typedef void (*HPMHOOK_post_clif_disp_overhead) (struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl); typedef void (*HPMHOOK_pre_clif_notify_playerchat) (struct block_list **bl, const char **mes); @@ -2006,8 +2008,8 @@ typedef void (*HPMHOOK_pre_clif_npc_market_purchase_ack) (struct map_session_dat typedef void (*HPMHOOK_post_clif_npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response); typedef bool (*HPMHOOK_pre_clif_parse_roulette_db) (void); typedef bool (*HPMHOOK_post_clif_parse_roulette_db) (bool retVal___); -typedef void (*HPMHOOK_pre_clif_roulette_generate_ack) (struct map_session_data **sd, unsigned char *result, short *stage, short *prizeIdx, int *bonusItemID); -typedef void (*HPMHOOK_post_clif_roulette_generate_ack) (struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, int bonusItemID); +typedef void (*HPMHOOK_pre_clif_roulette_generate_ack) (struct map_session_data **sd, enum GENERATE_ROULETTE_ACK *result, short *stage, short *prizeIdx, int *bonusItemID); +typedef void (*HPMHOOK_post_clif_roulette_generate_ack) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID); typedef void (*HPMHOOK_pre_clif_openmergeitem) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_openmergeitem) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_cancelmergeitem) (int *fd, struct map_session_data **sd); @@ -2632,6 +2634,8 @@ typedef void (*HPMHOOK_pre_clif_camera_change) (struct map_session_data **sd, fl typedef void (*HPMHOOK_post_clif_camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target); typedef void (*HPMHOOK_pre_clif_item_preview) (struct map_session_data **sd, int *n); typedef void (*HPMHOOK_post_clif_item_preview) (struct map_session_data *sd, int n); +typedef bool (*HPMHOOK_pre_clif_enchant_equipment) (struct map_session_data **sd, enum equip_pos *pos, int *cardSlot, int *cardId); +typedef bool (*HPMHOOK_post_clif_enchant_equipment) (bool retVal___, struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 4b0054b28..1a45e836c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1164,6 +1164,8 @@ struct { struct HPMHookPoint *HP_clif_messagecolor_self_post; struct HPMHookPoint *HP_clif_messagecolor_pre; struct HPMHookPoint *HP_clif_messagecolor_post; + struct HPMHookPoint *HP_clif_serviceMessageColor_pre; + struct HPMHookPoint *HP_clif_serviceMessageColor_post; struct HPMHookPoint *HP_clif_disp_overhead_pre; struct HPMHookPoint *HP_clif_disp_overhead_post; struct HPMHookPoint *HP_clif_notify_playerchat_pre; @@ -2224,6 +2226,8 @@ struct { struct HPMHookPoint *HP_clif_camera_change_post; struct HPMHookPoint *HP_clif_item_preview_pre; struct HPMHookPoint *HP_clif_item_preview_post; + struct HPMHookPoint *HP_clif_enchant_equipment_pre; + struct HPMHookPoint *HP_clif_enchant_equipment_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -7785,6 +7789,8 @@ struct { int HP_clif_messagecolor_self_post; int HP_clif_messagecolor_pre; int HP_clif_messagecolor_post; + int HP_clif_serviceMessageColor_pre; + int HP_clif_serviceMessageColor_post; int HP_clif_disp_overhead_pre; int HP_clif_disp_overhead_post; int HP_clif_notify_playerchat_pre; @@ -8845,6 +8851,8 @@ struct { int HP_clif_camera_change_post; int HP_clif_item_preview_pre; int HP_clif_item_preview_post; + int HP_clif_enchant_equipment_pre; + int HP_clif_enchant_equipment_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 a900af716..2e7b73cf7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -606,6 +606,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->broadcast2, HP_clif_broadcast2) }, { HP_POP(clif->messagecolor_self, HP_clif_messagecolor_self) }, { HP_POP(clif->messagecolor, HP_clif_messagecolor) }, + { HP_POP(clif->serviceMessageColor, HP_clif_serviceMessageColor) }, { HP_POP(clif->disp_overhead, HP_clif_disp_overhead) }, { HP_POP(clif->notify_playerchat, HP_clif_notify_playerchat) }, { HP_POP(clif->msgtable, HP_clif_msgtable) }, @@ -1136,6 +1137,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->camera_showWindow, HP_clif_camera_showWindow) }, { HP_POP(clif->camera_change, HP_clif_camera_change) }, { HP_POP(clif->item_preview, HP_clif_item_preview) }, + { HP_POP(clif->enchant_equipment, HP_clif_enchant_equipment) }, /* cmdline_interface */ { 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 af1f11fe2..2306d72aa 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -15184,6 +15184,32 @@ void HP_clif_messagecolor(struct block_list *bl, uint32 color, const char *msg) } return; } +void HP_clif_serviceMessageColor(struct map_session_data *sd, uint32 color, const char *msg) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_serviceMessageColor_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, uint32 *color, const char **msg); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_serviceMessageColor_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_serviceMessageColor_pre[hIndex].func; + preHookFunc(&sd, &color, &msg); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.serviceMessageColor(sd, color, msg); + } + if (HPMHooks.count.HP_clif_serviceMessageColor_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, uint32 color, const char *msg); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_serviceMessageColor_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_serviceMessageColor_post[hIndex].func; + postHookFunc(sd, color, msg); + } + } + return; +} void HP_clif_disp_overhead(struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl) { int hIndex = 0; if (HPMHooks.count.HP_clif_disp_overhead_pre > 0) { @@ -20841,10 +20867,10 @@ bool HP_clif_parse_roulette_db(void) { } return retVal___; } -void HP_clif_roulette_generate_ack(struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, int bonusItemID) { +void HP_clif_roulette_generate_ack(struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID) { int hIndex = 0; if (HPMHooks.count.HP_clif_roulette_generate_ack_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, unsigned char *result, short *stage, short *prizeIdx, int *bonusItemID); + void (*preHookFunc) (struct map_session_data **sd, enum GENERATE_ROULETTE_ACK *result, short *stage, short *prizeIdx, int *bonusItemID); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_generate_ack_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_roulette_generate_ack_pre[hIndex].func; @@ -20859,7 +20885,7 @@ void HP_clif_roulette_generate_ack(struct map_session_data *sd, unsigned char re HPMHooks.source.clif.roulette_generate_ack(sd, result, stage, prizeIdx, bonusItemID); } if (HPMHooks.count.HP_clif_roulette_generate_ack_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, int bonusItemID); + void (*postHookFunc) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_generate_ack_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_roulette_generate_ack_post[hIndex].func; postHookFunc(sd, result, stage, prizeIdx, bonusItemID); @@ -28991,6 +29017,33 @@ void HP_clif_item_preview(struct map_session_data *sd, int n) { } return; } +bool HP_clif_enchant_equipment(struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_clif_enchant_equipment_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, enum equip_pos *pos, int *cardSlot, int *cardId); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_enchant_equipment_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_enchant_equipment_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &pos, &cardSlot, &cardId); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.enchant_equipment(sd, pos, cardSlot, cardId); + } + if (HPMHooks.count.HP_clif_enchant_equipment_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_enchant_equipment_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_enchant_equipment_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, pos, cardSlot, cardId); + } + } + return retVal___; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; |