diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-08-09 06:47:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-08-21 22:36:41 +0300 |
commit | bf4abf934cb74f0e55a10cc9943d469072c2a8c9 (patch) | |
tree | b9f8ac2ff52c7ee05b2d3b9060c4ee07e7d9b38c /src/map/packets_struct.h | |
parent | af9ee21c486c3099f4811e63f8c6d91d509a1034 (diff) | |
download | hercules-bf4abf934cb74f0e55a10cc9943d469072c2a8c9.tar.gz hercules-bf4abf934cb74f0e55a10cc9943d469072c2a8c9.tar.bz2 hercules-bf4abf934cb74f0e55a10cc9943d469072c2a8c9.tar.xz hercules-bf4abf934cb74f0e55a10cc9943d469072c2a8c9.zip |
Add new version for packet ZC_NPC_MARKET_PURCHASE_RESULT
Also add enum for result field in packet ZC_NPC_MARKET_PURCHASE_RESULT
Diffstat (limited to 'src/map/packets_struct.h')
-rw-r--r-- | src/map/packets_struct.h | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index b40064abf..c1203b26d 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -300,7 +300,6 @@ enum packet_headers { notifybindonequip = 0x2d3, monsterhpType = 0x977, maptypeproperty2Type = 0x99b, - npcmarketresultackType = 0x9d7, #if PACKETVER >= 20131223 // version probably can be 20131030 [4144] wisendType = 0x9df, #else @@ -1362,22 +1361,6 @@ struct packet_npc_market_purchase { } list[]; // Note: We assume this should be <= MAX_INVENTORY (since you can't hold more than MAX_INVENTORY items thus cant buy that many at once). } __attribute__((packed)); -struct packet_npc_market_result_ack { - int16 PacketType; - int16 PacketLength; - uint8 result; - struct { -#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 - uint32 ITID; -#else - uint16 ITID; -#endif - uint16 qty; - uint32 price; - // [4144] need remove MAX_INVENTORY from here - } list[MAX_INVENTORY];/* assuming MAX_INVENTORY is max since you can't hold more than MAX_INVENTORY items thus cant buy that many at once. */ -} __attribute__((packed)); - #if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20131106 || defined(PACKETVER_ZERO) /* inner struct figured by Ind after some annoying hour of debugging (data Thanks to Yommy) */ struct PACKET_ZC_NPC_MARKET_OPEN_sub { @@ -3602,6 +3585,34 @@ struct PACKET_ZC_SKILLINFO_UPDATE2 { DEFINE_PACKET_HEADER(ZC_SKILLINFO_UPDATE2, 0x07e1); #endif +struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub { +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 ITID; +#else + uint16 ITID; +#endif + uint16 qty; + uint32 price; +} __attribute__((packed)); + +#if PACKETVER_MAIN_NUM >= 20190807 || PACKETVER_RE_NUM >= 20190807 +struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT { + int16 PacketType; + int16 PacketLength; + uint16 result; + struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NPC_MARKET_PURCHASE_RESULT, 0x0b4e); +#elif PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20130911 || defined(PACKETVER_ZERO) +struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT { + int16 PacketType; + int16 PacketLength; + uint8 result; + struct PACKET_ZC_NPC_MARKET_PURCHASE_RESULT_sub list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NPC_MARKET_PURCHASE_RESULT, 0x09d7); +#endif + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris |