summaryrefslogtreecommitdiff
path: root/src/net/eathena/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-06 00:09:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:58 +0300
commit1ec5a1847a7c226d6dfee2a5d46c121a9a037161 (patch)
treef38c9c3e75b1c89af7c0e2787cdc07e7629badbc /src/net/eathena/beinghandler.cpp
parent298e63668f6fc6944dde59dd82bc99cb8199887c (diff)
downloadmanaverse-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.gz
manaverse-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.bz2
manaverse-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.tar.xz
manaverse-1ec5a1847a7c226d6dfee2a5d46c121a9a037161.zip
eathena: add packet SMSG_MONSTER_HP 0x0977.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r--src/net/eathena/beinghandler.cpp17
1 files changed, 17 insertions, 0 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