From 7ac2da363583a568256f5efc2ab58fa2b342b233 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 9 Sep 2014 20:00:59 +0300 Subject: eathena: add packet CMSG_NPC_COOKING 0x025b. --- src/net/eathena/npchandler.cpp | 8 ++++++++ src/net/eathena/npchandler.h | 3 +++ src/net/eathena/protocol.h | 1 + src/net/npchandler.h | 5 +++++ src/net/tmwa/npchandler.cpp | 5 +++++ src/net/tmwa/npchandler.h | 3 +++ 6 files changed, 25 insertions(+) diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index be82548fd..3943d99c4 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -209,6 +209,14 @@ void NpcHandler::produceMix(const int nameId, outMsg.writeInt16(materialId3, "material 3"); } +void NpcHandler::cooking(const CookingType::Type type, + const int nameId) const +{ + MessageOut outMsg(CMSG_NPC_COOKING); + outMsg.writeInt16(static_cast(type), "type"); + outMsg.writeInt16(nameId, "name id"); +} + int NpcHandler::getNpc(Net::MessageIn &msg) { if (msg.getId() == SMSG_NPC_CHOICE diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h index 96b1b5c87..720a4c9f8 100644 --- a/src/net/eathena/npchandler.h +++ b/src/net/eathena/npchandler.h @@ -72,6 +72,9 @@ class NpcHandler final : public MessageHandler, public Ea::NpcHandler const int materialId2, const int materialId3) const override final; + void cooking(const CookingType::Type type, + const int nameId) const override final; + int getNpc(Net::MessageIn &msg) override final; protected: diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 0eb37cbe7..941b8f6fc 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -315,6 +315,7 @@ #define CMSG_SET_SHORTCUTS 0x02ba #define CMSG_NPC_COMPLETE_PROGRESS_BAR 0x02f1 #define CMSG_NPC_PRODUCE_MIX 0x018e +#define CMSG_NPC_COOKING 0x025b #define CMSG_PLAYER_MAPMOVE 0x0140 #define CMSG_REMOVE_OPTION 0x012a #define CMSG_PLAYER_SET_MEMO 0x011d diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 13942b80b..33f0ae3a0 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -25,6 +25,8 @@ #include +#include "being/cookingtype.h" + #include "localconsts.h" namespace Net @@ -74,6 +76,9 @@ class NpcHandler notfinal const int materialId1, const int materialId2, const int materialId3) const = 0; + + virtual void cooking(const CookingType::Type type, + const int nameId) const = 0; }; } // namespace Net diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 474fa1411..8e691a808 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -214,6 +214,11 @@ void NpcHandler::produceMix(const int nameId A_UNUSED, { } +void NpcHandler::cooking(const CookingType::Type type, + const int nameId) const +{ +} + int NpcHandler::getNpc(Net::MessageIn &msg) { if (msg.getId() == SMSG_NPC_CHOICE diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index 01aba1e96..8cb2a531a 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -77,6 +77,9 @@ class NpcHandler final : public MessageHandler, public Ea::NpcHandler const int materialId1, const int materialId2, const int materialId3) const override final; + + void cooking(const CookingType::Type type, + const int nameId) const; }; } // namespace TmwAthena -- cgit v1.2.3-60-g2f50