Rough Update for EW_C/D ('Gateway of the Gods' to 'At Worlds End')

arr-p5
Liza 2024-05-28 22:24:06 +02:00
parent d485e72818
commit 9d20ed27d0
Signed by: liza
GPG Key ID: 7199F8D727D55F67
32 changed files with 624 additions and 142 deletions

View File

@ -6,6 +6,7 @@ using System.Numerics;
using System.Threading;
using System.Threading.Tasks;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game;
using Questionable.External;
@ -36,13 +37,11 @@ internal sealed class MovementController : IDisposable
public bool IsNavmeshReady => _navmeshIpc.IsReady;
public bool IsPathRunning => _navmeshIpc.IsPathRunning;
public bool IsPathfinding => _pathfindTask is { IsCompleted: false };
public Vector3? Destination { get; private set; }
public float StopDistance { get; private set; }
public bool IsFlying { get; private set; }
public DestinationData? Destination { get; private set; }
public void Update()
{
if (_pathfindTask != null)
if (_pathfindTask != null && Destination != null)
{
if (_pathfindTask.IsCompletedSuccessfully)
{
@ -52,7 +51,7 @@ internal sealed class MovementController : IDisposable
var navPoints = _pathfindTask.Result.Skip(1).ToList();
Vector3 start = _clientState.LocalPlayer?.Position ?? navPoints[0];
if (IsFlying && !_condition[ConditionFlag.InFlight] && _condition[ConditionFlag.Mounted])
if (Destination.IsFlying && !_condition[ConditionFlag.InFlight] && _condition[ConditionFlag.Mounted])
{
if (IsOnFlightPath(start) || navPoints.Any(IsOnFlightPath))
{
@ -62,7 +61,7 @@ internal sealed class MovementController : IDisposable
}
}
}
else if (!IsFlying && !_condition[ConditionFlag.Mounted] && navPoints.Count > 0 &&
else if (!Destination.IsFlying && !_condition[ConditionFlag.Mounted] && navPoints.Count > 0 &&
!_gameFunctions.HasStatusPreventingSprintOrMount())
{
float actualDistance = 0;
@ -98,9 +97,22 @@ internal sealed class MovementController : IDisposable
if (IsPathRunning && Destination != null)
{
Vector3 localPlayerPosition = _clientState.LocalPlayer?.Position ?? Vector3.Zero;
if ((localPlayerPosition - Destination.Value).Length() < StopDistance &&
Math.Abs(localPlayerPosition.Y - Destination.Value.Y) < 1.95f) // target is too far below you
Stop();
if ((localPlayerPosition - Destination.Position).Length() < Destination.StopDistance)
{
if (Destination.DataId != null)
{
GameObject? gameObject = _gameFunctions.FindObjectByDataId(Destination.DataId.Value);
if (gameObject != null && gameObject is Character)
{
if (Math.Abs(localPlayerPosition.Y - gameObject.Position.Y) < 1.95f)
Stop();
}
else
Stop();
}
else
Stop();
}
}
}
@ -110,29 +122,27 @@ internal sealed class MovementController : IDisposable
return pointOnFloor != null && Math.Abs(pointOnFloor.Value.Y - p.Y) > 0.5f;
}
private void PrepareNavigation(EMovementType type, Vector3 to, bool fly, float? stopDistance)
private void PrepareNavigation(EMovementType type, uint? dataId, Vector3 to, bool fly, float? stopDistance)
{
ResetPathfinding();
_gameFunctions.ExecuteCommand("/automove off");
Destination = to;
StopDistance = stopDistance ?? (DefaultStopDistance - 0.2f);
IsFlying = fly;
Destination = new DestinationData(dataId, to, stopDistance ?? (DefaultStopDistance - 0.2f), fly);
}
public void NavigateTo(EMovementType type, Vector3 to, bool fly, float? stopDistance = null)
public void NavigateTo(EMovementType type, uint? dataId, Vector3 to, bool fly, float? stopDistance = null)
{
PrepareNavigation(type, to, fly, stopDistance);
PrepareNavigation(type, dataId, to, fly, stopDistance);
_cancellationTokenSource = new();
_cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(10));
_pathfindTask =
_navmeshIpc.Pathfind(_clientState.LocalPlayer!.Position, to, fly, _cancellationTokenSource.Token);
}
public void NavigateTo(EMovementType type, List<Vector3> to, bool fly, float? stopDistance)
public void NavigateTo(EMovementType type, uint? dataId, List<Vector3> to, bool fly, float? stopDistance)
{
PrepareNavigation(type, to.Last(), fly, stopDistance);
PrepareNavigation(type, dataId, to.Last(), fly, stopDistance);
_navmeshIpc.MoveTo(to);
}
@ -164,4 +174,6 @@ internal sealed class MovementController : IDisposable
{
Stop();
}
public sealed record DestinationData(uint? DataId, Vector3 Position, float StopDistance, bool IsFlying);
}

