muffin v7.38.8
This commit is contained in:
parent
5e2d8f648b
commit
3e10cbbbf2
51 changed files with 2585 additions and 1972 deletions
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
|
|
@ -45,7 +46,7 @@ internal static class AetheryteShortcut
|
|||
}
|
||||
}
|
||||
|
||||
internal sealed class UseAetheryteShortcut(ILogger<UseAetheryteShortcut> logger, AetheryteFunctions aetheryteFunctions, QuestFunctions questFunctions, IClientState clientState, IChatGui chatGui, ICondition condition, AetheryteData aetheryteData, ExtraConditionUtils extraConditionUtils) : TaskExecutor<Task>()
|
||||
internal sealed class UseAetheryteShortcut(ILogger<UseAetheryteShortcut> logger, AetheryteFunctions aetheryteFunctions, QuestFunctions questFunctions, IClientState clientState, IObjectTable objectTable, IChatGui chatGui, ICondition condition, AetheryteData aetheryteData, ExtraConditionUtils extraConditionUtils) : TaskExecutor<Task>()
|
||||
{
|
||||
private bool _teleported;
|
||||
|
||||
|
|
@ -116,14 +117,15 @@ internal static class AetheryteShortcut
|
|||
return true;
|
||||
}
|
||||
}
|
||||
IGameObject gameObject = objectTable[0];
|
||||
NearPositionCondition nearPosition = skipAetheryteCondition.NearPosition;
|
||||
if (nearPosition != null && clientState.TerritoryType == nearPosition.TerritoryId && Vector3.Distance(nearPosition.Position, clientState.LocalPlayer.Position) <= nearPosition.MaximumDistance)
|
||||
if (nearPosition != null && clientState.TerritoryType == nearPosition.TerritoryId && gameObject != null && Vector3.Distance(nearPosition.Position, gameObject.Position) <= nearPosition.MaximumDistance)
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte shortcut, as we're near the position");
|
||||
return true;
|
||||
}
|
||||
NearPositionCondition notNearPosition = skipAetheryteCondition.NotNearPosition;
|
||||
if (notNearPosition != null && clientState.TerritoryType == notNearPosition.TerritoryId && notNearPosition.MaximumDistance <= Vector3.Distance(notNearPosition.Position, clientState.LocalPlayer.Position))
|
||||
if (notNearPosition != null && clientState.TerritoryType == notNearPosition.TerritoryId && gameObject != null && notNearPosition.MaximumDistance <= Vector3.Distance(notNearPosition.Position, gameObject.Position))
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte shortcut, as we're not near the position");
|
||||
return true;
|
||||
|
|
@ -134,23 +136,27 @@ internal static class AetheryteShortcut
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if (base.Task.ExpectedTerritoryId == territoryType && !skipAetheryteCondition.Never)
|
||||
if (base.Task.ExpectedTerritoryId == territoryType)
|
||||
{
|
||||
if (skipAetheryteCondition != null && skipAetheryteCondition.InSameTerritory)
|
||||
IGameObject gameObject2 = objectTable[0];
|
||||
if (gameObject2 != null && !skipAetheryteCondition.Never)
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte teleport due to SkipCondition (InSameTerritory)");
|
||||
return true;
|
||||
}
|
||||
Vector3 position = clientState.LocalPlayer.Position;
|
||||
if (base.Task.Step.Position.HasValue && (position - base.Task.Step.Position.Value).Length() < base.Task.Step.CalculateActualStopDistance())
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte teleport, we're near the target");
|
||||
return true;
|
||||
}
|
||||
if (aetheryteData.CalculateDistance(position, territoryType, base.Task.TargetAetheryte) < 20f || (base.Task.Step.AethernetShortcut != null && (aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.From) < 20f || aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.To) < 20f)))
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte teleport");
|
||||
return true;
|
||||
if (skipAetheryteCondition != null && skipAetheryteCondition.InSameTerritory)
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte teleport due to SkipCondition (InSameTerritory)");
|
||||
return true;
|
||||
}
|
||||
Vector3 position = gameObject2.Position;
|
||||
if (base.Task.Step.Position.HasValue && (position - base.Task.Step.Position.Value).Length() < base.Task.Step.CalculateActualStopDistance())
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte teleport, we're near the target");
|
||||
return true;
|
||||
}
|
||||
if (aetheryteData.CalculateDistance(position, territoryType, base.Task.TargetAetheryte) < 20f || (base.Task.Step.AethernetShortcut != null && (aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.From) < 20f || aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.To) < 20f)))
|
||||
{
|
||||
logger.LogInformation("Skipping aetheryte teleport");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -208,7 +214,7 @@ internal static class AetheryteShortcut
|
|||
}
|
||||
}
|
||||
|
||||
internal sealed class MoveAwayFromAetheryteExecutor(MoveExecutor moveExecutor, AetheryteData aetheryteData, IClientState clientState) : TaskExecutor<MoveAwayFromAetheryte>()
|
||||
internal sealed class MoveAwayFromAetheryteExecutor(MoveExecutor moveExecutor, AetheryteData aetheryteData, IClientState clientState, IObjectTable objectTable) : TaskExecutor<MoveAwayFromAetheryte>()
|
||||
{
|
||||
private static readonly Dictionary<EAetheryteLocation, List<Vector3>> AetherytesToMoveFrom;
|
||||
|
||||
|
|
@ -219,7 +225,12 @@ internal static class AetheryteShortcut
|
|||
|
||||
protected override bool Start()
|
||||
{
|
||||
Vector3 playerPosition = clientState.LocalPlayer.Position;
|
||||
IGameObject gameObject = objectTable[0];
|
||||
if (gameObject == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Vector3 playerPosition = gameObject.Position;
|
||||
if (aetheryteData.CalculateDistance(playerPosition, clientState.TerritoryType, base.Task.TargetAetheryte) >= 20f)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue