diff --git a/Common/Data/Excel/ChapterLevelExcel.cs b/Common/Data/Excel/ChapterLevelExcel.cs new file mode 100644 index 0000000..d8bb7e2 --- /dev/null +++ b/Common/Data/Excel/ChapterLevelExcel.cs @@ -0,0 +1,14 @@ +namespace MikuSB.Data.Excel; + +[ResourceEntity("level.json")] +public class ChapterLevelExcel : ExcelResource +{ + public uint ID { get; set; } + + public override uint GetId() => ID; + + public override void Loaded() + { + GameData.ChapterLevelData.Add(ID, this); + } +} diff --git a/Common/Data/GameData.cs b/Common/Data/GameData.cs index b225e9b..046caa2 100644 --- a/Common/Data/GameData.cs +++ b/Common/Data/GameData.cs @@ -11,6 +11,7 @@ public static class GameData public static Dictionary UpgradeExpData { get; private set; } = []; public static Dictionary BreakLevelLimitData { get; private set; } = []; public static Dictionary RecycleData { get; private set; } = []; + public static Dictionary ChapterLevelData { get; private set; } = []; } public static class GameResourceTemplateId diff --git a/GameServer/Game/Player/PlayerInstance.cs b/GameServer/Game/Player/PlayerInstance.cs index 3448bdc..d63c58b 100644 --- a/GameServer/Game/Player/PlayerInstance.cs +++ b/GameServer/Game/Player/PlayerInstance.cs @@ -244,12 +244,11 @@ public class PlayerInstance(PlayerGameData data) yield return (4, guideId, 999); // Launch.GPASSID = 22 stores pass counts. ChapterLevel.GID = 21 stores star flags. - // Completing the prologue/early chapter range prevents function conditions from - // treating the account as a fresh tutorial player. - for (uint levelId = 10_000; levelId <= 10_700; levelId++) + // Unlock every level defined in level.json so all chapters are accessible from the start. + foreach (var levelId in GameData.ChapterLevelData.Keys) { yield return (21, levelId, 7); - yield return (22, levelId, 1); + yield return (22, levelId, 1_700_000_000); } } #endregion