Пример #1
0
        public static float GetAvgDistanceFromEnemyTeam(Vector3 from, float MaxRange = 1200f)
        {
            var numberOfEnemies = from.CountEnemiesInRange(MaxRange);
            if (numberOfEnemies != 0)
            {
                var enemies = HeroManager.Enemies.Where(en => en.IsValidTarget(MaxRange, true, from)).ToList();
                var totalDistance = enemies.Sum(en => en.Distance(ObjectManager.Player.ServerPosition));

                return totalDistance / numberOfEnemies;
            }
            return -1;
        }
Пример #2
0
        public static bool OkToQ(Vector3 position)
        {
            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
                return false;
            var allies = position.CountAlliesInRange(ObjectManager.Player.AttackRange);
            var enemies = position.CountEnemiesInRange(ObjectManager.Player.AttackRange);
            var lhEnemies = GetLhEnemiesNearPosition(position, ObjectManager.Player.AttackRange).Count();

            if (enemies == 1) //It's a 1v1, safe to assume I can E
            {
                return true;
            }

            //Adding 1 for the Player
            return (allies + 1 > enemies - lhEnemies);
        }
Пример #3
0
        /// <summary>
        /// Gets the average distance of a specified position to the enemies.
        /// </summary>
        /// <param name="from">From.</param>
        /// <returns></returns>
        public static float GetAvgDistance(Vector3 from)
        {
            var numberOfEnemies = from.CountEnemiesInRange(1200f);
            if (numberOfEnemies != 0)
            {
                var enemies = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from)
                                                                       &&
                                                                       en.Health >
                                                                       ObjectManager.Player.GetAutoAttackDamage(en)*3 +
                                                                       Variables._Player.GetSpellDamage(en, SpellSlot.W) +
                                                                       Variables._Player.GetSpellDamage(en, SpellSlot.Q)).ToList()
                    ;
                var enemiesEx = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from)).ToList();
                var LHEnemies = enemiesEx.Count() - enemies.Count();

                var totalDistance = (LHEnemies > 1 && enemiesEx.Count() > 2)
                    ? enemiesEx.Sum(en => en.Distance(ObjectManager.Player.ServerPosition))
                    : enemies.Sum(en => en.Distance(ObjectManager.Player.ServerPosition));

                return totalDistance/numberOfEnemies;
            }
            return -1;
        }
Пример #4
0
        static bool IsNotIntoEnemies(Vector3 position)
        {
            var enemyPoints = GetEnemyPoints();
            if (enemyPoints.ToList().Contains(position.To2D()) && !enemyPoints.Contains(ObjectManager.Player.ServerPosition.To2D()))
            {
                return false;
            }

            var closeEnemies =
                EntityManager.Heroes.Enemies.FindAll(
                    en =>
                        en.IsValidTarget(1500f) && !en.IsDead &&
                        !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f));
            if (!closeEnemies.All(enemy => position.CountEnemiesInRange(enemy.AttackRange) <= 1))
            {
                return false;
            }

            return true;
        }
Пример #5
0
 public static bool SafeCheckThree(Vector3 pos)
 {
     return (!EnemyPoints().Contains(pos.To2D()) ||
             EnemyPoints().Contains(Player.Instance.ServerPosition.To2D())) &&
            !EntityManager.Heroes.Enemies.FindAll(
                e =>
                    e.IsValidTarget(1500) &&
                    !(e.Distance(Player.Instance.ServerPosition) < e.GetAutoAttackRange() + 65))
                .All(e => pos.CountEnemiesInRange(e.GetAutoAttackRange()) <= 1);
 }
