summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-08-19 20:48:52 +0300
committerAndrei Karas <akaras@inbox.ru>2019-08-19 20:48:52 +0300
commit4e5d11c6d14dc255070c61d5bb867d2c52039f30 (patch)
tree59bf3ff99e8968535246864207cfe88c68672eb4 /src
parentbd923dda709637530a9fb1728c09c539f3bfc966 (diff)
downloadplus-4e5d11c6d14dc255070c61d5bb867d2c52039f30.tar.gz
plus-4e5d11c6d14dc255070c61d5bb867d2c52039f30.tar.bz2
plus-4e5d11c6d14dc255070c61d5bb867d2c52039f30.tar.xz
plus-4e5d11c6d14dc255070c61d5bb867d2c52039f30.zip
Update packet SMSG_HOMUNCULUS_INFO
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/homunculusrecv.cpp77
-rw-r--r--src/net/eathena/homunculusrecv.h1
-rw-r--r--src/net/eathena/packetsin.inc18
3 files changed, 96 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");
diff --git a/src/net/eathena/homunculusrecv.h b/src/net/eathena/homunculusrecv.h
index 8183db1f9..4949e8bac 100644
--- a/src/net/eathena/homunculusrecv.h
+++ b/src/net/eathena/homunculusrecv.h
@@ -34,6 +34,7 @@ namespace EAthena
void processHomunculusData(Net::MessageIn &msg);
void processHomunculusInfo1(Net::MessageIn &msg);
void processHomunculusInfo2(Net::MessageIn &msg);
+ void processHomunculusInfo3(Net::MessageIn &msg);
void processHomunculusSkillUp(Net::MessageIn &msg);
void processHomunculusFood(Net::MessageIn &msg);
void processHomunculusExp(Net::MessageIn &msg);
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index 492ca268d..0cdbf304e 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -1791,6 +1791,24 @@ if (packetVersionMain >= 20190522)
packet(SMSG_PLAYER_SHORTCUTS, 0x0b20, 271, &PlayerRecv::processPlayerShortcuts3, 20190522);
}
+// 20190605 re
+if (packetVersionRe >= 20190605)
+{
+ packet(SMSG_HOMUNCULUS_INFO, 0x0b2f, 73, &HomunculusRecv::processHomunculusInfo3, 20190605);
+}
+
+// 20190619 main
+if (packetVersionMain >= 20190619)
+{
+ packet(SMSG_HOMUNCULUS_INFO, 0x0b2f, 73, &HomunculusRecv::processHomunculusInfo3, 20190619);
+}
+
+// 20190626 zero
+if (packetVersionZero >= 20190626)
+{
+ packet(SMSG_HOMUNCULUS_INFO, 0x0b2f, 73, &HomunculusRecv::processHomunculusInfo3, 20190626);
+}
+
// 0
// evol always packets
packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, -1, &LoginRecv::processServerVersion, 0);