Example #1
0
        /// <summary>
        /// Tries to navigate to a given GameObject with the selected navigation mode.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        private async Task <bool> PerformNavigation(GameObject obj)
        {
            if (!BotBase.Instance.UseNavGraph)
            {
                Navigator.PlayerMover.MoveTowards(obj.Location);
                return(await Task.FromResult(true));
            }

            if (BotBase.Instance.UseNavGraph)
            {
                if (!MovementManager.IsFlying && !MovementManager.IsDiving)
                {
                    await CommonBehaviors.MoveAndStop(
                        r => obj.Location, r => BotBase.Instance.FollowDistance, true,
                        "Following selected target")
                    .ExecuteCoroutine();
                }
                else
                {
                    if (WaitHelper.Instance.IsDoneWaiting("FlightorWaitingTimer", TimeSpan.FromMilliseconds(500), true))
                    {
                        Flightor.MoveTo(obj.Location);
                    }
                }
                return(await Task.FromResult(true));
            }

            return(await Task.FromResult(false));
        }
Example #2
0
        /// <summary>
        /// Function to Find and Interact with NPCs
        /// </summary>
        public void catchAeonaxx()
        {
            float myXLocation = StyxWoW.Me.Location.X;
            float myYLocation = StyxWoW.Me.Location.Y;
            float myZLocation = StyxWoW.Me.Location.Z;

            if (AeonaxxFriendly != null && youngStoneDrake == null && !AeonaxxFriendly.WithinInteractRange && AeonaxxFriendly.IsAlive && !StyxWoW.Me.Combat)
            {
                float xLocation = AeonaxxFriendly.Location.X;
                float yLocation = AeonaxxFriendly.Location.Y;
                float zLocation = AeonaxxFriendly.Location.Z;

                Flightor.MoveTo(new WoWPoint(xLocation, yLocation, zLocation));
                Logging.Write(Colors.MediumPurple, "Rarekiller: Aeonaxx is valid, we're not in combat and aeonaxx is alive...  moving to Aeonaxx at" + " X: " + AeonaxxFriendly.Location.X + " Y: " + AeonaxxFriendly.Location.Y + " Z: " + AeonaxxFriendly.Location.Z);
            }
            else if (AeonaxxFriendly != null && youngStoneDrake == null && AeonaxxFriendly.WithinInteractRange && !StyxWoW.Me.Combat) // no check for isAlive because we're also using this as a secondary Looting Method
            {
                AeonaxxFriendly.Interact();                                                                                           // Triple Interact attempt so it hopefully doesn't do the Interact and then stop (bottish and unreliable)
                AeonaxxFriendly.Interact();                                                                                           // Will also be used as a secondary Looting Method incase first one fails or they didn't enable Loot Mobs
                AeonaxxFriendly.Interact();                                                                                           // Since we parachute right next to Aeonaxx it shouldn't be an issue
                Logging.Write(Colors.MediumPurple, "Rarekiller: Aeonaxx is valid and within melee range, interacting...");
            }
            else if (AeonaxxHostile != null && youngStoneDrake == null && AeonaxxHostile.IsAlive && StyxWoW.Me.HealthPercent > 50)
            {
                AeonaxxHostile.Target();
                Logging.Write(Colors.MediumPurple, "Rarekiller: [Mounted] attacking Aeonaxx | [DEBUG] Mount Display ID: " + StyxWoW.Me.MountDisplayId);
            }
            else if (AeonaxxHostile != null && youngStoneDrake != null && youngStoneDrake.IsAlive && StyxWoW.Me.HealthPercent < 50)
            {
                youngStoneDrake.Target();
                Logging.Write(Colors.MediumPurple, "Rarekiller: [Mounted] attacking Young Stone Drakes until they are all slayed | [DEBUG] Mount Display ID: " + StyxWoW.Me.MountDisplayId);
            }
        }
        private Composite CreateBehavior_Kill()
        {
            const uint torvaldErikssonId = 27377;

            var     movetoLocation  = new WoWPoint(2939.321, -2536.72, 123.3394);
            WoWUnit torvaldEriksson = null;

            return
                (new PrioritySelector(
                     ctx =>
                     torvaldEriksson =
                         ObjectManager.GetObjectsOfTypeFast <WoWUnit>().FirstOrDefault(u => u.Entry == torvaldErikssonId && u.IsAlive),
                     // move in position
                     new Decorator(
                         ctx => WoWMovement.ActiveMover.Location.DistanceSqr(movetoLocation) > 5 * 5,
                         new Action(ctx => Flightor.MoveTo(movetoLocation))),
                     new Decorator(ctx => WoWMovement.ActiveMover.IsMoving, new Action(ctx => WoWMovement.MoveStop())),
                     new Decorator(
                         ctx => torvaldEriksson != null,
                         new PrioritySelector(
                             // target
                             new Decorator(
                                 ctx => WoWMovement.ActiveMover.CurrentTargetGuid != torvaldEriksson.Guid,
                                 new Action(ctx => torvaldEriksson.Target())),
                             // face
                             new Decorator(
                                 ctx => !WoWMovement.ActiveMover.IsSafelyFacing(torvaldEriksson, 30),
                                 new Action(ctx => torvaldEriksson.Face())),
                             new Action(ctx => AimAndFire(torvaldEriksson))))));
        }
