Пример #1
0
        public override async Task <bool> MoveToSpot(ExGatherTag tag)
        {
            tag.StatusText = "Moving to " + this;

            if (approachLocation == Vector3.Zero)
            {
                if (HotSpots == null || HotSpots.Count == 0)
                {
                    return(false);
                }

                approachLocation = HotSpots.Shuffle().First();
            }

            var result = await approachLocation.MoveToPointWithin(dismountAtDestination : Stealth);

            if (result)
            {
                await Coroutine.Yield();

                if (Stealth)
                {
                    await tag.CastAura(Ability.Stealth, AbilityAura.Stealth);

                    result = await NodeLocation.MoveToNoMount(UseMesh, tag.Distance, tag.Node.EnglishName, tag.MovementStopCallback);
                }
                else
                {
                    result =
                        await
                        NodeLocation.MoveTo(
                            UseMesh,
                            radius : tag.Distance,
                            name : tag.Node.EnglishName,
                            stopCallback : tag.MovementStopCallback);
                }
            }

            return(result);
        }
Пример #2
0
        protected override async Task <bool> Main()
        {
            if (startZoneId != WorldManager.ZoneId)
            {
                return(isDone = true);
            }

            if (ExProfileBehavior.Me.Distance(Location) <= Distance)
            {
                return(isDone = true);
            }

            if (HotSpots != null)
            {
                if (Type == MoveToType.Auto)
                {
                    Type = MoveToType.RandomPointWithin;
                }

                var locations = new List <HotSpot>(HotSpots);
                if (Location != Vector3.Zero)
                {
                    locations.Add(new HotSpot(Location, Distance)
                    {
                        Name = Name
                    });
                }

                destination = locations.Shuffle().First();

                Logger.Verbose(Localization.Localization.ExMoveTo_Random, Location);
            }
            else
            {
                if (Type == MoveToType.Auto)
                {
                    Type = MoveToType.StopWithinRange;
                }

                destination = new HotSpot(Location, Distance)
                {
                    Name = Name
                };
            }

            var name = !string.IsNullOrWhiteSpace(destination.Name) ? "[" + destination.Name + "] " : string.Empty;

            StatusText = string.Format(Localization.Localization.ExMoveTo_Move, name, destination, Type);

            switch (Type)
            {
            case MoveToType.StopWithinRange:
                await destination.MoveTo(UseMesh);

                break;

            case MoveToType.RandomPointWithin:
                await destination.MoveToPointWithin();

                break;
            }

            return(isDone = true);
        }