diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-06 00:09:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:58 +0300 |
commit | 1ec5a1847a7c226d6dfee2a5d46c121a9a037161 (patch) | |
tree | f38c9c3e75b1c89af7c0e2787cdc07e7629badbc /src | |
parent | 298e63668f6fc6944dde59dd82bc99cb8199887c (diff) | |
download | manaplus-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.gz manaplus-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.bz2 manaplus-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.xz manaplus-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.zip |
eathena: add packet SMSG_MONSTER_HP 0x0977.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 17 | ||||
-rw-r--r-- | src/net/eathena/beinghandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index b856bc575..baaa3eccc 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -221,6 +221,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processMapTypeProperty(msg); break; + case SMSG_MONSTER_HP: + processMonsterHp(msg); + break; + default: break; } @@ -1047,4 +1051,17 @@ void BeingHandler::processBeingAction2(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processBeingAction") } +void BeingHandler::processMonsterHp(Net::MessageIn &msg) const +{ + Being *const dstBeing = actorManager->findBeing( + msg.readInt32("monster id")); + const int hp = msg.readInt32("hp"); + const int maxHP = msg.readInt32("max hp"); + if (dstBeing) + { + dstBeing->setHP(hp); + dstBeing->setMaxHP(maxHP); + } +} + } // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index d3744ba78..2d4afd0d9 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -61,6 +61,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler void processBeingMove2(Net::MessageIn &msg) const; void processBeingAction2(Net::MessageIn &msg) const; + + void processMonsterHp(Net::MessageIn &msg) const; }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index b84468d27..6775691f1 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -245,7 +245,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0980 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, -1, -1, 0, 0, 0, 0, 0, 0, 11, 9, 8, 0, 0, 0, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index d3426f19c..aa1ed94c2 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -192,6 +192,7 @@ #define SMSG_QUEST_REMOVE 0x02b4 #define SMSG_MVP 0x010c +#define SMSG_MONSTER_HP 0x0977 /********************************** * Packets from client to server * |