summaryrefslogtreecommitdiff
path: root/src/net/eathena/mercenaryhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/mercenaryhandler.cpp')
-rw-r--r--src/net/eathena/mercenaryhandler.cpp15
1 files changed, 15 insertions, 0 deletions
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<int8_t>(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<int16_t>(sz + 4 + 1), "len");
+ outMsg.writeString(msg, sz, "message");
+ outMsg.writeInt8(0, "zero byte");
+}
+
} // namespace EAthena