Example #4
0
 /// <summary>
 /// Fly to a Helperpoint
 /// </summary>
 static public bool MoveTo(WoWPoint Helperpoint, Int64 Distance, bool ForceGround)
 {
     Logging.Write(Colors.MediumPurple, "Rarekiller: Move to Helperpoint");
     while (Me.Location.Distance(Helperpoint) > Distance)
     {
         if (ForceGround && Me.IsSwimming)
         {
             WoWMovement.ClickToMove(Helperpoint);
         }
         else if (ForceGround)
         {
             Navigator.MoveTo(Helperpoint);
         }
         else
         {
             Flightor.MoveTo(Helperpoint);
         }
         Thread.Sleep(100);
         if (Rarekiller.ToonInvalidCombat)
         {
             return(false);
         }
     }
     return(true);
 }
Example #5
0
        /// <summary>
        /// Tries to navigate to a given GameObject with the selected navigation mode.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        private async Task <bool> PerformNavigation(GameObject obj)
        {
            if (Settings.BotBase.Instance.WaypointGenerationMode == WaypointGenerationMode.Offmesh)
            {
                Navigator.PlayerMover.MoveTowards(obj.Location);
                return(await Task.FromResult(true));
            }

            if (Settings.BotBase.Instance.WaypointGenerationMode == WaypointGenerationMode.NavGraph)
            {
                if (!MovementManager.IsFlying && !MovementManager.IsDiving)
                {
                    await CommonBehaviors.MoveAndStop(
                        r => obj.Location, r => MoveToDistance, true,
                        "Following selected target")
                    .ExecuteCoroutine();
                }
                else
                {
                    Flightor.MoveTo(obj.Location);
                }

                return(await Task.FromResult(true));
            }

            return(await Task.FromResult(false));
        }
Example #6
0
        public async Task <bool> MainCoroutine()
        {
            if (IsDone)
            {
                return(false);
            }

            var pomFruit = Pomfruit.FirstOrDefault();

            if (pomFruit == null)
            {
                return(false);
            }

            if (pomFruit.Distance < 25 && PomharvestFirework.Cooldown == 0)
            {
                PomharvestFirework.UseContainerItem();
                await Coroutine.Sleep(200);
            }

            TreeRoot.StatusText = "Moving to Pomfruit";
            Flightor.MoveTo(pomFruit.Location);
            await Coroutine.Sleep(200);

            pomFruit.Interact();

            return(true);
        }
Example #7
0
        public static async Task <bool> MoveToOnGroundNoMount(
            this Vector3 destination,
            float radius,
            string name = null,
            Func <float, float, bool> stopCallback = null)
        {
            stopCallback = stopCallback ?? ((d, r) => d <= r);

            var   sprintDistance = Math.Min(20.0f, CharacterSettings.Instance.MountDistance);
            float distance;
            var   moveResult = MoveResult.GeneratingPath;

            while (Behaviors.ShouldContinue &&
                   (!stopCallback(distance = Core.Player.Location.Distance3D(destination), radius) ||
                    stopCallback == DontStopInRange) && !moveResult.IsDoneMoving())
            {
                //moveResult = Flightor.MoveTo(new FlyToParameters(destination));
                moveResult = MovementManager.IsDiving ? Flightor.MoveTo(new FlyToParameters(destination)) : Navigator.MoveTo(new MoveToParameters(destination));

                await Coroutine.Yield();

                if (distance > sprintDistance)
                {
                    await Sprint();
                }
            }

            return(true);
        }