View File

@ -6,11 +6,10 @@ using System.IO;
using System.Numerics;
using System.Text.Json;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Object;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Questionable.Data;
using Questionable.External;
using Questionable.Model.V1;
@ -49,6 +48,7 @@ internal sealed class QuestController
_territoryData = new TerritoryData(dataManager);
Reload();
_gameFunctions.QuestController = this;
}
@ -101,6 +101,8 @@ internal sealed class QuestController
}
#endif
public bool IsKnownQuest(ushort questId) => _quests.ContainsKey(questId);
private void LoadFromDirectory(DirectoryInfo configDirectory)
{
foreach (FileInfo fileInfo in configDirectory.GetFiles("*.json"))
@ -305,7 +307,9 @@ internal sealed class QuestController
if (!CurrentQuest.StepProgress.AethernetShortcutUsed)
{
if (step.AethernetShortcut != null)
if (step.AethernetShortcut != null &&
_gameFunctions.IsAetheryteUnlocked(step.AethernetShortcut.From) &&
_gameFunctions.IsAetheryteUnlocked(step.AethernetShortcut.To))
{
EAetheryteLocation from = step.AethernetShortcut.From;
EAetheryteLocation to = step.AethernetShortcut.To;
@ -325,7 +329,7 @@ internal sealed class QuestController
};
}
else
_movementController.NavigateTo(EMovementType.Quest, _aetheryteData.Locations[from], false,
_movementController.NavigateTo(EMovementType.Quest, null, _aetheryteData.Locations[from], false,
6.9f);
return;
@ -333,7 +337,11 @@ internal sealed class QuestController
}
}
if (step.Position != null)
if (step.TargetTerritoryId == _clientState.TerritoryType)
{
// no more movement
}
else if (step.Position != null)
{
float distance;
if (step.InteractionType == EInteractionType.WalkTo)
@ -375,7 +383,7 @@ internal sealed class QuestController
if (actualDistance > distance)
{
_movementController.NavigateTo(EMovementType.Quest, step.Position.Value,
_movementController.NavigateTo(EMovementType.Quest, step.DataId, step.Position.Value,
step.Fly && _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType), distance);
return;
}
@ -384,20 +392,49 @@ internal sealed class QuestController
{
if (actualDistance > distance)
{
_movementController.NavigateTo(EMovementType.Quest, [step.Position.Value],
_movementController.NavigateTo(EMovementType.Quest, step.DataId, [step.Position.Value],
step.Fly && _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType), distance);
return;
}
}
}
else if (step.DataId != null && step.StopDistance != null)
{
GameObject? gameObject = _gameFunctions.FindObjectByDataId(step.DataId.Value);
if (gameObject == null ||
(gameObject.Position - _clientState.LocalPlayer!.Position).Length() > step.StopDistance)
{
return;
}
}
switch (step.InteractionType)
{
case EInteractionType.Interact:
if (step.DataId != null)
{
GameObject? gameObject = _gameFunctions.FindObjectByDataId(step.DataId.Value);
if (gameObject == null)
return;
if (!gameObject.IsTargetable && _condition[ConditionFlag.Mounted])
{
_gameFunctions.Unmount();
return;
}
_gameFunctions.InteractWith(step.DataId.Value);
IncreaseStepCount();
}
break;
case EInteractionType.AttuneAethernetShard:
if (step.DataId != null)
{
_gameFunctions.InteractWith(step.DataId.Value);
if (!_gameFunctions.IsAetheryteUnlocked((EAetheryteLocation)step.DataId.Value))
_gameFunctions.InteractWith(step.DataId.Value);
IncreaseStepCount();
}
@ -433,23 +470,28 @@ internal sealed class QuestController
break;
case EInteractionType.UseItem:
if (_gameFunctions.Unmount())
return;
if (step is { DataId: not null, ItemId: not null })
{
if (_gameFunctions.Unmount())
return;
_gameFunctions.UseItem(step.DataId.Value, step.ItemId.Value);
IncreaseStepCount();
}
else if (step.ItemId != null)
{
_gameFunctions.UseItem(step.ItemId.Value);
IncreaseStepCount();
}
break;
case EInteractionType.Combat:
if (_gameFunctions.Unmount())
return;
if (step.EnemySpawnType != null)
{
if (_gameFunctions.Unmount())
return;
if (step.DataId != null && step.EnemySpawnType == EEnemySpawnType.AfterInteraction)
_gameFunctions.InteractWith(step.DataId.Value);
@ -470,7 +512,7 @@ internal sealed class QuestController
case EInteractionType.WaitForObjectAtPosition:
if (step is { DataId: not null, Position: not null } &&
!_gameFunctions.IsObbjectAtPosition(step.DataId.Value, step.Position.Value))
!_gameFunctions.IsObjectAtPosition(step.DataId.Value, step.Position.Value))
{
return;
}

View File

@ -11,6 +11,7 @@ using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Control;
using FFXIVClientStructs.FFXIV.Client.Game.Object;
@ -20,6 +21,7 @@ using FFXIVClientStructs.FFXIV.Client.System.Memory;
using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Lumina.Excel.GeneratedSheets;
using Questionable.Controller;
using Questionable.Model.V1;
using BattleChara = FFXIVClientStructs.FFXIV.Client.Game.Character.BattleChara;
using GameObject = Dalamud.Game.ClientState.Objects.Types.GameObject;
@ -72,35 +74,61 @@ internal sealed unsafe class GameFunctions
.AsReadOnly();
}
public QuestController QuestController { private get; set; }
public (ushort CurrentQuest, byte Sequence) GetCurrentQuest()
{
ushort currentQuest;
// if any quest that is currently tracked (i.e. in the to-do list) exists as mapped quest, we use that
var questManager = QuestManager.Instance();
if (questManager != null)
{
foreach (var tracked in questManager->TrackedQuestsSpan)
{
switch (tracked.QuestType)
{
default:
continue;
case 1: // normal quest
currentQuest = questManager->NormalQuestsSpan[tracked.Index].QuestId;
break;
}
if (QuestController.IsKnownQuest(currentQuest))
return (currentQuest, QuestManager.GetQuestSequence(currentQuest));
}
}
var scenarioTree = AgentScenarioTree.Instance();
if (scenarioTree == null)
{
//ImGui.Text("Scenario tree is null.");
return (0, 0);
}
return default;
if (scenarioTree->Data == null)
{
//ImGui.Text("Scenario tree data is null.");
return (0, 0);
}
return default;
uint currentQuest = scenarioTree->Data->CurrentScenarioQuest;
currentQuest = scenarioTree->Data->CurrentScenarioQuest;
if (currentQuest == 0)
{
//ImGui.Text("Current quest is 0.");
return (0, 0);
}
return default;
return (currentQuest, QuestManager.GetQuestSequence(currentQuest));
}
public QuestWork? GetQuestEx(ushort questId)
{
QuestWork* questWork = QuestManager.Instance()->GetQuestById(questId);
return questWork != null ? *questWork : null;
//ImGui.Text($"Current Quest: {currentQuest}");
//ImGui.Text($"Progress: {QuestManager.GetQuestSequence(currentQuest)}");
return ((ushort)currentQuest, QuestManager.GetQuestSequence(currentQuest));
}
public bool IsAetheryteUnlocked(uint aetheryteId, out byte subIndex)
{
subIndex = 0;
var uiState = UIState.Instance();
return uiState != null && uiState->IsAetheryteUnlocked(aetheryteId);
/*
var telepo = Telepo.Instance();
if (telepo == null || telepo->UpdateAetheryteList() == null)
{
@ -120,6 +148,7 @@ internal sealed unsafe class GameFunctions
subIndex = 0;
return false;
*/
}
public bool IsAetheryteUnlocked(EAetheryteLocation aetheryteLocation)
@ -285,7 +314,7 @@ internal sealed unsafe class GameFunctions
#endregion
private GameObject? FindObjectByDataId(uint dataId)
public GameObject? FindObjectByDataId(uint dataId)
{
foreach (var gameObject in _objectTable)
{
@ -311,6 +340,11 @@ internal sealed unsafe class GameFunctions
}
}
public void UseItem(uint itemId)
{
AgentInventoryContext.Instance()->UseItem(itemId);
}
public void UseItem(uint dataId, uint itemId)
{
GameObject? gameObject = FindObjectByDataId(dataId);
@ -331,7 +365,7 @@ internal sealed unsafe class GameFunctions
}
}
public bool IsObbjectAtPosition(uint dataId, Vector3 position)
public bool IsObjectAtPosition(uint dataId, Vector3 position)
{
GameObject? gameObject = FindObjectByDataId(dataId);
return gameObject != null && (gameObject.Position - position).Length() < 0.05f;

View File

@ -17,6 +17,8 @@ public class QuestStep
public float? StopDistance { get; set; }
public ushort TerritoryId { get; set; }
public ushort? TargetTerritoryId { get; set; }
public bool Disabled { get; set; }
public bool DisableNavmesh { get; set; }
public bool? Mount { get; set; }

View File

@ -28,7 +28,8 @@
"Z": 67.826294
},
"TerritoryId": 958,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818348
},
{
"DataId": 1039942,
@ -53,7 +54,8 @@
"Z": -325.85645
},
"TerritoryId": 958,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818350
},
{
"DataId": 1039946,

View File

@ -1,7 +1,6 @@
{
"Version": 1,
"Author": "liza",
"Comment": "TODO This should have an aetheryte?",
"QuestSequence": [
{
"Sequence": 0,
@ -36,6 +35,18 @@
{
"Sequence": 3,
"Steps": [
{
"DataId": 174,
"Position": {
"X": -566.2438,
"Y": 134.6656,
"Z": 650.6459
},
"StopDistance": 10,
"TerritoryId": 959,
"InteractionType": "AttuneAetheryte",
"DisableNavmesh": true
},
{
"DataId": 1039977,
"Position": {
@ -45,10 +56,10 @@
},
"TerritoryId": 959,
"InteractionType": "Interact",
"EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
14077
],
"Comment": "TODO what happened to seq: 2"
]
}
]
},

View File

@ -28,7 +28,8 @@
"Z": 514.4884
},
"TerritoryId": 959,
"InteractionType": "Interact"
"InteractionType": "Interact",
"DisableNavmesh": true
}
]
},

