diff --git a/AutoDuty/Helpers/ContentHelper.cs b/AutoDuty/Helpers/ContentHelper.cs index 5d96ffa5..a5dfcdba 100644 --- a/AutoDuty/Helpers/ContentHelper.cs +++ b/AutoDuty/Helpers/ContentHelper.cs @@ -10,6 +10,7 @@ namespace AutoDuty.Helpers { using Dalamud.Utility; + using static global::AutoDuty.Data.Classes; internal static class ContentHelper { @@ -33,6 +34,17 @@ private unsafe static int DawnIndex(uint index, uint ex) }; } + private unsafe static int TrustIndex(int index, uint ex) + { + return ex switch + { + 3 => index, + 4 => index - 11, + 5 => index - 22, + _ => -1 + }; + } + internal static void PopulateDuties() { var listContentFinderCondition = Svc.Data.GameData.GetExcelSheet(); @@ -65,7 +77,7 @@ static string CleanName(string name) ItemLevelRequired = contentFinderCondition.ItemLevelRequired, DawnContent = listDawnContent.Any(dawnContent => dawnContent.Content.Value == contentFinderCondition), TrustContent = listDawnContent.Any(dawnContent => dawnContent.Content.Value == contentFinderCondition && dawnContent.Unknown13), - TrustIndex = listDawnContent.Where(dawnContent => dawnContent.Unknown13).IndexOf(x => x.Content.Value == contentFinderCondition), + TrustIndex = TrustIndex(listDawnContent.Where(dawnContent => dawnContent.Unknown13).IndexOf(x => x.Content.Value == contentFinderCondition), contentFinderCondition.TerritoryType.Value.ExVersion.Value.RowId), VariantContent = ListVVDContent.Any(variantContent => variantContent == contentFinderCondition.TerritoryType.Value.RowId), VVDIndex = ListVVDContent.FindIndex(variantContent => variantContent == contentFinderCondition.TerritoryType.Value.RowId), GCArmyContent = ListGCArmyContent.Any(gcArmyContent => gcArmyContent == contentFinderCondition.TerritoryType.Value.RowId), @@ -92,10 +104,10 @@ static string CleanName(string name) if (content.ExVersion == 5) content.TrustMembers.Add(TrustHelper.Members[TrustMemberName.Krile]); } - + DictionaryContent.Add(contentFinderCondition.TerritoryType.Value.RowId, content); } - + DictionaryContent = DictionaryContent.OrderBy(content => content.Value.ExVersion).ThenBy(content => content.Value.ClassJobLevelRequired).ThenBy(content => content.Value.TerritoryType).ToDictionary(); } diff --git a/AutoDuty/Helpers/QueueHelper.cs b/AutoDuty/Helpers/QueueHelper.cs index 129367cd..03ea64b6 100644 --- a/AutoDuty/Helpers/QueueHelper.cs +++ b/AutoDuty/Helpers/QueueHelper.cs @@ -86,10 +86,10 @@ internal static void QueueTrust() AddonHelper.FireCallBack(addonDawn, true, 20, (_content!.ExVersion - 3)); return; } - else if (addonDawn->AtkValues[151].UInt != _content.DawnIndex) + else if (addonDawn->AtkValues[151].UInt != _content.TrustIndex) { - Svc.Log.Debug($"Queue Helper - Clicking: {_content.EnglishName} at index: {_content.DawnIndex}"); - AddonHelper.FireCallBack(addonDawn, true, 15, _content.DawnIndex); + Svc.Log.Debug($"Queue Helper - Clicking: {_content.EnglishName} at index: {_content.TrustIndex}"); + AddonHelper.FireCallBack(addonDawn, true, 15, _content.TrustIndex); } else if (!_turnedOffTrustMembers) {