Beispiel #1
0
 /// <summary>
 ///     Determines whether the position is safe.
 /// </summary>
 /// <param name="position">The position.</param>
 /// <returns></returns>
 public static bool IsSafe(this Vector3 position)
 {
     return(position.IsSafeEx() && position.IsNotIntoEnemies() &&
            HeroManager.Enemies.All(m => m.LSDistance(position) > 350f) &&
            (!position.UnderTurret(true) ||
             (ObjectManager.Player.UnderTurret(true) && position.UnderTurret(true) &&
              ObjectManager.Player.HealthPercent > 10)));
 }
Beispiel #2
0
 /// <summary>
 ///     Determines whether the position is safe.
 /// </summary>
 /// <param name="position">The position.</param>
 /// <returns></returns>
 public static bool IsSafe(this Vector3 position)
 {
     return(position.To2D().IsSafeEx() &&
            position.IsNotIntoEnemies() &&
            EntityManager.Heroes.Enemies.All(m => m.Distance(position) > 350f)
            &&
            (!position.UnderTurret(true) ||
             (ObjectManager.Player.UnderTurret(true) && position.UnderTurret(true) &&
              ObjectManager.Player.HealthPercent > 10)));
     //Either it is not under turret or both the player and the position are under turret already and the health percent is greater than 10.
 }
Beispiel #3
0
 private bool IsDangerousPosition(Vector3 pos)
 {
     return(GameObjects.EnemyHeroes.Any(
                e => e.IsHPBarRendered && e.IsMelee &&
                (e.Distance(pos) < 375)) ||
            (pos.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true)));
 }
        public static bool IsGoodEndPosition(this Vector3 position)
        {
            for (int i = 1; i <= 300f; i += 300 / 5)
            {
                if (ObjectManager.Player.ServerPosition.Extend(position, i).IsWall())
                {
                    return(false);
                }
            }

            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
            {
                return(false);
            }

            var maxEnemies         = 3;
            var enemiesEndPosition = position.CountEnemiesInRange(600);

            if (maxEnemies > enemiesEndPosition)
            {
                return(true);
            }

            var enemiesAtPlayerPosition = ObjectManager.Player.CountEnemiesInRange(400);

            if (enemiesEndPosition <= enemiesAtPlayerPosition)
            {
                return(true);
            }

            return(false);
        }
Beispiel #5
0
        public static bool IsSafePosition(this Vector3 position, bool considerAllyTurrets = true, bool considerLhEnemies = true)
        {
            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 = considerLhEnemies ? position.GetLhEnemiesNear(ObjectManager.Player.AttackRange, 15).Count() : 0;

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

            if (position.UnderAllyTurret())
            {
                var nearestAllyTurret = ObjectManager.Get <Obj_AI_Turret>().Where(h => h.IsAlly).OrderBy(d => d.Distance(position, true)).FirstOrDefault();

                if (nearestAllyTurret != null)
                {
                    ////We're adding more allies, since the turret adds to the firepower of the team.
                    allies += 2;
                }
            }

            ////Adding 1 for my Player
            return(allies + 1 > enemies - lhEnemies);
        }
Beispiel #6
0
 private bool IsDangerousPosition(Vector3 pos)
 {
     return(GameObjects.EnemyHeroes.Any(
                e => e.IsValidTarget() &&
                (e.Distance(pos) < 375) && (E.GetPrediction(e).UnitPosition.Distance(pos) > 500)) ||
            (pos.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true)));
 }