View File

@ -61,6 +61,7 @@
"Y": 76.14732,
"Z": 480.91858
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}

View File

@ -12,6 +12,7 @@
"Y": 76.14732,
"Z": 480.91858
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -42,6 +43,7 @@
"Y": 172.25903,
"Z": 548.94324
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -57,6 +59,7 @@
"Y": 163.31726,
"Z": 593.0419
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -72,6 +75,7 @@
"Y": 156.8169,
"Z": 594.23206
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -87,6 +91,7 @@
"Y": 147.4784,
"Z": 566.1554
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}

View File

@ -12,6 +12,7 @@
"Y": 169.00394,
"Z": 549.6758
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -20,6 +21,52 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": -326.42538,
"Y": 98.98749,
"Z": 526.5519
},
"TerritoryId": 959,
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"Position": {
"X": -50.482517,
"Y": 42.360725,
"Z": 466.64243
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"Position": {
"X": 113.70272,
"Y": 45.552776,
"Z": 460.49585
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"Position": {
"X": 129.9883,
"Y": 54.543076,
"Z": 468.93378
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"Position": {
"X": 126.817184,
"Y": 55.823048,
"Z": 476.34058
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 1038884,
"Position": {
@ -87,6 +134,7 @@
"Y": 59.911327,
"Z": 411.42883
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}

View File

@ -21,14 +21,14 @@
"Sequence": 1,
"Steps": [
{
"DataId": 2012019,
"Position": {
"X": 21.7081,
"Y": -133.5001,
"Z": -385.7313
"X": 1.131261,
"Y": -114.92335,
"Z": -418.2727
},
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"DataId": 1038897,
@ -52,9 +52,19 @@
"Y": -128.8109,
"Z": -512.0165
},
"StopDistance": 10,
"TerritoryId": 959,
"InteractionType": "AttuneAetheryte"
},
{
"Position": {
"X": 36.500526,
"Y": -129.20917,
"Z": -521.85284
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 1038901,
"Position": {
@ -63,7 +73,8 @@
"Z": -555.0164
},
"TerritoryId": 959,
"InteractionType": "Interact"
"InteractionType": "Interact",
"DisableNavmesh": true
}
]
},
@ -85,6 +96,25 @@
{
"Sequence": 255,
"Steps": [
{
"Position": {
"X": -72.39724,
"Y": -49.589592,
"Z": -336.63968
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"Position": {
"X": -105.34293,
"Y": -49.589592,
"Z": -367.6591
},
"TerritoryId": 959,
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"DataId": 1038903,
"Position": {

View File

@ -20,6 +20,48 @@
{
"Sequence": 1,
"Steps": [
{
"DataId": 2012013,
"Position": {
"X": 29.1046,
"Y": -47.739,
"Z": -550.4077
},
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818362
},
{
"Position": {
"X": 62.71022,
"Y": -46.99965,
"Z": -433.81802
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"Position": {
"X": 47.394165,
"Y": -133.50012,
"Z": -397.90225
},
"TerritoryId": 959,
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"DataId": 2012019,
"Position": {
"X": 21.7081,
"Y": -133.5001,
"Z": -385.7313
},
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818368,
"DisableNavmesh": true
},
{
"DataId": 1038908,
"Position": {
@ -28,7 +70,8 @@
"Z": -618.7686
},
"TerritoryId": 959,
"InteractionType": "Interact"
"InteractionType": "Interact",
"AetheryteShortcut": "Mare Lamentorum - Bestways Burrow"
}
]
},
@ -37,13 +80,8 @@
"Steps": [
{
"DataId": 2012178,
"Position": {
"X": -486.59497,
"Y": -154.37555,
"Z": -689.26526
},
"TerritoryId": 959,
"InteractionType": "ManualAction",
"InteractionType": "Interact",
"Comment": "Navmesh can't jump"
}
]
@ -59,22 +97,30 @@
"Z": -595.72754
},
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818360
},
{
"DataId": 1038912,
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact",
"Comment": "Navmesh can't jump"
}
]
},
{
"Sequence": 4,
"Steps": [
{
"Position": {
"X": -455.40552,
"Y": -168,
"Z": -620.05035
},
"TerritoryId": 959,
"InteractionType": "Interact"
},
{
"ItemId": null,
"TerritoryId": 959,
"InteractionType": "UseItem"
"InteractionType": "UseItem",
"ItemId": 2003236
}
]
},

View File

@ -42,18 +42,14 @@
"Z": -253.94832
},
"TerritoryId": 959,
"InteractionType": "ManualAction",
"Comment": "Navmesh can't jump"
"InteractionType": "WalkTo"
},
{
"DataId": 1038923,
"Position": {
"X": -376.27222,
"Y": -151.67168,
"Z": -267.90265
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
"InteractionType": "Interact",
"Comment": "Navmesh can't jump"
}
]
},
@ -67,18 +63,14 @@
"Z": -361.57114
},
"TerritoryId": 959,
"InteractionType": "ManualAction",
"Comment": "Navmesh can't jump"
"InteractionType": "WalkTo"
},
{
"DataId": 1038924,
"Position": {
"X": -329.97632,
"Y": -151.67169,
"Z": -333.76062
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
"InteractionType": "Interact",
"Comment": "Navmesh can't jump"
}
]
},

