"Z": 419.7605
},
"TerritoryId": 959,
- "InteractionType": "Instruction",
+ "InteractionType": "WaitForManualProgress",
"Comment": "Follow Argos"
},
{
"Z": 523.5217
},
"TerritoryId": 959,
- "InteractionType": "Instruction",
+ "InteractionType": "WaitForManualProgress",
"Comment": "Follow Argos"
},
{
"InteractionType": "Jump",
"JumpDestination": {
"Position": {
- "X": -444.84818,
- "Y": -160.76439,
- "Z": -645.7075
+ "X": -443.62042,
+ "Y": -160.7644,
+ "Z": -644.7719
}
},
"Comment": "Platform 4"
},
{
"Position": {
- "X": -444.84818,
- "Y": -160.76439,
- "Z": -645.7075
+ "X": -443.62042,
+ "Y": -160.7644,
+ "Z": -644.7719
},
"TerritoryId": 959,
"InteractionType": "Jump",
"Z": -620.05035
},
"TerritoryId": 959,
- "InteractionType": "Interact"
+ "InteractionType": "Interact",
+ "Comment": "FIXME Auto-playing quests seems to get stuck here/do nothing"
}
]
}
"Z": 301.63266
},
"TerritoryId": 956,
- "InteractionType": "Interact",
- "Comment": "TODO Should cancel navmesh if condition is [OccupiedInCutsceneEvent OR BetweenAreas]; then verify next marker distance"
+ "InteractionType": "WalkTo"
}
]
},
{
"Sequence": 5,
"Steps": [
+ {
+ "Position": {
+ "X": 26.119669,
+ "Y": 269.043,
+ "Z": -587.29144
+ },
+ "TerritoryId": 960,
+ "InteractionType": "WalkTo",
+ "CompletionQuestVariablesFlags": [
+ null,
+ null,
+ null,
+ null,
+ null,
+ -128
+ ]
+ },
{
"DataId": 2012354,
"Position": {
},
"TerritoryId": 960,
"InteractionType": "WaitForManualProgress",
- "Comment": "Identify Anomaly (Elbow/Knee)"
+ "Comment": "Identify Anomaly (Head, Elbow or Knee)"
}
]
},
if (IsPathRunning && Destination != null)
{
+ if (_gameFunctions.IsLoadingScreenVisible())
+ {
+ Stop();
+ return;
+ }
+
Vector3 localPlayerPosition = _clientState.LocalPlayer?.Position ?? Vector3.Zero;
if ((localPlayerPosition - Destination.Position).Length() < Destination.StopDistance)
{
}
QuestWork? questWork = gameFunctions.GetQuestEx(QuestId);
- if (questWork != null && Step.MatchesQuestVariables(questWork.Value))
+ if (questWork != null && Step.MatchesQuestVariables(questWork.Value, true))
{
logger.LogInformation("Skipping step, as quest variables match");
return true;
{
public IEnumerable<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
{
- if (step.CompletionQuestVariablesFlags.Count == 6)
+ if (step.CompletionQuestVariablesFlags.Count == 6 && step.CompletionQuestVariablesFlags.Any(x => x is > 0))
{
var task = serviceProvider.GetRequiredService<WaitForCompletionFlags>()
.With(quest, step);
public ETaskResult Update()
{
QuestWork? questWork = gameFunctions.GetQuestEx(Quest.QuestId);
- return questWork != null && Step.MatchesQuestVariables(questWork.Value)
+ return questWork != null && Step.MatchesQuestVariables(questWork.Value, false)
? ETaskResult.TaskComplete
: ETaskResult.StillRunning;
}
public bool IsOccupied()
{
- if (_gameGui.TryGetAddonByName("FadeMiddle", out AtkUnitBase* fade) &&
- LAddon.IsAddonReady(fade) &&
- fade->IsVisible)
+ if (IsLoadingScreenVisible())
return true;
return _condition[ConditionFlag.Occupied] || _condition[ConditionFlag.Occupied30] ||
_condition[ConditionFlag.Casting] || _condition[ConditionFlag.Unknown57] ||
_condition[ConditionFlag.BetweenAreas] || _condition[ConditionFlag.BetweenAreas51];
}
+
+ public bool IsLoadingScreenVisible()
+ {
+ return _gameGui.TryGetAddonByName("FadeMiddle", out AtkUnitBase* fade) &&
+ LAddon.IsAddonReady(fade) &&
+ fade->IsVisible;
+ }
}
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using System.Text.Json.Serialization;
public IList<short?> CompletionQuestVariablesFlags { get; set; } = new List<short?>();
public IList<DialogueChoice> DialogueChoices { get; set; } = new List<DialogueChoice>();
- public unsafe bool MatchesQuestVariables(QuestWork questWork)
+ /// <summary>
+ /// Positive values: Must be set to this value; will wait for the step to have these set.
+ /// Negative values: Will skip if set to this value, won't wait for this to be set.
+ /// </summary>
+ public unsafe bool MatchesQuestVariables(QuestWork questWork, bool forSkip)
{
if (CompletionQuestVariablesFlags.Count != 6)
return false;
continue;
byte actualValue = questWork.Variables[i];
- byte expectedValue = check > 0 ? (byte)check : (byte)0;
byte checkByte = check > 0 ? (byte)check : (byte)-check;
-
- if ((actualValue & checkByte) != expectedValue)
- return false;
+ if (forSkip)
+ {
+ byte expectedValue = (byte)Math.Abs(check.Value);
+ if ((actualValue & checkByte) != expectedValue)
+ return false;
+ }
+ else if (!forSkip && check > 0)
+ {
+ byte expectedValue = check > 0 ? (byte)check : (byte)0;
+ if ((actualValue & checkByte) != expectedValue)
+ return false;
+ }
}
return true;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
- <Version>0.8</Version>
+ <Version>0.9</Version>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>