From cd8b69ef3edafde047ad4db6f7b81afb53bb23f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Oct 2014 20:35:59 +0300 Subject: eathena: add packet SMSG_BEING_STAT_UPDATE_1 0x01ab. --- src/net/eathena/beinghandler.cpp | 25 +++++++++++++++++++++++++ src/net/eathena/beinghandler.h | 2 ++ src/net/eathena/protocol.h | 1 + 3 files changed, 28 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index c92de3651..f96fdd332 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -38,6 +38,8 @@ #include "gui/windows/outfitwindow.h" +#include "net/ea/eaprotocol.h" + #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" #include "net/eathena/sprite.h" @@ -106,6 +108,7 @@ BeingHandler::BeingHandler(const bool enableSync) : SMSG_SKILL_AUTO_CAST, SMSG_RANKS_LIST, SMSG_BEING_FAKE_NAME, + SMSG_BEING_STAT_UPDATE_1, 0 }; handledMessages = _messages; @@ -287,6 +290,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processBeingFakeName(msg); break; + case SMSG_BEING_STAT_UPDATE_1: + processBeingStatUpdate1(msg); + break; + default: break; } @@ -1883,4 +1890,22 @@ void BeingHandler::processBeingFakeName(Net::MessageIn &msg) const dstBeing->setDirection(dir); } +void BeingHandler::processBeingStatUpdate1(Net::MessageIn &msg) const +{ + const int id = msg.readInt32("account id"); + const int type = msg.readInt16("type"); + const int value = msg.readInt32("value"); + + Being *const dstBeing = actorManager->findBeing(id); + if (!dstBeing) + return; + + if (type != Ea::MANNER) + { + logger->log("Error: unknown being stat type: %d", type); + return; + } + dstBeing->setManner(value); +} + } // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index dab13a57e..6a7599c11 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -117,6 +117,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler void processBeingRemoveSkil(Net::MessageIn &msg) const; void processBeingFakeName(Net::MessageIn &msg) const; + + void processBeingStatUpdate1(Net::MessageIn &msg) const; }; } // namespace EAthena diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 005d1c863..ebeb16eba 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -114,6 +114,7 @@ #define SMSG_BEING_NAME_RESPONSE2 0x0220 /**< Has to be requested */ #define SMSG_BEING_CHANGE_DIRECTION 0x009c #define SMSG_BEING_RESURRECT 0x0148 +#define SMSG_BEING_STAT_UPDATE_1 0x01ab #define SMSG_PLAYER_STATUS_CHANGE 0x0229 #define SMSG_PLAYER_STATUS_CHANGE_NO_TICK 0x0196 -- cgit v1.2.3-70-g09d2