From e68643a3d46e6092727c21a751b86c7f03414710 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Sep 2014 17:10:07 +0300 Subject: eathena: add packet CMSG_HOMMERC_ATTACK 0x0233. --- src/net/eathena/homunculushandler.cpp | 11 +++++++++++ src/net/eathena/homunculushandler.h | 2 ++ src/net/eathena/mercenaryhandler.cpp | 11 +++++++++++ src/net/eathena/mercenaryhandler.h | 2 ++ src/net/eathena/protocol.h | 1 + 5 files changed, 27 insertions(+) (limited to 'src/net/eathena') 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 -- cgit v1.2.3-60-g2f50