Beispiel #7
0
 public static bool CondemnCheck(Vector3 Position, out Obj_AI_Hero target)
 {
     if (Position.UnderTurret(true))
     {
         target = null;
         return(false);
     }
     foreach (var En in HeroManager.Enemies.Where(hero => hero.IsValidTarget() && hero.Distance(Player.Position) <= FlowersVayne
                                                  .E.Range))
     {
         var EPred = FlowersVayne
                     .E.GetPrediction(En);
         int pushDist      = FlowersVayne.Menu.Item("nightmoon.e.pushdistance").GetValue <Slider>().Value;
         var FinalPosition = EPred.UnitPosition.To2D().Extend(Position.To2D(), -pushDist).To3D();
         for (int i = 1; i < pushDist; i += (int)En.BoundingRadius)
         {
             Vector3 loc3       = EPred.UnitPosition.To2D().Extend(Position.To2D(), -i).To3D();
             var     OrTurret   = Helpers.UnderTurret(FinalPosition);
             var     OrFountain = Helpers.Fountain(FinalPosition);
             if (Helpers.Wall(loc3) || OrTurret || OrFountain)
             {
                 target = En;
                 return(true);
             }
         }
     }
     target = null;
     return(false);
 }
Beispiel #8
0
        // TODO
        /// <summary>
        ///     Determines whether the specified position is safe.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <returns></returns>
        public bool IsSafePosition(Vector3 position)
        {
            try
            {
                if (!position.UnderTurret(true))
                {
                    return(true);
                }

                /*
                 * var smallestDistance = float.MaxValue;
                 * var turret = new Obj_AI_Turret();
                 *
                 * foreach (var entry in turretCache)
                 * {
                 *  if (entry.Value.Distance(Variables.Player) <= smallestDistance)
                 *  {
                 *      smallestDistance = entry.Value.Distance(Variables.Player);
                 *      turret = entry.Value;
                 *  }
                 * }
                 *
                 * if (position.Distance(turret.ServerPosition) >= turret.AttackRange)
                 * {
                 *  return true;
                 * }
                 *
                 * if (turretTarget.Any())
                 * {
                 *  var target = turretTarget[turret.NetworkId];
                 *
                 *  if (Utility.IsValidTarget(target, float.MaxValue, false))
                 *  {
                 *      // We can onehit the turret, there are not much enemies near and we won't die from the next turret shot
                 *      if (turret.Health + turret.AttackShield <= Variables.Player.GetAutoAttackDamage(turret)
                 *          && turret.CountEnemiesInRange(turret.AttackRange) < 2
                 *          && Variables.Player.Health > turret.GetAutoAttackDamage(Variables.Player) * 2
                 *          && Geometry.Distance(position, turret.ServerPosition) <= Variables.Player.AttackRange)
                 *      {
                 *          return true;
                 *      }
                 *
                 *      // Turret is focusing something else and there are new targets that are not we in range
                 *      if (target != null && !target.IsMe
                 *          && this.CountAttackableUnitsInRange(turret.Position, turret.AttackRange) > 1
                 *          && target.Health >= turret.GetAutoAttackDamage((Obj_AI_Base)target))
                 *      {
                 *          return true;
                 *      }
                 *  }
                 * }
                 */
                return(false);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(false);
            }
        }
Beispiel #9
0
 public static bool IsDangerousPosition(this Vector3 pos)
 {
     return
         (EntityManager.Heroes.Enemies.Any(
              e => e.IsValidTarget() && e.IsVisible &&
              e.Distance(pos) < Misc.GetSliderValue(PluginModel.MiscMenu, "QMinDist")) ||
          (pos.UnderTurret(true) && !Player.Instance.UnderTurret(true)) || pos.ToNavMeshCell().CollFlags.HasFlag(CollisionFlags.Wall));
 }
