diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-22 02:18:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-22 02:18:52 +0300 |
commit | 4482f516b5bd6677b5eb045bdc624f50a6ac6313 (patch) | |
tree | 0fcd6877861fa4cef51b7e2b435665d685126835 /src/net/eathena | |
parent | 7787e10673e0b2a379b713ec823c6858e5ec1249 (diff) | |
download | plus-4482f516b5bd6677b5eb045bdc624f50a6ac6313.tar.gz plus-4482f516b5bd6677b5eb045bdc624f50a6ac6313.tar.bz2 plus-4482f516b5bd6677b5eb045bdc624f50a6ac6313.tar.xz plus-4482f516b5bd6677b5eb045bdc624f50a6ac6313.zip |
eathena: add packet CMSG_NPC_MARKET_BUY 0x09d6.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/markethandler.cpp | 10 | ||||
-rw-r--r-- | src/net/eathena/markethandler.h | 4 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index 915b850fd..4631abf03 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -73,4 +73,14 @@ void MarketHandler::close() createOutPacket(CMSG_NPC_MARKET_CLOSE); } +void MarketHandler::buyItem(const int itemId, + const unsigned char color A_UNUSED, + const int amount) const +{ + createOutPacket(CMSG_NPC_MARKET_BUY); + outMsg.writeInt16(8, "len"); + outMsg.writeInt16(static_cast<int16_t>(itemId), "item id"); + outMsg.writeInt16(static_cast<int16_t>(amount), "amount"); +} + } // namespace EAthena diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h index ab12cc215..41d2a0126 100644 --- a/src/net/eathena/markethandler.h +++ b/src/net/eathena/markethandler.h @@ -39,6 +39,10 @@ class MarketHandler final : public MessageHandler, void close() override final; + void buyItem(const int itemId, + const unsigned char color, + const int amount) const override final; + protected: void processMarketOpen(Net::MessageIn &msg); }; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index fa5940ea3..27e7339f3 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -383,6 +383,7 @@ #define CMSG_NPC_BUY_REQUEST 0x00c8 #define CMSG_NPC_SELL_REQUEST 0x00c9 #define CMSG_NPC_MARKET_CLOSE 0x09d8 +#define CMSG_NPC_MARKET_BUY 0x09d6 #define CMSG_TRADE_REQUEST 0x00e4 #define CMSG_TRADE_RESPONSE 0x00e6 |