View File

@ -20,6 +20,27 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": 68.93551,
"Y": -48.912445,
"Z": -683.716
},
"TerritoryId": 959,
"InteractionType": "WalkTo",
"DisableNavmesh": true,
"Mount": true
},
{
"Position": {
"X": 86.32549,
"Y": -137.4167,
"Z": -619.77936
},
"TerritoryId": 959,
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"DataId": 1038928,
"Position": {
@ -89,15 +110,17 @@
"Z": -405.08124
},
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818366
},
{
"DataId": 1038929,
"Position": {
"X": 596.2294,
"X": 595.4731,
"Y": -167.50227,
"Z": -510.33884
"Z": -511.4072
},
"StopDistance": 0.25,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -109,10 +132,11 @@
{
"DataId": 1038929,
"Position": {
"X": 547.2717,
"X": 547.8397,
"Y": -167.50174,
"Z": -525.274
"Z": -526.3702
},
"StopDistance": 0.25,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -124,10 +148,11 @@
{
"DataId": 1038929,
"Position": {
"X": 572.0069,
"X": 572.45984,
"Y": -167.50163,
"Z": -574.98785
"Z": -577.03906
},
"StopDistance": 0.25,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -139,10 +164,11 @@
{
"DataId": 1038929,
"Position": {
"X": 616.97437,
"X": 617.89886,
"Y": -167.50163,
"Z": -593.1553
"Z": -594.92847
},
"StopDistance": 0.25,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -154,10 +180,11 @@
{
"DataId": 1038929,
"Position": {
"X": 623.16296,
"X": 622.8754,
"Y": -167.50217,
"Z": -657.5506
"Z": -659.45184
},
"StopDistance": 0.25,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -173,6 +200,7 @@
"Y": -168.00002,
"Z": -656.58044
},
"StopDistance": 7,
"TerritoryId": 959,
"InteractionType": "Interact"
}

View File

@ -1,7 +1,6 @@
{
"Version": 1,
"Author": "liza",
"Comment": "Sequence 3 is the end of the chase marker",
"QuestSequence": [
{
"Sequence": 0,
@ -29,7 +28,8 @@
"Z": -512.2606
},
"TerritoryId": 959,
"InteractionType": "Interact"
"InteractionType": "Interact",
"AetheryteShortcut": "Mare Lamentorum - Bestways Burrow"
}
]
},
@ -49,6 +49,22 @@
}
]
},
{
"Sequence": 3,
"Steps": [
{
"DataId": 2012185,
"Position": {
"X": -5.416992,
"Y": -49.05786,
"Z": -269.24548
},
"TerritoryId": 959,
"InteractionType": "ManualAction",
"Comment": "Duty - Follow Urianger (but you failed the first time)"
}
]
},
{
"Sequence": 255,
"Steps": [

View File

@ -20,6 +20,47 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": -126.76068,
"Y": 61.04055,
"Z": -76.382324
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 2012014,
"Position": {
"X": -128.008,
"Y": 66.33093,
"Z": -68.2536
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818363
},
{
"Position": {
"X": -116.83438,
"Y": 63.151585,
"Z": -71.81973
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 2012010,
"Position": {
"X": 42.58789,
"Y": 124.01001,
"Z": -167.04059
},
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818359
},
{
"DataId": 1038936,
"Position": {
@ -44,6 +85,7 @@
},
"TerritoryId": 959,
"InteractionType": "Combat",
"EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
13998,
14093,
@ -93,6 +135,7 @@
},
"TerritoryId": 959,
"InteractionType": "ManualAction",
"AetheryteShortcut": "Mare Lamentorum - Bestways Burrow",
"Comment": "Navmesh can't jump"
},
{
@ -102,8 +145,19 @@
"Y": -154.98596,
"Z": -595.5444
},
"StopDistance": 3,
"TerritoryId": 959,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818361
},
{
"Position": {
"X": 351.1467,
"Y": -167.87698,
"Z": -605.0467
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 1038937,

View File

@ -31,6 +31,15 @@
"InteractionType": "Interact",
"Comment": "Teleporter"
},
{
"Position": {
"X": 65.32143,
"Y": -49.589592,
"Z": -690.11676
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 1038947,
"Position": {
@ -55,6 +64,7 @@
},
"TerritoryId": 959,
"InteractionType": "Combat",
"EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
13996,
13997,
@ -66,6 +76,15 @@
{
"Sequence": 3,
"Steps": [
{
"Position": {
"X": 18.495846,
"Y": -49.589592,
"Z": -301.7225
},
"TerritoryId": 959,
"InteractionType": "WalkTo"
},
{
"DataId": 1038950,
"Position": {
@ -88,9 +107,9 @@
"Y": 128.67769,
"Z": 572.0454
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact",
"Comment": "Unsure if this is the correct data id"
"InteractionType": "Interact"
}
]
}

View File

@ -12,6 +12,7 @@
"Y": 128.6778,
"Z": 566.8573
},
"StopDistance": 5,
"TerritoryId": 959,
"InteractionType": "Interact"
}
@ -20,6 +21,16 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": -614.86835,
"Y": 128.67761,
"Z": 677.33923
},
"TerritoryId": 959,
"InteractionType": "WalkTo",
"Comment": "Avoids Combat"
},
{
"DataId": 2012531,
"Position": {
@ -53,7 +64,8 @@
"Z": 407.79736
},
"TerritoryId": 958,
"InteractionType": "Interact"
"InteractionType": "Interact",
"AetheryteShortcut": "Garlemald - Camp Broken Glass"
}
]
},
@ -69,6 +81,7 @@
},
"TerritoryId": 962,
"InteractionType": "Interact",
"AetheryteShortcut": "Old Sharlayan",
"AethernetShortcut": [
"[Old Sharlayan] Aetheryte Plaza",
"[Old Sharlayan] The Baldesion Annex"

View File

@ -12,6 +12,7 @@
"Y": 3.8989394,
"Z": 7.003784
},
"StopDistance": 5,
"TerritoryId": 962,
"InteractionType": "Interact"
}
@ -36,15 +37,10 @@
"Sequence": 2,
"Steps": [
{
"DataId": 1038978,
"Position": {
"X": 202.34985,
"Y": 1.7699993,
"Z": 757.71716
},
"TerritoryId": 957,
"InteractionType": "Interact",
"Comment": "Does this get completed automatically on teleport? Using the coords from the next step"
"AetheryteShortcut": "Thavnair - Yedlihmad",
"InteractionType": "WalkTo",
"Comment": "Quest automatically progresses once teleported to Yedlihmad"
}
]
},

