From 03d1705dfafccdcd5ed613a2cca699e80978f747 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 Jul 2018 07:23:36 +0300 Subject: Add new chanaged packet where item id with size int32 was introduced. Also fix some other packets for support int32 ints. --- src/net/eathena/homunculusrecv.cpp | 2 +- src/net/eathena/npchandler.cpp | 17 +++++++++++------ src/net/eathena/packetsin.inc | 29 +++++++++++++++++++++++++++++ src/net/eathena/packetsout.inc | 10 ++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/net/eathena/homunculusrecv.cpp b/src/net/eathena/homunculusrecv.cpp index 5f0b586bd..33bde140c 100644 --- a/src/net/eathena/homunculusrecv.cpp +++ b/src/net/eathena/homunculusrecv.cpp @@ -123,7 +123,7 @@ void HomunculusRecv::processHomunculusInfo(Net::MessageIn &msg) Notify_true); const int hungry = msg.readInt16("hungry"); const int intimacy = msg.readInt16("intimacy"); - const int equip = msg.readInt16("equip"); + const int equip = msg.readItemId("item id"); PlayerInfo::setStatBase(Attributes::HOMUN_ATK, msg.readInt16("atk"), Notify_true); diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index eb4108bb2..f8bcea2d7 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -279,10 +279,10 @@ void NpcHandler::produceMix(const int nameId, const int materialId3) const { createOutPacket(CMSG_NPC_PRODUCE_MIX); - outMsg.writeInt16(CAST_S16(nameId), "name id"); - outMsg.writeInt16(CAST_S16(materialId1), "material 1"); - outMsg.writeInt16(CAST_S16(materialId2), "material 2"); - outMsg.writeInt16(CAST_S16(materialId3), "material 3"); + outMsg.writeItemId(nameId, "item id"); + outMsg.writeItemId(materialId1, "material 1"); + outMsg.writeItemId(materialId2, "material 2"); + outMsg.writeItemId(materialId3, "material 3"); } void NpcHandler::cooking(const CookingTypeT type, @@ -290,13 +290,18 @@ void NpcHandler::cooking(const CookingTypeT type, { createOutPacket(CMSG_NPC_COOKING); outMsg.writeInt16(CAST_S16(type), "type"); - outMsg.writeInt16(CAST_S16(nameId), "name id"); + outMsg.writeItemId(nameId, "item id"); } void NpcHandler::repair(const int index) const { createOutPacket(CMSG_NPC_REPAIR); outMsg.writeInt16(CAST_S16(index), "index"); + // unused fields. + outMsg.writeItemId(0, "item id"); + outMsg.writeInt8(0, "refine"); + for (int f = 0; f < maxCards; f ++) + outMsg.writeItemId(0, "card"); } void NpcHandler::refine(const int index) const @@ -314,7 +319,7 @@ void NpcHandler::identify(const int index) const void NpcHandler::selectArrow(const int nameId) const { createOutPacket(CMSG_NPC_SELECT_ARROW); - outMsg.writeInt16(CAST_S16(nameId), "name id"); + outMsg.writeItemId(nameId, "item id"); } void NpcHandler::selectAutoSpell(const int skillId) const diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 019f0c418..91e4e3cba 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -1132,6 +1132,35 @@ if (packetVersion >= 20180627) packet(SMSG_LOGIN_ERROR2, 0x0b02, 26, &LoginRecv::processLoginError2, 20180627); } +// 20180704 re +if (packetVersionRe >= 20180704) +{ + packet(SMSG_ITEM_VISIBLE, 0x009d, 19, &ItemRecv::processItemVisible, 20180704); + packet(SMSG_MVP_ITEM, 0x010a, 6, &ChatRecv::processMVPItem, 20180704); + packet(SMSG_SKILL_FAILED, 0x0110, 14, &SkillRecv::processSkillFailed, 20180704); + packet(SMSG_PLAYER_SKILL_PRODUCE_EFFECT, 0x018f, 8, &SkillRecv::processSkillProduceEffect, 20180704); + packet(SMSG_PET_FOOD, 0x01a3, 7, &PetRecv::processPetFood, 20180704); + packet(SMSG_PLAYER_INVENTORY_USE, 0x01c8, 15, &Ea::InventoryRecv::processPlayerInventoryUse, 20180704); + packet(SMSG_BEING_CHANGE_LOOKS2, 0x01d7, 15, &BeingRecv::processBeingChangeLook2, 20180704); + packet(SMSG_PLAYER_UPGRADE_MESSAGE, 0x0223, 10, &PlayerRecv::processPlayerUpgradeMessage, 20180704); + packet(SMSG_HOMUNCULUS_FOOD, 0x022f, 7, &HomunculusRecv::processHomunculusFood, 20180704); + packet(SMSG_PLAYER_ITEM_RENTAL_TIME, 0x0298, 10, &InventoryRecv::processPlayerItemRentalTime, 20180704); + packet(SMSG_PLAYER_ITEM_RENTAL_EXPIRED, 0x0299, 8, &InventoryRecv::processPlayerItemRentalExpired, 20180704); + packet(SMSG_PARTY_ITEM_PICKUP, 0x02b8, 32, &PartyRecv::processPartyItemPickup, 20180704); + packet(SMSG_BUYINGSTORE_SELLER_SELL_FAILED, 0x0824, 8, &BuyingStoreRecv::processBuyingStoreSellerSellFailed, 20180704); + packet(SMSG_BUYINGSTORE_REPORT, 0x09e6, 24, &BuyingStoreRecv::processBuyingStoreReport, 20180704); + packet(SMSG_HOMUNCULUS_INFO, 0x09f7, 77, &HomunculusRecv::processHomunculusInfo, 20180704); + packet(SMSG_MAIL2_ADD_ITEM_RESULT, 0x0a05, 63, &Mail2Recv::processAddItemResult, 20180704); + packet(SMSG_TRADE_ITEM_ADD, 0x0a09, 55, &TradeRecv::processTradeItemAdd, 20180704); + packet(SMSG_PLAYER_STORAGE_ADD, 0x0a0a, 57, &InventoryRecv::processPlayerStorageAdd, 20180704); + packet(SMSG_PLAYER_CART_ADD, 0x0a0b, 57, &InventoryRecv::processPlayerCartAdd, 20180704); + packet(SMSG_ROULETTE_OPEN_ACK, 0x0a1a, 25, &RouletteRecv::processRouletteOpenAck, 20180704); + packet(SMSG_ROULETTE_GENERATE_ACK_TYPE, 0x0a20, 23, &RouletteRecv::processRouletteGenerateAckType, 20180704); + packet(SMSG_ROULETTE_RECV_ITEM_ACK, 0x0a22, 7, &RouletteRecv::processRouletteItemAck, 20180704); + packet(SMSG_PLAYER_INVENTORY_ADD, 0x0a37, 69, &InventoryRecv::processPlayerInventoryAdd, 20180704); + packet(SMSG_ITEM_DROPPED, 0x0add, 24, &ItemRecv::processItemDropped, 20180704); +} + // 0 // evol always packets packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, -1, &LoginRecv::processServerVersion, 0); diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc index 6b3e3dd34..59926bbdb 100644 --- a/src/net/eathena/packetsout.inc +++ b/src/net/eathena/packetsout.inc @@ -1403,4 +1403,14 @@ if (packetVersionZero >= 20180411) packet(CMSG_ATTENDANCE_REWARD, 0x0aef, 2, clif->pAttendanceRewardRequest); } +// 20180704 re +if (packetVersionRe >= 20180704) +{ + packet(CMSG_NPC_PRODUCE_MIX, 0x018e, 18, clif->pProduceMix); + packet(CMSG_NPC_SELECT_ARROW, 0x01ae, 6, clif->pSelectArrow); + packet(CMSG_NPC_REPAIR, 0x01fd, 25, clif->pRepairItem); + packet(CMSG_NPC_COOKING, 0x025b, 8, clif->pCooking); + packet(CMSG_PRIVATE_AIRSHIP_REQUEST, 0x0a49, 22, clif->pPrivateAirshipRequest); +} + #endif -- cgit v1.2.3-60-g2f50