30 lines
985 B
C#
30 lines
985 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Dalamud.Plugin.Services;
|
|
using Lumina.Excel.Sheets;
|
|
using Questionable.Model.Questing;
|
|
|
|
namespace Questionable.Data;
|
|
|
|
internal static class GameQuestSequences
|
|
{
|
|
public static List<int> GetCompletionSequences(IDataManager dataManager, QuestId questId)
|
|
{
|
|
Quest? rowOrDefault = dataManager.GetExcelSheet<Quest>().GetRowOrDefault((uint)(0x10000 | questId.Value));
|
|
if (rowOrDefault.HasValue)
|
|
{
|
|
Quest valueOrDefault = rowOrDefault.GetValueOrDefault();
|
|
if (valueOrDefault.TodoParams.Count == 0 || valueOrDefault.TodoParams[0].ToDoCompleteSeq == 0)
|
|
{
|
|
return new List<int>();
|
|
}
|
|
return (from seq in (from seq in ((IEnumerable<Quest.TodoParamsStruct>)valueOrDefault.TodoParams).Select((Func<Quest.TodoParamsStruct, int>)((Quest.TodoParamsStruct x) => x.ToDoCompleteSeq))
|
|
where seq != 0
|
|
select seq).Distinct()
|
|
orderby seq
|
|
select seq).ToList();
|
|
}
|
|
return new List<int>();
|
|
}
|
|
}
|