// This is really ugly but due to pulse taking too long to tick this is the only path I can take.
 public override void OnTick()
 {
     Logging.Write("Let the trog genocide commence");
     while (!IsDone)
     {
         try
         {
             WoWPulsator.Pulse(PulseFlags.Objects);
             if (!InVehicle)
             {
                 var turret = GetTurret();
                 if (turret != null)
                 {
                     if (turret.DistanceSqr > 5 * 5)
                     {
                         Navigator.MoveTo(turret.Location);
                     }
                     else
                     {
                         turret.Interact();
                     }
                 }
                 else
                 {
                     Logging.Write("Unable to find turret");
                 }
             }
             // if 5 or mobs are within 20 units of turret then use Power Burst ability
             if (MobCountAtLocation(Me.Location, 20, 46711, 46712) >= 5)
             {
                 Lua.DoString("if GetPetActionCooldown(2) == 0 then CastPetAction(2) end");
             }
             var target = GetBestTarget();
             if (target != null)
             {
                 WoWMovement.ClickToMove(target.Location);
                 Lua.DoString("if GetPetActionCooldown(1) == 0 then CastPetAction(1) end");
             }
         }
         catch (Exception ex)
         {
             Logging.Write(ex.ToString());
         }
     }
 }
Exemple #2
0
        public override void Rest()
        {
            if (SSSettings.Instance.UseRest)
            {
                if (!Styx.Logic.Common.Rest.NoFood)
                {
                    if (Me.HealthPercent < SSSettings.Instance.restHealth)
                    {
                        if (!Me.Combat && !Me.IsSwimming)
                        {
                            if (Me.Mounted)
                            {
                                Mount.Dismount();
                            }
                            slog("Rest: Eating Food");
                            Lua.DoString("UseItemByName(\"" + Styx.Helpers.LevelbotSettings.Instance.FoodName + "\")");
                            Thread.Sleep(500);
                            SpellManager.Cast("Stealth");
                            while ((Me.HealthPercent < 98) && Me.HasAura("Food"))
                            {
                                if (!ObjectManager.IsInGame || Me == null)
                                {
                                    break;
                                }

                                WoWPulsator.Pulse(BotManager.Current.PulseFlags);
                                ObjectManager.Update();
                                Thread.Sleep(10);
                            }
                        }
                    }
                }
            }
            fightTimer.Reset();
            pullTimer.Reset();
        }