View File

@ -91,10 +91,11 @@
{
"DataId": 1038997,
"Position": {
"X": -37.70625,
"Y": -9.957219E-05,
"Z": -134.90237
"X": -37.667046,
"Y": -0.00014948845,
"Z": -136.80333
},
"StopDistance": 0.25,
"TerritoryId": 963,
"InteractionType": "Interact"
}

View File

@ -23,10 +23,11 @@
{
"DataId": 1039002,
"Position": {
"X": 56.012253,
"X": 57.04193,
"Y": 26.99999,
"Z": 44.92237
"Z": 46.383568
},
"StopDistance": 0.25,
"TerritoryId": 963,
"InteractionType": "Interact",
"AethernetShortcut": [

View File

@ -42,6 +42,7 @@
"Y": 51.57471,
"Z": -597.1924
},
"StopDistance": 5,
"TerritoryId": 957,
"InteractionType": "Interact"
}
@ -59,6 +60,7 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
13994
]
@ -77,6 +79,7 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
13992,
13993
@ -139,6 +142,7 @@
"Y": 5.2643433,
"Z": -244.4953
},
"StopDistance": 10,
"TerritoryId": 957,
"InteractionType": "AttuneAetheryte"
},

View File

@ -28,7 +28,8 @@
"Z": -272.84656
},
"TerritoryId": 957,
"InteractionType": "Interact"
"InteractionType": "Interact",
"DisableNavmesh": true
}
]
},
@ -43,7 +44,8 @@
"Z": -343.89258
},
"TerritoryId": 957,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818331
},
{
"DataId": 2011997,
@ -53,7 +55,8 @@
"Z": -447.8676
},
"TerritoryId": 957,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818336
},
{
"DataId": 1039023,
@ -79,6 +82,7 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
13991,
13990
@ -128,6 +132,7 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
13989
]

