public override async Task <bool> MoveFromSpot(ExGatherTag tag)
        {
            tag.StatusText = "Moving from " + this;

            var result = true;

            if (ReturnToApproachLocation)
            {
                result &= await approachLocation.MoveToOnGround();
            }

#if RB_CN
            if (UnstealthAfter && Core.Player.HasAura((int)AbilityAura.Stealth))
            {
                result &= await tag.CastAura(Ability.Stealth);
            }
#else
            if (UnstealthAfter && Core.Player.HasAura((int)AbilityAura.Sneak))
            {
                result &= await tag.CastAura(Ability.Sneak);
            }
#endif

            //change the approach location for the next time we go to this node.
            approachLocation = HotSpots.Shuffle().First();

            return(result);
        }
Example #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);
        }