Пример #6
0
        public bool IsGoodPosition(Vector3 dashPos)
        {
            if (Config.Item("WallCheck", true).GetValue<bool>())
            {
                float segment = DashSpell.Range / 5;
                for (int i = 1; i <= 5; i++)
                {
                    if (Player.Position.Extend(dashPos, i * segment).IsWall())
                        return false;
                }
            }

            if (Config.Item("TurretCheck", true).GetValue<bool>())
            {
                if(dashPos.UnderTurret(true))
                    return false;
            }

            var enemyCheck = Config.Item("EnemyCheck", true).GetValue<Slider>().Value;
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Player.CountEnemiesInRange(400);

            if(enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }
Пример #7
0
 private static bool CheckForRetreat(Obj_AI_Base enemy, Vector3 pos)
 {
     if (_GameInfo.GameState == State.Jungling)
     {
         return false;
     }
     if (enemy != null && !enemy.UnderTurret(true) && player.Distance(enemy) < 350 && !_GameInfo.AttackedByTurret)
     {
         return false;
     }
     var indanger = ((Helpers.GetHealth(true, pos) +
                      ((player.Distance(pos) < GameInfo.ChampionRange) ? 0 : player.Health)) * 1.3f <
                     Helpers.GetHealth(false, pos) && pos.CountEnemiesInRange(GameInfo.ChampionRange) > 1 &&
                     Helpers.AlliesThere(pos, 500) == 0) ||
                    player.HealthPercent < menu.Item("HealtToBack").GetValue<Slider>().Value;
     if (indanger || _GameInfo.AttackedByTurret)
     {
         if (((enemy != null && Helpers.AlliesThere(pos, 600) > 0) && player.HealthPercent > 25))
         {
             return false;
         }
         if (_GameInfo.AttackedByTurret)
         {
             if ((enemy != null &&
                  (enemy.Health > player.GetAutoAttackDamage(enemy, true) * 2 ||
                   enemy.Distance(player) > Orbwalking.GetRealAutoAttackRange(enemy) + 20) || enemy == null))
             {
                 return true;
             }
         }
         if (indanger)
         {
             return true;
         }
     }
     return false;
 }
Пример #8
0
 private static bool CheckObjective(Vector3 pos)
 {
     if ((pos.CountEnemiesInRange(800) > 0 || pos.CountAlliesInRange(800) > 0) && !CheckForRetreat(null, pos))
     {
         var obj = Helpers.GetNearest(pos);
         if (obj != null && obj.Health < obj.MaxHealth - 300)
         {
             if (player.Distance(pos) > Jungle.smiteRange)
             {
                 _GameInfo.MoveTo = pos;
                 return true;
             }
         }
     }
     if ((Jungle.SmiteReady() || (player.Level >= 14 && player.HealthPercent > 80)) && player.Level >= 9 &&
         player.Distance(Camps.Dragon.Position) < GameInfo.ChampionRange)
     {
         var drake = Helpers.GetNearest(player.Position, GameInfo.ChampionRange);
         if (drake != null && drake.Name.Contains("Dragon"))
         {
             _GameInfo.CurrentMonster = 13;
             _GameInfo.MoveTo = drake.Position;
             return true;
         }
     }
     return false;
 }
Пример #9
0
        public static bool IsSafePosition(Vector3 position)
        {
            var enemies = position.CountEnemiesInRange(800);
            var allies = CountAlliesInRange(position);
            var turrets = EntityManager.Turrets.Allies.Count(x => _Player.Distance(x) < 800 && x.IsValid && !x.IsDead);
            var lowEnemies = GetLowaiAiHeroClients(position, 800).Count();

            if (UnderEnemyTurret(position)) return false;

            if (enemies == 1)
            {
                return true;
            }
            return allies + turrets > enemies - lowEnemies;
        }
Пример #10
0
 bool CaitlynIsSafePosition(Vector3 position)
 {
     //If the enemies in range - the low health enemies in range are equal to zero and our Health % is >= 40% then we can go in
     return (position.CountEnemiesInRange(450f) - HeroHelper.GetLhEnemiesNearPosition(position,450f).Count == 0) && (ObjectManager.Player.HealthPercentage() >= 40) && (!position.UnderTurret(true));
 }
Пример #11
0
        public static bool IsSafePosition(Vector3 position) // cradits to Asuna & ijabba
        {
            if (position.UnderTurret(true) && !Player.UnderTurret(true))
            {
                return false;
            }
            var allies = position.CountAlliesInRange(Orbwalking.GetRealAutoAttackRange(Player));
            var enemies = position.CountEnemiesInRange(Orbwalking.GetRealAutoAttackRange(Player));
            var lhEnemies = GetLhEnemiesNearPosition(position, Orbwalking.GetRealAutoAttackRange(Player)).Count();

            if (enemies == 1) 
            {
                return true;
            }

           
            return (allies + 1 > enemies - lhEnemies);
        }
Пример #12
0
 private static bool GoodPath(Vector3 gankPosition, bool withoutHero=false)
 {
     return
         Player.GetPath(gankPosition)
             .All(
                 point =>
                     !point.UnderTurret(true) && (gankPosition.CountEnemiesInRange(800) == 0 || withoutHero) &&
                     MinionManager.GetMinions(gankPosition, 800, MinionTypes.All, MinionTeam.Enemy).Count == 0);
 }
Пример #13
0
        public static bool IsSafePosition(Vector3 position)
        {
            var underTurret =
                EntityManager.Turrets.Enemies.FirstOrDefault(
                    turret => !turret.IsDead && turret.Distance(position) <= 950);
            var allies = EntityManager.Heroes.Allies.Count(
                allied => !allied.IsDead && allied.Distance(position) <= 800);
            var enemies = position.CountEnemiesInRange(1000);
            var lhEnemies = GetLowaiAiHeroClients(position, 800).Count();
            if (underTurret != null) return false;

            if (enemies == 1)
            {
                return true;
            }
            return allies > enemies - lhEnemies;
        }
Пример #14
0
 public static bool OkToQ2(Vector3 Position)
 {
     if (!MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.mirin"))
     {
         var closeEnemies =
             HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f)).OrderBy(en => en.Distance(Position));
         if (closeEnemies.Any())
         {
             return
                 closeEnemies.All(
                     enemy =>
                         Position.CountEnemiesInRange(
                             MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.dynamicqsafety")
                                 ? enemy.AttackRange
                                 : 405f) < 1);
         }
         return true;
     }
     else
     {
         if (Position.CountEnemiesInRange(360f) >= 1)
         {
             return false;
         }
         return true;
     }
 }