Example #8
0
 private static void flyTo(WoWPoint loc)
 {
     while (_me.Location.Distance(loc) > 2)
     {
         if (Flightor.MountHelper.CanMount && !Flightor.MountHelper.Mounted)
         {
             Flightor.MountHelper.MountUp();
             StyxWoW.SleepForLagDuration();
             Thread.Sleep(1000);
             while (_me.IsCasting)
             {
                 Thread.Sleep(150);
             }
         }
         Flightor.MoveTo(loc);
     }
     Styx.Logic.Pathing.Navigator.FindHeight(loc.X, loc.Y, out _height);
     while (Math.Abs(_me.Location.Z - _height) > 1)
     {
         WoWMovement.Move(WoWMovement.MovementDirection.Descend);
         Thread.Sleep(100);
     }
     Flightor.MountHelper.Dismount();
     while (_me.Location.Distance2D(loc) > 1)
     {
         Navigator.MoveTo(loc);
     }
 }
Example #9
0
        private static async Task <bool> HandleDismount()
        {
            Navigator.Clear();
            Flightor.Clear();

            while (Me.Mounted)
            {
                if (Me.Location.Distance(s_targetLocation) > 5)
                {
                    await Coroutine.Wait(20000, () => Flightor.MoveTo(s_targetLocation) == MoveResult.ReachedDestination);
                }
                else
                {
                    await CommonCoroutines.LandAndDismount(null, true, s_targetLocation);

                    await CommonCoroutines.StopMoving();

                    var _target = Me.CurrentTarget;
                    if (_target != null)
                    {
                        Lua.DoString("StartAttack()");
                    }
                }
                //await Coroutine.Yield();
            }
            return(true);
        }
        protected override RunStatus Run(object context)
        {
            if (LootAction.GetLoot())
            {
                return(RunStatus.Success);
            }
            //  dks can refresh water walking while flying around.
            if (AutoAngler.Instance.MySettings.UseWaterWalking &&
                StyxWoW.Me.Class == WoWClass.DeathKnight && !WaterWalking.IsActive)
            {
                WaterWalking.Cast();
            }
            if (AutoAngler.CurrentPoint == WoWPoint.Zero)
            {
                return(RunStatus.Failure);
            }
            if (AutoAngler.FishAtHotspot && StyxWoW.Me.Location.Distance(AutoAngler.CurrentPoint) <= 3)
            {
                return(RunStatus.Failure);
            }
            //float speed = StyxWoW.Me.MovementInfo.CurrentSpeed;
            //float modifier = _settings.Fly ? 5f : 2f;
            //float precision = speed > 7 ? (modifier*speed)/7f : modifier;
            float precision = StyxWoW.Me.IsFlying ? AutoAnglerSettings.Instance.PathPrecision : 3;

            if (StyxWoW.Me.Location.Distance(AutoAngler.CurrentPoint) <= precision)
            {
                AutoAngler.CycleToNextPoint();
            }
            if (_settings.Fly)
            {
                if (_me.IsSwimming)
                {
                    if (_me.GetMirrorTimerInfo(MirrorTimerType.Breath).CurrentTime > 0)
                    {
                        WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
                    }
                    else if (_me.MovementInfo.IsAscending || _me.MovementInfo.JumpingOrShortFalling)
                    {
                        WoWMovement.MoveStop(WoWMovement.MovementDirection.JumpAscend);
                    }
                }
                if (!StyxWoW.Me.Mounted)
                {
                    Flightor.MountHelper.MountUp();
                }
                Flightor.MoveTo(AutoAngler.CurrentPoint);
            }
            else
            {
                if (!StyxWoW.Me.Mounted && Mount.ShouldMount(AutoAngler.CurrentPoint) && Mount.CanMount())
                {
                    Mount.MountUp(() => AutoAngler.CurrentPoint);
                }
                Navigator.MoveTo(AutoAngler.CurrentPoint);
            }
            return(RunStatus.Success);
        }
 private Composite CreateBehavior_MoveTo(Func <object, WoWPoint> locationSelector)
 {
     return
         (new PrioritySelector(
              new Decorator(
                  ctx => WoWMovement.ActiveMover.MovementInfo.CanFly,
                  new Action(ctx => Flightor.MoveTo(locationSelector(ctx)))),
              new Action(ctx => Navigator.MoveTo(locationSelector(ctx)))));
 }
