summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/mercenaryrecv.cpp52
1 files changed, 36 insertions, 16 deletions
diff --git a/src/net/eathena/mercenaryrecv.cpp b/src/net/eathena/mercenaryrecv.cpp
index a4d98a7e9..5ca5433ae 100644
--- a/src/net/eathena/mercenaryrecv.cpp
+++ b/src/net/eathena/mercenaryrecv.cpp
@@ -51,25 +51,45 @@ void MercenaryRecv::processMercenaryInfo(Net::MessageIn &msg)
// +++ need create if need mercenary being and update stats
Being *const dstBeing = actorManager->findBeing(
msg.readBeingId("being id"));
- msg.readInt16("atk");
- msg.readInt16("matk");
- msg.readInt16("hit");
- msg.readInt16("crit/10");
- msg.readInt16("def");
- msg.readInt16("mdef");
- msg.readInt16("flee");
- msg.readInt16("attack speed");
+ PlayerInfo::setAttribute(Attributes::MERC_ATK,
+ msg.readInt16("atk"));
+ PlayerInfo::setAttribute(Attributes::MERC_MATK,
+ msg.readInt16("matk"));
+ PlayerInfo::setAttribute(Attributes::MERC_HIT,
+ msg.readInt16("hit"));
+ PlayerInfo::setAttribute(Attributes::MERC_CRIT,
+ msg.readInt16("crit/10"));
+ PlayerInfo::setAttribute(Attributes::MERC_DEF,
+ msg.readInt16("def"));
+ PlayerInfo::setAttribute(Attributes::MERC_MDEF,
+ msg.readInt16("mdef"));
+ PlayerInfo::setAttribute(Attributes::MERC_FLEE,
+ msg.readInt16("flee"));
+ PlayerInfo::setAttribute(Attributes::MERC_ATTACK_DELAY,
+ msg.readInt16("attack speed"));
const std::string name = msg.readString(24, "name");
const int level = msg.readInt16("level");
- msg.readInt32("hp");
- msg.readInt32("max hp");
- msg.readInt32("sp");
- msg.readInt32("max sp");
- msg.readInt32("expire time");
- msg.readInt16("faith");
- msg.readInt32("calls");
- msg.readInt32("kills");
+ PlayerInfo::setAttribute(Attributes::MERC_LEVEL,
+ level);
+ PlayerInfo::setAttribute(Attributes::MERC_HP,
+ msg.readInt32("hp"));
+ PlayerInfo::setAttribute(Attributes::MERC_MAX_HP,
+ msg.readInt32("max hp"));
+ PlayerInfo::setAttribute(Attributes::MERC_MP,
+ msg.readInt32("sp"));
+ PlayerInfo::setAttribute(Attributes::MERC_MAX_MP,
+ msg.readInt32("max sp"));
+ PlayerInfo::setAttribute(Attributes::MERC_EXPIRE,
+ msg.readInt32("expire time"));
+ PlayerInfo::setAttribute(Attributes::MERC_FAITH,
+ msg.readInt16("faith"));
+ PlayerInfo::setAttribute(Attributes::MERC_CALLS,
+ msg.readInt32("calls"));
+ PlayerInfo::setAttribute(Attributes::MERC_KILLS,
+ msg.readInt32("kills"));
const int range = msg.readInt16("attack range");
+ PlayerInfo::setAttribute(Attributes::MERC_ATTACK_RANGE,
+ range);
if (dstBeing && localPlayer)
{
MercenaryInfo *const mercenary = new MercenaryInfo;