Jump to content

Recommended Posts

How do i tell the bot to do *something* if there is Elite nearby?

currently:

        #region Wrath
        bool Wrath()
        {
            if (!_wrath.KnownSpell) return false;
            if (!_wrath.IsSpellUsable) return false;
            if (ObjectManager.Me.ManaPercentage > 50)
            {
                WoWPlayer tank = getTanks().First();
                WoWUnit target = tank.TargetObject;
                if (ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(tank.Position) <= 8
                && UnitCanAttack.CanAttack(u.GetBaseAddress, tank.GetBaseAddress)) >= 3 || ObjectManager.Target.IsElite) //to improve with elite area check
                {
                    return false;
                }
                Interact.InteractGameObject(target.GetBaseAddress, true);
                MovementManager.Face(target);
                _wrath.Launch();
            }
            return false;
        }
        #endregion

 

Link to comment
https://wrobot.eu/forums/topic/2674-elite-nearby-c/
Share on other sites

Hello, I am not sure to understand exactly what you want, but you can use code like this:

        int numberOfEliteNearTank = ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(tank.Position) <= u.InteractDistance
                                     && u.IsElite
                                     && UnitCanAttack.CanAttack(u.GetBaseAddress, tank.GetBaseAddress));

        if (numberOfEliteNearTank >= 3)
        {
            // ..
        }

 

Link to comment
https://wrobot.eu/forums/topic/2674-elite-nearby-c/#findComment-12217
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...