Beispiel #10
0
        private static void LogicR()
        {
            foreach (
                var t in
                Program.Enemies.Where(
                    t =>
                    t.IsValidTarget() &&
                    BallPos.Distance(Prediction.GetPrediction(t, R.Delay).CastPosition) < R.Width &&
                    BallPos.Distance(t.ServerPosition) < R.Width))
            {
                if (Program.Combo && getCheckBoxItem(rMenu, "Ralways" + t.NetworkId))
                {
                    R.Cast();
                }

                if (getCheckBoxItem(rMenu, "Rks"))
                {
                    var comboDmg = OktwCommon.GetKsDamage(t, R);

                    if (t.IsValidTarget(Q.Range))
                    {
                        comboDmg += Q.GetDamage(t);
                    }
                    if (W.IsReady())
                    {
                        comboDmg += W.GetDamage(t);
                    }
                    if (Player.IsInAutoAttackRange(t))
                    {
                        comboDmg += Player.GetAutoAttackDamage(t) * 2;
                    }
                    if (t.Health < comboDmg)
                    {
                        R.Cast();
                    }
                    Program.debug("ks");
                }
                if (getCheckBoxItem(rMenu, "Rturrent") && BallPos.UnderTurret(false) && !BallPos.UnderTurret(true))
                {
                    R.Cast();
                    Program.debug("Rturrent");
                }
                if (getCheckBoxItem(rMenu, "Rlifesaver") &&
                    Player.Health < Player.CountEnemiesInRange(800) * Player.Level * 20 &&
                    Player.Distance(BallPos) > t.Distance(Player.Position))
                {
                    R.Cast();
                    Program.debug("ls");
                }
            }

            var countEnemies = CountEnemiesInRangeDeley(BallPos, R.Width, R.Delay);

            if (countEnemies >= getSliderItem(rMenu, "rCount") && BallPos.CountEnemiesInRange(R.Width) == countEnemies)
            {
                R.Cast();
            }
        }
Beispiel #11
0
        private void LogicR()
        {
            var Rturrent   = Config.Item("Rturrent").GetValue <bool>();
            var Rks        = Config.Item("Rks").GetValue <bool>();
            var Rlifesaver = Config.Item("Rlifesaver").GetValue <bool>();

            foreach (var t in Program.Enemies.Where(t => t.IsValidTarget() && BallPos.Distance(Prediction.GetPrediction(t, R.Delay).CastPosition) < R.Width && BallPos.Distance(t.ServerPosition) < R.Width))
            {
                if (Rks)
                {
                    var comboDmg = R.GetDamage(t);

                    if (t.IsValidTarget(Q.Range))
                    {
                        comboDmg += Q.GetDamage(t);
                    }
                    if (W.IsReady())
                    {
                        comboDmg += W.GetDamage(t);
                    }
                    if (t.Health < comboDmg)
                    {
                        R.Cast();
                    }
                    Program.debug("ks");
                }
                if (Rturrent && BallPos.UnderTurret(false) && !BallPos.UnderTurret(true))
                {
                    R.Cast();
                    Program.debug("Rturrent");
                }
                if (Rlifesaver && Player.Health < Player.CountEnemiesInRange(800) * Player.Level * 20 && Player.Distance(BallPos) > t.Distance(Player.Position))
                {
                    R.Cast();
                    Program.debug("ls");
                }
            }

            int countEnemies = CountEnemiesInRangeDeley(BallPos, R.Width, R.Delay);

            if (countEnemies >= Config.Item("rCount").GetValue <Slider>().Value&& BallPos.CountEnemiesInRange(R.Width) == countEnemies)
            {
                R.Cast();
            }
        }
Beispiel #12
0
        public static bool IsSafe(Vector3 Position)
        {
            if ((Position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true)) || (PositioningVariables.EnemiesClose.Count() > 1 && iSRGeometry.GetEnemyPoints().Contains(Position.To2D())))
            {
                return(false);
            }

            return(true);
        }
 public static bool IsDangerousPosition(this Vector3 pos)
 {
     return
         (HeroManager.Enemies.Any(
              e => e.IsValidTarget() && e.IsVisible &&
              e.Distance(pos) < 375) ||
          Traps.EnemyTraps.Any(t => pos.Distance(t.Position) < 125) ||
          (pos.UnderTurret(true) && !Player.UnderTurret(true)) || pos.IsWall());
 }
Beispiel #14
0
        public static bool IsSafe(Vector3 Position)
        {
            if((Position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true)) || (PositioningVariables.EnemiesClose.Count() > 1 && iSRGeometry.GetEnemyPoints().Contains(Position.To2D())))
            {
                return false;
            }

            return true;
        }
