diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-24 23:24:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-24 23:24:39 +0300 |
commit | d2fade5787cb2fa315056410af6d6e6b92438b14 (patch) | |
tree | bbdf2830c78a3230d3a55097a77d4f68498d9d0f /src/net/eathena/homunculushandler.cpp | |
parent | d3e9dc55ac13e99fd2634c87f4ffbff7e8781798 (diff) | |
download | manaplus-d2fade5787cb2fa315056410af6d6e6b92438b14.tar.gz manaplus-d2fade5787cb2fa315056410af6d6e6b92438b14.tar.bz2 manaplus-d2fade5787cb2fa315056410af6d6e6b92438b14.tar.xz manaplus-d2fade5787cb2fa315056410af6d6e6b92438b14.zip |
eathena: add packet SMSG_HOMUNCULUS_INFO 0x022e.
Diffstat (limited to 'src/net/eathena/homunculushandler.cpp')
-rw-r--r-- | src/net/eathena/homunculushandler.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index 7cdafb0aa..36f634de0 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -47,6 +47,7 @@ HomunculusHandler::HomunculusHandler() : { SMSG_HOMUNCULUS_SKILLS, SMSG_HOMUNCULUS_DATA, + SMSG_HOMUNCULUS_INFO, 0 }; handledMessages = _messages; @@ -65,6 +66,10 @@ void HomunculusHandler::handleMessage(Net::MessageIn &msg) processHomunculusData(msg); break; + case SMSG_HOMUNCULUS_INFO: + processHomunculusInfo(msg); + break; + default: break; } @@ -135,4 +140,46 @@ void HomunculusHandler::processHomunculusData(Net::MessageIn &msg) } } +void HomunculusHandler::processHomunculusInfo(Net::MessageIn &msg) +{ + const std::string name = msg.readString(24, "name"); + msg.readUInt8("flags"); // 0x01 - renamed, 0x02 - vaporize, 0x04 - alive + const int level = msg.readInt16("level"); + const int hungry = msg.readInt16("hungry"); + const int intimacy = msg.readInt16("intimacy"); + const int equip = msg.readInt16("equip"); + msg.readInt16("atk"); + msg.readInt16("matk"); + msg.readInt16("hit"); + msg.readInt16("luk/3 or crit/10"); + msg.readInt16("def"); + msg.readInt16("mdef"); + msg.readInt16("flee"); + msg.readInt16("attack speed"); + msg.readInt16("hp"); + msg.readInt16("max hp"); + msg.readInt16("sp"); + msg.readInt16("max sp"); + msg.readInt32("exp"); + msg.readInt32("next exp"); + msg.readInt16("skill points"); + const int range = msg.readInt16("attack range"); + + HomunculusInfo *const info = PlayerInfo::getHomunculus(); + if (!info) // we cant find homunculus being because id is missing + return; + Being *const dstBeing = actorManager->findBeing(info->id); + + if (dstBeing) + { + info->name = name; + info->level = level; + info->range = range; + info->hungry = hungry; + info->intimacy = intimacy; + info->equip = equip; + PlayerInfo::setHomunculusBeing(dstBeing); + } +} + } // namespace EAthena |