diff options
-rw-r--r-- | src/being/homunculusinfo.h | 4 | ||||
-rw-r--r-- | src/net/eathena/homunculushandler.cpp | 47 | ||||
-rw-r--r-- | src/net/eathena/homunculushandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
5 files changed, 55 insertions, 1 deletions
diff --git a/src/being/homunculusinfo.h b/src/being/homunculusinfo.h index 120ace843..1f644c404 100644 --- a/src/being/homunculusinfo.h +++ b/src/being/homunculusinfo.h @@ -28,6 +28,8 @@ struct HomunculusInfo final HomunculusInfo() : name(), id(0), + level(0), + range(0), hungry(0), intimacy(0), equip(0) @@ -37,6 +39,8 @@ struct HomunculusInfo final std::string name; int id; + int level; + int range; int hungry; int intimacy; int equip; 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 diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h index c172adb90..6fa49a451 100644 --- a/src/net/eathena/homunculushandler.h +++ b/src/net/eathena/homunculushandler.h @@ -43,6 +43,8 @@ class HomunculusHandler final : public MessageHandler, void processHomunculusSkills(Net::MessageIn &msg); void processHomunculusData(Net::MessageIn &msg); + + void processHomunculusInfo(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 28002d4e4..b9114aabd 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -85,7 +85,7 @@ int16_t packet_lengths[] = // #0x0200 26, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 10, 0, 0, 0, 22, -1, 16, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 122, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 19, 0, 0, + -1, 122, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 19, 71, 0, 12, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0240 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 74ddf6dda..5e059a3b9 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -260,6 +260,7 @@ #define SMSG_HOMUNCULUS_SKILLS 0x0235 #define SMSG_HOMUNCULUS_DATA 0x0230 +#define SMSG_HOMUNCULUS_INFO 0x022e /********************************** * Packets from client to server * |