Vesper bay aetheryte tickets: manually move through gate

This commit is contained in:
Liza 2024-07-29 01:09:04 +02:00
parent 9c637ea42e
commit 2a729e5612
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

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