View File

@ -50,6 +50,15 @@
{
"Sequence": 3,
"Steps": [
{
"Position": {
"X": 543.0377,
"Y": 15.147404,
"Z": -147.8739
},
"TerritoryId": 957,
"InteractionType": "WalkTo"
},
{
"DataId": 2011996,
"Position": {
@ -58,7 +67,18 @@
"Z": -159.1059
},
"TerritoryId": 957,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818332,
"DisableNavmesh": true
},
{
"Position": {
"X": 536.3203,
"Y": 12.722106,
"Z": -95.65565
},
"TerritoryId": 957,
"InteractionType": "WalkTo"
},
{
"Position": {
@ -68,6 +88,7 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
13988
]
@ -115,9 +136,11 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
13987
]
],
"$": "QuestVariables after: 16 1 0 0 0 128"
},
{
"Position": {
@ -127,9 +150,11 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
13986
]
],
"$": "QuestVariables after: 33 1 0 0 0 192"
},
{
"Position": {
@ -139,6 +164,7 @@
},
"TerritoryId": 957,
"InteractionType": "Combat",
"EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
13985,
13984

View File

@ -28,7 +28,8 @@
"Z": 425.10107
},
"TerritoryId": 957,
"InteractionType": "AttuneAetherCurrent"
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818337
},
{
"DataId": 2012207,
@ -53,8 +54,8 @@
"Z": 141.25269
},
"TerritoryId": 957,
"InteractionType": "ManualAction",
"Comment": "Navmesh can't swim"
"InteractionType": "Interact",
"DisableNavmesh": true
}
]
},
@ -68,15 +69,48 @@
"Y": -60.471558,
"Z": 133.25696
},
"StopDistance": 0.5,
"TerritoryId": 957,
"InteractionType": "ManualAction",
"Comment": "Navmesh can't swim"
"InteractionType": "Interact",
"DisableNavmesh": true
}
]
},
{
"Sequence": 4,
"Steps": [
{
"Position": {
"X": 235.94444,
"Y": -0.6,
"Z": 145.83025
},
"TerritoryId": 957,
"InteractionType": "WalkTo",
"DisableNavmesh": true,
"Mount": true
},
{
"Position": {
"X": 252.0308,
"Y": 0.57823455,
"Z": 150.66217
},
"TerritoryId": 957,
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"DataId": 2011999,
"Position": {
"X": 53.177612,
"Y": 11.36792,
"Z": 187.396
},
"TerritoryId": 957,
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818338
},
{
"DataId": 1039052,
"Position": {
@ -85,8 +119,7 @@
"Z": 217.85303
},
"TerritoryId": 957,
"InteractionType": "ManualAction",
"Comment": "Navmesh can't swim; should *probably* collect the aether current before interacting here"
"InteractionType": "Interact"
}
]
},
@ -100,6 +133,7 @@
"Y": 25.65825,
"Z": -319.87494
},
"StopDistance": 5,
"TerritoryId": 957,
"InteractionType": "Interact"
}

