diff --git a/Source/GrasscutterTools/Game/Data/Excels/EquipAffixData.cs b/Source/GrasscutterTools/Game/Data/Excels/EquipAffixData.cs new file mode 100644 index 0000000..85ffe21 --- /dev/null +++ b/Source/GrasscutterTools/Game/Data/Excels/EquipAffixData.cs @@ -0,0 +1,36 @@ +/** + * Grasscutter Tools + * Copyright (C) 2023 jie65535 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + **/ + +using Newtonsoft.Json; + +namespace GrasscutterTools.Game.Data.Excels +{ + [ResourceType("EquipAffixExcelConfigData.json")] + internal class EquipAffixData + { + [JsonProperty("id")] + public int Id { get; set; } + + [JsonProperty("level")] + public int Level { get; set; } + + [JsonProperty("nameTextMapHash")] + public long NameTextMapHash { get; set; } + } +} diff --git a/Source/GrasscutterTools/Game/Data/Excels/ReliquarySetData.cs b/Source/GrasscutterTools/Game/Data/Excels/ReliquarySetData.cs new file mode 100644 index 0000000..31e75e5 --- /dev/null +++ b/Source/GrasscutterTools/Game/Data/Excels/ReliquarySetData.cs @@ -0,0 +1,38 @@ +/** + * Grasscutter Tools + * Copyright (C) 2023 jie65535 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + **/ + +using System.Collections.Generic; + +using Newtonsoft.Json; + +namespace GrasscutterTools.Game.Data.Excels +{ + [ResourceType("ReliquarySetExcelConfigData.json")] + internal class ReliquarySetData + { + [JsonProperty("setId")] + public int SetId { get; set; } + + [JsonProperty("equipAffixId")] + public int EquipAffixId { get; set; } + + [JsonProperty("containsList")] + public List ContainsList { get; set; } + } +} diff --git a/Source/GrasscutterTools/Game/Data/GameResources.cs b/Source/GrasscutterTools/Game/Data/GameResources.cs index 681e555..712cfb2 100644 --- a/Source/GrasscutterTools/Game/Data/GameResources.cs +++ b/Source/GrasscutterTools/Game/Data/GameResources.cs @@ -61,6 +61,10 @@ namespace GrasscutterTools.Game.Data public Dictionary ReliquaryData { get; set; } + public List ReliquarySetData { get; set; } + + public List EquipAffixData { get; set; } + public Dictionary SceneData { get; set; } public List SceneTagData { get; set; } @@ -200,6 +204,25 @@ namespace GrasscutterTools.Game.Data ReliquaryData.Values.OrderBy(it => it.Id).Select(it => $"{it.Id}:{TextMapData.GetText(it.NameTextMapHash.ToString())}"), Encoding.UTF8); + // ArtifactCat (套装) + var affixNameMap = EquipAffixData + .Where(a => a.Level == 0 && a.NameTextMapHash != 0) + .ToDictionary(a => a.Id, a => a.NameTextMapHash); + sb.Clear(); + foreach (var set in ReliquarySetData.Where(s => s.ContainsList != null && s.ContainsList.Count > 0)) + { + var derivedId = set.ContainsList[0] / 1000; + string name = null; + if (set.EquipAffixId != 0 && affixNameMap.TryGetValue(set.EquipAffixId, out var nameHash)) + name = TextMapData.GetText(nameHash.ToString()); + if (name == null || name.StartsWith("[N/A]")) + name = GameData.ArtifactCats[derivedId]; + if (name == ItemMap.EmptyName) + continue; + sb.AppendFormat("{0}:{1}", derivedId, name).AppendLine(); + } + File.WriteAllText(Path.Combine(dir, "ArtifactCat.txt"), sb.ToString(), Encoding.UTF8); + #endregion Artifact #region Avatar diff --git a/Source/GrasscutterTools/GrasscutterTools.csproj b/Source/GrasscutterTools/GrasscutterTools.csproj index 9951b4f..7597737 100644 --- a/Source/GrasscutterTools/GrasscutterTools.csproj +++ b/Source/GrasscutterTools/GrasscutterTools.csproj @@ -162,6 +162,8 @@ + +