summaryrefslogtreecommitdiff
path: root/src/net/eathena/homunculusrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/homunculusrecv.cpp')
-rw-r--r--src/net/eathena/homunculusrecv.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/net/eathena/homunculusrecv.cpp b/src/net/eathena/homunculusrecv.cpp
index 95117e967..1e9a0d7a7 100644
--- a/src/net/eathena/homunculusrecv.cpp
+++ b/src/net/eathena/homunculusrecv.cpp
@@ -267,6 +267,83 @@ void HomunculusRecv::processHomunculusInfo2(Net::MessageIn &msg)
PlayerInfo::setHomunculusBeing(dstBeing);
}
+void HomunculusRecv::processHomunculusInfo3(Net::MessageIn &msg)
+{
+ if (actorManager == nullptr)
+ return;
+ const std::string name = msg.readString(24, "name");
+ msg.readUInt8("flags"); // 0x01 - renamed, 0x02 - vaporize, 0x04 - alive
+ const int level = msg.readInt16("level");
+ PlayerInfo::setStatBase(Attributes::HOMUN_LEVEL,
+ level,
+ Notify_true);
+ const int hungry = msg.readInt16("hungry");
+ const int intimacy = msg.readInt16("intimacy");
+ PlayerInfo::setStatBase(Attributes::HOMUN_ATK,
+ msg.readInt16("atk"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_MATK,
+ msg.readInt16("matk"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_HIT,
+ msg.readInt16("hit"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_CRIT,
+ msg.readInt16("luk/3 or crit/10"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_DEF,
+ msg.readInt16("def"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_MDEF,
+ msg.readInt16("mdef"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_FLEE,
+ msg.readInt16("flee"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_ATTACK_DELAY,
+ msg.readInt16("attack speed"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_HP,
+ msg.readInt32("hp"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_MAX_HP,
+ msg.readInt32("max hp"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_MP,
+ msg.readInt16("sp"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_MAX_MP,
+ msg.readInt16("max sp"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_EXP,
+ msg.readInt32("exp"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_EXP_NEEDED,
+ msg.readInt32("next exp"),
+ Notify_true);
+ PlayerInfo::setStatBase(Attributes::HOMUN_SKILL_POINTS,
+ msg.readInt16("skill points"),
+ Notify_true);
+ const int range = msg.readInt16("attack range");
+ PlayerInfo::setStatBase(Attributes::HOMUN_ATTACK_RANGE,
+ range,
+ Notify_true);
+
+ PlayerInfo::updateAttrs();
+ HomunculusInfo *const info = PlayerInfo::getHomunculus();
+ if (info == nullptr)
+ return;
+ Being *const dstBeing = actorManager->findBeing(info->id);
+
+ info->name = name;
+ info->level = level;
+ info->range = range;
+ info->hungry = hungry;
+ info->intimacy = intimacy;
+ info->equip = 0;
+ PlayerInfo::setHomunculusBeing(dstBeing);
+}
+
void HomunculusRecv::processHomunculusSkillUp(Net::MessageIn &msg)
{
const int skillId = msg.readInt16("skill id");