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

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

            if (approachLocation == null)
            {
                approachLocation = HotSpots.Shuffle().First();
            }

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

            if (!result)
            {
                return(false);
            }

            var landed = MovementManager.IsDiving || await NewNewLandingTask();

            if (landed && Core.Player.IsMounted && !MovementManager.IsDiving)
            {
                ActionManager.Dismount();
            }

            Navigator.Stop();
            await Coroutine.Yield();

            if (Stealth)
            {
#if RB_CN
                await tag.CastAura(Ability.Stealth, AbilityAura.Stealth);
#else
                await tag.CastAura(Ability.Sneak, AbilityAura.Sneak);
#endif
            }

            result = await NodeLocation.MoveToOnGroundNoMount(tag.Distance, tag.Node.EnglishName, 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.MoveTo(UseMesh);

                break;

            case MoveToType.OnGround:
                await destination.MoveToOnGround();

                break;
            }

            return(isDone = true);
        }