public async Task <bool> Main() { if (WorldManager.ZoneId != ZoneId) { thisPath = await NavGraph.GetPathAsync((ushort)ZoneId, XYZ); if (thisPath == null || thisPath.Count == 0) { return(false); } while (WorldManager.ZoneId != ZoneId && await NavGraph.NavGraphConsumer(ctx => thisPath).ExecuteCoroutine()) { await Coroutine.Yield(); } } if (!await Movement.MoveTo(XYZ, Land, Dismount)) { return(false); } await Coroutine.Wait(4000, () => !Core.Me.InCombat); return(_done = true); }
private async Task <bool> GenerateNodes() { var path = await NavGraph.GetPathAsync((uint)ZoneId, XYZ); if (path == null) { LogError($"Couldn't get a path to {XYZ} on {ZoneId}, Stopping."); return(true); } _generatedNodes = true; FinalizedPath = path; return(true); }
private async Task <bool> InitPathToNpc() { findPathRequested = true; Queue <NavGraph.INode> res = await NavGraph.GetPathAsync(TargetNpc.ZoneId, TargetNpc.Location); this.Log("GetPathAsync finished. Result is {0}empty", res == null ? "" : "not "); if (res == null) { return(false); } FinalizedPath = res; return(true); }
internal static async Task <Queue <NavGraph.INode> > GenerateNodes(uint ZoneId, Vector3 xyz) { return(await NavGraph.GetPathAsync((uint)ZoneId, xyz)); }