summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/homunculushandler.cpp9
-rw-r--r--src/net/eathena/homunculushandler.h2
-rw-r--r--src/net/eathena/mercenaryhandler.cpp9
-rw-r--r--src/net/eathena/mercenaryhandler.h2
-rw-r--r--src/net/eathena/protocol.h1
5 files changed, 23 insertions, 0 deletions
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