BetterSister 367 Posted January 31, 2016 Share Posted January 31, 2016 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 More sharing options...
Droidz 2738 Posted February 1, 2016 Share Posted February 1, 2016 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) { // .. } BetterSister 1 Link to comment https://wrobot.eu/forums/topic/2674-elite-nearby-c/#findComment-12217 Share on other sites More sharing options...
BetterSister 367 Posted February 1, 2016 Author Share Posted February 1, 2016 Looks like this will work! Thank you.im trying to tell the bot to not waste mana with wrath if there is elites nearby Link to comment https://wrobot.eu/forums/topic/2674-elite-nearby-c/#findComment-12226 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now