diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-25 17:10:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-25 17:10:07 +0300 |
commit | e68643a3d46e6092727c21a751b86c7f03414710 (patch) | |
tree | 786faeadb397ef5a542572bd6f5061b4d7d2b847 /src/net/eathena | |
parent | 74b96285c2ad2f07af0af9f8926bcd5e253dcde9 (diff) | |
download | manaplus-e68643a3d46e6092727c21a751b86c7f03414710.tar.gz manaplus-e68643a3d46e6092727c21a751b86c7f03414710.tar.bz2 manaplus-e68643a3d46e6092727c21a751b86c7f03414710.tar.xz manaplus-e68643a3d46e6092727c21a751b86c7f03414710.zip |
eathena: add packet CMSG_HOMMERC_ATTACK 0x0233.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/homunculushandler.cpp | 11 | ||||
-rw-r--r-- | src/net/eathena/homunculushandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/mercenaryhandler.cpp | 11 | ||||
-rw-r--r-- | src/net/eathena/mercenaryhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
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 |