summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/eathena/questhandler.cpp23
-rw-r--r--src/net/eathena/questhandler.h3
4 files changed, 28 insertions, 1 deletions
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index a4b8e1f31..0d9371b94 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, 0, 0, 107, 0, 0, 0, 0, 0, 191, 0, 0, 0, 0, 0, 0,
+ 0, -1, 0, 107, 0, 0, 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 bf0b4bfb0..960bfcedd 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -183,6 +183,7 @@
#define SMSG_GUILD_BROKEN 0x015e
#define SMSG_QUEST_ADD 0x02b3
+#define SMSG_QUEST_LIST 0x02b1
#define SMSG_MVP 0x010c
diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp
index 7eb1734f1..7b857b9b7 100644
--- a/src/net/eathena/questhandler.cpp
+++ b/src/net/eathena/questhandler.cpp
@@ -38,6 +38,7 @@ QuestHandler::QuestHandler() :
static const uint16_t _messages[] =
{
SMSG_QUEST_ADD,
+ SMSG_QUEST_LIST,
0
};
handledMessages = _messages;
@@ -52,6 +53,10 @@ void QuestHandler::handleMessage(Net::MessageIn &msg)
processAddQuest(msg);
break;
+ case SMSG_QUEST_LIST:
+ processAddQuests(msg);
+ break;
+
default:
break;
}
@@ -84,4 +89,22 @@ void QuestHandler::processAddQuest(Net::MessageIn &msg)
}
}
+void QuestHandler::processAddQuests(Net::MessageIn &msg)
+{
+ msg.readInt16("len");
+ const int num = msg.readInt32("quests count");
+ for (int f = 0; f < num; f ++)
+ {
+ const int var = msg.readInt32("quest id");
+ const int val = msg.readUInt8("state");
+ if (questsWindow)
+ questsWindow->updateQuest(var, val);
+ if (skillDialog)
+ skillDialog->updateQuest(var, val);
+ }
+
+ if (questsWindow)
+ questsWindow->rebuild(false);
+}
+
} // namespace TmwAthena
diff --git a/src/net/eathena/questhandler.h b/src/net/eathena/questhandler.h
index 3b882e910..2177db62c 100644
--- a/src/net/eathena/questhandler.h
+++ b/src/net/eathena/questhandler.h
@@ -35,7 +35,10 @@ class QuestHandler final : public MessageHandler
void handleMessage(Net::MessageIn &msg) override final;
+ protected:
static void processAddQuest(Net::MessageIn &msg);
+
+ static void processAddQuests(Net::MessageIn &msg);
};
} // namespace EAthena