View File

@ -27,8 +27,10 @@
"Y": 3.1168795,
"Z": -262.0432
},
"StopDistance": 15,
"TerritoryId": 957,
"InteractionType": "Interact"
"InteractionType": "Interact",
"AetheryteShortcut": "Thavnair - Palaka's Stand"
}
]
},
@ -42,6 +44,7 @@
"Y": 3.1168792,
"Z": -262.62305
},
"StopDistance": 7,
"TerritoryId": 957,
"InteractionType": "Interact"
}
@ -85,6 +88,16 @@
{
"Sequence": 255,
"Steps": [
{
"Position": {
"X": 425.544,
"Y": 3.1257756,
"Z": -218.32741
},
"TerritoryId": 957,
"InteractionType": "WalkTo",
"DisableNavmesh": true
},
{
"DataId": 1039064,
"Position": {

View File

@ -12,6 +12,7 @@
"Y": 3.1168795,
"Z": -262.62305
},
"StopDistance": 5,
"TerritoryId": 957,
"InteractionType": "Interact"
}
@ -42,8 +43,9 @@
"Z": -683.829
},
"TerritoryId": 957,
"InteractionType": "Interact",
"Comment": "Travel to Radz-at-Han"
"InteractionType": "WalkTo",
"Comment": "Travel to Radz-at-Han",
"TargetTerritoryId": 963
},
{
"DataId": 1040354,
@ -112,6 +114,7 @@
"Y": 36,
"Z": 71.70203
},
"StopDistance": 5,
"TerritoryId": 963,
"InteractionType": "Interact"
}

