diff --git a/Questionable/Controller/Steps/Interactions/UseItem.cs b/Questionable/Controller/Steps/Interactions/UseItem.cs index f0d6a22ab..bef6fadec 100644 --- a/Questionable/Controller/Steps/Interactions/UseItem.cs +++ b/Questionable/Controller/Steps/Interactions/UseItem.cs @@ -11,6 +11,7 @@ using Microsoft.Extensions.Logging; using Questionable.Controller.Steps.Common; using Questionable.Controller.Steps.Shared; using Questionable.Controller.Utils; +using Questionable.Data; using Questionable.Model; using Questionable.Model.V1; using AethernetShortcut = Questionable.Controller.Steps.Shared.AethernetShortcut; @@ -21,7 +22,12 @@ internal static class UseItem { public const int VesperBayAetheryteTicket = 30362; - internal sealed class Factory(IServiceProvider serviceProvider, ILogger logger) : ITaskFactory + internal sealed class Factory( + IServiceProvider serviceProvider, + IClientState clientState, + TerritoryData territoryData, + ILogger logger) + : ITaskFactory { public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) { @@ -30,6 +36,7 @@ internal static class UseItem ArgumentNullException.ThrowIfNull(step.ItemId); + var unmount = serviceProvider.GetRequiredService(); if (step.ItemId == VesperBayAetheryteTicket) { unsafe @@ -38,9 +45,20 @@ internal static class UseItem if (inventoryManager->GetInventoryItemCount(step.ItemId.Value) == 0) return CreateVesperBayFallbackTask(); } + + var task = serviceProvider.GetRequiredService() + .With(quest.QuestId, step.ItemId.Value, step.CompletionQuestVariablesFlags); + return + [ + unmount, task, + new WaitConditionTask(() => clientState.TerritoryType == 140, + $"Wait(territory: {territoryData.GetNameAndId(140)})"), + serviceProvider.GetRequiredService() + .With(140, new(-408.92343f, 23.167036f, -351.16223f), 0.25f, dataId: null, disableNavMesh: true, + sprint: false, fly: false) + ]; } - var unmount = serviceProvider.GetRequiredService(); if (step.GroundTarget == true) { ITask task;