using Lumina; using ICRebuild.Core; using System.Text.Json; if(args.Length!=2) throw new ArgumentException("StatusAudit sqpack-directory output-json"); using var game=new GameData(args[0]); var sheet=game.GetExcelSheet() ?? throw new InvalidDataException("Status sheet unavailable"); var result=new List(); var root=game.GetFile("exd/root.exl"); if(root!=null) foreach(var entry in root.ExdMap.Where(x=>x.Value==0x14A)) Console.WriteLine($"Native movement-check sheet 0x14A = {entry.Key}"); foreach(var (group,id) in StatusCatalog.Entries()) { var row=sheet.GetRowOrDefault(id); if(row==null) { Console.WriteLine($"MISSING {group} {id}"); result.Add(new{Group=group,Id=id,Missing=true}); continue; } var s=row.Value; Console.WriteLine($"{group} {id} {s.Name}: movement={s.LockMovement} control={s.LockControl} actions={s.LockActions}"); result.Add(new {Group=group,Id=id,Name=s.Name.ToString(),Description=s.Description.ToString(),s.LockMovement,s.LockControl,s.LockActions,s.Flags,s.Flag2,s.ParamEffect,s.ParamModifier}); } foreach(var s in sheet) { var name=s.Name.ToString(); if((name=="Heavy" || name=="Leaden") && !StatusCatalog.SlowCandidates.Contains(s.RowId)) { Console.WriteLine($"UNLISTED_SLOW {s.RowId} {name}: {s.Description}"); result.Add(new{Group="UnlistedSlowNameSearch",Id=s.RowId,Name=name,Description=s.Description.ToString()}); } if(!new[]{"charm","fear","hysteria","seduc","terror"}.Any(x=>name.Contains(x,StringComparison.OrdinalIgnoreCase))) continue; Console.WriteLine($"CONTROL {s.RowId} {name}: movement={s.LockMovement} control={s.LockControl} actions={s.LockActions}"); result.Add(new {Group="ControlNameSearch",Id=s.RowId,Name=name,Description=s.Description.ToString(),s.LockMovement,s.LockControl,s.LockActions,s.Flags,s.Flag2,s.ParamEffect,s.ParamModifier}); } var territories=game.GetExcelSheet(); foreach(uint id in new uint[]{1108,1290}) { var territory=territories?.GetRowOrDefault(id); if(territory.HasValue) Console.WriteLine($"TERRITORY {id}: use={territory.Value.TerritoryIntendedUse.RowId}, name={territory.Value.PlaceName.Value.Name}"); } File.WriteAllText(args[1],JsonSerializer.Serialize(result,new JsonSerializerOptions{WriteIndented=true}));