summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-25 02:54:24 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-25 02:54:24 +0300
commit2fa664c6c3aa7b6a83283bd9fc040cb65a332734 (patch)
tree6b17283ef1f8022fa6454ae8c709501974cd1eed /src/net
parentc9795055ee1b6079ef9b0c0e3faf4bb79704bd98 (diff)
downloadmv-2fa664c6c3aa7b6a83283bd9fc040cb65a332734.tar.gz
mv-2fa664c6c3aa7b6a83283bd9fc040cb65a332734.tar.bz2
mv-2fa664c6c3aa7b6a83283bd9fc040cb65a332734.tar.xz
mv-2fa664c6c3aa7b6a83283bd9fc040cb65a332734.zip
Add homunculus attributes. Set homunculus attributes from server.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/homunculusrecv.cpp48
1 files changed, 33 insertions, 15 deletions
diff --git a/src/net/eathena/homunculusrecv.cpp b/src/net/eathena/homunculusrecv.cpp
index 54c585424..c836e07bb 100644
--- a/src/net/eathena/homunculusrecv.cpp
+++ b/src/net/eathena/homunculusrecv.cpp
@@ -113,25 +113,43 @@ void HomunculusRecv::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");
+ PlayerInfo::setAttribute(Attributes::HOMUN_LEVEL, 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");
+ PlayerInfo::setAttribute(Attributes::HOMUN_ATK,
+ msg.readInt16("atk"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_MATK,
+ msg.readInt16("matk"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_HIT,
+ msg.readInt16("hit"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_CRIT,
+ msg.readInt16("luk/3 or crit/10"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_DEF,
+ msg.readInt16("def"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_MDEF,
+ msg.readInt16("mdef"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_FLEE,
+ msg.readInt16("flee"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_ATTACK_DELAY,
+ msg.readInt16("attack speed"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_HP,
+ msg.readInt16("hp"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_MAX_HP,
+ msg.readInt16("max hp"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_MP,
+ msg.readInt16("sp"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_MAX_MP,
+ msg.readInt16("max sp"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_EXP,
+ msg.readInt32("exp"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_EXP_NEEDED,
+ msg.readInt32("next exp"));
+ PlayerInfo::setAttribute(Attributes::HOMUN_SKILL_POINTS,
+ msg.readInt16("skill points"));
const int range = msg.readInt16("attack range");
+ PlayerInfo::setAttribute(Attributes::HOMUN_ATTACK_RANGE,
+ range);
HomunculusInfo *const info = PlayerInfo::getHomunculus();
if (!info) // we can't find homunculus being because id is missing