From d1b748607aae28c82c0f53e0a97bc988174f6b7a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Sep 2014 00:19:28 +0300 Subject: eathena: partially impliment packet SMSG_QUEST_UPDATE_OBJECTIVES 0x02b5. --- src/net/eathena/packets.h | 2 +- src/net/eathena/protocol.h | 1 + src/net/eathena/questhandler.cpp | 20 ++++++++++++++++++++ src/net/eathena/questhandler.h | 2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 463b52537..df3f8fbf4 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -96,7 +96,7 @@ int16_t packet_lengths[] = 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -1, -1, 107, 0, 0, 0, 0, 0, 191, 0, 0, 0, 0, 0, 0, + 0, -1, -1, 107, 0, -1, 0, 0, 0, 191, 0, 0, 0, 0, 0, 0, // #0x02C0 0, -1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 7aee6cfa3..f77af71a5 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -185,6 +185,7 @@ #define SMSG_QUEST_ADD 0x02b3 #define SMSG_QUEST_LIST 0x02b1 #define SMSG_QUEST_LIST_OBJECTIVES 0x02b2 +#define SMSG_QUEST_UPDATE_OBJECTIVES 0x02b5 #define SMSG_MVP 0x010c diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp index 496ea49ad..3dee91b3f 100644 --- a/src/net/eathena/questhandler.cpp +++ b/src/net/eathena/questhandler.cpp @@ -40,6 +40,7 @@ QuestHandler::QuestHandler() : SMSG_QUEST_ADD, SMSG_QUEST_LIST, SMSG_QUEST_LIST_OBJECTIVES, + SMSG_QUEST_UPDATE_OBJECTIVES, 0 }; handledMessages = _messages; @@ -62,6 +63,10 @@ void QuestHandler::handleMessage(Net::MessageIn &msg) processAddQuestsObjectives(msg); break; + case SMSG_QUEST_UPDATE_OBJECTIVES: + processUpdateQuestsObjectives(msg); + break; + default: break; } @@ -77,6 +82,7 @@ void QuestHandler::processAddQuest(Net::MessageIn &msg) const int num = msg.readInt16("objectives count"); for (int f = 0; f < num; f ++) { + // need use in quests kills list msg.readInt32("monster id"); msg.readInt16("count"); msg.readString(24, "monster name"); @@ -132,4 +138,18 @@ void QuestHandler::processAddQuestsObjectives(Net::MessageIn &msg) } } +void QuestHandler::processUpdateQuestsObjectives(Net::MessageIn &msg) +{ + msg.readInt16("len"); + const int num = msg.readInt16("objectives count"); + for (int f = 0; f < num; f ++) + { + // need use in quests kills list + msg.readInt32("quest id"); + msg.readInt32("monster id"); + msg.readInt16("count old"); + msg.readInt16("count new"); + } +} + } // namespace TmwAthena diff --git a/src/net/eathena/questhandler.h b/src/net/eathena/questhandler.h index 95cab96d3..a3782e75b 100644 --- a/src/net/eathena/questhandler.h +++ b/src/net/eathena/questhandler.h @@ -41,6 +41,8 @@ class QuestHandler final : public MessageHandler static void processAddQuests(Net::MessageIn &msg); static void processAddQuestsObjectives(Net::MessageIn &msg); + + static void processUpdateQuestsObjectives(Net::MessageIn &msg); }; } // namespace EAthena -- cgit v1.2.3-70-g09d2