Beispiel #15
0
 public static bool IsDangerousPosition(this Vector3 pos)
 {
     return
         (HeroManager.Enemies.Any(
              e => e.IsValidTarget() && e.IsVisible &&
              e.Distance(pos) < Program.ComboMenu.Item("QMinDist").GetValue <Slider>().Value) ||
          Traps.EnemyTraps.Any(t => pos.Distance(t.Position) < 125) ||
          (pos.UnderTurret(true) && !Player.UnderTurret(true)) || pos.IsWall());
 }
Beispiel #16
0
 private bool DashCheck(Vector3 dash)
 {
     if ((!dash.UnderTurret(true) || Program.Combo))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #17
0
        private void LogicR()
        {
            foreach (var t in Program.Enemies.Where(t => t.IsValidTarget() && BallPos.Distance(Prediction.GetPrediction(t, R.Delay).CastPosition) < R.Width && BallPos.Distance(t.ServerPosition) < R.Width))
            {
                if (Program.Combo && Config.Item("Ralways" + t.ChampionName, true).GetValue <bool>())
                {
                    R.Cast();
                }

                if (Config.Item("Rks", true).GetValue <bool>())
                {
                    var comboDmg = OktwCommon.GetKsDamage(t, R);

                    if (t.IsValidTarget(Q.Range))
                    {
                        comboDmg += Q.GetDamage(t);
                    }
                    if (W.IsReady())
                    {
                        comboDmg += W.GetDamage(t);
                    }
                    if (Orbwalker.InAutoAttackRange(t))
                    {
                        comboDmg += (float)Player.GetAutoAttackDamage(t) * 2;
                    }
                    if (t.Health < comboDmg)
                    {
                        R.Cast();
                    }
                    Program.debug("ks");
                }
                if (Config.Item("Rturrent", true).GetValue <bool>() && BallPos.UnderTurret(false) && !BallPos.UnderTurret(true))
                {
                    R.Cast();
                    Program.debug("Rturrent");
                }
                if (Config.Item("Rlifesaver", true).GetValue <bool>() && Player.Health < Player.CountEnemiesInRange(800) * Player.Level * 20 && Player.Distance(BallPos) > t.Distance(Player.Position))
                {
                    R.Cast();
                    Program.debug("ls");
                }
            }

            int countEnemies = CountEnemiesInRangeDeley(BallPos, R.Width, R.Delay);

            if (countEnemies >= Config.Item("rCount", true).GetValue <Slider>().Value&& BallPos.CountEnemiesInRange(R.Width) == countEnemies)
            {
                R.Cast();
            }
        }
        public static bool IsSafe(this Vector3 position, float range)
        {
            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 = position.GetLhEnemiesNear(ObjectManager.Player.AttackRange, 15).Count();

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

            if (position.UnderAllyTurret())
            {
                var nearestAllyTurret = ObjectManager.Get <Obj_AI_Turret>().Where(a => a.IsAlly).OrderBy(d => d.Distance(position, true)).FirstOrDefault();

                if (nearestAllyTurret != null)
                {
                    ////We're adding more allies, since the turret adds to the firepower of the team.
                    allies += 2;
                }
            }

            var normalCheck          = (allies + 1 > enemies - lhEnemies);
            var PositionEnemiesCheck = true;

            var Vector2Position = position.To2D();
            var enemyPoints     = PositioningHelper.GetEnemyZoneList(false);

            if (enemyPoints.Contains(Vector2Position))
            {
                PositionEnemiesCheck = false;
            }
            var closeEnemies = PositioningHelper.EnemiesClose;

            if (!closeEnemies.All(
                    enemy =>
                    position.CountEnemiesInRange(enemy.AttackRange) <= 1))
            {
                PositionEnemiesCheck = false;
            }

            return(normalCheck && PositionEnemiesCheck);
        }
Beispiel #19
0
 private static void GotoAxe(Vector3 target)
 {
     if (!lastQpos.IsValid())
     {
         return;
     }
     var maxDist = getSliderItem(miscMenu, "gotoAxeMaxDist");
     var orig = player.LSDistance(target);
     var ext = player.LSDistance(lastQpos) + lastQpos.LSDistance(target);
     if (player.LSDistance(lastQpos) < maxDist && !lastQpos.UnderTurret(true))
     //ext - orig < maxDist && Orbwalking.CanMove(100)
     {
         Orbwalker.OrbwalkTo(lastQpos);
         //player.IssueOrder(GameObjectOrder.MoveTo, lastQpos);
     }
 }
Beispiel #20
0
        public static bool IsSafePosition(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);
        }
