From a08416d782bb9296578b2a69e4eb1e33f55523a4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Feb 2015 13:39:42 +0300 Subject: eathena: add packet CMSG_HOMMERC_TALK 0x0b13. --- src/net/eathena/mercenaryhandler.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/net/eathena/mercenaryhandler.cpp') diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 165f0b37a..27c1e361c 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -215,4 +215,19 @@ void MercenaryHandler::attack(const int targetId, const bool keep) const outMsg.writeInt8(static_cast(keep ? 1 : 0), "keep"); } +void MercenaryHandler::talk(const std::string &restrict text) const +{ + if (text.empty()) + return; + std::string msg = text; + if (msg.size() > 500) + msg = msg.substr(0, 500); + const size_t sz = msg.size(); + + createOutPacket(CMSG_HOMMERC_TALK); + outMsg.writeInt16(static_cast(sz + 4 + 1), "len"); + outMsg.writeString(msg, sz, "message"); + outMsg.writeInt8(0, "zero byte"); +} + } // namespace EAthena -- cgit v1.2.3-60-g2f50