From 0ef4d8b885bf98735dbf800fc7385f625f18a9e4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Sep 2014 13:45:37 +0300 Subject: eathena: add packet CMSG_HOMMERC_MOVE_TO_MASTER 0x0234. --- src/net/eathena/homunculushandler.cpp | 9 +++++++++ src/net/eathena/homunculushandler.h | 2 ++ src/net/eathena/mercenaryhandler.cpp | 9 +++++++++ src/net/eathena/mercenaryhandler.h | 2 ++ src/net/eathena/protocol.h | 1 + 5 files changed, 23 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index 567bad3e4..54c64cf59 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -185,4 +185,13 @@ void HomunculusHandler::setName(const std::string &name) const outMsg.writeString(name, 24, "name"); } +void HomunculusHandler::moveToMaster() const +{ + const int id = PlayerInfo::getHomunculusId(); + if (!id) + return; + createOutPacket(CMSG_HOMMERC_MOVE_TO_MASTER); + outMsg.writeInt32(id); +} + } // namespace EAthena diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h index 77cffb3d5..627561655 100644 --- a/src/net/eathena/homunculushandler.h +++ b/src/net/eathena/homunculushandler.h @@ -41,6 +41,8 @@ class HomunculusHandler final : public MessageHandler, void setName(const std::string &name) const override final; + void moveToMaster() const override final; + protected: void processHomunculusSkills(Net::MessageIn &msg); diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 541f62cf7..dae3f1836 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -186,4 +186,13 @@ void MercenaryHandler::fire() outMsg.writeInt8(2, "action"); // delete } +void MercenaryHandler::moveToMaster() const +{ + const int id = PlayerInfo::getMercenaryId(); + if (!id) + return; + createOutPacket(CMSG_HOMMERC_MOVE_TO_MASTER); + outMsg.writeInt32(id); +} + } // namespace EAthena diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h index 7d99ea197..197efdfc0 100644 --- a/src/net/eathena/mercenaryhandler.h +++ b/src/net/eathena/mercenaryhandler.h @@ -43,6 +43,8 @@ class MercenaryHandler final : public MessageHandler, void fire() override final; + void moveToMaster() const override final; + protected: void processMercenaryUpdate(Net::MessageIn &msg); diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index ad53b9269..698bddf59 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -418,6 +418,7 @@ #define CMSG_PET_MENU_ACTION 0x01a1 #define CMSG_HOMUNCULUS_SET_NAME 0x0231 +#define CMSG_HOMMERC_MOVE_TO_MASTER 0x0234 #define CMSG_DORI_DORI 0x01e7 #define CMSG_EXPLOSION_SPIRITS 0x01ed -- cgit v1.2.3-70-g09d2