diff options
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 0422570d7..26b9a1c64 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -50,6 +50,7 @@ #include "gui/widgets/whispertab.h" #include "net/chathandler.h" +#include "net/playerhandler.h" #include "net/net.h" #include "utils/dtor.h" @@ -803,6 +804,27 @@ void ChatWindow::event(Channels channel, const Mana::Event &event) break; }; } + else if (event.getName() == EVENT_UPDATESTAT) + { + if (!config.getBoolValue("showJobExp")) + return; + + int id = event.getInt("id"); + if (id == Net::getPlayerHandler()->getJobLocation()) + { + std::pair<int, int> exp + = PlayerInfo::getStatExperience(id); + if (event.getInt("oldValue1") > exp.first + || !event.getInt("oldValue2")) + { + return; + } + + int change = exp.first - event.getInt("oldValue1"); + if (change != 0) + battleChatLog("+" + toString(change) + " job"); + } + } } } |