Пример #15
0
 public bool InAARange(Vector3 point)
 {
     if (!Config.Item("AAcheck", true).GetValue<bool>())
         return true;
     else if (Orbwalker.GetTarget() != null && Orbwalker.GetTarget().Type == GameObjectType.obj_AI_Hero)
     {
         return point.Distance(Orbwalker.GetTarget().Position) < Player.AttackRange;
     }
     else
     {
         return point.CountEnemiesInRange(Player.AttackRange) > 0;
     }
 }
Пример #16
0
 private static bool CheckLaneClear(Vector3 pos)
 {
     return (Helpers.AlliesThere(pos) == 0 || Helpers.AlliesThere(pos) >= 2 ||
             player.Distance(_GameInfo.SpawnPoint) < 6000 || player.Distance(_GameInfo.SpawnPointEnemy) < 6000 ||
             player.Level >= 14) && pos.CountEnemiesInRange(GameInfo.ChampionRange) == 0 &&
            Helpers.getMobs(pos, GameInfo.ChampionRange).Count +
            _GameInfo.EnemyStructures.Count(p => p.Distance(pos) < GameInfo.ChampionRange) > 0 &&
            !_GameInfo.MonsterList.Any(m => m.Position.Distance(pos) < 600) && _GameInfo.SmiteableMob == null &&
            _GameInfo.GameState != State.Retreat;
 }
