$"Pathfinding complete, route: [{string.Join(" → ", _pathfindTask.Result.Select(x => x.ToString()))}]"));
var navPoints = _pathfindTask.Result.Skip(1).ToList();
- if (!IsFlying && !_condition[ConditionFlag.Mounted] && navPoints.Count > 0 &&
- !_gameFunctions.HasStatusPreventingSprintOrMount())
+ Vector3 start = _clientState.LocalPlayer?.Position ?? navPoints[0];
+ if (IsFlying && !_condition[ConditionFlag.InFlight] && _condition[ConditionFlag.Mounted])
+ {
+ if (IsOnFlightPath(start) || navPoints.Any(IsOnFlightPath))
+ {
+ unsafe
+ {
+ ActionManager.Instance()->UseAction(ActionType.GeneralAction, 2);
+ }
+ }
+ }
+ else if (!IsFlying && !_condition[ConditionFlag.Mounted] && navPoints.Count > 0 &&
+ !_gameFunctions.HasStatusPreventingSprintOrMount())
{
- Vector3 start = _clientState.LocalPlayer?.Position ?? navPoints[0];
float actualDistance = 0;
foreach (Vector3 end in navPoints)
{
if (IsPathRunning && Destination != null)
{
Vector3 localPlayerPosition = _clientState.LocalPlayer?.Position ?? Vector3.Zero;
- if ((localPlayerPosition - Destination.Value).Length() < StopDistance)
+ if ((localPlayerPosition - Destination.Value).Length() < StopDistance &&
+ Math.Abs(localPlayerPosition.Y - Destination.Value.Y) < 1.95f) // target is too far below you
Stop();
}
}
+ private bool IsOnFlightPath(Vector3 p)
+ {
+ Vector3? pointOnFloor = _navmeshIpc.GetPointOnFloor(p);
+ return pointOnFloor != null && Math.Abs(pointOnFloor.Value.Y - p.Y) > 0.5f;
+ }
+
private void PrepareNavigation(EMovementType type, Vector3 to, bool fly, float? stopDistance)
{
ResetPathfinding();
else
distance = step.StopDistance ?? MovementController.DefaultStopDistance;
+ _pluginLog.Information($"Stop dist: {distance}");
var position = _clientState.LocalPlayer?.Position ?? new Vector3();
float actualDistance = (position - step.Position.Value).Length();
if (actualDistance > distance)
{
_movementController.NavigateTo(EMovementType.Quest, step.Position.Value,
- _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType), distance);
+ step.Fly && _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType), distance);
return;
}
}
if (actualDistance > distance)
{
_movementController.NavigateTo(EMovementType.Quest, [step.Position.Value],
- _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType), distance);
+ step.Fly && _gameFunctions.IsFlyingUnlocked(_clientState.TerritoryType), distance);
return;
}
}
private readonly ICallGateSubscriber<bool> _pathIsRunning;
private readonly ICallGateSubscriber<float> _pathGetTolerance;
private readonly ICallGateSubscriber<float, object> _pathSetTolerance;
+ private readonly ICallGateSubscriber<Vector3, bool, float, Vector3?> _queryPointOnFloor;
public NavmeshIpc(DalamudPluginInterface pluginInterface)
{
_pathIsRunning = pluginInterface.GetIpcSubscriber<bool>("vnavmesh.Path.IsRunning");
_pathGetTolerance = pluginInterface.GetIpcSubscriber<float>("vnavmesh.Path.GetTolerance");
_pathSetTolerance = pluginInterface.GetIpcSubscriber<float, object>("vnavmesh.Path.SetTolerance");
+ _queryPointOnFloor = pluginInterface.GetIpcSubscriber<Vector3, bool, float, Vector3?>("vnavmesh.Query.Mesh.PointOnFloor");
}
public bool IsReady
_pathMoveTo.InvokeAction(position, false);
}
+
+ public Vector3? GetPointOnFloor(Vector3 position)
+ => _queryPointOnFloor.InvokeFunc(position, true, 1);
}
public bool Disabled { get; set; }
public bool DisableNavmesh { get; set; }
public bool? Mount { get; set; }
+ public bool Fly { get; set; }
public string? Comment { get; set; }
[JsonConverter(typeof(AetheryteConverter))]
"Z": -67.36859
},
"TerritoryId": 962,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "AethernetShortcut": [
+ "[Old Sharlayan] The Baldesion Annex",
+ "[Old Sharlayan] The Studium"
+ ]
}
]
},
"Y": 21.84602,
"Z": -91.32526
},
+ "StopDistance": 5,
"TerritoryId": 962,
"InteractionType": "Interact"
}
"Z": -15.213318
},
"TerritoryId": 129,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "AetheryteShortcut": "Limsa Lominsa"
}
]
},
"Z": 525.2003
},
"TerritoryId": 621,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "AetheryteShortcut": "Lochs - Ala Mhigan Quarter",
+ "Fly": true
}
]
}
"Y": 70.139626,
"Z": 522.88086
},
+ "StopDistance": 5,
"TerritoryId": 621,
"InteractionType": "Interact"
}
"Y": 122,
"Z": -362.96637
},
+ "StopDistance": 7,
"TerritoryId": 737,
"InteractionType": "Interact",
"Comment": "A-Ruhn-Senna"
"Y": 122,
"Z": -366.47595
},
+ "StopDistance": 7,
"TerritoryId": 737,
"InteractionType": "Interact",
"Comment": "Sicard"
"Y": 122,
"Z": -366.84216
},
+ "StopDistance": 7,
"TerritoryId": 737,
"InteractionType": "Interact",
"Comment": "Lyse"
"Y": 122,
"Z": -363.9124
},
+ "StopDistance": 7,
"TerritoryId": 737,
"InteractionType": "Interact",
"Comment": "Lucia"
"Y": 122,
"Z": -352.34613
},
+ "StopDistance": 7,
"TerritoryId": 737,
"InteractionType": "Interact",
"Comment": "Cirina"
"Y": 122,
"Z": -364.9806
},
+ "StopDistance": 7,
"TerritoryId": 737,
"InteractionType": "Interact"
}
"Y": 69.9999,
"Z": 534.3251
},
+ "StopDistance": 7,
"TerritoryId": 621,
"InteractionType": "Interact"
}
"Y": 24.18463,
"Z": 479.9764
},
+ "StopDistance": 7,
"TerritoryId": 958,
"InteractionType": "AttuneAetheryte"
},
"Y": 23.803606,
"Z": 404.65393
},
+ "StopDistance": 7,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 22.717295,
"Z": 435.62976
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 22.738518,
"Z": 435.56873
},
+ "StopDistance": 7,
"TerritoryId": 958,
"InteractionType": "Interact"
}
{
"Sequence": 1,
"Steps": [
+ {
+ "Position": {
+ "X": -210.6673,
+ "Y": 15.799101,
+ "Z": 451.78333
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
{
"DataId": 2012000,
"Position": {
"Y": 31.937134,
"Z": 423.6056
},
+ "StopDistance": 5,
+ "TerritoryId": 958,
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818344,
+ "DisableNavmesh": true
+ },
+ {
+ "Position": {
+ "X": -188.58397,
+ "Y": 20.625948,
+ "Z": 408.3002
+ },
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "WalkTo",
+ "DisableNavmesh": true,
+ "Mount": true
},
{
"DataId": 1038840,
{
"Sequence": 2,
"Steps": [
+ {
+ "Position": {
+ "X": -135.94785,
+ "Y": 3.426586,
+ "Z": 360.1115
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo",
+ "DisableNavmesh": true,
+ "Mount": true
+ },
+ {
+ "Position": {
+ "X": -48.166317,
+ "Y": -0.8113563,
+ "Z": 374.09103
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
{
"DataId": 2012076,
"Position": {
"Y": 32.318867,
"Z": 150.04187
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 38.372063,
"Z": 217.54773
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 38.372063,
"Z": 214.55713
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 38.372063,
"Z": 216.05249
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
{
"Sequence": 6,
"Steps": [
+ {
+ "Position": {
+ "X": 398.44858,
+ "Y": 5.094846,
+ "Z": 231.72844
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
{
"Position": {
"X": 393.71204,
},
"TerritoryId": 958,
"InteractionType": "ManualAction",
+ "DisableNavmesh": true,
"Comment": "Jump on Pipeline and move near the Aether Current"
},
{
"Z": 520.31726
},
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818347
+ },
+ {
+ "Position": {
+ "X": 379.2122,
+ "Y": -18.622318,
+ "Z": 530.3423
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo",
+ "DisableNavmesh": true
},
{
"DataId": 2012001,
"Z": 644.28174
},
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818345
},
{
"DataId": 1038853,
"Z": 650.26306
},
"TerritoryId": 958,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "Mount": false
}
]
},
"Y": 23.803606,
"Z": 405.2644
},
+ "StopDistance": 7,
"TerritoryId": 958,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "AetheryteShortcut": "Garlemald - Camp Broken Glass"
}
]
},
"Y": 22.071072,
"Z": 434.01233
},
+ "StopDistance": 6,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": -0.13689682,
"Z": 150.48564
},
+ "StopDistance": 1,
"TerritoryId": 958,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "Comment": "Follow Alphinaud and Alisaie"
}
]
},
"Z": 102.00659
},
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818346
},
{
"Position": {
"Y": 0.96746624,
"Z": 103.04115
},
+ "StopDistance": 1,
"TerritoryId": 958,
"InteractionType": "Combat",
+ "EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
14083,
14084
"Y": 0.99992824,
"Z": 105.82129
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 5.506278,
"Z": 78.14653
},
+ "StopDistance": 1,
"TerritoryId": 958,
"InteractionType": "Combat",
+ "EnemySpawnType": "AutoOnEnterArea",
"KillEnemyDataIds": [
14082
]
"Y": 5.5300293,
"Z": 76.67651
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 14.620869,
"Z": -164.97536
},
+ "StopDistance": 1,
"TerritoryId": 958,
+ "EnemySpawnType": "AutoOnEnterArea",
"InteractionType": "Combat",
"KillEnemyDataIds": [
14081
"Y": 14.616225,
"Z": -162.85956
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"InteractionType": "Interact",
"Comment": "Octavia"
},
+ {
+ "Position": {
+ "X": 502.34732,
+ "Y": -36.65,
+ "Z": -178.38684
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
{
"DataId": 1037715,
"Position": {
{
"Sequence": 3,
"Steps": [
+ {
+ "Position": {
+ "X": 548.01605,
+ "Y": -36.61611,
+ "Z": -237.499
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
+ {
+ "Position": {
+ "X": 547.66595,
+ "Y": -36.616203,
+ "Z": -244.51854
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo",
+ "DisableNavmesh": true
+ },
{
"DataId": 1037719,
"Position": {
{
"Sequence": 4,
"Steps": [
+ {
+ "Position": {
+ "X": 547.021,
+ "Y": -36.616203,
+ "Z": -244.6051
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
{
"DataId": 1039899,
"Position": {
"Z": -216.84601
},
"TerritoryId": 958,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "DisableNavmesh": true
}
]
},
{
"Sequence": 1,
"Steps": [
+ {
+ "Position": {
+ "X": 531.7644,
+ "Y": -36.650005,
+ "Z": -228.76685
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
{
"DataId": 1039901,
"Position": {
},
"TerritoryId": 958,
"InteractionType": "Interact",
- "Comment": "Map"
+ "Comment": "Map",
+ "Mount": true
},
{
"DataId": 2012005,
"Z": -482.20038
},
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818349
},
{
"DataId": 2012095,
"InteractionType": "Interact"
}
]
+ },
+ {
+ "Sequence": 255,
+ "Steps": [
+ {
+ "DataId": 1039906,
+ "Position": {
+ "X": 432.2423,
+ "Y": 15.558166,
+ "Z": -611.90204
+ },
+ "TerritoryId": 958,
+ "InteractionType": "Interact"
+ }
+ ]
}
]
}
"Y": 16.102577,
"Z": -578.4848
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Z": -579.7666
},
"TerritoryId": 958,
- "InteractionType": "Interact"
+ "InteractionType": "UseItem",
+ "ItemId": 2003229
}
]
},
"Y": -36.65,
"Z": -233.87512
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": -36.65,
"Z": -233.87512
},
+ "StopDistance": 5,
"TerritoryId": 958,
"InteractionType": "Interact"
}
"Y": 14.389221,
"Z": -172.25916
},
+ "StopDistance": 5,
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818352
+ },
+ {
+ "Position": {
+ "X": -141.20903,
+ "Y": 11.389334,
+ "Z": -399.3773
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo"
+ },
+ {
+ "Position": {
+ "X": -153.54558,
+ "Y": 11.389343,
+ "Z": -402.64487
+ },
+ "TerritoryId": 958,
+ "InteractionType": "ManualAction",
+ "Comment": "Jump to Aether Current"
+ },
+ {
+ "DataId": 2012009,
+ "Position": {
+ "X": -144.9455,
+ "Y": 17.56311,
+ "Z": -420.52344
+ },
+ "TerritoryId": 958,
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818353
+ },
+ {
+ "Position": {
+ "X": -145.6724,
+ "Y": 11.389343,
+ "Z": -398.82806
+ },
+ "TerritoryId": 958,
+ "InteractionType": "ManualAction",
+ "Comment": "Leave the Aether Current location"
},
{
"Position": {
"Z": -518.2117
},
"TerritoryId": 958,
- "InteractionType": "AttuneAetherCurrent"
+ "InteractionType": "AttuneAetherCurrent",
+ "AetherCurrentId": 2818351
+ },
+ {
+ "Position": {
+ "X": 76.583664,
+ "Y": 10.5,
+ "Z": -538.34607
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo",
+ "DisableNavmesh": true
},
{
"DataId": 1039917,
"Y": -35.324707,
"Z": -178.36273
},
+ "StopDistance": 7,
"TerritoryId": 958,
- "InteractionType": "AttuneAetheryte"
+ "InteractionType": "AttuneAetheryte",
+ "DisableNavmesh": true
},
{
"DataId": 1037716,
{
"Sequence": 6,
"Steps": [
+ {
+ "Position": {
+ "X": 539.89374,
+ "Y": -36.65,
+ "Z": -193.11551
+ },
+ "TerritoryId": 958,
+ "InteractionType": "WalkTo",
+ "Mount": true,
+ "DisableNavmesh": true
+ },
{
"DataId": 2012111,
"Position": {
},
"TerritoryId": 958,
"InteractionType": "Combat",
+ "EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
14078
]
"Z": 94.77368
},
"TerritoryId": 958,
- "InteractionType": "Combat",
+ "InteractionType": "ManualAction",
+ "EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
14079
],
- "Comment": "TODO Needs item use?"
+ "Comment": "TODO Needs item use?",
+ "ItemId": 2003231,
+ "ItemUseHealthMaxPercent": 10
},
{
"DataId": 2012108,
"Z": 153.24634
},
"TerritoryId": 958,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "Comment": "TODO Maybe move the train station aether current interaction before this"
},
{
"DataId": 2012110,
"Z": 396.96338
},
"TerritoryId": 958,
- "InteractionType": "Interact",
+ "InteractionType": "ManualAction",
+ "EnemySpawnType": "AfterInteraction",
"KillEnemyDataIds": [
14080
],
- "Comment": "TODO Needs item use?"
+ "Comment": "TODO Needs item use?",
+ "ItemId": 2003231,
+ "ItemUseHealthMaxPercent": 10
}
]
},
"type": ["boolean", "null"],
"description": "If true, will mount regardless of distance to position. If false, will unmount."
},
+ "Fly": {
+ "type": "boolean",
+ "description": "If true and flying is unlocked in a zone, will use a flight path"
+ },
"AetheryteShortcut": {
"type": "string",
"description": "The Aetheryte to teleport to (before moving)",