summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-23 22:18:00 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-23 22:18:00 +0300
commit76717e42814b805f45354b8c93a693f7b7235e40 (patch)
tree620e8d7a9282b0d8e5acfad47e4aa1462b4bbbea /src/net/eathena/inventoryhandler.cpp
parent3fb968387deba0cbfd59d029aa6cf4789d68d09c (diff)
downloadmanaplus-76717e42814b805f45354b8c93a693f7b7235e40.tar.gz
manaplus-76717e42814b805f45354b8c93a693f7b7235e40.tar.bz2
manaplus-76717e42814b805f45354b8c93a693f7b7235e40.tar.xz
manaplus-76717e42814b805f45354b8c93a693f7b7235e40.zip
Add all versions for packet CMSG_MOVE_TO_STORAGE.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r--src/net/eathena/inventoryhandler.cpp173
1 files changed, 172 insertions, 1 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 44655d9df..343eb2d15 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -272,6 +272,172 @@ void InventoryHandler::closeStorage() const
createOutPacket(CMSG_CLOSE_STORAGE);
}
+void InventoryHandler::moveItemInventoryToStorage(const int slot,
+ const int amount) const
+{
+ createOutPacket(CMSG_MOVE_TO_STORAGE);
+ if (packetVersion >= 20101124)
+ {
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20080827)
+ {
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20070212)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20070108)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20060327)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20050719)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20050718)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20050628)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20050509)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20050110)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20041129)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20041025)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20041005)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20040920)
+ {
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20040906)
+ {
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20040809)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else if (packetVersion >= 20040726)
+ {
+ outMsg.writeInt16(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(0, "unknown");
+ outMsg.writeInt8(0, "unknown");
+ outMsg.writeInt32(amount, "amount");
+ }
+ else
+ {
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET), "index");
+ outMsg.writeInt32(amount, "amount");
+ }
+}
+
void InventoryHandler::moveItem2(const InventoryTypeT source,
const int slot,
const int amount,
@@ -282,9 +448,14 @@ void InventoryHandler::moveItem2(const InventoryTypeT source,
if (source == InventoryType::Inventory)
{
if (destination == InventoryType::Storage)
- packet = CMSG_MOVE_TO_STORAGE;
+ {
+ moveItemInventoryToStorage(slot, amount);
+ return;
+ }
else if (destination == InventoryType::Cart)
+ {
packet = CMSG_MOVE_TO_CART;
+ }
}
else if (source == InventoryType::Storage)
{