View File

@ -43,7 +43,9 @@
"Z": -27.023743
},
"TerritoryId": 963,
"InteractionType": "AttuneAetheryte"
"InteractionType": "AttuneAetheryte",
"StopDistance": 10,
"DisableNavmesh": true
},
{
"DataId": 195,

View File

@ -12,6 +12,7 @@
"Y": -1.9999962,
"Z": 88.12085
},
"StopDistance": 5,
"TerritoryId": 963,
"InteractionType": "Interact"
}

View File

@ -80,6 +80,11 @@
"description": "The territory id associated with the location",
"exclusiveMinimum": 0
},
"TargetTerritoryId": {
"type": "integer",
"description": "If set, this step is complete (movement-wise) if this territory id is reached",
"exclusiveMinimum": 0
},
"InteractionType": {
"type": "string",
"description": "What to do at the position",

View File

@ -1,7 +1,9 @@
using System;
using System.Linq;
using System.Numerics;
using Dalamud.Game;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.Command;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
@ -21,6 +23,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
private readonly IClientState _clientState;
private readonly IFramework _framework;
private readonly IGameGui _gameGui;
private readonly ICommandManager _commandManager;
private readonly GameFunctions _gameFunctions;
private readonly QuestController _questController;
@ -40,6 +43,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
_clientState = clientState;
_framework = framework;
_gameGui = gameGui;
_commandManager = commandManager;
_gameFunctions = new GameFunctions(dataManager, objectTable, sigScanner, targetManager, condition, pluginLog);
AetheryteData aetheryteData = new AetheryteData(dataManager);
@ -54,6 +58,8 @@ public sealed class QuestionablePlugin : IDalamudPlugin
_pluginInterface.UiBuilder.Draw += _windowSystem.Draw;
_framework.Update += FrameworkUpdate;
_commandManager.AddHandler("/qst", new CommandInfo(ProcessCommand));
}
private void FrameworkUpdate(IFramework framework)
@ -64,6 +70,11 @@ public sealed class QuestionablePlugin : IDalamudPlugin
_movementController.Update();
}
private void ProcessCommand(string command, string arguments)
{
_windowSystem.Windows.Single(x => x is DebugWindow).Toggle();
}
private unsafe void HandleNavigationShortcut()
{
var inputData = UIInputData.Instance();
@ -76,7 +87,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
_gameGui.ScreenToWorld(new Vector2(inputData->CursorXPosition, inputData->CursorYPosition),
out Vector3 worldPos))
{
_movementController.NavigateTo(EMovementType.Shortcut, worldPos,
_movementController.NavigateTo(EMovementType.Shortcut, null, worldPos,
_gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType));
}
}
@ -84,6 +95,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
public void Dispose()
{
_commandManager.RemoveHandler("/qst");
_framework.Update -= FrameworkUpdate;
_pluginInterface.UiBuilder.Draw -= _windowSystem.Draw;

View File

@ -1,10 +1,12 @@
using System.Globalization;
using System.Linq;
using System.Numerics;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Interface;
using Dalamud.Interface.Components;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Control;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using ImGuiNET;
@ -52,6 +54,27 @@ internal sealed class DebugWindow : Window
if (currentQuest != null)
{
ImGui.TextUnformatted($"Quest: {currentQuest.Quest.Name} / {currentQuest.Sequence} / {currentQuest.Step}");
var questWork = _gameFunctions.GetQuestEx(currentQuest.Quest.QuestId);
if (questWork != null)
{
var qw = questWork.Value;
string vars = "";
for (int i = 0; i < 6; ++i)
vars += qw.Variables[i] + " ";
// For combat quests, a sequence to kill 3 enemies works a bit like this:
// Trigger enemies → 0
// Kill first enemy → 1
// Kill second enemy → 2
// Last enemy → increase sequence, reset variable to 0
// The order in which enemies are killed doesn't seem to matter.
// If multiple waves spawn, this continues to count up (e.g. 1 enemy from wave 1, 2 enemies from wave 2, 1 from wave 3) would count to 3 then 0
ImGui.Text($"QW: {vars.Trim()} / {qw.Flags}");
}
else
ImGui.TextUnformatted("(Not accepted)");
ImGui.TextUnformatted(_questController.DebugState ?? "--");
ImGui.TextUnformatted(_questController.Comment ?? "--");
@ -95,8 +118,8 @@ internal sealed class DebugWindow : Window
{
if (ImGui.Button("Move to Target"))
{
_movementController.NavigateTo(EMovementType.DebugWindow, _targetManager.Target.Position,
_gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType));
_movementController.NavigateTo(EMovementType.DebugWindow, _targetManager.Target.DataId,
_targetManager.Target.Position, _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType));
}
}
else