From a08416d782bb9296578b2a69e4eb1e33f55523a4 Mon Sep 17 00:00:00 2001 From: Andrei Karas <akaras@inbox.ru> Date: Wed, 25 Feb 2015 13:39:42 +0300 Subject: eathena: add packet CMSG_HOMMERC_TALK 0x0b13. --- src/net/eathena/homunculushandler.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/net/eathena/homunculushandler.cpp') diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index 6a8c42efa..7eafac3cc 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -285,4 +285,19 @@ void HomunculusHandler::fire() const outMsg.writeInt8(2, "command"); // delete } +void HomunculusHandler::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<int16_t>(sz + 4 + 1), "len"); + outMsg.writeString(msg, sz, "message"); + outMsg.writeInt8(0, "zero byte"); +} + } // namespace EAthena -- cgit v1.2.3-70-g09d2