summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-23 14:45:23 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-23 14:45:23 +0300
commitc2a0903d2f487a6146bbf0829adb16afeb1efda5 (patch)
treed63fbd1a943893612fe04f12438a78eaa3e41479
parent955f144a8310583babd96963a0c8e604ce8c849b (diff)
downloadmanaplus-c2a0903d2f487a6146bbf0829adb16afeb1efda5.tar.gz
manaplus-c2a0903d2f487a6146bbf0829adb16afeb1efda5.tar.bz2
manaplus-c2a0903d2f487a6146bbf0829adb16afeb1efda5.tar.xz
manaplus-c2a0903d2f487a6146bbf0829adb16afeb1efda5.zip
eathena: add packet CMSG_PET_MENU_ACTION 0x01a1.
-rw-r--r--src/net/eathena/pethandler.cpp31
-rw-r--r--src/net/eathena/pethandler.h10
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/pethandler.h10
-rw-r--r--src/net/tmwa/pethandler.cpp20
-rw-r--r--src/net/tmwa/pethandler.h10
6 files changed, 82 insertions, 0 deletions
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp
index baf6d1056..c565cd280 100644
--- a/src/net/eathena/pethandler.cpp
+++ b/src/net/eathena/pethandler.cpp
@@ -282,4 +282,35 @@ void PetHandler::processPetFood(Net::MessageIn &msg)
msg.readInt16("food id");
}
+void PetHandler::requestStatus() const
+{
+ createOutPacket(CMSG_PET_MENU_ACTION);
+ outMsg.writeInt8(0);
+}
+
+void PetHandler::feed() const
+{
+ createOutPacket(CMSG_PET_MENU_ACTION);
+ outMsg.writeInt8(1);
+}
+
+void PetHandler::dropLoot() const
+{
+ createOutPacket(CMSG_PET_MENU_ACTION);
+ outMsg.writeInt8(2); // performance
+}
+
+void PetHandler::returnToEgg() const
+{
+ createOutPacket(CMSG_PET_MENU_ACTION);
+ outMsg.writeInt8(3);
+ PlayerInfo::setPet(nullptr);
+}
+
+void PetHandler::unequip() const
+{
+ createOutPacket(CMSG_PET_MENU_ACTION);
+ outMsg.writeInt8(4);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/pethandler.h b/src/net/eathena/pethandler.h
index bd6b94c64..3f98b619b 100644
--- a/src/net/eathena/pethandler.h
+++ b/src/net/eathena/pethandler.h
@@ -57,6 +57,16 @@ class PetHandler final : public MessageHandler, public Net::PetHandler
void setName(const std::string &name) const override final;
+ void requestStatus() const override final;
+
+ void feed() const override final;
+
+ void dropLoot() const override final;
+
+ void returnToEgg() const override final;
+
+ void unequip() const override final;
+
protected:
void processPetRoulette(Net::MessageIn &msg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index ffb76bc99..188599ac0 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -409,6 +409,7 @@
#define CMSG_PET_REQUEST_STATE 0x01a9
#define CMSG_PET_SET_NAME 0x01a5
#define CMSG_PET_SELECT_EGG 0x01a7
+#define CMSG_PET_MENU_ACTION 0x01a1
#define CMSG_DORI_DORI 0x01e7
#define CMSG_EXPLOSION_SPIRITS 0x01ed
diff --git a/src/net/pethandler.h b/src/net/pethandler.h
index 8827a63e8..1d4ebbe50 100644
--- a/src/net/pethandler.h
+++ b/src/net/pethandler.h
@@ -48,6 +48,16 @@ class PetHandler notfinal
virtual void requestPetState(const int data) const = 0;
virtual void setName(const std::string &name) const = 0;
+
+ virtual void requestStatus() const = 0;
+
+ virtual void feed() const = 0;
+
+ virtual void dropLoot() const = 0;
+
+ virtual void returnToEgg() const = 0;
+
+ virtual void unequip() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp
index a071d1289..ebbef5240 100644
--- a/src/net/tmwa/pethandler.cpp
+++ b/src/net/tmwa/pethandler.cpp
@@ -86,4 +86,24 @@ void PetHandler::setName(const std::string &name A_UNUSED) const
{
}
+void PetHandler::requestStatus() const
+{
+}
+
+void PetHandler::feed() const
+{
+}
+
+void PetHandler::dropLoot() const
+{
+}
+
+void PetHandler::returnToEgg() const
+{
+}
+
+void PetHandler::unequip() const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h
index 113fba6b6..ad487c629 100644
--- a/src/net/tmwa/pethandler.h
+++ b/src/net/tmwa/pethandler.h
@@ -55,6 +55,16 @@ class PetHandler final : public MessageHandler, public Net::PetHandler
void setName(const std::string &name) const override final;
+ void requestStatus() const override final;
+
+ void feed() const override final;
+
+ void dropLoot() const override final;
+
+ void returnToEgg() const override final;
+
+ void unequip() const override final;
+
protected:
int mRandCounter;
};