Example #12
0
        private async Task <bool> MainCoroutine()
        {
            var activeMover = WoWMovement.ActiveMover;

            if (activeMover == null)
            {
                return(false);
            }

            var immediateDestination = FindImmediateDestination();

            // Arrived at destination?
            if (AtLocation(activeMover.Location, immediateDestination))
            {
                var completionMessage = string.Format("Arrived at destination '{0}'", RoughDestination.Name);

                // Land if we need to...
                // NB: The act of landing may cause us to exceed the ArrivalTolerance specified.
                if (Land && Me.Mounted)
                {
                    await UtilityCoroutine.LandAndDismount(string.Format("Landing at destination '{0}'", RoughDestination.Name));

                    BehaviorDone(completionMessage);
                    return(true);
                }

                // Done...
                BehaviorDone(completionMessage);
                return(false);
            }

            // Do not run FlyTo when there is a PoI set...
            if (BotPoi.Current.Type != PoiType.None)
            {
                await Coroutine.Sleep(TimeSpan.FromSeconds(10));

                QBCLog.DeveloperInfo("FlyTo temporarily suspended due to {0}", BotPoi.Current);
                return(true);
            }

            // Move closer to destination...
            var parameters = new FlyToParameters(immediateDestination)
            {
                CheckIndoors = !IgnoreIndoors
            };

            if (MinHeight.HasValue)
            {
                parameters.MinHeight = MinHeight.Value;
            }

            Flightor.MoveTo(parameters);
            return(true);
        }
Example #13
0
        private async Task <bool> MainCoroutine()
        {
            var activeMover = WoWMovement.ActiveMover;

            if (activeMover == null)
            {
                return(false);
            }

            var immediateDestination = FindImmediateDestination();

            // If we've no way to reach destination, inform user and quit...
            if (!Flightor.CanFly && !Navigator.CanNavigateWithin(Me.Location, immediateDestination, (float)DefaultArrivalTolerance))
            {
                QBCLog.Fatal("Toon doesn't have flying capability in this area, and there is no ground path to the destination."
                             + " Please learn the flying skill appropriate for this area.");
                BehaviorDone();
                return(false);
            }

            // Arrived at destination?
            if (AtLocation(activeMover.Location, immediateDestination))
            {
                var completionMessage = string.Format("Arrived at destination '{0}'", RoughDestination.Name);

                // Land if we need to...
                // NB: The act of landing may cause us to exceed the ArrivalTolerance specified.
                if (Land && Me.Mounted)
                {
                    await UtilityCoroutine.LandAndDismount(string.Format("Landing at destination '{0}'", RoughDestination.Name));

                    BehaviorDone(completionMessage);
                    return(true);
                }

                // Done...
                BehaviorDone(completionMessage);
                return(false);
            }

            // Do not run FlyTo when there is a PoI set...
            if (BotPoi.Current.Type != PoiType.None)
            {
                await Coroutine.Sleep(TimeSpan.FromSeconds(10));

                QBCLog.DeveloperInfo("FlyTo temporarily suspended due to {0}", BotPoi.Current);
                return(true);
            }

            // Move closer to destination...
            Flightor.MoveTo(immediateDestination, !IgnoreIndoors);
            return(true);
        }
