summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-16 20:59:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-16 20:59:21 +0300
commit2b498808d000346d2310d0a5a1906eadf98cf2ce (patch)
treed98cfc196433de4807e19333c810f518436acd18
parent3242aa80fbee19eb421ace68d1c3c69e4fc777e6 (diff)
downloadplus-2b498808d000346d2310d0a5a1906eadf98cf2ce.tar.gz
plus-2b498808d000346d2310d0a5a1906eadf98cf2ce.tar.bz2
plus-2b498808d000346d2310d0a5a1906eadf98cf2ce.tar.xz
plus-2b498808d000346d2310d0a5a1906eadf98cf2ce.zip
Add packet SMSG_ITEM_DROPPED2 0x0b19.
-rw-r--r--src/net/eathena/itemhandler.cpp38
-rw-r--r--src/net/eathena/itemhandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
4 files changed, 42 insertions, 1 deletions
diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp
index 004b97104..827541e90 100644
--- a/src/net/eathena/itemhandler.cpp
+++ b/src/net/eathena/itemhandler.cpp
@@ -41,6 +41,7 @@ ItemHandler::ItemHandler() :
SMSG_ITEM_VISIBLE,
SMSG_ITEM_VISIBLE2,
SMSG_ITEM_DROPPED,
+ SMSG_ITEM_DROPPED2,
SMSG_ITEM_REMOVE,
SMSG_GRAFFITI_VISIBLE,
SMSG_ITEM_MVP_DROPPED,
@@ -77,6 +78,10 @@ void ItemHandler::handleMessage(Net::MessageIn &msg)
processItemVisible2(msg);
break;
+ case SMSG_ITEM_DROPPED2:
+ processItemDropped2(msg);
+ break;
+
default:
break;
}
@@ -110,6 +115,39 @@ void ItemHandler::processItemDropped(Net::MessageIn &msg)
}
}
+void ItemHandler::processItemDropped2(Net::MessageIn &msg)
+{
+ const BeingId id = msg.readBeingId("id");
+ const int itemId = msg.readInt16("item id");
+ const int itemType = msg.readUInt8("type");
+ const Identified identified = fromInt(
+ msg.readUInt8("identify"), Identified);
+ msg.readUInt8("attribute");
+ const uint8_t refine = msg.readUInt8("refine");
+ int cards[4];
+ for (int f = 0; f < 4; f++)
+ cards[f] = msg.readInt16("card");
+ const int x = msg.readInt16("x");
+ const int y = msg.readInt16("y");
+ const int amount = msg.readInt16("amount");
+ const int subX = static_cast<int>(msg.readInt8("subx"));
+ const int subY = static_cast<int>(msg.readInt8("suby"));
+
+ if (actorManager)
+ {
+ actorManager->createItem(id,
+ itemId,
+ x, y,
+ itemType,
+ amount,
+ 0,
+ ItemColor_one,
+ identified,
+ subX, subY,
+ nullptr);
+ }
+}
+
void ItemHandler::processGraffiti(Net::MessageIn &msg)
{
UNIMPLIMENTEDPACKET;
diff --git a/src/net/eathena/itemhandler.h b/src/net/eathena/itemhandler.h
index f7029e1d0..194b29273 100644
--- a/src/net/eathena/itemhandler.h
+++ b/src/net/eathena/itemhandler.h
@@ -42,6 +42,8 @@ class ItemHandler final : public MessageHandler, public Ea::ItemHandler
protected:
static void processItemDropped(Net::MessageIn &msg);
+ static void processItemDropped2(Net::MessageIn &msg);
+
static void processGraffiti(Net::MessageIn &msg);
static void processItemMvpDropped(Net::MessageIn &msg);
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 722feca7d..4f5f8a95e 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -282,7 +282,7 @@ int16_t packet_lengths[] =
//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// #0x0B00
16, -1, 10, -1, -1, -1, -1, 0, 27, 0, -1, -1, 0, 0, 0, 0,
- -1, 0, 0, 0, 0, 0, -1, 19, 28, 0, 0, 0, 0, 0, 0, 0,
+ -1, 0, 0, 0, 0, 0, -1, 19, 28, 28, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// #0x0B40
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 562ae4d06..1f3be9ef0 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -143,6 +143,7 @@ packet(SMSG_ITEM_VISIBLE, 0x009d); /**< An item is on the floor */
packet(SMSG_ITEM_VISIBLE2, 0x0b18);
packet(SMSG_GRAFFITI_VISIBLE, 0x01c9);
packet(SMSG_ITEM_DROPPED, 0x084b); /**< An item is dropped */
+packet(SMSG_ITEM_DROPPED2, 0x0b19);
packet(SMSG_ITEM_MVP_DROPPED, 0x07fd);
packet(SMSG_ITEM_REMOVE, 0x00a1); /**< An item disappers */
packet(SMSG_BEING_VISIBLE, 0x0915);