From 8caabaeaf267d617ae04f13454bb587c3dbfa427 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 29 Nov 2014 13:31:02 +0300 Subject: eathena: add packet SMSG_MOB_INFO 0x0b03. --- src/net/eathena/beinghandler.cpp | 17 +++++++++++++++++ src/net/eathena/beinghandler.h | 2 ++ src/net/eathena/packets.h | 2 +- src/net/eathena/protocol.h | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 71d7ea5b8..447e7fc4a 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -118,6 +118,7 @@ BeingHandler::BeingHandler(const bool enableSync) : SMSG_RANKS_LIST, SMSG_BEING_FAKE_NAME, SMSG_BEING_STAT_UPDATE_1, + SMSG_MOB_INFO, 0 }; handledMessages = _messages; @@ -319,6 +320,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processBeingStatUpdate1(msg); break; + case SMSG_MOB_INFO: + processMobInfo(msg); + break; + default: break; } @@ -1965,4 +1970,16 @@ void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) BLOCK_END("BeingHandler::processBeingSelfEffect") } +void BeingHandler::processMobInfo(Net::MessageIn &msg) +{ + const int len = msg.readInt16("len"); + if (len < 12) + return; + Being *const dstBeing = actorManager->findBeing( + msg.readInt32("monster id")); + const int attackRange = msg.readInt32("range"); + if (dstBeing) + dstBeing->setAttackRange(attackRange); +} + } // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index cafe2457f..cb5c5d6a4 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -124,6 +124,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void processPlaterStatusChange2(Net::MessageIn &msg); static void processBeingSelfEffect(Net::MessageIn &msg); + + static void processMobInfo(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 5e71c7304..69b0239be 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -279,7 +279,7 @@ int16_t packet_lengths[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0B00 - 16, -1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, -1, 10, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index b101e273a..469cdb77c 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -307,8 +307,11 @@ #define SMSG_ELEMENTAL_INFO 0x081d #define SMSG_UPDATE_HOST 0x0063 + #define SMSG_MAP_MASK 0x0b02 +#define SMSG_MOB_INFO 0x0b03 + /********************************** * Packets from client to server * **********************************/ -- cgit v1.2.3-60-g2f50