예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 internal static async Task <Queue <NavGraph.INode> > GenerateNodes(uint ZoneId, Vector3 xyz)
 {
     return(await NavGraph.GetPathAsync((uint)ZoneId, xyz));
 }