Beispiel #21
0
        private bool ShouldE(Vector3 pos)
        {
            var maxEnemies = Menu.Item("Do_Not_E", true).GetValue <Slider>().Value;

            if (!Menu.Item("E_If_UnderTurret", true).GetValue <KeyBind>().Active&& pos.UnderTurret(true))
            {
                return(false);
            }

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

            return(pos.CountEnemiesInRange(600) < maxEnemies);
        }
Beispiel #22
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.UnderTurret(true) || Program.Combo))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #23
0
        private void GotoAxe(Vector3 target)
        {
            if (!lastQpos.IsValid())
            {
                return;
            }
            var maxDist = config.Item("gotoAxeMaxDist", true).GetValue <Slider>().Value;
            var orig    = player.Distance(target);
            var ext     = player.Distance(lastQpos) + lastQpos.Distance(target);

            if (player.Distance(lastQpos) < maxDist && !lastQpos.UnderTurret(true))
            //ext - orig < maxDist && Orbwalking.CanMove(100)
            {
                orbwalker.SetOrbwalkingPoint(lastQpos);
                //player.IssueOrder(GameObjectOrder.MoveTo, lastQpos);
            }
        }
Beispiel #24
0
        public static bool OkToQ(this 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);
        }
Beispiel #25
0
        public static bool IsSafeQPosition(this Vector3 position)
        {
            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
            {
                return(false);
            }

            var allies    = position.CountAlliesInRange(AutoAttackRange);
            var enemies   = position.CountEnemiesInRange(AutoAttackRange);
            var lhEnemies = position.GetNearbyLowHealthEnemies(AutoAttackRange).Count;

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

            return(allies + 1 > enemies - lhEnemies);
        }
Beispiel #26
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);
        }
