summaryrefslogtreecommitdiff
path: root/src/net/tmwa/buysellhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/buysellhandler.cpp')
-rw-r--r--src/net/tmwa/buysellhandler.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 2e5f79127..7a8165c89 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -180,4 +180,22 @@ void BuySellHandler::requestBuyList(const std::string &nick) const
}
}
+void BuySellHandler::sendBuyRequest(const std::string &nick,
+ const ShopItem *const item,
+ const int amount) const
+{
+ if (!chatWindow || nick.empty() || !item ||
+ amount < 1 || amount > item->getQuantity())
+ {
+ return;
+ }
+ const std::string data = strprintf("!buyitem %d %d %d",
+ item->getId(), item->getPrice(), amount);
+
+ if (config.getBoolValue("hideShopMessages"))
+ chatHandler->privateMessage(nick, data);
+ else
+ chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER);
+}
+
} // namespace TmwAthena