Example #14
0
        protected override RunStatus Run(object context)
        {
            Vendor  ven    = BotPoi.Current.AsVendor;
            WoWUnit vendor = ObjectManager.GetObjectsOfType <WoWUnit>().
                             FirstOrDefault(m => m.Entry == ven.Entry || m.Entry == ven.Entry2);
            WoWPoint loc = vendor != null ? vendor.Location : ven.Location;

            if (_me.Location.Distance(loc) > 4)
            {
                if (AutoAngler.Instance.MySettings.Fly)
                {
                    Flightor.MoveTo(WoWMathHelper.CalculatePointFrom(_me.Location, loc, 4));
                }
                else
                {
                    if (!ObjectManager.Me.Mounted && Mount.ShouldMount(loc) && Mount.CanMount())
                    {
                        Mount.MountUp(() => loc);
                    }
                    Navigator.MoveTo(WoWMathHelper.CalculatePointFrom(_me.Location, loc, 4));
                }
            }
            else
            {
                if (MerchantFrame.Instance == null || !MerchantFrame.Instance.IsVisible)
                {
                    if (vendor == null)
                    {
                        AutoAngler.Instance.Log("No vendor found at location {0}. hearth + logging out instead", loc);
                        BotPoi.Current = new BotPoi(PoiType.InnKeeper);
                        return(RunStatus.Failure);
                    }
                    vendor.Interact();
                }
                else
                {
                    // sell all poor and common items not in protected Items list.
                    List <WoWItem> itemList = _me.BagItems.Where(i => !ProtectedItemsManager.Contains(i.Entry) &&
                                                                 !i.IsSoulbound && !i.IsConjured &&
                                                                 (i.Quality == WoWItemQuality.Poor || i.Quality == WoWItemQuality.Common)).ToList();
                    foreach (var item in itemList)
                    {
                        item.UseContainerItem();
                    }
                    MerchantFrame.Instance.RepairAllItems();
                    BotPoi.Current = new BotPoi(PoiType.None);
                }
            }
            return(RunStatus.Success);
        }
Example #15
0
        public static async Task <bool> MailItems()
        {
            WoWPoint mboxLoc = BotPoi.Current.Location;
            var      mailbox = ObjectManager.GetObjectsOfType <WoWGameObject>().
                               FirstOrDefault(
                m => m.SubType == WoWGameObjectType.Mailbox &&
                m.Location.Distance(mboxLoc) < 10);

            if (mailbox == null)
            {
                if (Me.Location.DistanceSqr(BotPoi.Current.Location) > 4 * 4)
                {
                    Flightor.MoveTo(BotPoi.Current.Location);
                    return(true);
                }

                var profile = ProfileManager.CurrentOuterProfile;
                if (profile != null)
                {
                    profile.MailboxManager.Blacklist.Add(BotPoi.Current.AsMailbox);
                }

                BotPoi.Clear(string.Format("Unable to find mailbox @ {0}", BotPoi.Current.Location));
                return(false);
            }
            if (!mailbox.WithinInteractRange)
            {
                return(await FlyTo(BotPoi.Current.Location));
            }

            if (!mailbox.WithinInteractRange)
            {
                return(await FlyTo(mailbox.Location, mailbox.SafeName));
            }

            if (!MailFrame.Instance.IsVisible)
            {
                mailbox.Interact();
                await CommonCoroutines.SleepForLagDuration();

                return(true);
            }

            await Vendors.MailAllItemsCoroutine();

            Vendor ven = ProfileManager.CurrentOuterProfile.VendorManager.GetClosestVendor();

            BotPoi.Current = ven != null ? new BotPoi(ven, PoiType.Repair) : new BotPoi(PoiType.None);
            return(true);
        }
 public static void MoveToLocation(WoWPoint loc)
 {
     while (loc.Distance(StyxWoW.Me.Location) > 3)
     {
         if (!Flightor.MountHelper.Mounted)
         {
             Flightor.MountHelper.MountUp();
         }
         if (!StyxWoW.Me.IsMoving)
         {
             Flightor.MoveTo(loc);
         }
     }
 }
Example #17
0
        private static async Task <bool> TryFlightor(WoWPoint destination)
        {
            // If a toon can't fly, skip this...
            // NB: Although Flightor will fall back to Navigator, there are side-effects.
            // Flightor will mount even if UseMount is disabled.  So, if we don't want to mount
            // we don't want to even try Flightor; otherwise, unexpected side-effects can ensue.
            var activeMover = WoWMovement.ActiveMover;

            if (Mount.UseMount || activeMover.IsSwimming ||
                !Navigator.CanNavigateWithin(activeMover.Location, destination, 5))
            {
                Flightor.MoveTo(destination, 15.0f, true);
                return(true);
            }
            return(false);
        }
Example #18
0
 public static void performSafeFlight(WoWPoint landLoc, WoWPoint targetLoc)
 {
     if (_me.Location.Distance(targetLoc) > 2)
     {
         while (landLoc.Distance(_me.Location) > 1)
         {
             Flightor.MoveTo(landLoc);
             Thread.Sleep(100);
         }
         Flightor.MountHelper.Dismount();
         while (targetLoc.Distance(_me.Location) > 1)
         {
             Navigator.MoveTo(targetLoc);
             Thread.Sleep(100);
         }
     }
 }
Example #19
0
        private static async Task <bool> MoveSummoningBell(Vector3 loc)
        {
            var moving = MoveResult.GeneratingPath;

            while (!(moving == MoveResult.Done ||
                     moving == MoveResult.ReachedDestination ||
                     moving == MoveResult.Failed ||
                     moving == MoveResult.Failure ||
                     moving == MoveResult.PathGenerationFailed))
            {
                moving = Flightor.MoveTo(new FlyToParameters(loc));

                await Coroutine.Yield();
            }

            return(true);
        }
Example #20
0
        internal static async Task <bool> FlightorMove(Vector3 loc)
        {
            var moving = MoveResult.GeneratingPath;

            while (!(moving == MoveResult.Done ||
                     moving == MoveResult.ReachedDestination ||
                     moving == MoveResult.Failed ||
                     moving == MoveResult.Failure ||
                     moving == MoveResult.PathGenerationFailed))
            {
                moving = Flightor.MoveTo(new FlyToParameters(loc));

                await Coroutine.Yield();
            }
            Navigator.PlayerMover.MoveStop();
            return(moving == MoveResult.ReachedDestination);
        }
Example #21
0
        protected override async Task <bool> Main()
        {
            var immediateDestination = FindImmediateDestination();

            if (AtLocation(Core.Player.Location, immediateDestination))
            {
                var completionMessage = $"Arrived at destination {RoughDestination.Name}";
                if (Land)
                {
                    Log("Landing at destination {0}", RoughDestination.Name);
                    var landed = await CommonTasks.Land();

                    if (landed)
                    {
                        if (Dismount)
                        {
                            ActionManager.Dismount();
                        }
                        BehaviorDone(completionMessage);
                        return(true);
                    }
                    Log("Failed to land at {0}", immediateDestination);
                    return(false);
                }
                BehaviorDone(completionMessage);
                return(false);
            }

            var parameters = new FlyToParameters(immediateDestination)
            {
                CheckIndoors = !IgnoreIndoors
            };

            if (MinHeight > 0)
            {
                parameters.MinHeight = MinHeight;
            }

            await CommonTasks.MountUp();

            await CommonTasks.TakeOff();

            Flightor.MoveTo(parameters);
            return(true);
        }
Example #22
0
 protected override async Task Run()
 {
     if (StyxWoW.Me.Location.Distance(_loc) > 6)
     {
         Flightor.MoveTo(_loc);
         TreeRoot.StatusText = string.Format("Flying to location {0}", _loc);
     }
     else
     {
         if (Dismount)
         {
             await CommonCoroutines.LandAndDismount(landPoint : _loc);
         }
         //Lua.DoString("Dismount() CancelShapeshiftForm()");
         IsDone = true;
         TreeRoot.StatusText = string.Format("Arrived at location {0}", _loc);
     }
 }
Example #23
0
 public async static Task <bool> FlyTo(WoWPoint destination, string destinationName = null)
 {
     if (destination.DistanceSqr(_lastMoveTo) > 5 * 5)
     {
         if (MoveToLogTimer.IsFinished)
         {
             if (string.IsNullOrEmpty(destinationName))
             {
                 destinationName = destination.ToString();
             }
             AutoAnglerBot.Log("Flying to {0}", destinationName);
             MoveToLogTimer.Reset();
         }
         _lastMoveTo = destination;
     }
     Flightor.MoveTo(destination);
     return(true);
 }
Example #24
0
        static public void findAndKillMob()
        {
            ObjectManager.Update();
            List <WoWUnit> objList = ObjectManager.GetObjectsOfType <WoWUnit>()
                                     .Where(o => ((o.Entry == 50057) || // Blazewing Hyjal
                                                  (o.Entry == 50053) || // Thartuk the Exile Hyjal
                                                  (o.Entry == 50050) || // Shok'sharak Vashir
                                                  (o.Entry == 50005) || // Poseidus Vashir
                                                  (o.Entry == 50052) || // Burgy Blackheart Vashir
                                                  (o.Entry == 49913) || // Lady La-La Vashir
                                                  (o.Entry == 50060) || // Terborus Tiefenheim
                                                  (o.Entry == 50059) || // Golgarok Tiefenheim
                                                  (o.Entry == 50065) || // Armagedillo Uldum
                                                  (o.Entry == 50064) || // Cyrus the Black Uldum
                                                  (o.Entry == 50085) || // Overlord Sunderfury Twilight Higlands
                                                  (o.Entry == 50086)    // Tarvus the Vile
                                                  ))
                                     .OrderBy(o => o.Distance).ToList();

            foreach (WoWUnit o in objList)
            {
                if (!o.Dead)
                {
                    if (inCombat)
                    {
                        return;
                    }
                    Log("Find a Drake !!!");
                    if (!(o.Entry == 50005) || !(o.Entry == 50052) || !(o.Entry == 49913))
                    {
                        Log("Flying to kill a Rare Mob !!!");
                        while (o.Location.Distance(Me.Location) > 20)
                        {
                            Flightor.MoveTo(o.Location);
                        }
                    }
                    o.Target();
                    o.Face();
                    SpellManager.Cast(pull);
                    Log("Pull {0}", o.Entry);
                    Thread.Sleep(500);
                }
            }
        }
Example #25
0
        internal static async Task <bool> FlyTo2(Vector3 loc)
        {
            var moving = MoveResult.GeneratingPath;

            while (!(moving == MoveResult.Done ||
                     moving == MoveResult.ReachedDestination ||
                     moving == MoveResult.Failed ||
                     moving == MoveResult.Failure ||
                     moving == MoveResult.PathGenerationFailed))
            {
                moving = Flightor.MoveTo(loc, 100f, false);

                await Coroutine.Yield();
            }
            Flightor.Clear();
            MovementManager.MoveStop();

            return(true);
        }
        private Composite StateBehaviorPS_ReturningToBase()
        {
            return(new PrioritySelector(
                       // Start over...
                       new Decorator(context => !Query.IsInVehicle(),
                                     new Action(context => { BehaviorState = BehaviorStateType.MountingVehicle; })),

                       // Exit vehicle...
                       new Decorator(context => Navigator.AtLocation(PathEnd),
                                     new Action(context => { Lua.DoString("VehicleExit()"); })),

                       // Move back to 'safe mounting' area...
                       new Action(context =>
            {
                TreeRoot.StatusText = "Moving back to safe area";
                Flightor.MoveTo(PathEnd, (float)FlightorMinHeight);
            })
                       ));
        }
        private Composite SubBehaviorPS_Heal()
        {
            return
                (new Decorator(context =>
            {
                var vehicle = DragonVehicle;

                return
                Weapon_DevourHuman.IsAbilityReady() &&
                ((vehicle.HealthPercent <= 70) || (vehicle.ManaPercent <= 35));
            },

                               new Action(context =>
            {
                if (!IsViableTarget(SelectedTargetToDevour))
                {
                    SelectedTargetToDevour = FindSoldierForHeal();

                    // We want exit point to be different than point we entered to get the devour target...
                    // This should minimize the damage we take by not returning through areas
                    // that are currently under fire.
                    StationPoint = FindNewStationPoint(SelectedTargetToDevour, TAU / 2);
                    return RunStatus.Success;
                }

                var selectedTargetLocation = SelectedTargetToDevour.Location;

                Utility.Target(SelectedTargetToDevour);
                if (selectedTargetLocation.Distance(DragonVehicle.Location) > (Weapon_DevourHuman.MaxRange / 2))
                {
                    Flightor.MoveTo(selectedTargetLocation);
                    return RunStatus.Success;
                }

                WoWMovement.MoveStop();
                Weapon_DevourHuman.UseAbility();
                _targetBlacklist.Add(SelectedTargetToDevour, TimeSpan.FromSeconds(60));

                WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend, TimeSpan.FromMilliseconds(1500));
                return RunStatus.Failure;           // fall through
            })));
        }