Beispiel #27
0
        /// <summary>
        /// Determines whether the position is Safe using the allies/enemies logic
        /// </summary>
        /// <param name="Position">The position.</param>
        /// <returns></returns>
        public static bool IsSafeEx(this Vector3 Position)
        {
            if (Position.UnderTurret(true) && !ObjectManager.Player.UnderTurret())
            {
                return(false);
            }
            var range           = 1000f;
            var lowHealthAllies =
                HeroManager.Allies.Where(a => a.IsValidTarget(range, false) && a.HealthPercent < 10 && !a.IsMe);
            var lowHealthEnemies =
                HeroManager.Allies.Where(a => a.IsValidTarget(range) && a.HealthPercent < 10);
            var enemies      = ObjectManager.Player.CountEnemiesInRange(range);
            var allies       = ObjectManager.Player.CountAlliesInRange(range);
            var enemyTurrets = GameObjects.EnemyTurrets.Where(m => m.IsValidTarget(975f));
            var allyTurrets  = GameObjects.AllyTurrets.Where(m => m.IsValidTarget(975f, false));

            return(allies - lowHealthAllies.Count() + allyTurrets.Count() * 2 + 1 >= enemies - lowHealthEnemies.Count() + (!ObjectManager.Player.UnderTurret(true) ? enemyTurrets.Count() * 2 : 0));
        }
        public static bool IsSafe(this Vector3 position, bool noQIntoEnemiesCheck = false)
        {
            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 = position.GetLhEnemiesNear(ObjectManager.Player.AttackRange, 15).Count();

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

            if (position.UnderAllyTurret())
            {
                var nearestAllyTurret = ObjectManager.Get <Obj_AI_Turret>().Where(a => a.IsAlly).OrderBy(d => d.Distance(position, true)).FirstOrDefault();

                if (nearestAllyTurret != null)
                {
                    ////We're adding more allies, since the turret adds to the firepower of the team.
                    allies += 2;
                }
            }

            ////Adding 1 for my Player
            var normalCheck   = (allies + 1 > enemies - lhEnemies);
            var QEnemiesCheck = true;

            if (MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.tumble.noqenemies") && noQIntoEnemiesCheck)
            {
                var Vector2Position = position.To2D();
                var enemyPoints     = MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.tumble.dynamicqsafety") ? GetEnemyPoints() : GetEnemyPoints(false);
                if (enemyPoints.Contains(Vector2Position) &&
                    !MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.tumble.qspam"))
                {
                    QEnemiesCheck = false;
                }
            }

            return(normalCheck && QEnemiesCheck);
        }
Beispiel #29
0
        /// <summary>
        ///     Checks the Condemn
        /// </summary>
        /// <param name="fromPosition">
        ///     From Position
        /// </param>
        /// <param name="target">
        ///     The target
        /// </param>
        /// <returns>
        ///     The <see cref="bool"/>.
        /// </returns>
        private bool CheckCondemn(Vector3 fromPosition, out Obj_AI_Hero target)
        {
            if (fromPosition.UnderTurret(true) || !this.spells[SpellSlot.E].IsReady())
            {
                target = null;
                return(false);
            }

            if (
                !HeroManager.Enemies.Any(
                    h =>
                    h.IsValidTarget(this.spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) &&
                    !h.HasBuffOfType(BuffType.SpellImmunity)))
            {
                target = null;
                return(false);
            }

            foreach (var unit in
                     HeroManager.Enemies.Where(
                         h =>
                         h.IsValidTarget(this.spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) &&
                         !h.HasBuffOfType(BuffType.SpellImmunity) &&
                         !this.GetItemValue <bool>("com.iseries.vayne.noe." + h.ChampionName.ToLowerInvariant())))
            {
                const int PushDistance   = 400;
                var       targetPosition = unit.ServerPosition;
                var       endPosition    = targetPosition.Extend(ObjectManager.Player.ServerPosition, -PushDistance);
                for (var i = 0; i < PushDistance; i += (int)unit.BoundingRadius)
                {
                    var extendedPosition = targetPosition.Extend(ObjectManager.Player.ServerPosition, -i);
                    if (extendedPosition.IsWall() || endPosition.IsWall())
                    {
                        target = unit;
                        return(true);
                    }
                }
            }

            target = null;
            return(false);
        }
Beispiel #30
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);
        }
Beispiel #31
0
        public bool IsGoodPosition(Vector3 dashPos)
        {
            if (getCheckBoxItem("WallCheck"))
            {
                var segment = DashSpell.Range / 5;
                for (var i = 1; i <= 5; i++)
                {
                    if (Player.Position.LSExtend(dashPos, i * segment).LSIsWall())
                    {
                        return(false);
                    }
                }
            }

            if (getCheckBoxItem("TurretCheck"))
            {
                if (dashPos.UnderTurret(true))
                {
                    return(false);
                }
            }

            var enemyCheck        = getSliderItem("EnemyCheck");
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
            {
                return(true);
            }

            var enemyCountPlayer = Player.CountEnemiesInRange(400);

            if (enemyCountDashPos <= enemyCountPlayer)
            {
                return(true);
            }

            return(false);
        }
