From 0fa16439e6419827579d3c4e33e4e6bd6788b9ff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Nov 2014 12:50:02 +0300 Subject: Show readable server messages for some limits. --- src/net/eathena/chathandler.cpp | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 50d4569dc..9e1954679 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -337,13 +337,36 @@ void ChatHandler::processChat(Net::MessageIn &msg) void ChatHandler::processFormatMessage(Net::MessageIn &msg) { - int msgId = msg.readInt16("msg id"); + const int msgId = msg.readInt16("msg id"); // +++ here need load message from configuration file - const std::string chatMsg = strprintf("Message #%d", msgId); + std::string chatMsg; if (msgId >= 1266 && msgId <= 1269) + { mercenaryHandler->handleMercenaryMessage(msgId - 1266); - else - processChatContinue(chatMsg, ChatMsgType::BY_SERVER); + return; + } + switch (msgId) + { + case 1334: + chatMsg = _("Can't cast skill in this area."); + break; + case 1335: + chatMsg = _("Can't use item in this area."); + break; + case 1773: + chatMsg = _("Can't equip. Wrong level."); + break; + case 1774: + chatMsg = _("Can't use. Wrong level."); + break; + case 1923: + chatMsg = _("Work in progress."); // busy with npc + break; + default: + chatMsg = strprintf("Message #%d", msgId); + break; + } + processChatContinue(chatMsg, ChatMsgType::BY_SERVER); } void ChatHandler::processFormatMessageNumber(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2