summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/markethandler.cpp10
-rw-r--r--src/net/eathena/markethandler.h4
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/markethandler.h4
-rw-r--r--src/net/tmwa/markethandler.cpp6
-rw-r--r--src/net/tmwa/markethandler.h5
6 files changed, 30 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
diff --git a/src/net/markethandler.h b/src/net/markethandler.h
index 348c262a6..8e31d8613 100644
--- a/src/net/markethandler.h
+++ b/src/net/markethandler.h
@@ -35,6 +35,10 @@ class MarketHandler notfinal
{ }
virtual void close() = 0;
+
+ virtual void buyItem(const int itemId,
+ const unsigned char color,
+ const int amount) const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/markethandler.cpp b/src/net/tmwa/markethandler.cpp
index 5e7a6a9c4..4ac91a5a8 100644
--- a/src/net/tmwa/markethandler.cpp
+++ b/src/net/tmwa/markethandler.cpp
@@ -51,4 +51,10 @@ void MarketHandler::close()
{
}
+void MarketHandler::buyItem(const int itemId A_UNUSED,
+ const unsigned char color A_UNUSED,
+ const int amount A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/markethandler.h b/src/net/tmwa/markethandler.h
index d3e1a3101..b9d1a013e 100644
--- a/src/net/tmwa/markethandler.h
+++ b/src/net/tmwa/markethandler.h
@@ -38,6 +38,11 @@ class MarketHandler final : public MessageHandler,
void handleMessage(Net::MessageIn &msg) override final;
void close() override final;
+
+ void buyItem(const int itemId,
+ const unsigned char color,
+ const int amount) const override final;
+
};
} // namespace TmwAthena