Beispiel #32
0
        public static bool IsSafe(this Vector3 position, bool noQIntoEnemiesCheck = false)
        {
            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 = position.GetLhEnemiesNear(ObjectManager.Player.AttackRange, 15).Count();

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

            if (position.UnderAllyTurret_Ex())
            {
                var nearestAllyTurret = ObjectManager.Get <Obj_AI_Turret>().Where(a => a.IsAlly).OrderBy(d => d.Distance(position, true)).FirstOrDefault();

                if (nearestAllyTurret != null)
                {
                    ////We're adding more allies, since the turret adds to the firepower of the team.
                    allies += 2;
                }
            }

            ////Adding 1 for my Player
            var normalCheck   = (allies + 1 > enemies - lhEnemies);
            var QEnemiesCheck = true;

            if (getCheckBoxItem(MenuGenerator.miscMenu, "dz191.vhr.misc.tumble.noqenemies") && noQIntoEnemiesCheck)
            {
                if (!getCheckBoxItem(MenuGenerator.miscMenu, "dz191.vhr.misc.tumble.noqenemies.old"))
                {
                    var Vector2Position = position.To2D();
                    var enemyPoints     = getCheckBoxItem(MenuGenerator.miscMenu, "dz191.vhr.misc.tumble.dynamicqsafety")
                        ? GetEnemyPoints()
                        : GetEnemyPoints(false);
                    if (enemyPoints.Contains(Vector2Position) &&
                        !getCheckBoxItem(MenuGenerator.miscMenu, "dz191.vhr.misc.tumble.qspam"))
                    {
                        QEnemiesCheck = false;
                    }

                    var closeEnemies =
                        HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f) && !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
                        .OrderBy(en => en.Distance(position));

                    if (
                        !closeEnemies.All(
                            enemy =>
                            position.CountEnemiesInRange(
                                getCheckBoxItem(MenuGenerator.miscMenu, "dz191.vhr.misc.tumble.dynamicqsafety")
                                        ? enemy.AttackRange
                                        : 405f) <= 1))
                    {
                        QEnemiesCheck = false;
                    }
                }
                else
                {
                    var closeEnemies =
                        HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f)).OrderBy(en => en.Distance(position));
                    if (closeEnemies.Any())
                    {
                        QEnemiesCheck =
                            !closeEnemies.All(
                                enemy =>
                                position.CountEnemiesInRange(
                                    getCheckBoxItem(MenuGenerator.miscMenu, "dz191.vhr.misc.tumble.dynamicqsafety")
                                            ? enemy.AttackRange
                                            : 405f) <= 1);
                    }
                }
            }

            return(normalCheck && QEnemiesCheck);
        }
Beispiel #33
0
            public TumblePosition(Vector3 position)
            {
                var me = ObjectManager.Player;
                this.Position = position;

                this.NearbyMelees =
                    EntityManager.Heroes.Enemies.Count(
                        e => e.IsMelee && !e.IsDead && e.IsValidTargetEx(380, true, position));
                this.EnemiesInRange =
                    EntityManager.Heroes.Enemies.Count(e => e.Position.IsInRange(position, 600f) && !e.IsDead);
                this.AlliesInRange =
                    EntityManager.Heroes.Allies.Count(e => e.Position.IsInRange(position, 600f) && !e.IsDead);
                this.AttackableEnemies = EntityManager.Heroes.Enemies.Count(e => e.IsInAutoAttackRange(me) && !e.IsDead);
                this.CanCondemn = SpellManager.E.IsReady() && Condemn.GetTarget(position) != null;
                this.UnderEnemyTurret = position.UnderTurret(true);
                this.IsWall = false;
                // TODO: Mirin mode?
            }
Beispiel #34
0
        public bool IsGoodPosition(Vector3 dashPos)
        {
            if (getCheckBoxItem("WallCheck"))
            {
                var segment = DashSpell.Range / 5;
                for (var i = 1; i <= 5; i++)
                {
                    if (Player.Position.LSExtend(dashPos, i * segment).LSIsWall())
                        return false;
                }
            }

            if (getCheckBoxItem("TurretCheck"))
            {
                if (dashPos.UnderTurret(true))
                    return false;
            }

            var enemyCheck = getSliderItem("EnemyCheck");
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Player.CountEnemiesInRange(400);

            if (enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }