Ejemplo n.º 1
0
 public static bool EatingOrDrinking(this WoWPlayer p)
 {
     if (p.Combat)
     {
         return(false);
     }
     if (p.HasAura("Drink") && p.ManaPercent < 95)
     {
         return(true);
     }
     if (p.HasAura("Food") && p.HealthPercent < 95)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        public static bool IsValidSymbiosisTarget(WoWPlayer p)
        {
            if (p.IsHorde != Me.IsHorde)
                return false;

            if (Blacklist.Contains(p.Guid, BlacklistFlags.Combat))
                return false;

            if (!p.IsAlive)
                return false;

            if (p.Level < 87)
                return false;

            if (p.Combat)
                return false;

            if (p.Distance > 28)
                return false;

            if (p.HasAura("Symbiosis"))
                return false;

            if (!p.InLineOfSpellSight)
                return false;

            return true;
        }
        private void _MainPulseProc()
        {
            // Must we go futher anyway?
            if (!TreeRoot.IsRunning)
            {
                if (LastOK.Elapsed.TotalSeconds > 30)
                {
                    Logging.Write(@"[NoMoveDetector] LastPosition reseted, bot is not running (but pulse is called ???)");
                    LastOK.Restart();
                }
                return;
            }

            WoWPlayer Me = StyxWoW.Me;

            //Cancel timer if move > 10 yards is detected
            if (LastLoc.Distance(Me.Location) > 10f)
            {
                if (LastOK.Elapsed.TotalSeconds > 30)
                {
                    Logging.Write(@"[NoMoveDetector] Move detected. LastPosition reseted");
                }
                if (nBotRestart > 0)
                {
                    nBotRestart -= 1;
                }
                LastOK.Restart();
                LastLoc = Me.Location;
                return;
            }

            /* if (LastOK.ElapsedMilliseconds > 1000 * 5 && !StyxWoW.Me.HasAura("Food"))
             * {
             *   // BestFood detection correct
             *   ulong nCurrentFood = CharacterSettings.Instance.DrinkName.ToUInt32();
             *   WoWItem tp = ObjectManager.GetObjectByGuid<WoWItem>(nCurrentFood);
             *   if (nCurrentFood == 0)
             *   {
             *
             *   }
             * } */
            // Have we moved whithin last 5 mins
            if (LastOK.Elapsed.TotalSeconds > 300)
            {
                if (Styx.CommonBot.Frames.AuctionFrame.Instance.IsVisible || Styx.CommonBot.Frames.MailFrame.Instance.IsVisible)
                {
                    Logging.Write(@"[NoMoveDetector] not mooving last {0} min but has open frame.  LastPosition reseted", nBotRestart * 5);
                    LastOK.Restart();
                    LastLoc = Me.Location;
                    return;
                }
                if (Me.HasAura("Resurrection Sickness"))
                {
                    LastOK.Restart();
                    return;
                }
                if (nBotRestart > 1) // Not mooving for 10 min, hope you have a reloger...
                {
                    Logging.Write(@"[NoMoveDetector] not mooving last 15 min : Stopping Wow...");
                    Lua.DoString(@"ForceQuit()");
                }
                else
                {
                    nBotRestart++;
                    Logging.Write(@"[NoMoveDetector] not mooving last {0} min : Restarting bot...", nBotRestart * 5);
                    LastOK.Restart();
                    RestartThread.Start();
                }
            }
        }