From 2fdda3157f90144b51e9aec7b8c451d088c18cfe Mon Sep 17 00:00:00 2001 From: Kei-Luna Date: Sat, 2 May 2026 09:13:04 +0900 Subject: [PATCH] Unlock all of Paradox's talents --- Common/Data/Excel/Rogue3DTalentExcel.cs | 31 +++++++++++++++++++ Common/Data/GameData.cs | 1 + .../Handlers/Rogue3D/Rogue3DStateHelper.cs | 14 +++++++++ 3 files changed, 46 insertions(+) create mode 100644 Common/Data/Excel/Rogue3DTalentExcel.cs diff --git a/Common/Data/Excel/Rogue3DTalentExcel.cs b/Common/Data/Excel/Rogue3DTalentExcel.cs new file mode 100644 index 0000000..7caa3b4 --- /dev/null +++ b/Common/Data/Excel/Rogue3DTalentExcel.cs @@ -0,0 +1,31 @@ +using Newtonsoft.Json; + +namespace MikuSB.Data.Excel; + +[ResourceEntity("server_03_talent.json")] +public class Rogue3DTalentExcel : ExcelResource +{ + [JsonProperty("TalentID")] public uint TalentId { get; set; } + [JsonProperty("UnlockCondition")] private object? UnlockConditionRaw { get; set; } + [JsonIgnore] public uint UnlockCondition { get; private set; } + + public override uint GetId() => TalentId; + + public override void Loaded() + { + UnlockCondition = ParseUnlockCondition(UnlockConditionRaw); + GameData.Rogue3DTalentData[TalentId] = this; + } + + private static uint ParseUnlockCondition(object? raw) + { + return raw switch + { + null => 0, + long value when value > 0 => (uint)value, + int value when value > 0 => (uint)value, + string text when uint.TryParse(text, out var value) => value, + _ => 0 + }; + } +} diff --git a/Common/Data/GameData.cs b/Common/Data/GameData.cs index 4e6dc33..177f591 100644 --- a/Common/Data/GameData.cs +++ b/Common/Data/GameData.cs @@ -17,6 +17,7 @@ public static class GameData public static Dictionary ManifestationData { get; private set; } = []; public static Dictionary Rogue3DDifficultData { get; private set; } = []; public static Dictionary Rogue3DSeasonData { get; private set; } = []; + public static Dictionary Rogue3DTalentData { get; private set; } = []; public static Dictionary BreakData { get; private set; } = []; public static Dictionary SpineData { get; private set; } = []; public static Dictionary NodeConditionData { get; private set; } = []; diff --git a/GameServer/Server/CallGS/Handlers/Rogue3D/Rogue3DStateHelper.cs b/GameServer/Server/CallGS/Handlers/Rogue3D/Rogue3DStateHelper.cs index 71141ba..c79119e 100644 --- a/GameServer/Server/CallGS/Handlers/Rogue3D/Rogue3DStateHelper.cs +++ b/GameServer/Server/CallGS/Handlers/Rogue3D/Rogue3DStateHelper.cs @@ -23,9 +23,23 @@ internal static class Rogue3DStateHelper EnsureMinAttr(player, UnlockDiff3Sid, 1, sync); EnsureMinAttr(player, UnlockDiff4Sid, 1, sync); + foreach (var scienceSid in GetUnlockTalentScienceSids()) + { + EnsureMinAttr(player, scienceSid, 1, sync); + } + return sync; } + private static IEnumerable GetUnlockTalentScienceSids() + { + return GameData.Rogue3DTalentData.Values + .Select(x => x.UnlockCondition) + .Where(x => x > 0) + .Distinct() + .OrderBy(x => x); + } + private static void EnsureMinAttr(PlayerInstance player, uint sid, uint value, NtfSyncPlayer sync, bool overwrite = false) { var attr = player.Data.Attrs.FirstOrDefault(x => x.Gid == GroupId && x.Sid == sid);