summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-25 13:45:37 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-25 13:45:37 +0300
commit0ef4d8b885bf98735dbf800fc7385f625f18a9e4 (patch)
tree69c6370ab94d675251aa99f4b2396c293c9c1498
parent0416def34b70d89754006fa96a49c1180b5bbacf (diff)
downloadplus-0ef4d8b885bf98735dbf800fc7385f625f18a9e4.tar.gz
plus-0ef4d8b885bf98735dbf800fc7385f625f18a9e4.tar.bz2
plus-0ef4d8b885bf98735dbf800fc7385f625f18a9e4.tar.xz
plus-0ef4d8b885bf98735dbf800fc7385f625f18a9e4.zip
eathena: add packet CMSG_HOMMERC_MOVE_TO_MASTER 0x0234.
-rw-r--r--src/being/playerinfo.cpp10
-rw-r--r--src/being/playerinfo.h4
-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
-rw-r--r--src/net/homunculushandler.h2
-rw-r--r--src/net/mercenaryhandler.h2
-rw-r--r--src/net/tmwa/homunculushandler.cpp4
-rw-r--r--src/net/tmwa/homunculushandler.h2
-rw-r--r--src/net/tmwa/mercenaryhandler.cpp4
-rw-r--r--src/net/tmwa/mercenaryhandler.h2
13 files changed, 53 insertions, 0 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index d4654c7be..428878af9 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -533,4 +533,14 @@ HomunculusInfo *getHomunculus()
return mHomunculus;
}
+int getHomunculusId()
+{
+ return mHomunculus ? mHomunculus->id : 0;
+}
+
+int getMercenaryId()
+{
+ return mMercenary ? mMercenary->id : 0;
+}
+
} // namespace PlayerInfo
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index aa2251bbe..6082aa740 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -256,6 +256,10 @@ namespace PlayerInfo
void setHomunculus(HomunculusInfo *const info);
void setHomunculusBeing(Being *const being);
+
+ int getHomunculusId();
+
+ int getMercenaryId();
} // namespace PlayerInfo
#endif // BEING_PLAYERINFO_H
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
diff --git a/src/net/homunculushandler.h b/src/net/homunculushandler.h
index ded676341..09ee9e48a 100644
--- a/src/net/homunculushandler.h
+++ b/src/net/homunculushandler.h
@@ -35,6 +35,8 @@ class HomunculusHandler notfinal
{ }
virtual void setName(const std::string &name) const = 0;
+
+ virtual void moveToMaster() const = 0;
};
} // namespace Net
diff --git a/src/net/mercenaryhandler.h b/src/net/mercenaryhandler.h
index ab7d4d426..85e72b02f 100644
--- a/src/net/mercenaryhandler.h
+++ b/src/net/mercenaryhandler.h
@@ -37,6 +37,8 @@ class MercenaryHandler notfinal
virtual void handleMercenaryMessage(const int cmd) = 0;
virtual void fire() = 0;
+
+ virtual void moveToMaster() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/homunculushandler.cpp b/src/net/tmwa/homunculushandler.cpp
index d79e5289c..b0760454e 100644
--- a/src/net/tmwa/homunculushandler.cpp
+++ b/src/net/tmwa/homunculushandler.cpp
@@ -46,4 +46,8 @@ void HomunculusHandler::setName(const std::string &name A_UNUSED) const
{
}
+void HomunculusHandler::moveToMaster() const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/homunculushandler.h b/src/net/tmwa/homunculushandler.h
index c67b52f89..d5c4d1b72 100644
--- a/src/net/tmwa/homunculushandler.h
+++ b/src/net/tmwa/homunculushandler.h
@@ -39,6 +39,8 @@ class HomunculusHandler final : public MessageHandler,
void handleMessage(Net::MessageIn &msg) override final;
void setName(const std::string &name) const override final;
+
+ void moveToMaster() const override final;
};
} // namespace TmwAthena
diff --git a/src/net/tmwa/mercenaryhandler.cpp b/src/net/tmwa/mercenaryhandler.cpp
index 94f8c7436..64f91dc1a 100644
--- a/src/net/tmwa/mercenaryhandler.cpp
+++ b/src/net/tmwa/mercenaryhandler.cpp
@@ -50,4 +50,8 @@ void MercenaryHandler::fire()
{
}
+void MercenaryHandler::moveToMaster() const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/mercenaryhandler.h b/src/net/tmwa/mercenaryhandler.h
index 483884d77..b9f8d9c07 100644
--- a/src/net/tmwa/mercenaryhandler.h
+++ b/src/net/tmwa/mercenaryhandler.h
@@ -41,6 +41,8 @@ class MercenaryHandler final : public MessageHandler,
void handleMercenaryMessage(const int cmd) override final;
void fire() override final;
+
+ void moveToMaster() const override final;
};
} // namespace TmwAthena