mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-15 08:24:52 +01:00
parse static data to get quest data
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using nksrv.Utils;
|
||||
using nksrv.StaticInfo;
|
||||
using nksrv.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -15,7 +16,14 @@ namespace nksrv.LobbyServer.Msgs.Trigger
|
||||
var req = await ReadData<ReqFinMainQuest>();
|
||||
var user = GetUser();
|
||||
Console.WriteLine("Complete quest: " + req.Tid);
|
||||
user.SetQuest(req.Tid, true); // todo is this right?
|
||||
user.SetQuest(req.Tid, true);
|
||||
|
||||
var completedQuest = StaticDataParser.Instance.GetMainQuestByTableId(req.Tid);
|
||||
if (completedQuest == null) throw new Exception("Quest not found");
|
||||
|
||||
// set next quest as available
|
||||
user.SetQuest(completedQuest.next_main_quest_id, true);
|
||||
|
||||
JsonDb.Save();
|
||||
var response = new ResFinMainQuest();
|
||||
WriteData(response);
|
||||
|
||||
Reference in New Issue
Block a user