Example #28
0
        /// <summary>
        /// Moves to a Unit
        /// </summary>
        static public bool MoveTo(WoWObject o, Int64 Distance, bool ForceGround)
        {
            Logging.Write(Colors.MediumPurple, "Rarekiller: Move to {0}", o.Name);
            Stopwatch BlacklistTimer = new Stopwatch();

            BlacklistTimer.Start();

            while (o.Location.Distance(Me.Location) > Distance)
            {
                if (ForceGround && Me.IsSwimming)
                {
                    WoWMovement.ClickToMove(o.Location);
                }
                else if (ForceGround)
                {
                    Navigator.MoveTo(o.Location);
                }
                else
                {
                    Flightor.MoveTo(o.Location);
                }
                Thread.Sleep(100);
                // ----------------- Security  ---------------------
                if (Rarekiller.ToonInvalidCombat)
                {
                    return(false);
                }
                if (Rarekiller.Settings.BlacklistCheck && (BlacklistTimer.Elapsed.TotalSeconds > (Convert.ToInt32(Rarekiller.Settings.BlacklistTime))))
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach Object {0}, Blacklist and Move on", o.Name);
                    Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    BlacklistTimer.Reset();
                    WoWMovement.MoveStop();
                    return(false);
                }
            }
            BlacklistTimer.Reset();
            Thread.Sleep(300);
            WoWMovement.MoveStop();
            return(true);
        }
Example #29
0
        /// <summary>
        /// Descend Function
        /// </summary>
        static public bool DescendToLand(WoWUnit Unit)
        {
            Logging.Write(Colors.MediumPurple, "Rarekiller: Descend to Land");
            WoWPoint Ground = Me.Location;

            Ground.Z = getGroundZ(Me.Location);
            if (Ground.Z != float.MinValue)
            {
                while (Me.Location.Distance(Ground) > 5)
                {
                    Flightor.MoveTo(Ground);
                    Thread.Sleep(100);
                    if (Rarekiller.ToonInvalidCombat)
                    {
                        return(false);
                    }
                }
            }
            else
            {
                WoWPoint Groundnear = Me.Location;
                Groundnear.Z = Unit.Z + 5;
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Move Groundnear, because getGroundZ returns float.MinValue");
                while (Me.Location.Distance(Groundnear) > 3 && Me.IsFlying)
                {
                    Flightor.MoveTo(Groundnear);
                    Thread.Sleep(100);
                    if (Rarekiller.ToonInvalidCombat)
                    {
                        return(false);
                    }
                }

                //Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: MovementDirection.Descend, because getGroundZ returns float.MinValue");
                //WoWMovement.Move(WoWMovement.MovementDirection.Descend);
                //Thread.Sleep(4000);
                //WoWMovement.MoveStop();
            }
            return(true);
        }
Example #30
0
        internal static async Task <bool> FlightorMove(FateData fate)
        {
            if (fate == null)
            {
                return(false);
            }
            var moving = MoveResult.GeneratingPath;
            var target = new FlyToParameters(fate.Location);

            while ((!(moving == MoveResult.Done ||
                      moving == MoveResult.ReachedDestination ||
                      moving == MoveResult.Failed ||
                      moving == MoveResult.Failure ||
                      moving == MoveResult.PathGenerationFailed)) && FateManager.ActiveFates.Any(i => i.Id == fate.Id && i.IsValid))
            {
                moving = Flightor.MoveTo(target);

                await Coroutine.Yield();
            }
            Navigator.PlayerMover.MoveStop();
            return(moving == MoveResult.ReachedDestination);
        }