From cee0e9966fb9ec9068aa7483cf38ff128508193b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 30 Sep 2014 20:24:15 +0300 Subject: eathena: add packet SMSG_BEING_FAKE_NAME 0x0078. --- src/net/eathena/beinghandler.cpp | 26 ++++++++++++++++++++++++++ src/net/eathena/beinghandler.h | 2 ++ src/net/eathena/protocol.h | 1 + 3 files changed, 29 insertions(+) (limited to 'src') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index c51651f38..56f894097 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -105,6 +105,7 @@ BeingHandler::BeingHandler(const bool enableSync) : SMSG_PLAYER_HP, SMSG_SKILL_AUTO_CAST, SMSG_RANKS_LIST, + SMSG_BEING_FAKE_NAME, 0 }; handledMessages = _messages; @@ -282,6 +283,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processRanksList(msg); break; + case SMSG_BEING_FAKE_NAME: + processBeingFakeName(msg); + break; + default: break; } @@ -1860,4 +1865,25 @@ void BeingHandler::processBeingRemoveSkil(Net::MessageIn &msg) const msg.readInt32("skill unit id"); } +void BeingHandler::processBeingFakeName(Net::MessageIn &msg) const +{ + const BeingType::BeingType type = static_cast( + msg.readUInt8("object type")); + const int id = msg.readInt32("npc id"); + msg.skip(8, "unused"); + const int job = msg.readInt16("class?"); // 111 + msg.skip(30, "unused"); + uint16_t x, y; + uint8_t dir; + msg.readCoordinates(x, y, dir, "position"); + msg.readUInt8("sx"); + msg.readUInt8("sy"); + msg.skip(4, "unsued"); + + Being *const dstBeing = createBeing2(id, job, type); + dstBeing->setSubtype(job, 0); + dstBeing->setTileCoords(x, y); + dstBeing->setDirection(dir); +} + } // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 9bd811f10..dab13a57e 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -115,6 +115,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler void processPlayerGuilPartyInfo(Net::MessageIn &msg) const; void processBeingRemoveSkil(Net::MessageIn &msg) const; + + void processBeingFakeName(Net::MessageIn &msg) const; }; } // namespace EAthena diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index c5b4d5c0d..45356938e 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -91,6 +91,7 @@ #define SMSG_ITEM_DROPPED 0x084b /**< An item is dropped */ #define SMSG_ITEM_REMOVE 0x00a1 /**< An item disappers */ #define SMSG_BEING_VISIBLE 0x0915 +#define SMSG_BEING_FAKE_NAME 0x0078 #define SMSG_BEING_MOVE 0x0914 /**< A nearby monster moves */ #define SMSG_BEING_SPAWN 0x090f /**< A being spawns nearby */ #define SMSG_BEING_MOVE2 0x0086 /**< New eAthena being moves */ -- cgit v1.2.3-70-g09d2