diff options
Diffstat (limited to 'src/net/eathena/homunculushandler.cpp')
-rw-r--r-- | src/net/eathena/homunculushandler.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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 |