public sealed class QuestStep
{
+ public const float DefaultStopDistance = 3f;
+
public EInteractionType InteractionType { get; set; }
public uint? DataId { get; set; }
Position = position;
TerritoryId = territoryId;
}
+
+ public float CalculateActualStopDistance()
+ {
+ if (InteractionType == EInteractionType.WalkTo)
+ return StopDistance ?? 0.25f;
+ else
+ return StopDistance ?? DefaultStopDistance;
+ }
}
internal sealed class MovementController : IDisposable
{
- public const float DefaultStopDistance = 3f;
-
private static readonly List<BlacklistedArea> BlacklistedAreas =
[
new(1191, new(-223.0412f, 31.937134f, -584.03906f), 5f, 7.75f),
_chatFunctions.ExecuteCommand("/automove off");
}
- Destination = new DestinationData(dataId, to, stopDistance ?? (DefaultStopDistance - 0.2f), fly, sprint,
+ Destination = new DestinationData(dataId, to, stopDistance ?? (QuestStep.DefaultStopDistance - 0.2f), fly, sprint,
useNavmesh);
MovementStartedAt = DateTime.MaxValue;
}
}
Vector3 pos = clientState.LocalPlayer!.Position;
+ if (Step.Position != null && (pos - Step.Position.Value).Length() < Step.CalculateActualStopDistance())
+ {
+ logger.LogInformation("Skipping aetheryte teleport, we're near the target");
+ return false;
+ }
+
if (aetheryteData.CalculateDistance(pos, territoryType, TargetAetheryte) < 20 ||
(Step.AethernetShortcut != null &&
(aetheryteData.CalculateDistance(pos, territoryType, Step.AethernetShortcut.From) < 20 ||
yield return new WaitConditionTask(() => movementController.IsNavmeshReady,
"Wait(navmesh ready)");
- float distance;
- if (Step.InteractionType == EInteractionType.WalkTo)
- distance = Step.StopDistance ?? 0.25f;
- else
- distance = Step.StopDistance ?? MovementController.DefaultStopDistance;
-
+ float distance = Step.CalculateActualStopDistance();
var position = clientState.LocalPlayer?.Position ?? new Vector3();
float actualDistance = (position - Destination).Length();