Skip to content

Commit

Permalink
add mount to moveto and ignore los
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Jan 7, 2025
1 parent 780927f commit 7eb4ead
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Automaton/Tasks/CommonTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
namespace Automaton.Tasks;
public abstract class CommonTasks : AutoTask
{
protected async Task MoveTo(Vector3 dest, float tolerance, bool fly = false)
protected async Task MoveTo(Vector3 dest, float tolerance, bool mount = false, bool fly = false)
{
using var scope = BeginScope("MoveTo");
if (Player.DistanceTo(dest) < tolerance)
return; // already in range

if (mount)
await Mount();

// ensure navmesh is ready
await WaitWhile(() => P.Navmesh.BuildProgress() >= 0, "BuildMesh");
ErrorIf(!P.Navmesh.IsReady(), "Failed to build navmesh for the zone");
Expand Down
3 changes: 2 additions & 1 deletion Automaton/Tasks/KillFlag.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using Dalamud.Game.ClientState.Objects.Types;
using ECommons.Automation;
using Lumina.Excel.Sheets;
using System.Threading.Tasks;

namespace Automaton.Tasks;
public sealed class KillFlag : CommonTasks
{
protected override async Task Execute()
{
Status = "Teleporting";
Status = $"Teleporting to {GetRow<TerritoryType>(PlayerEx.MapFlag.TerritoryId)!.Value.PlaceName.Value.Name}";
await TeleportTo(PlayerEx.MapFlag.TerritoryId, PlayerEx.MapFlag.ToVector3());
Status = "Mounting";
await Mount();
Expand Down
4 changes: 2 additions & 2 deletions Automaton/Utilities/Coords.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static uint FindClosestAetheryte(uint territoryTypeId, Vector3 worldPos)
// firmament aetherytes are special (see
return 70;
}
if (territoryTypeId == 399) // Hinterlands
return 478; // Idyllshire
if (territoryTypeId == 478) // Hinterlands
return 75; // Idyllshire
List<Sheets.Aetheryte> aetherytes = [.. GetSheet<Sheets.Aetheryte>()?.Where(a => a.Territory.RowId == territoryTypeId)];
return aetherytes.Count > 0 ? aetherytes.MinBy(a => (worldPos - AetherytePosition(a)).LengthSquared()).RowId : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Automaton/Utilities/PlayerEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static bool InteractWith(ulong instanceId)
var obj = GameObjectManager.Instance()->Objects.GetObjectByGameObjectId(instanceId);
if (obj == null)
return false;
TargetSystem.Instance()->InteractWithObject(obj);
TargetSystem.Instance()->InteractWithObject(obj, false);
return true;
}

Expand Down

0 comments on commit 7eb4ead

Please sign in to comment.