Пример #17
0
        public static bool IsGoodPosition(Vector3 dashPos)
        {
            if (MenuManager.UseQWall)
            {
                float segment = Manager.SpellManager.Q.Range / 5;
                for (int i = 1; i <= 5; i++)
                {
                    if (Variables._Player.Position.Extend(dashPos, i * segment).IsWall())
                        return false;
                }
            }

            var enemyCheck = MenuManager.UseQEnemies;
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Variables._Player.CountEnemiesInRange(400);

            if (enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }
Пример #18
0
 internal bool targInKnockupRadius(Vector3 dpos)
 {
     return dpos.CountEnemiesInRange(QRadius) > 0;
 }
Пример #19
0
        static bool ShouldE(Vector3 vec)
        {
            var maxEnemies = spell["Do_Not_E"].Cast<Slider>().CurrentValue;

            if (!spell["E_If_UnderTurret"].Cast<KeyBind>().CurrentValue && UnderTurret(vec, true))
                return false;

            if (Player.HealthPercent <= spell["Do_Not_E_HP"].Cast<Slider>().CurrentValue)
                return false;

            if (vec.CountEnemiesInRange(600) >= maxEnemies)
                return false;

            return true;
        }
Пример #20
0
 private static bool CheckLaneClear(Vector3 pos)
 {
     if (Debug)
     {
         Console.WriteLine(
             Helpers.getMobs(pos, GameInfo.ChampionRange).Count +
             _GameInfo.EnemyStructures.Count(p => p.Distance(pos) < GameInfo.ChampionRange));
         Console.WriteLine(!_GameInfo.MonsterList.Any(m => m.Position.Distance(pos) < 600));
     }
     return (Helpers.AlliesThere(pos) == 0 || Helpers.AlliesThere(pos) >= 2 ||
             player.Distance(_GameInfo.SpawnPoint) < 6000 || player.Distance(_GameInfo.SpawnPointEnemy) < 6000 ||
             player.Level >= 10) && pos.CountEnemiesInRange(GameInfo.ChampionRange) == 0 &&
            Helpers.getMobs(pos, GameInfo.ChampionRange).Count +
            _GameInfo.EnemyStructures.Count(
                p =>
                    p.Distance(pos) < GameInfo.ChampionRange &&
                    Helpers.getAllyMobs(p, 1250).Count(m => m.UnderTurret(true)) > 0) > 0 &&
            !_GameInfo.MonsterList.Any(m => m.Position.Distance(pos) < 600) && _GameInfo.SmiteableMob == null &&
            _GameInfo.GameState != State.Retreat;
 }
Пример #21
0
 private bool DashCheck(Vector3 dash)
 {
     if (
         !Player.Position.Extend(dash, Q.Range).IsWall()
         && !Player.Position.Extend(dash, Q.Range - 100).IsWall()
         && !Player.Position.Extend(dash, Q.Range - 200).IsWall()
         && !Player.Position.Extend(dash, Q.Range - 300).IsWall()
         && dash.CountEnemiesInRange(800) < 3 && dash.CountEnemiesInRange(400) < 2 && dash.CountEnemiesInRange(200) < 1
         && (!dash.UnderTurret(true) || Program.Combo))
         return true;
     else
         return false;
 }
Пример #22
0
        public static Vector3 IsSafe(Obj_AI_Hero target, Vector3 vec, bool checkTarget = true)
        {
            if (DontSafeCheck)
                return vec;

            if (checkTarget)
            {
                if (target.ServerPosition.To2D().Distance(vec) <= target.AttackRange)
                {
                    if (vec.CountEnemiesInRange(1000) > 1)
                        return Vector3.Zero;
                    else if (target.ServerPosition.To2D().Distance(vec) <= target.AttackRange / 2f)
                        return SCommon.Maths.Geometry.Deviation(ObjectManager.Player.ServerPosition.To2D(), target.ServerPosition.To2D(), 60).To3D();
                }

                if (((DontQIntoEnemies || target.IsMelee) && HeroManager.Enemies.Any(p => p.ServerPosition.To2D().Distance(vec) <= p.AttackRange + ObjectManager.Player.BoundingRadius + (p.IsMelee ? 100 : 0))) || vec.UnderTurret(true))
                    return Vector3.Zero;
            }
            if (HeroManager.Enemies.Any(p => p.NetworkId != target.NetworkId && p.ServerPosition.To2D().Distance(vec) <= p.AttackRange + (p.IsMelee ? 50 : 0)) || vec.UnderTurret(true))
                return Vector3.Zero;

            return vec;
        }
Пример #23
0
Файл: Ekko.cs Проект: myo/LSharp
        private bool ShouldE(Vector3 vec)
        {
            var maxEnemies = menu.Item("Do_Not_E", true).GetValue<Slider>().Value;

            if (!menu.Item("E_If_UnderTurret", true).GetValue<KeyBind>().Active && vec.UnderTurret(true))
                return false;

            if (Player.HealthPercent <= menu.Item("Do_Not_E_HP", true).GetValue<Slider>().Value)
                return false;

            if (vec.CountEnemiesInRange(600) >= maxEnemies)
                return false;

            return true;
        }
Пример #24
0
        public static Vector3 IsSafe(Obj_AI_Hero target, Vector3 vec)
        {
            if (target.ServerPosition.To2D().Distance(vec) <= target.AttackRange && vec.CountEnemiesInRange(1000) > 1)
                return Vector3.Zero;

            if (HeroManager.Enemies.Any(p => p.NetworkId != target.NetworkId && p.ServerPosition.To2D().Distance(vec) <= p.AttackRange) || vec.UnderTurret(true))
                return Vector3.Zero;

            return vec;
        }
Пример #25
0
        /// <summary>
        /// Determines whether the specified position is Safe using AA ranges logic.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <returns></returns>
        public static bool IsSafeEx(Vector3 position)
        {
            var closeEnemies =
                EntityManager.Heroes.Enemies.FindAll(
                    en =>
                        en.IsValidTarget(1500f) &&
                        !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
                    .OrderBy(en => en.Distance(position));

            return closeEnemies.All(
                enemy =>
                    position.CountEnemiesInRange(enemy.AttackRange) <= 1);
        }
Пример #26
0
        private static bool IsGoodPosition(Vector3 dashPos)
        {
            if (Manager.MenuManager.QNWall)
            {
                float segment = Manager.SpellManager.Q.Range / 5;
                for (int i = 1; i <= 5; i++)
                {
                    if (Variables._Player.Position.Extend(dashPos, i * segment).IsWall())
                        return false;
                }
            }

            if (Manager.MenuManager.QNTurret)
            {
                if (Variables.UnderEnemyTower(dashPos.To2D()))
                    return false;
            }

            var enemyCheck = Manager.MenuManager.QNEnemies;
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Variables._Player.CountEnemiesInRange(400);

            if (enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }
Пример #27
0
        /// <summary>
        /// Checks if a position is safe
        /// </summary>
        /// <param name="position">
        /// The Position
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        private bool IsSafe(Vector3 position)
        {
            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
            {
                return false;
            }

            var allies = position.CountAlliesInRange(ObjectManager.Player.AttackRange);
            var enemies = position.CountEnemiesInRange(ObjectManager.Player.AttackRange);
            var lhEnemies = GetLhEnemiesNearPosition(position, ObjectManager.Player.AttackRange).Count();

            if (enemies == 1)
            {
                // It's a 1v1, safe to assume I can E
                return true;
            }

            // Adding 1 for the Player
            return allies + 1 > enemies - lhEnemies;
        }