diff options
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 |