summaryrefslogtreecommitdiff
path: root/src/net/eathena/mercenaryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-25 13:39:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-25 13:39:42 +0300
commita08416d782bb9296578b2a69e4eb1e33f55523a4 (patch)
tree467817701e3c35ea6a41e8723d31b652c910db21 /src/net/eathena/mercenaryhandler.cpp
parentc551238526f12f0c28bf44bc131c7e95d675b61d (diff)
downloadmanaverse-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.gz
manaverse-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.bz2
manaverse-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.xz
manaverse-a08416d782bb9296578b2a69e4eb1e33f55523a4.zip
eathena: add packet CMSG_HOMMERC_TALK 0x0b13.
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