diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f95551c..800d6a1b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -- bug fix: combat job "auto/highest ilvl" wasn't working with the new automatic class switching thing, because i wasn't aware of it. wired that in. -alydev \ No newline at end of file +- Feature: added functionality for special quest prerequisites, e.g legendary mount quest -alydev \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index a1b47fca8..719e4d939 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,6 +1,6 @@ - 15.306.1.27 + 15.306.1.28 diff --git a/Questionable/Functions/QuestFunctions.cs b/Questionable/Functions/QuestFunctions.cs index 5cc4a377f..20411931a 100644 --- a/Questionable/Functions/QuestFunctions.cs +++ b/Questionable/Functions/QuestFunctions.cs @@ -12,6 +12,7 @@ using Lumina.Excel.Sheets; using Questionable.Model.Common; using Questionable.Model.Questing; +using static FFXIVClientStructs.FFXIV.Client.Game.BGMSystem; using static Questionable.Domain.QuestInfo; using static Questionable.Utils.CacheUtils; using GrandCompany = FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany; @@ -751,9 +752,25 @@ public bool IsQuestComplete(ElementId elementId) if (firstLockedAetheryte != null) lockedReason.Add(_LF("Aetheryte locked: {0}", firstLockedAetheryte ?? EAetheryteLocation.None), value: true); } + + bool prerequisites = questId.Value switch + { + 432 => AllMountsUnlocked(new ushort[] { 28, 29, 30, 31, 40, 43 }), + 1550 => AllMountsUnlocked(new ushort[] { 75, 76, 77, 78, 90, 98, 104 }), + 3200 => AllMountsUnlocked(new ushort[] { 115, 116, 133, 144, 158, 172, 182 }), + 4057 => AllMountsUnlocked(new ushort[] { 189, 192, 205, 217, 226, 238, 249 }), + 4795 => AllMountsUnlocked(new ushort[] { 261, 262, 293, 306, 315, 325, 332 }), + 5469 => AllMountsUnlocked(new ushort[] { 345, 346, 363, 389, 407, 422, 444 }), + _ => false + }; + + if (!prerequisites) + lockedReason.Add(_LF("Prerequisites not met"), value: true); return (lockedReason.Values.Any(x => x), lockedReason.Keys.ToArray()); } + private unsafe bool AllMountsUnlocked(ushort[] mounts) => mounts.All(x => PlayerState.Instance()->IsMountUnlocked(x)); + private bool IsQuestLocked(SatisfactionSupplyNpcId satisfactionSupplyNpcId) { SatisfactionSupplyInfo questInfo = (SatisfactionSupplyInfo)questData.GetQuestInfo(satisfactionSupplyNpcId);