From 1254155e406e83035d25190dfc9f5c25a839fc0d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Apr 2016 03:20:54 +0300 Subject: Add packet SMSG_BEING_ACTION2 0x02e1. --- src/net/eathena/beingrecv.cpp | 13 ++++++++++--- src/net/eathena/packetsin.inc | 16 ++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index a70c68bd8..3a1438c15 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -921,13 +921,20 @@ void BeingRecv::processBeingAction2(Net::MessageIn &msg) msg.readInt32("tick"); const int srcSpeed = msg.readInt32("src speed"); msg.readInt32("dst speed"); - const int param1 = msg.readInt32("damage"); - if (serverVersion == 0 || serverVersion >= 11) + int param1; + if (msg.getVersion() >= 20071113) + param1 = msg.readInt32("damage"); + else + param1 = msg.readInt16("damage"); + if (msg.getVersion() >= 20131223) msg.readUInt8("is sp damaged"); msg.readInt16("count"); const AttackTypeT type = static_cast( msg.readUInt8("action")); - msg.readInt32("left damage"); + if (msg.getVersion() >= 20071113) + msg.readInt32("left damage"); + else + msg.readInt16("left damage"); switch (type) { diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 0c99439f7..f5ec52716 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -24,6 +24,9 @@ packet(SMSG_PLAYER_STORAGE_ADD, 0x01c4, 22, &InventoryRecv::processPlayerStorageAdd, 5); packet(SMSG_PLAYER_CART_ADD, 0x01c5, 22, &InventoryRecv::processPlayerCartAdd, 5); +// 20071113 +packet(SMSG_BEING_ACTION2, 0x02e1, 33, &BeingRecv::processBeingAction2, 20071113); + // 20080102 packet(SMSG_MAP_LOGIN_SUCCESS, 0x02eb, 14, &GameRecv::processMapLogin, 20080102); @@ -33,12 +36,6 @@ packet(SMSG_PLAYER_SHORTCUTS, 0x07d9, 269, &PlayerRecv::processPlay // 20100223 packet(SMSG_TRADE_ITEM_ADD, 0x080f, 20, &TradeRecv::processTradeItemAdd, 20100223); -// < 20131223 -if (serverVersion > 0 && serverVersion <= 10) -{ - packet(SMSG_BEING_ACTION2, 0x02e1, 33, &BeingRecv::processBeingAction2, 0); -} - // 20120221 packet(SMSG_BEING_VISIBLE, 0x0915, -1, &BeingRecv::processBeingVisible, 20120221); packet(SMSG_BEING_MOVE, 0x0914, -1, &BeingRecv::processBeingMove, 20120221); @@ -54,6 +51,7 @@ packet(SMSG_PLAYER_CART_EQUIP, 0x0994, -1, &InventoryRecv::processP packet(SMSG_BEING_VISIBLE, 0x09dd, -1, &BeingRecv::processBeingVisible, 20131223); packet(SMSG_BEING_MOVE, 0x09db, -1, &BeingRecv::processBeingMove, 20131223); packet(SMSG_BEING_SPAWN, 0x09dc, -1, &BeingRecv::processBeingSpawn, 20131223); +packet(SMSG_BEING_ACTION2, 0x08c8, 34, &BeingRecv::processBeingAction2, 20131223); // 20141022 packet(SMSG_MAP_LOGIN_SUCCESS, 0x0a18, 14, &GameRecv::processMapLogin, 20141022); @@ -459,12 +457,6 @@ packet(SMSG_WHISPER, 0x0097, -1, &ChatRecv::processWhispe packet(SMSG_WHISPER_RESPONSE, 0x09df, 7, &ChatRecv::processWhisperResponse, 0); packet(SMSG_WHO_ANSWER, 0x00c2, 6, &Ea::GameRecv::processWhoAnswer, 0); -// 20150000 fix -if (serverVersion >= 11 || serverVersion == 0) -{ - packet(SMSG_BEING_ACTION2, 0x08c8, 34, &BeingRecv::processBeingAction2, 0); -} - if ((serverVersion >= 8 || serverVersion == 0) && packetVersion >= 20150226) { packet(SMSG_VENDING_OPEN, 0x0136, -1, &VendingRecv::processOpen, 0); -- cgit v1.2.3-70-g09d2