From 660d3b585ab50038e5b2ea3fb9cf4049a7e697d1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 11 Sep 2014 12:12:43 +0300 Subject: eathena: add packet CMSG_PET_CATCH 0x019f. --- src/net/eathena/pethandler.cpp | 13 ++++++++++++- src/net/eathena/pethandler.h | 2 ++ src/net/eathena/protocol.h | 2 ++ src/net/pethandler.h | 2 ++ src/net/tmwa/pethandler.cpp | 4 ++++ src/net/tmwa/pethandler.h | 2 ++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index f96176c38..1b8f77881 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -22,9 +22,11 @@ #include "gui/chatconsts.h" +#include "net/chathandler.h" #include "net/net.h" -#include "net/chathandler.h" +#include "net/eathena/messageout.h" +#include "net/eathena/protocol.h" #include "debug.h" @@ -74,4 +76,13 @@ void PetHandler::emote(const uint8_t emoteId, const int petId A_UNUSED) static_cast(emoteId), mRandCounter), GENERAL_CHANNEL); } +void PetHandler::catchPet(const Being *const being) const +{ + if (!being) + return; + + MessageOut outMsg(CMSG_PET_CATCH); + outMsg.writeInt32(being->getId()); +} + } // namespace EAthena diff --git a/src/net/eathena/pethandler.h b/src/net/eathena/pethandler.h index 7ddb7422b..126089724 100644 --- a/src/net/eathena/pethandler.h +++ b/src/net/eathena/pethandler.h @@ -49,6 +49,8 @@ class PetHandler final : public MessageHandler, public Net::PetHandler void emote(const uint8_t emoteId, const int petId) override final; + void catchPet(const Being *const being) const override final; + protected: int mRandCounter; }; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index c49550fa5..bad8fa1a9 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -337,6 +337,8 @@ #define CMSG_REMOVE_OPTION 0x012a #define CMSG_PLAYER_SET_MEMO 0x011d +#define CMSG_PET_CATCH 0x019f + #define SMSG_SOLVE_CHAR_NAME 0x0194 #define SMSG_SKILL_CASTING 0x07fb #define SMSG_SKILL_CAST_CANCEL 0x01b9 diff --git a/src/net/pethandler.h b/src/net/pethandler.h index ac9a6f980..750baf4dc 100644 --- a/src/net/pethandler.h +++ b/src/net/pethandler.h @@ -42,6 +42,8 @@ class PetHandler notfinal const int x, const int y) const = 0; virtual void emote(const uint8_t emoteId, const int petId) = 0; + + virtual void catchPet(const Being *const being) const = 0; }; } // namespace Net diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp index edc18b02d..dc15929ed 100644 --- a/src/net/tmwa/pethandler.cpp +++ b/src/net/tmwa/pethandler.cpp @@ -74,4 +74,8 @@ void PetHandler::emote(const uint8_t emoteId, const int petId A_UNUSED) static_cast(emoteId), mRandCounter), GENERAL_CHANNEL); } +void PetHandler::catchPet(const Being *const being A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h index bcfa6b1a6..93d3ef2d4 100644 --- a/src/net/tmwa/pethandler.h +++ b/src/net/tmwa/pethandler.h @@ -49,6 +49,8 @@ class PetHandler final : public MessageHandler, public Net::PetHandler void emote(const uint8_t emoteId, const int petId) override final; + void catchPet(const Being *const being) const override final; + protected: int mRandCounter; }; -- cgit v1.2.3-70-g09d2