diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 91e1208c43..3c4ef4609f 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -2771,7 +2771,7 @@ void clif_additem( struct map_session_data *sd, int n, int amount, unsigned char return; } - struct packet_additem p; + struct PACKET_ZC_ITEM_PICKUP_ACK p; if( fail ){ p = {}; @@ -2808,7 +2808,7 @@ void clif_additem( struct map_session_data *sd, int n, int amount, unsigned char #endif } - p.PacketType = additemType; + p.PacketType = HEADER_ZC_ITEM_PICKUP_ACK; p.Index = client_index( n ); p.count = amount; p.result = fail; @@ -4690,7 +4690,7 @@ void clif_tradeadditem( struct map_session_data* sd, struct map_session_data* ts clif_add_random_options( p.option_data, &sd->inventory.u.items_inventory[index] ); #if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 p.location = pc_equippoint_sub( sd, sd->inventory_data[index] ); - p.viewSprite = sd->inventory_data[index]->look; + p.look = sd->inventory_data[index]->look; p.enchantgrade = sd->inventory.u.items_inventory[index].enchantgrade; #endif #endif @@ -4698,7 +4698,7 @@ void clif_tradeadditem( struct map_session_data* sd, struct map_session_data* ts p = {}; } - p.packetType = tradeaddType; + p.packetType = HEADER_ZC_ADD_EXCHANGE_ITEM; p.amount = amount; clif_send( &p, sizeof( p ), &tsd->bl, SELF ); @@ -4822,7 +4822,7 @@ void clif_storageitemadded( struct map_session_data* sd, struct item* i, int ind struct PACKET_ZC_ADD_ITEM_TO_STORE p; - p.packetType = storageaddType; // Storage item added + p.packetType = HEADER_ZC_ADD_ITEM_TO_STORE; // Storage item added p.index = client_storage_index( index ); // index p.amount = amount; // amount p.itemId = client_nameid( i->nameid ); // id @@ -7133,7 +7133,7 @@ void clif_item_repair_list( struct map_session_data *sd,struct map_session_data return; } - int len = MAX_INVENTORY * sizeof( struct PACKET_ZC_REPAIRITEMLIST_sub ) + sizeof( struct PACKET_ZC_REPAIRITEMLIST ); + int len = MAX_INVENTORY * sizeof( struct REPAIRITEM_INFO ) + sizeof( struct PACKET_ZC_REPAIRITEMLIST ); // Preallocate the maximum size WFIFOHEAD( fd, len ); @@ -7153,10 +7153,10 @@ void clif_item_repair_list( struct map_session_data *sd,struct map_session_data } if( c > 0 ){ - p->packetType = 0x1fc; + p->packetType = HEADER_ZC_REPAIRITEMLIST; // Recalculate real length - len = c * sizeof( struct PACKET_ZC_REPAIRITEMLIST_sub ) + sizeof( struct PACKET_ZC_REPAIRITEMLIST ); + len = c * sizeof( struct REPAIRITEM_INFO ) + sizeof( struct PACKET_ZC_REPAIRITEMLIST ); p->packetLength = len; WFIFOSET( fd, len ); @@ -7293,7 +7293,7 @@ void clif_cart_additem( struct map_session_data *sd, int n, int amount ){ struct PACKET_ZC_ADD_ITEM_TO_CART p; - p.packetType = cartaddType; + p.packetType = HEADER_ZC_ADD_ITEM_TO_CART; p.index = client_index( n ); p.amount = amount; p.itemId = client_nameid( sd->cart.u.items_cart[n].nameid ); @@ -10400,7 +10400,7 @@ void clif_viewequip_ack( struct map_session_data* sd, struct map_session_data* t nullpo_retv( sd ); nullpo_retv( tsd ); - struct packet_viewequip_ack packet; + struct PACKET_ZC_EQUIPWIN_MICROSCOPE packet; int equip = 0; for( int i = 0; i < EQI_MAX; i++ ){ @@ -10423,8 +10423,8 @@ void clif_viewequip_ack( struct map_session_data* sd, struct map_session_data* t } } - packet.PacketType = viewequipackType; - packet.PacketLength = ( sizeof( packet ) - sizeof( packet.list ) ) + ( sizeof( struct EQUIPITEM_INFO ) * equip ); + packet.PacketType = HEADER_ZC_EQUIPWIN_MICROSCOPE; + packet.PacketLength = sizeof( packet ) + sizeof( struct EQUIPITEM_INFO ) * equip; safestrncpy( packet.characterName, tsd->status.name, NAME_LENGTH ); @@ -13230,7 +13230,12 @@ void clif_parse_Cooking(int fd,struct map_session_data *sd) { /// 01fd W (CZ_REQ_ITEMREPAIR) /// 01fd .W .W .B .W .W .W .W ??? void clif_parse_RepairItem( int fd, struct map_session_data *sd ){ - const struct PACKET_CZ_REQ_ITEMREPAIR *p = (struct PACKET_CZ_REQ_ITEMREPAIR *)RFIFOP( fd, 0 ); +// Hercules has wrong date -> use correct one here +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 + const struct PACKET_CZ_REQ_ITEMREPAIR2 *p = (struct PACKET_CZ_REQ_ITEMREPAIR2 *)RFIFOP( fd, 0 ); +#else + const struct PACKET_CZ_REQ_ITEMREPAIR1 *p = (struct PACKET_CZ_REQ_ITEMREPAIR1 *)RFIFOP( fd, 0 ); +#endif if (sd->menuskill_id != BS_REPAIRWEAPON) return; @@ -13240,7 +13245,7 @@ void clif_parse_RepairItem( int fd, struct map_session_data *sd ){ clif_menuskill_clear(sd); return; } - skill_repairweapon( sd, p->index ); + skill_repairweapon( sd, p->item.index ); clif_menuskill_clear(sd); } @@ -15723,7 +15728,7 @@ void clif_Mail_setattachment( struct map_session_data* sd, int index, int amount WFIFOB(fd,4) = flag; WFIFOSET(fd,packet_len(0x255)); #else - struct PACKET_ZC_ADD_ITEM_TO_MAIL p; + struct PACKET_ZC_ACK_ADD_ITEM_RODEX p; if( flag ){ memset( &p, 0, sizeof( p ) ); @@ -15755,7 +15760,7 @@ void clif_Mail_setattachment( struct map_session_data* sd, int index, int amount #endif } - p.PacketType = rodexadditem; + p.PacketType = HEADER_ZC_ACK_ADD_ITEM_RODEX; p.result = flag; clif_send( &p, sizeof( p ), &sd->bl, SELF ); @@ -16227,29 +16232,24 @@ void clif_Mail_read( struct map_session_data *sd, int mail_id ){ #else msg_len += 1; // Zero Termination - int length = sizeof( struct PACKET_ZC_READ_MAIL ) + MAIL_BODY_LENGTH + sizeof( struct mail_item ) * MAIL_MAX_ITEM; - WFIFOHEAD( fd, length ); - struct PACKET_ZC_READ_MAIL *p = (struct PACKET_ZC_READ_MAIL *)WFIFOP( fd, 0 ); + struct PACKET_ZC_ACK_READ_RODEX *p = (struct PACKET_ZC_ACK_READ_RODEX *)packet_buffer; - p->PacketType = rodexread; - p->PacketLength = length; + p->PacketType = HEADER_ZC_ACK_READ_RODEX; + p->PacketLength = sizeof( struct PACKET_ZC_ACK_READ_RODEX ); p->opentype = msg->type; p->MailID = msg->id; p->TextcontentsLength = msg_len; p->zeny = msg->zeny; - int offset = sizeof( struct PACKET_ZC_READ_MAIL ); + safestrncpy( WBUFCP( p, p->PacketLength ), msg->body, msg_len ); + p->PacketLength += p->TextcontentsLength; - safestrncpy( WFIFOCP( fd, offset ), msg->body, msg_len ); - - offset += msg_len; - - int count = 0; + p->ItemCnt = 0; for( int j = 0; j < MAIL_MAX_ITEM; j++ ){ item = &msg->item[j]; if( item->nameid > 0 && item->amount > 0 && ( data = itemdb_exists( item->nameid ) ) != NULL ){ - struct mail_item* mailitem = (struct mail_item *)WFIFOP( fd, offset ); + struct PACKET_ZC_ACK_READ_RODEX_SUB* mailitem = (struct PACKET_ZC_ACK_READ_RODEX_SUB*)WBUFP( p, p->PacketLength ); mailitem->ITID = client_nameid( item->nameid ); mailitem->count = item->amount; @@ -16261,20 +16261,17 @@ void clif_Mail_read( struct map_session_data *sd, int mail_id ){ mailitem->viewSprite = data->look; mailitem->bindOnEquip = item->bound ? 2 : data->flag.bindOnEquip ? 1 : 0; clif_addcards( &mailitem->slot, item ); - clif_add_random_options( mailitem->optionData, item ); + clif_add_random_options( mailitem->option_data, item ); #if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 mailitem->enchantgrade = item->enchantgrade; #endif - offset += sizeof( struct mail_item ); - count++; + p->PacketLength += sizeof( *mailitem ); + p->ItemCnt++; } } - p->ItemCnt = count; - p->PacketLength = sizeof( struct PACKET_ZC_READ_MAIL ) + p->TextcontentsLength + sizeof( struct mail_item ) * p->ItemCnt; - - WFIFOSET( fd, p->PacketLength ); + clif_send( p, p->PacketLength, &sd->bl, SELF ); #endif if (msg->status == MAIL_UNREAD) { @@ -16353,7 +16350,7 @@ void clif_parse_Mail_cancelwrite( int fd, struct map_session_data *sd ){ void clif_Mail_Receiver_Ack( struct map_session_data* sd, uint32 char_id, short class_, uint32 level, const char* name ){ PACKET_ZC_CHECKNAME p = { 0 }; - p.PacketType = rodexcheckplayer; + p.PacketType = HEADER_ZC_CHECKNAME; p.CharId = char_id; p.Class = class_; p.BaseLevel = level; diff --git a/src/map/clif_packetdb.hpp b/src/map/clif_packetdb.hpp index d27a386880..fbc8ed89ef 100644 --- a/src/map/clif_packetdb.hpp +++ b/src/map/clif_packetdb.hpp @@ -70,7 +70,6 @@ packet( HEADER_ZC_ITEM_ENTRY, sizeof( struct PACKET_ZC_ITEM_ENTRY ) ); packet(0x009e,17); parseable_packet(0x009f,6,clif_parse_TakeItem,2); - packet( additemType, sizeof( struct packet_additem ) ); packet(0x00a1,6); parseable_packet(0x00a2,6,clif_parse_DropItem,2,4); packet( inventorylistnormalType, -1 ); @@ -143,7 +142,6 @@ parseable_packet(0x00e6,3,clif_parse_TradeAck,2); packet(0x00e7,3); parseable_packet(0x00e8,8,clif_parse_TradeAddItem,2,4); - packet( tradeaddType, sizeof( struct PACKET_ZC_ADD_EXCHANGE_ITEM ) ); packet(0x00ea,5); parseable_packet(0x00eb,2,clif_parse_TradeOk,0); packet(0x00ec,3); @@ -154,7 +152,6 @@ packet(0x00f1,2); packet(0x00f2,6); parseable_packet(0x00f3,8,clif_parse_MoveToKafra,2,4); - packet( storageaddType, sizeof( struct PACKET_ZC_ADD_ITEM_TO_STORE ) ); parseable_packet(0x00f5,8,clif_parse_MoveFromKafra,2,4); packet(0x00f6,8); parseable_packet(0x00f7,2,clif_parse_CloseKafra,0); @@ -202,7 +199,6 @@ packet(0x0121,14); packet( cartlistequipType, -1 ); packet( cartlistnormalType, -1 ); - packet( cartaddType, sizeof( struct PACKET_ZC_ADD_ITEM_TO_CART ) ); packet(0x0125,8); parseable_packet(0x0126,8,clif_parse_PutItemToCart,2,4); parseable_packet(0x0127,8,clif_parse_GetItemFromCart,2,4); @@ -414,7 +410,7 @@ packet(0x01fa,48); packet(0x01fb,56); packet(0x01fc,-1); - parseable_packet( HEADER_CZ_REQ_ITEMREPAIR, sizeof( struct PACKET_CZ_REQ_ITEMREPAIR ), clif_parse_RepairItem, 0 ); + parseable_packet( HEADER_CZ_REQ_ITEMREPAIR1, sizeof( struct PACKET_CZ_REQ_ITEMREPAIR1 ), clif_parse_RepairItem, 0 ); packet(0x01fe,5); packet(0x01ff,10); packet(0x0200,26); @@ -1104,7 +1100,6 @@ ack_packet(ZC_NOTIFY_BIND_ON_EQUIP,0x02d3,4,2); packet(0x02d5,2); parseable_packet(0x02d6,6,clif_parse_ViewPlayerEquip,2); - packet( viewequipackType, -1 ); parseable_packet(0x02d8,10,clif_parse_configuration,2,6); packet(0x02d9,10); packet(0x02da,3); @@ -2221,7 +2216,6 @@ parseable_packet(0x09E8,11,clif_parse_Mail_refreshinbox,2,3); // CZ_OPEN_MAILBOX parseable_packet(0x09E9,2,clif_parse_dull,0); // CZ_CLOSE_MAILBOX parseable_packet(0x09EA,11,clif_parse_Mail_read,2,3); // CZ_REQ_READ_MAIL - packet(rodexread,-1); // ZC_ACK_READ_MAIL parseable_packet(0x09EC,-1,clif_parse_Mail_send,2,4,28,52,60,62,64); // CZ_REQ_WRITE_MAIL packet(0x09ED,3); // ZC_ACK_WRITE_MAIL parseable_packet(0x09EE,11,clif_parse_Mail_refreshinbox,2,3); // CZ_REQ_NEXT_MAIL_LIST @@ -2235,7 +2229,6 @@ packet(0x09F6,11); // ZC_ACK_DELETE_MAIL parseable_packet(0x0A03,2,clif_parse_Mail_cancelwrite,0); // CZ_REQ_CANCEL_WRITE_MAIL parseable_packet(0x0A04,6,clif_parse_Mail_setattach,2,4); // CZ_REQ_ADD_ITEM_TO_MAIL - packet( rodexadditem, sizeof( struct PACKET_ZC_ADD_ITEM_TO_MAIL ) ); // ZC_ACK_ADD_ITEM_TO_MAIL parseable_packet(0x0A06,6,clif_parse_Mail_winopen,2,4); // CZ_REQ_REMOVE_ITEM_MAIL packet(0x0A07,9); // ZC_ACK_REMOVE_ITEM_MAIL parseable_packet(0x0A08,26,clif_parse_Mail_beginwrite,0); // CZ_REQ_OPEN_WRITE_MAIL @@ -2438,6 +2431,7 @@ #if PACKETVER >= 20191224 parseable_packet( HEADER_CZ_SE_CASHSHOP_OPEN2, sizeof( struct PACKET_CZ_SE_CASHSHOP_OPEN2 ), clif_parse_cashshop_open_request, 0 ); + parseable_packet( HEADER_CZ_REQ_ITEMREPAIR2, sizeof( struct PACKET_CZ_REQ_ITEMREPAIR2 ), clif_parse_RepairItem, 0 ); #endif #if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 diff --git a/src/map/packets.hpp b/src/map/packets.hpp index 1a0ef40d92..e291cb90e8 100644 --- a/src/map/packets.hpp +++ b/src/map/packets.hpp @@ -23,6 +23,7 @@ #define MAX_ACHIEVEMENT_DB MAX_ACHIEVEMENT_OBJECTIVES #define DEFINE_PACKET_HEADER(name, id) const int16 HEADER_##name = id; +#define DEFINE_PACKET_ID(name, id) DEFINE_PACKET_HEADER(name, id) #include "packets_struct.hpp" @@ -256,17 +257,7 @@ DEFINE_PACKET_HEADER(ZC_ACK_WEAPONREFINE, 0x223) DEFINE_PACKET_HEADER(CZ_REQ_MAKINGITEM, 0x25b) DEFINE_PACKET_HEADER(ZC_CASH_TIME_COUNTER, 0x298) DEFINE_PACKET_HEADER(ZC_CASH_ITEM_DELETE, 0x299) -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_PARTY, 0xb67) -#else - DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_PARTY, 0x2b8) -#endif DEFINE_PACKET_HEADER(ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER, 0x824) -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - DEFINE_PACKET_HEADER(ZC_SEARCH_STORE_INFO_ACK, 0xb64) -#else - DEFINE_PACKET_HEADER(ZC_SEARCH_STORE_INFO_ACK, 0x836) -#endif DEFINE_PACKET_HEADER(CZ_SSILIST_ITEM_CLICK, 0x83c) DEFINE_PACKET_HEADER(ZC_ENTRY_QUEUE_INIT, 0x90e); DEFINE_PACKET_HEADER(CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO, 0x9ac) diff --git a/src/map/packets_struct.hpp b/src/map/packets_struct.hpp index 6a68c0fe9d..3b0671cb15 100644 --- a/src/map/packets_struct.hpp +++ b/src/map/packets_struct.hpp @@ -17,48 +17,6 @@ enum packet_headers { banking_checkType = 0x9a6, cart_additem_ackType = 0x12c, sc_notickType = 0x196, -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - cartaddType = 0xb45, -#elif PACKETVER >= 20150226 - cartaddType = 0xa0b, -#elif PACKETVER >= 5 - cartaddType = 0x1c5, -#else - cartaddType = 0x124, -#endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - storageaddType = 0xb44, -#elif PACKETVER >= 20150226 - storageaddType = 0xa0a, -#elif PACKETVER >= 5 - storageaddType = 0x1c4, -#else - storageaddType = 0xf4, -#endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - tradeaddType = 0xb42, -#elif PACKETVER >= 20150226 - tradeaddType = 0xa09, -#elif PACKETVER >= 20100223 - tradeaddType = 0x80f, -#else - tradeaddType = 0x0e9, -#endif -#if PACKETVER < 20061218 - additemType = 0x0a0, -#elif PACKETVER < 20071002 - additemType = 0x29a, -#elif PACKETVER < 20120925 - additemType = 0x2d4, -#elif PACKETVER < 20150226 - additemType = 0x990, -#elif PACKETVER < 20160921 - additemType = 0xa0c, -#elif PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - additemType = 0xb41, -#else - additemType = 0xa37, -#endif #if PACKETVER < 4 idle_unitType = 0x78, #elif PACKETVER < 7 @@ -121,7 +79,7 @@ enum packet_headers { authokType = 0x73, #elif PACKETVER < 20141022 authokType = 0x2eb, - // Some clients smaller than 20160330 cant be tested [4144] +// Some clients smaller than 20160330 cant be tested [4144] #elif PACKETVER < 20160330 authokType = 0xa18, #else @@ -187,9 +145,9 @@ enum packet_headers { #else inventorylistnormalType = 0xa3, #endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 inventorylistequipType = 0xb39, -#elif PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 +#elif PACKETVER_MAIN_NUM >= 20181002 || PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 inventorylistequipType = 0xb0a, #elif PACKETVER >= 20150226 inventorylistequipType = 0xa0d, @@ -213,9 +171,9 @@ enum packet_headers { #else storageListNormalType = 0xa5, #endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 storageListEquipType = 0xb39, -#elif PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 +#elif PACKETVER_MAIN_NUM >= 20181002 || PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 storageListEquipType = 0xb0a, #elif PACKETVER >= 20150226 storageListEquipType = 0xa10, @@ -239,9 +197,9 @@ enum packet_headers { #else cartlistnormalType = 0x123, #endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 cartlistequipType = 0xb39, -#elif PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 +#elif PACKETVER_MAIN_NUM >= 20181002 || PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 cartlistequipType = 0xb0a, #elif PACKETVER >= 20150226 cartlistequipType = 0xa0f, @@ -256,16 +214,10 @@ enum packet_headers { #endif #if PACKETVER < 20100105 vendinglistType = 0x133, -#elif PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - vendinglistType = 0xb3d, #else vendinglistType = 0x800, #endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - openvendingType = 0xb40, -#else openvendingType = 0x136, -#endif #if PACKETVER >= 20120925 equipitemType = 0x998, #else @@ -280,22 +232,6 @@ enum packet_headers { unequipitemackType = 0x99a, #else unequipitemackType = 0xac, -#endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - viewequipackType = 0xb37, -#elif PACKETVER_MAIN_NUM >= 20180801 || PACKETVER_RE_NUM >= 20180801 || PACKETVER_ZERO_NUM >= 20180808 - viewequipackType = 0xb03, -#elif PACKETVER >= 20150226 - viewequipackType = 0xa2d, -#elif PACKETVER >= 20120925 - viewequipackType = 0x997, - // [4144] not supported due other packets/structs not updated - //#elif (PACKETVER_MAIN_NUM >= 20111207) || (PACKETVER_RE_NUM >= 20111122) - // viewequipackType = 0x906, -#elif PACKETVER >= 20101124 - viewequipackType = 0x859, -#else - viewequipackType = 0x2d7, #endif notifybindonequip = 0x2d3, monsterhpType = 0x977, @@ -325,21 +261,11 @@ enum packet_headers { #endif // PACKETVER >= 20141022 /* Rodex */ rodexicon = 0x09E7, -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - rodexread = 0x0B63, -#else - rodexread = 0x09EB, -#endif rodexwriteresult = 0x09ED, rodexnextpage = 0x09F0, rodexgetzeny = 0x09F2, rodexgetitem = 0x09F4, rodexdelete = 0x09F6, -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - rodexadditem = 0x0B3f, -#else - rodexadditem = 0x0A05, -#endif rodexremoveitem = 0x0A07, rodexopenwrite = 0x0A12, #if PACKETVER < 20160601 @@ -349,11 +275,6 @@ enum packet_headers { #else // PACKETVER >= 20170419 rodexmailList = 0x0Ac2, #endif -#if PACKETVER < 20160316 - rodexcheckplayer = 0x0A14, -#else // PACKETVER >= 20160316 - rodexcheckplayer = 0x0A51, -#endif #if PACKETVER >= 20151223 skillscale = 0xA41, #endif @@ -437,6 +358,23 @@ enum packet_headers { #endif }; +// TODO add here packets structs +DEFINE_PACKET_ID(ZC_PAR_CHANGE1, 0x00b0); +DEFINE_PACKET_ID(ZC_STATUS_CHANGE, 0x00be); +DEFINE_PACKET_ID(ZC_NOTIFY_CARTITEM_COUNTINFO, 0x0121); +DEFINE_PACKET_ID(ZC_ATTACK_RANGE, 0x013a); +DEFINE_PACKET_ID(ZC_COUPLESTATUS, 0x0141); + +#if PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO) +DEFINE_PACKET_ID(ZC_LONGPAR_CHANGE, 0x0acb); +#else // PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO) +DEFINE_PACKET_ID(ZC_LONGPAR_CHANGE, 0x00b1); +#endif // PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO) + +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +DEFINE_PACKET_ID(ZC_PAR_4JOB_CHANGE, 0x0b25); +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(push, 1) #endif // not NetBSD < 6 / Solaris @@ -490,6 +428,7 @@ struct ItemOptions { uint8 param; } __attribute__((packed)); +// TODO split struct inside blocks of #if/#elif struct EQUIPITEM_INFO { int16 index; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 @@ -511,9 +450,9 @@ struct EQUIPITEM_INFO { #if PACKETVER < 20120925 uint8 IsDamaged; #endif -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) +#if !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723) uint8 RefiningLevel; -#endif +#endif // !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723) struct EQUIPSLOTINFO slot; #if PACKETVER >= 20071002 int32 HireExpireDate; @@ -528,10 +467,10 @@ struct EQUIPITEM_INFO { uint8 option_count; struct ItemOptions option_data[MAX_ITEM_OPTIONS]; #endif -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 uint8 RefiningLevel; uint8 enchantgrade; -#endif +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 #if PACKETVER >= 20120925 struct { uint8 IsIdentified : 1; @@ -551,7 +490,7 @@ struct packet_authok { #if PACKETVER >= 20080102 int16 font; #endif - // Some clients smaller than 20160330 cant be tested [4144] +// Some clients smaller than 20160330 cant be tested [4144] #if PACKETVER >= 20141022 && PACKETVER < 20160330 uint8 sex; #endif @@ -571,7 +510,9 @@ struct packet_sc_notick { uint8 state; } __attribute__((packed)); -struct packet_additem { +// TODO put struct under #ifdef/#elif +// [4144] dates unconfirmed +struct PACKET_ZC_ITEM_PICKUP_ACK { int16 PacketType; uint16 Index; uint16 count; @@ -582,9 +523,9 @@ struct packet_additem { #endif uint8 IsIdentified; uint8 IsDamaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) +#if !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723) uint8 refiningLevel; -#endif +#endif // !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723) struct EQUIPSLOTINFO slot; #if PACKETVER >= 20120925 uint32 location; @@ -601,17 +542,33 @@ struct packet_additem { #endif #if PACKETVER >= 20150226 struct ItemOptions option_data[MAX_ITEM_OPTIONS]; +#endif #if PACKETVER >= 20160921 uint8 favorite; uint16 look; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 +#endif +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 uint8 refiningLevel; uint8 enchantgrade; -#endif -#endif -#endif +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0b41); +#elif PACKETVER >= 20160921 +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0a37); +#elif PACKETVER >= 20150226 +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0a0c); +#elif PACKETVER >= 20120925 +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0990); +#elif PACKETVER >= 20071002 +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x02d4); +#elif PACKETVER >= 20061218 +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x029a); +#else +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x00a0); +#endif + struct packet_dropflooritem { int16 PacketType; uint32 ITAID; @@ -767,7 +724,7 @@ struct packet_spawn_unit { #if PACKETVER >= 20150513 int16 body; #endif - /* Might be earlier, this is when the named item bug began */ +/* Might be earlier, this is when the named item bug began */ #if PACKETVER >= 20131223 char name[NAME_LENGTH]; #endif @@ -841,7 +798,7 @@ struct packet_unit_walking { #if PACKETVER >= 20150513 uint16 body; #endif - /* Might be earlier, this is when the named item bug began */ +/* Might be earlier, this is when the named item bug began */ #if PACKETVER >= 20131223 char name[NAME_LENGTH]; #endif @@ -913,7 +870,7 @@ struct packet_idle_unit { #if PACKETVER >= 20150513 uint16 body; #endif - /* Might be earlier, this is when the named item bug began */ +/* Might be earlier, this is when the named item bug began */ #if PACKETVER >= 20131223 char name[NAME_LENGTH]; #endif @@ -957,18 +914,18 @@ struct packet_maptypeproperty2 { int16 PacketType; int16 type; struct { - uint32 party : 1; // Show attack cursor on non-party members (PvP) - uint32 guild : 1; // Show attack cursor on non-guild members (GvG) - uint32 siege : 1; // Show emblem over characters' heads when in GvG (WoE castle) - uint32 mineffect : 1; // Automatically enable /mineffect - uint32 nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members) - uint32 countpk : 1; /// Show the PvP counter - uint32 nopartyformation : 1; /// Prevent party creation/modification - uint32 bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect - uint32 nocostume : 1; /// Does not show costume sprite. - uint32 usecart : 1; /// Allow opening cart inventory + uint32 party : 1; // Show attack cursor on non-party members (PvP) + uint32 guild : 1; // Show attack cursor on non-guild members (GvG) + uint32 siege : 1; // Show emblem over characters' heads when in GvG (WoE castle) + uint32 mineffect : 1; // Automatically enable /mineffect + uint32 nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members) + uint32 countpk : 1; /// Show the PvP counter + uint32 nopartyformation : 1; /// Prevent party creation/modification + uint32 bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect + uint32 nocostume : 1; /// Does not show costume sprite. + uint32 usecart : 1; /// Allow opening cart inventory uint32 summonstarmiracle : 1; // TODO: What does this do? Related to Taekwon Masters, but I have no idea. - uint32 SpareBits : 21; /// Currently ignored, reserved for future updates + uint32 SpareBits : 21; /// Currently ignored, reserved for future updates } flag; } __attribute__((packed)); @@ -1279,7 +1236,8 @@ struct packet_unequipitem_ack { uint8 result; } __attribute__((packed)); -struct packet_viewequip_ack { +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { int16 PacketType; int16 PacketLength; char characterName[NAME_LENGTH]; @@ -1288,18 +1246,117 @@ struct packet_viewequip_ack { int16 accessory; int16 accessory2; int16 accessory3; -#if PACKETVER >= 20101124 int16 robe; -#endif int16 headpalette; int16 bodypalette; -#if PACKETVER_MAIN_NUM >= 20180801 || PACKETVER_RE_NUM >= 20180801 || PACKETVER_ZERO_NUM >= 20180808 int16 body2; -#endif uint8 sex; - // [4144] need remove MAX_INVENTORY from here - struct EQUIPITEM_INFO list[MAX_INVENTORY]; + struct EQUIPITEM_INFO list[]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x0b37); +#elif PACKETVER_MAIN_NUM >= 20180801 || PACKETVER_RE_NUM >= 20180801 || PACKETVER_ZERO_NUM >= 20180808 +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { + int16 PacketType; + int16 PacketLength; + char characterName[NAME_LENGTH]; + int16 job; + int16 head; + int16 accessory; + int16 accessory2; + int16 accessory3; + int16 robe; + int16 headpalette; + int16 bodypalette; + int16 body2; + uint8 sex; + struct EQUIPITEM_INFO list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x0b03); +#elif PACKETVER >= 20140820 +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { + int16 PacketType; + int16 PacketLength; + char characterName[NAME_LENGTH]; + int16 job; + int16 head; + int16 accessory; + int16 accessory2; + int16 accessory3; + int16 robe; + int16 headpalette; + int16 bodypalette; + uint8 sex; + struct EQUIPITEM_INFO list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x0a2d); +#elif PACKETVER_MAIN_NUM >= 20121205 || PACKETVER_RE_NUM >= 20121107 +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { + int16 PacketType; + int16 PacketLength; + char characterName[NAME_LENGTH]; + int16 job; + int16 head; + int16 accessory; + int16 accessory2; + int16 accessory3; + int16 robe; + int16 headpalette; + int16 bodypalette; + uint8 sex; + struct EQUIPITEM_INFO list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x0997); +#elif PACKETVER_MAIN_NUM >= 20111207 || PACKETVER_RE_NUM >= 20111122 +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { + int16 PacketType; + int16 PacketLength; + char characterName[NAME_LENGTH]; + int16 job; + int16 head; + int16 accessory; + int16 accessory2; + int16 accessory3; + int16 robe; + int16 headpalette; + int16 bodypalette; + uint8 sex; + struct EQUIPITEM_INFO list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x0906); +#elif PACKETVER >= 20101123 +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { + int16 PacketType; + int16 PacketLength; + char characterName[NAME_LENGTH]; + int16 job; + int16 head; + int16 accessory; + int16 accessory2; + int16 accessory3; + int16 robe; + int16 headpalette; + int16 bodypalette; + uint8 sex; + struct EQUIPITEM_INFO list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x0859); +#elif PACKETVER_AD_NUM >= 20071211 || PACKETVER_SAK_NUM >= 20071127 || PACKETVER_MAIN_NUM >= 20071211 || defined(PACKETVER_RE) +struct PACKET_ZC_EQUIPWIN_MICROSCOPE { + int16 PacketType; + int16 PacketLength; + char characterName[NAME_LENGTH]; + int16 job; + int16 head; + int16 accessory; + int16 accessory2; + int16 accessory3; + int16 headpalette; + int16 bodypalette; + uint8 sex; + struct EQUIPITEM_INFO list[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_EQUIPWIN_MICROSCOPE, 0x02d7); +#endif struct packet_notify_bounditem { int16 PacketType; @@ -1603,7 +1660,11 @@ struct PACKET_CZ_ADD_ITEM_TO_MAIL { int16 count; } __attribute__((packed)); -struct PACKET_ZC_ADD_ITEM_TO_MAIL { +// [4144] this packet exists from +// PACKETVER_MAIN_NUM >= 20141112 || PACKETVER_RE_NUM >= 20140924 || defined(PACKETVER_ZERO) +// but used only packet versions with known struct +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_ACK_ADD_ITEM_RODEX { int16 PacketType; int8 result; int16 index; @@ -1616,43 +1677,39 @@ struct PACKET_ZC_ADD_ITEM_TO_MAIL { int8 type; int8 IsIdentified; int8 IsDamaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) - int8 refiningLevel; -#endif struct EQUIPSLOTINFO slot; struct ItemOptions optionData[MAX_ITEM_OPTIONS]; int16 weight; uint8 favorite; uint32 location; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 int8 refiningLevel; uint8 enchantgrade; -#endif } __attribute__((packed)); - -struct mail_item { +DEFINE_PACKET_HEADER(ZC_ACK_ADD_ITEM_RODEX, 0x0b3f); +#elif PACKETVER >= 20141119 +struct PACKET_ZC_ACK_ADD_ITEM_RODEX { + int16 PacketType; + int8 result; + int16 index; int16 count; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 - uint32 ITID; + uint32 itemId; #else - uint16 ITID; + uint16 itemId; #endif + int8 type; int8 IsIdentified; int8 IsDamaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) int8 refiningLevel; -#endif struct EQUIPSLOTINFO slot; - uint32 location; - uint8 type; - uint16 viewSprite; - uint16 bindOnEquip; struct ItemOptions optionData[MAX_ITEM_OPTIONS]; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - int8 refiningLevel; - uint8 enchantgrade; -#endif + int16 weight; + uint8 favorite; + uint32 location; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_ADD_ITEM_RODEX, 0x0a05); +#endif // PACKETVER >= 20141119 + struct PACKET_CZ_REQ_OPEN_WRITE_MAIL { int16 PacketType; @@ -1715,15 +1772,24 @@ struct PACKET_CZ_CHECKNAME2 { DEFINE_PACKET_HEADER(CZ_CHECKNAME2, 0x0b97) #endif // PACKETVER_MAIN_NUM >= 20201104 || PACKETVER_ZERO_NUM >= 20201118 +#if PACKETVER >= 20160302 struct PACKET_ZC_CHECKNAME { int16 PacketType; int32 CharId; int16 Class; int16 BaseLevel; -#if PACKETVER >= 20160316 char Name[24]; -#endif } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CHECKNAME, 0x0a51) +#elif PACKETVER >= 20141119 +struct PACKET_ZC_CHECKNAME { + int16 PacketType; + int32 CharId; + int16 Class; + int16 BaseLevel; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CHECKNAME, 0x0a14) +#endif struct PACKET_ZC_NOTIFY_UNREADMAIL { int16 PacketType; @@ -1780,7 +1846,27 @@ struct PACKET_CZ_REQ_READ_MAIL { int64 MailID; } __attribute__((packed)); -struct PACKET_ZC_READ_MAIL { +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_ACK_READ_RODEX_SUB { + int16 count; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 ITID; +#else + uint16 ITID; +#endif + int8 IsIdentified; + int8 IsDamaged; + struct EQUIPSLOTINFO slot; + uint32 location; + uint8 type; + uint16 viewSprite; + uint16 bindOnEquip; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; + int8 refiningLevel; + int8 enchantgrade; +} __attribute__((packed)); + +struct PACKET_ZC_ACK_READ_RODEX { int16 PacketType; int16 PacketLength; int8 opentype; @@ -1789,6 +1875,38 @@ struct PACKET_ZC_READ_MAIL { int64 zeny; int8 ItemCnt; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_READ_RODEX, 0x0b63); +// [4144] date unconfirmed +#elif PACKETVER >= 20140115 +struct PACKET_ZC_ACK_READ_RODEX_SUB { + int16 count; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 ITID; +#else + uint16 ITID; +#endif + int8 IsIdentified; + int8 IsDamaged; + int8 refiningLevel; + struct EQUIPSLOTINFO slot; + uint32 location; + uint8 type; + uint16 viewSprite; + uint16 bindOnEquip; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; +} __attribute__((packed)); + +struct PACKET_ZC_ACK_READ_RODEX { + int16 PacketType; + int16 PacketLength; + int8 opentype; + int64 MailID; + int16 TextcontentsLength; + int64 zeny; + int8 ItemCnt; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_READ_RODEX, 0x09eb); +#endif // PACKETVER >= 20140115 struct PACKET_CZ_REQ_DELETE_MAIL { int16 PacketType; @@ -2156,6 +2274,7 @@ struct PACKET_ZC_ITEM_ENTRY { uint8 subY; } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_ADD_ITEM_TO_STORE { int16 packetType; int16 index; @@ -2165,23 +2284,68 @@ struct PACKET_ZC_ADD_ITEM_TO_STORE { #else uint16 itemId; #endif -#if PACKETVER >= 5 uint8 itemType; + uint8 identified; + uint8 damaged; + struct EQUIPSLOTINFO slot; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; + uint8 refine; + uint8 enchantgrade; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_STORE, 0x0b44) +#elif PACKETVER_MAIN_NUM >= 20140813 || PACKETVER_RE_NUM >= 20140402 || defined(PACKETVER_ZERO) +struct PACKET_ZC_ADD_ITEM_TO_STORE { + int16 packetType; + int16 index; + int32 amount; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 itemType; + uint8 identified; + uint8 damaged; + uint8 refine; + struct EQUIPSLOTINFO slot; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_STORE, 0x0a0a) +// [4144] this version unconfirmed +#elif PACKETVER >= 5 +struct PACKET_ZC_ADD_ITEM_TO_STORE { + int16 packetType; + int16 index; + int32 amount; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 itemType; + uint8 identified; + uint8 damaged; + uint8 refine; + struct EQUIPSLOTINFO slot; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_STORE, 0x01c4) +#else +struct PACKET_ZC_ADD_ITEM_TO_STORE { + int16 packetType; + int16 index; + int32 amount; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; #endif uint8 identified; uint8 damaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) uint8 refine; -#endif struct EQUIPSLOTINFO slot; -#if PACKETVER >= 20150226 - struct ItemOptions option_data[MAX_ITEM_OPTIONS]; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - uint8 refine; - uint8 enchantgrade; -#endif -#endif } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_STORE, 0x00f4) +#endif struct PACKET_ZC_MVP_GETTING_ITEM { int16 packetType; @@ -2206,6 +2370,7 @@ struct PACKET_ZC_ACK_TOUSESKILL { uint8 cause; } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_ADD_ITEM_TO_CART { int16 packetType; int16 index; @@ -2215,23 +2380,68 @@ struct PACKET_ZC_ADD_ITEM_TO_CART { #else uint16 itemId; #endif -#if PACKETVER >= 5 uint8 itemType; + uint8 identified; + uint8 damaged; + struct EQUIPSLOTINFO slot; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; + uint8 refine; + uint8 enchantgrade; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_CART, 0x0b45); +#elif PACKETVER_MAIN_NUM >= 20140813 || PACKETVER_RE_NUM >= 20140402 || defined(PACKETVER_ZERO) +struct PACKET_ZC_ADD_ITEM_TO_CART { + int16 packetType; + int16 index; + int32 amount; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 itemType; + uint8 identified; + uint8 damaged; + uint8 refine; + struct EQUIPSLOTINFO slot; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_CART, 0x0a0b); +// [4144] this version unconfirmed +#elif PACKETVER >= 5 +struct PACKET_ZC_ADD_ITEM_TO_CART { + int16 packetType; + int16 index; + int32 amount; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 itemType; + uint8 identified; + uint8 damaged; + uint8 refine; + struct EQUIPSLOTINFO slot; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_CART, 0x01c5); +#else +struct PACKET_ZC_ADD_ITEM_TO_CART { + int16 packetType; + int16 index; + int32 amount; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; #endif uint8 identified; uint8 damaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) uint8 refine; -#endif struct EQUIPSLOTINFO slot; -#if PACKETVER >= 20150226 - struct ItemOptions option_data[MAX_ITEM_OPTIONS]; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - uint8 refine; - uint8 enchantgrade; -#endif -#endif } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ADD_ITEM_TO_CART, 0x0124); +#endif struct PACKET_CZ_REQMAKINGITEM { int16 packetType; @@ -2303,6 +2513,8 @@ struct PACKET_ZC_SPRITE_CHANGE { #endif } __attribute__((packed)); +// TODO put struct under #ifdef/#elif +// [4144] dates unconfirmed struct PACKET_ZC_ADD_EXCHANGE_ITEM { int16 packetType; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 @@ -2319,21 +2531,35 @@ struct PACKET_ZC_ADD_EXCHANGE_ITEM { #endif uint8 identified; uint8 damaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) +#if !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723) uint8 refine; -#endif +#endif // !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723) struct EQUIPSLOTINFO slot; #if PACKETVER >= 20150226 struct ItemOptions option_data[MAX_ITEM_OPTIONS]; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 +#endif +#if PACKETVER_MAIN_NUM >= 20161102 || PACKETVER_RE_NUM >= 20161026 || defined(PACKETVER_ZERO) uint32 location; - uint16 viewSprite; + uint16 look; +#endif // PACKETVER_MAIN_NUM >= 20161102 || PACKETVER_RE_NUM >= 20161026 || defined(PACKETVER_ZERO) +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 uint8 refine; uint8 enchantgrade; -#endif -#endif +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +DEFINE_PACKET_HEADER(ZC_ADD_EXCHANGE_ITEM, 0x0b42); +#elif PACKETVER_MAIN_NUM >= 20161102 || PACKETVER_RE_NUM >= 20161026 || defined(PACKETVER_ZERO) +DEFINE_PACKET_HEADER(ZC_ADD_EXCHANGE_ITEM, 0x0a96); +#elif PACKETVER >= 20150226 +DEFINE_PACKET_HEADER(ZC_ADD_EXCHANGE_ITEM, 0x0a09); +#elif PACKETVER >= 20100223 +DEFINE_PACKET_HEADER(ZC_ADD_EXCHANGE_ITEM, 0x080f); +#else +DEFINE_PACKET_HEADER(ZC_ADD_EXCHANGE_ITEM, 0x00e9); +#endif + struct PACKET_ZC_CASH_TIME_COUNTER { int16 packetType; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 @@ -2354,6 +2580,7 @@ struct PACKET_ZC_CASH_ITEM_DELETE { #endif } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_ITEM_PICKUP_PARTY { int16 packetType; uint32 AID; @@ -2364,17 +2591,31 @@ struct PACKET_ZC_ITEM_PICKUP_PARTY { #endif uint8 identified; uint8 damaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) - uint8 refine; -#endif struct EQUIPSLOTINFO slot; uint16 location; uint8 itemType; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 uint8 refine; uint8 enchantgrade; -#endif } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_PARTY, 0x0b67); +#elif PACKETVER >= 20070731 +struct PACKET_ZC_ITEM_PICKUP_PARTY { + int16 packetType; + uint32 AID; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 identified; + uint8 damaged; + uint8 refine; + struct EQUIPSLOTINFO slot; + uint16 location; + uint8 itemType; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_PARTY, 0x02b8); +#endif struct PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE { int16 packetType; @@ -2566,23 +2807,55 @@ struct PACKET_ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER { #endif } __attribute__((packed)); -struct PACKET_CZ_REQ_ITEMREPAIR { - int16 packetType; +#if PACKETVER >= 20191224 +struct REPAIRITEM_INFO2 { int16 index; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 uint32 itemId; #else uint16 itemId; #endif -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) - uint8 refine; -#endif - struct EQUIPSLOTINFO slot; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - uint8 refine; - uint8 enchantgrade; -#endif + struct EQUIPSLOTINFO slot; // unused? + uint8 refine; // unused? + uint8 enchantgrade; // unused? } __attribute__((packed)); +#elif PACKETVER >= 20191106 +struct REPAIRITEM_INFO2 { + int16 index; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 refine; // unused? + struct EQUIPSLOTINFO slot; // unused? +} __attribute__((packed)); +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 + +struct REPAIRITEM_INFO1 { + int16 index; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 refine; // unused? + struct EQUIPSLOTINFO slot; // unused? +} __attribute__((packed)); + +#if PACKETVER >= 20191224 +struct PACKET_CZ_REQ_ITEMREPAIR2 { + int16 packetType; + struct REPAIRITEM_INFO2 item; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_REQ_ITEMREPAIR2, 0x0b66); +#endif // PACKETVER >= 20191224 + +struct PACKET_CZ_REQ_ITEMREPAIR1 { + int16 packetType; + struct REPAIRITEM_INFO1 item; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_REQ_ITEMREPAIR1, 0x01fd); struct PACKET_CZ_REQ_MAKINGITEM { int16 packetType; @@ -2626,6 +2899,7 @@ struct PACKET_ZC_ACK_SCHEDULER_CASHITEM { struct PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub items[]; } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_PC_PURCHASE_MYITEMLIST_sub { uint32 price; int16 index; @@ -2638,25 +2912,45 @@ struct PACKET_ZC_PC_PURCHASE_MYITEMLIST_sub { #endif uint8 identified; uint8 damaged; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) - uint8 refine; -#endif struct EQUIPSLOTINFO slot; -#if PACKETVER >= 20150226 struct ItemOptions option_data[MAX_ITEM_OPTIONS]; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 uint8 refine; uint8 enchantgrade; -#endif -#endif } __attribute__((packed)); - struct PACKET_ZC_PC_PURCHASE_MYITEMLIST { int16 packetType; int16 packetLength; uint32 AID; struct PACKET_ZC_PC_PURCHASE_MYITEMLIST_sub items[]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_PC_PURCHASE_MYITEMLIST, 0x0b40); +#else // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_PC_PURCHASE_MYITEMLIST_sub { + uint32 price; + int16 index; + int16 amount; + uint8 itemType; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + uint8 identified; + uint8 damaged; + uint8 refine; + struct EQUIPSLOTINFO slot; +#if PACKETVER >= 20150226 + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; +#endif +} __attribute__((packed)); +struct PACKET_ZC_PC_PURCHASE_MYITEMLIST { + int16 packetType; + int16 packetLength; + uint32 AID; + struct PACKET_ZC_PC_PURCHASE_MYITEMLIST_sub items[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_PC_PURCHASE_MYITEMLIST, 0x0136); +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 #if PACKETVER_MAIN_NUM >= 20210203 || PACKETVER_RE_NUM >= 20211103 struct PACKET_ZC_PC_PURCHASE_ITEMLIST_sub { @@ -2694,7 +2988,7 @@ struct PACKET_ZC_PC_PURCHASE_ITEMLIST { struct PACKET_ZC_PC_PURCHASE_ITEMLIST_sub items[]; } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_PC_PURCHASE_ITEMLIST, 0x00c6) -#endif +#endif // PACKETVER_MAIN_NUM >= 20210203 struct PACKET_CZ_PC_PURCHASE_ITEMLIST_sub { uint16 amount; @@ -2858,22 +3152,23 @@ struct PACKET_ZC_MAKINGARROW_LIST { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_MAKINGARROW_LIST, 0x01ad); -struct PACKET_ZC_REPAIRITEMLIST_sub { - int16 index; -#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 - uint32 itemId; -#else - uint16 itemId; -#endif - uint8 refine; // unused? - struct EQUIPSLOTINFO slot; // unused? -} __attribute__((packed)); - +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +#define REPAIRITEM_INFO REPAIRITEM_INFO2 struct PACKET_ZC_REPAIRITEMLIST { int16 packetType; int16 packetLength; - struct PACKET_ZC_REPAIRITEMLIST_sub items[]; + struct REPAIRITEM_INFO items[]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_REPAIRITEMLIST, 0x0b65); +#else // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +#define REPAIRITEM_INFO REPAIRITEM_INFO1 +struct PACKET_ZC_REPAIRITEMLIST { + int16 packetType; + int16 packetLength; + struct REPAIRITEM_INFO items[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_REPAIRITEMLIST, 0x01fc); +#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub { int16 index; @@ -2976,6 +3271,7 @@ struct PACKET_CZ_SEARCH_STORE_INFO { */ } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub { uint32 storeId; uint32 AID; @@ -2988,16 +3284,38 @@ struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub { uint8 itemType; uint32 price; uint16 amount; -#if !( PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 ) + struct EQUIPSLOTINFO slot; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; uint8 refine; + uint8 enchantgrade; +} __attribute__((packed)); + +struct PACKET_ZC_SEARCH_STORE_INFO_ACK { + int16 packetType; + int16 packetLength; + uint8 firstPage; + uint8 nextPage; + uint8 usesCount; + struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub items[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SEARCH_STORE_INFO_ACK, 0x0b64); +#elif PACKETVER_MAIN_NUM >= 20100817 || PACKETVER_RE_NUM >= 20100706 || defined(PACKETVER_ZERO) +struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub { + uint32 storeId; + uint32 AID; + char shopName[MESSAGE_SIZE]; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; #endif + uint8 itemType; + uint32 price; + uint16 amount; + uint8 refine; struct EQUIPSLOTINFO slot; #if PACKETVER >= 20150226 struct ItemOptions option_data[MAX_ITEM_OPTIONS]; -#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200724 - uint8 refine; - uint8 enchantgrade; -#endif #endif } __attribute__((packed)); @@ -3009,6 +3327,9 @@ struct PACKET_ZC_SEARCH_STORE_INFO_ACK { uint8 usesCount; struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub items[]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SEARCH_STORE_INFO_ACK, 0x0836); +#endif // PACKETVER_MAIN_NUM >= 20100817 || PACKETVER_RE_NUM >= 20100706 || defined(PACKETVER_ZERO) + /* Achievement System */ struct ach_list_info { @@ -3229,8 +3550,18 @@ struct PACKET_ZC_AUTOSPELLLIST { DEFINE_PACKET_HEADER(ZC_AUTOSPELLLIST, 0x01cd); #endif -#if PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) -#if 0 && (PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 || PACKETVER_ZERO_NUM >= 20181024 ) +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_ITEM_PREVIEW { + int16 packetType; + int16 index; + int8 isDamaged; + struct EQUIPSLOTINFO slot; + struct ItemOptions option_data[MAX_ITEM_OPTIONS]; + uint8 refiningLevel; + uint8 enchantgrade; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ITEM_PREVIEW, 0x0b43); +#elif PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 || PACKETVER_ZERO_NUM >= 20181024 struct PACKET_ZC_ITEM_PREVIEW { int16 packetType; int16 index; @@ -3240,8 +3571,7 @@ struct PACKET_ZC_ITEM_PREVIEW { struct ItemOptions option_data[MAX_ITEM_OPTIONS]; } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_ITEM_PREVIEW, 0x0b13); -#else // PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 || PACKETVER_ZERO_NUM >= 20181024 - +#elif PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) struct PACKET_ZC_ITEM_PREVIEW { int16 packetType; int16 index; @@ -3251,7 +3581,6 @@ struct PACKET_ZC_ITEM_PREVIEW { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_ITEM_PREVIEW, 0x0ab9); #endif // PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 || PACKETVER_ZERO_NUM >= 20181024 -#endif // PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) #if PACKETVER_MAIN_NUM >= 20160831 || PACKETVER_RE_NUM >= 20151118 || defined(PACKETVER_ZERO) struct PACKET_ZC_ENCHANT_EQUIPMENT { @@ -3529,7 +3858,21 @@ struct PACKET_ZC_ROLE_CHANGE { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_ROLE_CHANGE, 0x00e1); -#if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO) +#if PACKETVER >= 20200902 +struct PACKET_ZC_BAN_LIST_sub { + int char_id; + char message[40]; + char char_name[NAME_LENGTH]; +} __attribute__((packed)); + +struct PACKET_ZC_BAN_LIST { + int16 packetType; + uint16 packetLen; + struct PACKET_ZC_BAN_LIST_sub chars[]; +} __attribute__((packed)); + +DEFINE_PACKET_HEADER(ZC_BAN_LIST, 0x0b7c); +#elif PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO) struct PACKET_ZC_BAN_LIST_sub { int char_id; char message[40]; @@ -4292,8 +4635,439 @@ struct PACKET_ZC_NOTIFY_SKILL_POSITION { int16 count; int8 action; }; + DEFINE_PACKET_HEADER(ZC_NOTIFY_SKILL_POSITION, 0x0115); +#if PACKETVER_MAIN_NUM >= 20130731 || PACKETVER_RE_NUM >= 20130707 || defined(PACKETVER_ZERO) +struct PACKET_ZC_C_MARKERINFO { + int16 PacketType; + uint32 AID; + int16 xPos; + int16 yPos; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_C_MARKERINFO, 0x09c1); +#endif + +#if PACKETVER >= 20200902 +struct GUILD_MEMBER_INFO { + uint32 AID; + uint32 GID; + int16 head; + int16 headPalette; + int16 sex; + int16 job; + int16 level; + int32 contributionExp; + int32 currentState; + int32 positionID; + uint32 lastLoginTime; + char char_name[NAME_LENGTH]; +} __attribute__((packed)); +struct PACKET_ZC_MEMBERMGR_INFO { + int16 PacketType; + int16 packetLength; + struct GUILD_MEMBER_INFO guildMemberInfo[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MEMBERMGR_INFO, 0x0b7d); +#elif PACKETVER_MAIN_NUM >= 20161214 || PACKETVER_RE_NUM >= 20161130 || defined(PACKETVER_ZERO) +struct GUILD_MEMBER_INFO { + uint32 AID; + uint32 GID; + int16 head; + int16 headPalette; + int16 sex; + int16 job; + int16 level; + int32 contributionExp; + int32 currentState; + int32 positionID; + uint32 lastLoginTime; +} __attribute__((packed)); +struct PACKET_ZC_MEMBERMGR_INFO { + int16 PacketType; + int16 packetLength; + struct GUILD_MEMBER_INFO guildMemberInfo[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MEMBERMGR_INFO, 0x0aa5); +#else // false: PACKETVER_MAIN_NUM >= 20161214 || PACKETVER_RE_NUM >= 20161130 || defined(PACKETVER_ZERO) +struct GUILD_MEMBER_INFO { + uint32 AID; + uint32 GID; + int16 head; + int16 headPalette; + int16 sex; + int16 job; + int16 level; + int32 contributionExp; + int32 currentState; + int32 positionID; + char intro[50]; + char char_name[NAME_LENGTH]; +} __attribute__((packed)); +struct PACKET_ZC_MEMBERMGR_INFO { + int16 PacketType; + int16 packetLength; + struct GUILD_MEMBER_INFO guildMemberInfo[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MEMBERMGR_INFO, 0x0154); +#endif + +#if PACKETVER >= 20200902 +struct PACKET_ZC_GUILD_INFO { + int16 PacketType; + int GDID; + int level; + int userNum; + int maxUserNum; + int userAverageLevel; + int exp; + int maxExp; + int point; + int honor; + int virtue; + int emblemVersion; + char guildname[NAME_LENGTH]; + char manageLand[MAP_NAME_LENGTH_EXT]; + int zeny; + int masterGID; + char masterName[NAME_LENGTH]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GUILD_INFO, 0x0b7b); +#elif PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO) +struct PACKET_ZC_GUILD_INFO { + int16 PacketType; + int GDID; + int level; + int userNum; + int maxUserNum; + int userAverageLevel; + int exp; + int maxExp; + int point; + int honor; + int virtue; + int emblemVersion; + char guildname[NAME_LENGTH]; + char manageLand[MAP_NAME_LENGTH_EXT]; + int zeny; + int masterGID; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GUILD_INFO, 0x0a84); +#else +struct PACKET_ZC_GUILD_INFO { + int16 PacketType; + int GDID; + int level; + int userNum; + int maxUserNum; + int userAverageLevel; + int exp; + int maxExp; + int point; + int honor; + int virtue; + int emblemVersion; + char guildname[NAME_LENGTH]; + char masterName[NAME_LENGTH]; + char manageLand[MAP_NAME_LENGTH_EXT]; + int zeny; +} __attribute__((packed)); +//0x150; [4144] this is packet for older versions? +DEFINE_PACKET_HEADER(ZC_GUILD_INFO, 0x01b6); +#endif + +struct PACKET_ZC_POSITION_ID_NAME_INFO { + int16 PacketType; + int16 PacketLength; + struct { + int positionID; + char posName[NAME_LENGTH]; + } posInfo[MAX_GUILDPOSITION]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_POSITION_ID_NAME_INFO, 0x0166); + +struct PACKET_ZC_POSITION_INFO { + int16 PacketType; + int16 PacketLength; + struct { + int positionID; + int right; + int ranking; + int payRate; + } posInfo[MAX_GUILDPOSITION]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_POSITION_INFO, 0x0160); + +struct GUILD_SKILLDATA { + uint16 id; + int inf; + uint16 level; + uint16 sp; + uint16 range2; + char name[NAME_LENGTH]; + uint8 upFlag; +} __attribute__((packed)); + +struct PACKET_ZC_GUILD_SKILLINFO { + int16 PacketType; + int16 PacketLength; + int16 skillPoint; + struct GUILD_SKILLDATA skillInfo[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GUILD_SKILLINFO, 0x0162); + +struct RELATED_GUILD_INFO { + int relation; + int GDID; + char guildname[NAME_LENGTH]; +} __attribute__((packed)); + +struct PACKET_ZC_MYGUILD_BASIC_INFO { + int16 PacketType; + int16 PacketLength; + struct RELATED_GUILD_INFO rgInfo[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MYGUILD_BASIC_INFO, 0x014c); + +#if PACKETVER >= 20160316 +struct PACKET_CZ_CAPTCHA_REGISTER { + int16 PacketType; + char answer[16]; + int16 imageSize; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CAPTCHA_REGISTER, 0x0a52); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_CAPTCHA_UPLOAD_REQUEST { + int16 PacketType; + char captchaKey[4]; + int captchaFlag; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CAPTCHA_UPLOAD_REQUEST, 0x0a53); +#endif + +#if PACKETVER >= 20160316 +struct PACKET_CZ_CAPTCHA_UPLOAD_REQUEST_ACK { + int16 PacketType; + int16 PacketLength; + char captchaKey[4]; + char imageData[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CAPTCHA_UPLOAD_REQUEST_ACK, 0x0a54); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_CAPTCHA_UPLOAD_REQUEST_STATUS { + int16 PacketType; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CAPTCHA_UPLOAD_REQUEST_STATUS, 0x0a55); +#endif + +#if PACKETVER >= 20160316 +struct PACKET_CZ_MACRO_REPORTER_ACK { + int16 PacketType; + uint32 AID; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_MACRO_REPORTER_ACK, 0x0a56); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_MACRO_REPORTER_STATUS { + int16 PacketType; + int status; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MACRO_REPORTER_STATUS, 0x0a57); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_MACRO_DETECTOR_REQUEST { + int16 PacketType; + int16 imageSize; + char captchaKey[4]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MACRO_DETECTOR_REQUEST, 0x0a58); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_MACRO_DETECTOR_REQUEST_DOWNLOAD { + int16 PacketType; + int16 PacketLength; + char captchaKey[4]; + char imageData[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MACRO_DETECTOR_REQUEST_DOWNLOAD, 0x0a59); +#endif + +#if PACKETVER >= 20160316 +struct PACKET_CZ_MACRO_DETECTOR_DOWNLOAD { + int16 PacketType; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_MACRO_DETECTOR_DOWNLOAD, 0x0a5a); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_MACRO_DETECTOR_SHOW { + int16 PacketType; + uint8 retryCount; + int timeout; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MACRO_DETECTOR_SHOW, 0x0a5b); +#endif + +#if PACKETVER >= 20160316 +struct PACKET_CZ_MACRO_DETECTOR_ANSWER { + int16 PacketType; + char answer[16]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_MACRO_DETECTOR_ANSWER, 0x0a5c); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_MACRO_DETECTOR_STATUS { + int16 PacketType; + int status; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MACRO_DETECTOR_STATUS, 0x0a5d); +#endif + +#if PACKETVER >= 20160323 +struct PACKET_CZ_CAPTCHA_PREVIEW_REQUEST { + int16 PacketType; + int captchaID; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CAPTCHA_PREVIEW_REQUEST, 0x0a69); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_CAPTCHA_PREVIEW_REQUEST { + int16 PacketType; + int captchaFlag; + int16 imageSize; + char captchaKey[4]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CAPTCHA_PREVIEW_REQUEST, 0x0a6a); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_CAPTCHA_PREVIEW_REQUEST_DOWNLOAD { + int16 PacketType; + int16 PacketLength; + char captchaKey[4]; + char imageData[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_CAPTCHA_PREVIEW_REQUEST_DOWNLOAD, 0x0a6b); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_CZ_MACRO_REPORTER_SELECT { + int16 PacketType; + int16 xPos; + int16 yPos; + int8 RadiusRange; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_MACRO_REPORTER_SELECT, 0x0a6c); +#endif + +#if PACKETVER >= 20160330 +struct PACKET_ZC_MACRO_REPORTER_SELECT { + int16 PacketType; + int16 PacketLength; + uint32 AID[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MACRO_REPORTER_SELECT, 0x0a6d); +#endif + +struct PACKET_ZC_ACK_MAKE_GROUP { + int16 PacketType; + int8 result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_MAKE_GROUP, 0x00fa); + +struct PACKET_ZC_PARTY_JOIN_REQ { + int16 PacketType; + int GRID; + char groupName[NAME_LENGTH]; +} __attribute__((packed)); +#if PACKETVER < 20070821 +DEFINE_PACKET_HEADER(ZC_PARTY_JOIN_REQ, 0x00fe); +#else +DEFINE_PACKET_HEADER(ZC_PARTY_JOIN_REQ, 0x02c6); +#endif + +struct PACKET_ZC_PARTY_JOIN_REQ_ACK { + int16 PacketType; + char characterName[NAME_LENGTH]; + int result; +} __attribute__((packed)); +#if PACKETVER < 20070821 +DEFINE_PACKET_HEADER(ZC_PARTY_JOIN_REQ_ACK, 0x00fd); +#else +DEFINE_PACKET_HEADER(ZC_PARTY_JOIN_REQ_ACK, 0x02c5); +#endif + +struct PACKET_ZC_NOTIFY_CHAT_PARTY { + int16 PacketType; + int16 PacketLength; + int AID; + char chatMsg[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NOTIFY_CHAT_PARTY, 0x0109); + +struct PACKET_ZC_NOTIFY_POSITION_TO_GROUPM { + int16 PacketType; + int AID; + int16 xPos; + int16 yPos; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NOTIFY_POSITION_TO_GROUPM, 0x0107); + +#if PACKETVER_ZERO_NUM >= 20210504 +struct PACKET_ZC_NOTIFY_HP_TO_GROUPM { + int16 PacketType; + uint32 AID; + int hp; + int maxhp; + int sp; + int maxsp; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NOTIFY_HP_TO_GROUPM, 0x0bab); +#elif PACKETVER >= 20100119 +struct PACKET_ZC_NOTIFY_HP_TO_GROUPM { + int16 PacketType; + uint32 AID; + int hp; + int maxhp; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NOTIFY_HP_TO_GROUPM, 0x080e); +#else // PACKETVER >= 20100119 +struct PACKET_ZC_NOTIFY_HP_TO_GROUPM { + int16 PacketType; + uint32 AID; + int16 hp; + int16 maxhp; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_NOTIFY_HP_TO_GROUPM, 0x0106); +#endif // PACKETVER >= 20100119 + +#if PACKETVER_MAIN_NUM >= 20170502 || PACKETVER_RE_NUM >= 20170419 || defined(PACKETVER_ZERO) +struct PACKET_ZC_PARTY_MEMBER_JOB_LEVEL { + int16 PacketType; + int AID; + int16 job; + int16 level; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_PARTY_MEMBER_JOB_LEVEL, 0x0abd); +#endif + +struct PACKET_ZC_DELETE_MEMBER_FROM_GROUP { + int16 PacketType; + int AID; + char characterName[NAME_LENGTH]; + int8 result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_DELETE_MEMBER_FROM_GROUP, 0x0105); + #if PACKETVER_MAIN_NUM >= 20210818 || PACKETVER_RE_NUM >= 20211103 || PACKETVER_ZERO_NUM >= 20210818 struct PACKET_CZ_REQ_TAKEOFF_EQUIP_ALL { int16 PacketType; @@ -4309,6 +5083,159 @@ struct PACKET_ZC_TAKEOFF_EQUIP_ALL_ACK { DEFINE_PACKET_HEADER(ZC_TAKEOFF_EQUIP_ALL_ACK, 0x0bae); #endif // PACKETVER_MAIN_NUM >= 20210818 || PACKETVER_RE_NUM >= 20211103 +#if PACKETVER_ZERO_NUM >= 20210504 +struct PACKET_ZC_BATTLEFIELD_NOTIFY_HP { + int16 PacketType; + uint32 AID; + int hp; + int maxhp; + int sp; + int maxsp; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_BATTLEFIELD_NOTIFY_HP, 0x0baa); +#elif PACKETVER >= 20140312 +struct PACKET_ZC_BATTLEFIELD_NOTIFY_HP { + int16 PacketType; + uint32 AID; + int hp; + int maxhp; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_BATTLEFIELD_NOTIFY_HP, 0x0a0e); +#elif PACKETVER >= 20071009 +struct PACKET_ZC_BATTLEFIELD_NOTIFY_HP { + int16 PacketType; + uint32 AID; + char name[NAME_LENGTH]; + int16 hp; + int16 maxhp; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_BATTLEFIELD_NOTIFY_HP, 0x02e0); +#endif // PACKETVER >= 20071009 + +#if PACKETVER_ZERO_NUM >= 20210721 +struct PACKET_ZC_SAY_DIALOG_ZERO1 { + int16 PacketType; + int16 PacketLength; + uint32 NpcID; + char message[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SAY_DIALOG_ZERO1, 0x0ba6); +#endif // PACKETVER_ZERO_NUM >= 20210721 + +#if PACKETVER_ZERO_NUM >= 20210721 +struct PACKET_ZC_SAY_DIALOG_ZERO2 { + int16 PacketType; + int16 PacketLength; + uint32 NpcID; + char message[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SAY_DIALOG_ZERO2, 0x0ba9); +#endif // PACKETVER_ZERO_NUM >= 20210721 + +#if PACKETVER_ZERO_NUM >= 20210721 +struct PACKET_ZC_MENU_LIST_ZERO { + int16 PacketType; + int16 PacketLength; + uint32 NpcID; + char message[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MENU_LIST_ZERO, 0x0ba7); +#endif // PACKETVER_ZERO_NUM >= 20210721 + +#if PACKETVER_MAIN_NUM >= 20210317 || PACKETVER_RE_NUM >= 20211103 || PACKETVER_ZERO_NUM >= 20210317 +struct PACKET_CZ_CHOOSE_MENU_ZERO { + int16 PacketType; + uint32 NpcID; + uint8 menuIndex; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CHOOSE_MENU_ZERO, 0x0ba8); +#endif // PACKETVER_MAIN_NUM >= 20210317 || PACKETVER_RE_NUM >= 20211103 || PACKETVER_ZERO_NUM >= 20210317 + +#if PACKETVER_MAIN_NUM >= 20210203 || PACKETVER_RE_NUM >= 20211103 +struct PACKET_ZC_SAY_DIALOG_ALIGN { + int16 PacketType; + uint8 align; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SAY_DIALOG_ALIGN, 0x0ba1); +#endif // PACKETVER_MAIN_NUM >= 20210203 || PACKETVER_RE_NUM >= 20211103 + +#if PACKETVER_MAIN_NUM >= 20191016 || PACKETVER_RE_NUM >= 20191016 || PACKETVER_ZERO_NUM >= 20191008 +struct PACKET_CZ_GRADE_ENCHANT_ADD_ITEM { + int16 PacketType; + int16 index; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_GRADE_ENCHANT_ADD_ITEM, 0x0b59); +#endif + +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct GRADE_ENCHANT_BLESSING { + int32 id; + int32 amount; + int32 max_blessing; + int32 bonus; +} __attribute__((packed)); + +struct GRADE_ENCHANT_MATERIAL { + int32 nameid; + int32 amount; + int32 price; + int32 downgrade; + int8 breakable; +} __attribute__((packed)); + +struct PACKET_ZC_GRADE_ENCHANT_ADD_ITEM_RESULT { + int16 PacketType; + int16 PacketLength; + int16 index; + int32 success_chance; + struct GRADE_ENCHANT_BLESSING blessing_info; + int32 protect_itemid; // used only for PACKETVER_RE_NUM >= 20200723 && PACKETVER_RE_NUM <= 20200819 + int32 protect_amount; // used only for PACKETVER_RE_NUM >= 20200723 && PACKETVER_RE_NUM <= 20200819 + struct GRADE_ENCHANT_MATERIAL material_info[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GRADE_ENCHANT_ADD_ITEM_RESULT, 0x0b5a); +#endif + +#if PACKETVER_MAIN_NUM >= 20191016 || PACKETVER_RE_NUM >= 20191016 || PACKETVER_ZERO_NUM >= 20191008 +struct PACKET_CZ_GRADE_ENCHANT_START { + int16 PacketType; + int16 index; + int material_index; + int8 blessing_flag; + int blessing_amount; + int8 protect_flag; // used only for PACKETVER_RE_NUM >= 20200723 && PACKETVER_RE_NUM <= 20200819 +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_GRADE_ENCHANT_START, 0x0b5b); +#endif + +#if PACKETVER_MAIN_NUM >= 20191016 || PACKETVER_RE_NUM >= 20191016 || PACKETVER_ZERO_NUM >= 20191008 +struct PACKET_CZ_GRADE_ENCHANT_CLOSE { + int16 PacketType; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_GRADE_ENCHANT_CLOSE, 0x0b5c); +#endif + +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_GRADE_ENCHANT_RESULT { + int16 PacketType; + int16 index; + int16 grade; + int result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GRADE_ENCHANT_RESULT, 0x0b5d); +#endif + +#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 +struct PACKET_ZC_GRADE_STATUS { + int16 packetType; + char name[NAME_LENGTH]; + uint32 itemId; + int16 grade; + int8 status; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_GRADE_STATUS, 0x0b5e); +#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