mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-17 01:15:13 +01:00
implement tactic academy
This commit is contained in:
@@ -13,6 +13,7 @@ using Newtonsoft.Json.Linq;
|
||||
using Swan.Parsers;
|
||||
using Newtonsoft.Json;
|
||||
using System.Drawing;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
namespace nksrv.StaticInfo
|
||||
{
|
||||
@@ -56,6 +57,7 @@ namespace nksrv.StaticInfo
|
||||
private JArray tutorialTable;
|
||||
private JArray itemEquipTable;
|
||||
private Dictionary<int, CharacterLevelData> LevelData = [];
|
||||
private Dictionary<int, TacticAcademyLessonRecord> TacticAcademyLessons = [];
|
||||
|
||||
public byte[] Sha256Hash;
|
||||
public int Size;
|
||||
@@ -256,6 +258,29 @@ namespace nksrv.StaticInfo
|
||||
else
|
||||
Logger.Warn("failed to read character level table entry");
|
||||
}
|
||||
|
||||
var tacticLessonTable = await LoadZip("TacticAcademyFunctionTable.json");
|
||||
|
||||
foreach (JToken item in tacticLessonTable)
|
||||
{
|
||||
var idRaw = item["id"];
|
||||
var groupidRaw = item["group_id"];
|
||||
var currencyIdRaw = item["currency_id"];
|
||||
var currencyValueRaw = item["currency_value"];
|
||||
|
||||
if (idRaw == null) throw new InvalidDataException();
|
||||
if (groupidRaw == null) throw new InvalidDataException();
|
||||
if (currencyIdRaw == null) throw new InvalidDataException();
|
||||
if (currencyValueRaw == null) throw new InvalidDataException();
|
||||
|
||||
var id = idRaw.ToObject<int>();
|
||||
var currencyId = currencyIdRaw.ToObject<int>();
|
||||
var currencyValue = currencyValueRaw.ToObject<int>();
|
||||
var groupid = groupidRaw.ToObject<int>();
|
||||
|
||||
var fullId = int.Parse(groupid.ToString() + id.ToString());
|
||||
TacticAcademyLessons.Add(id, new TacticAcademyLessonRecord() { CurrencyId = (CurrencyType)currencyId, CurrencyValue = currencyValue, GroupId = groupid, Id = id });
|
||||
}
|
||||
}
|
||||
|
||||
public MainQuestCompletionData? GetMainQuestForStageClearCondition(int stage)
|
||||
@@ -481,5 +506,10 @@ namespace nksrv.StaticInfo
|
||||
{
|
||||
return LevelData;
|
||||
}
|
||||
|
||||
public TacticAcademyLessonRecord GetTacticAcademyLesson(int lessonId)
|
||||
{
|
||||
return TacticAcademyLessons[lessonId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user