summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/homunculushandler.cpp11
-rw-r--r--src/net/eathena/homunculushandler.h2
-rw-r--r--src/net/eathena/mercenaryhandler.cpp11
-rw-r--r--src/net/eathena/mercenaryhandler.h2
-rw-r--r--src/net/eathena/protocol.h1
5 files changed, 27 insertions, 0 deletions
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp
index 320af387e..bbddc4412 100644
--- a/src/net/eathena/homunculushandler.cpp
+++ b/src/net/eathena/homunculushandler.cpp
@@ -204,4 +204,15 @@ void HomunculusHandler::move(const int x, const int y) const
outMsg.writeCoordinates(x, y, 0U);
}
+void HomunculusHandler::attack(const int targetId, const bool keep) const
+{
+ const int id = PlayerInfo::getHomunculusId();
+ if (!id)
+ return;
+ createOutPacket(CMSG_HOMMERC_ATTACK);
+ outMsg.writeInt32(id);
+ outMsg.writeInt32(targetId);
+ outMsg.writeInt8(keep ? 1 : 0);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h
index 01cb0586f..53ad59f4a 100644
--- a/src/net/eathena/homunculushandler.h
+++ b/src/net/eathena/homunculushandler.h
@@ -45,6 +45,8 @@ class HomunculusHandler final : public MessageHandler,
void move(const int x, const int y) const override final;
+ void attack(const int targetId, const bool keep) const override final;
+
protected:
void processHomunculusSkills(Net::MessageIn &msg);
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 1ec3628a8..6ac4072c5 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -205,4 +205,15 @@ void MercenaryHandler::move(const int x, const int y) const
outMsg.writeCoordinates(x, y, 0U);
}
+void MercenaryHandler::attack(const int targetId, const bool keep) const
+{
+ const int id = PlayerInfo::getHomunculusId();
+ if (!id)
+ return;
+ createOutPacket(CMSG_HOMMERC_ATTACK);
+ outMsg.writeInt32(id);
+ outMsg.writeInt32(targetId);
+ outMsg.writeInt8(keep ? 1 : 0);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h
index 06fdd7cec..6ef3c02f5 100644
--- a/src/net/eathena/mercenaryhandler.h
+++ b/src/net/eathena/mercenaryhandler.h
@@ -47,6 +47,8 @@ class MercenaryHandler final : public MessageHandler,
void move(const int x, const int y) const override final;
+ void attack(const int targetId, const bool keep) const override final;
+
protected:
void processMercenaryUpdate(Net::MessageIn &msg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index c1df2d1e6..65257b904 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -420,6 +420,7 @@
#define CMSG_HOMUNCULUS_SET_NAME 0x0231
#define CMSG_HOMMERC_MOVE_TO_MASTER 0x0234
#define CMSG_HOMMERC_MOVE_TO 0x0232
+#define CMSG_HOMMERC_ATTACK 0x0233
#define CMSG_DORI_DORI 0x01e7
#define CMSG_EXPLOSION_SPIRITS 0x01ed