public static void LaneClear()
        {
            if (Player.HasBuff("summonerexhaust"))
            {
                return;
            }

            var minions = EntityManager.MinionsAndMonsters.GetLaneMinions(
                EntityManager.UnitTeam.Enemy, Player.Instance.Position, Spells.Q.Range).ToArray();

            if (!minions.Any())
            {
                return;
            }

            if (Config.LaneMenu.IsChecked("laneclear.useQ") &&
                Player.Instance.ManaPercent > Config.LaneMenu.GetValue("laneclear.minManaQ"))
            {
                var qKillableMinions = minions.Where(x => x.GetTotalHealth() < Damages.GetQDamage(x)).ToArray();
                if (!qKillableMinions.Any())
                {
                    return;
                }

                var predictionResult =
                    (from minion in qKillableMinions
                     let pred = Spells.Q.GetPrediction(minion)
                                let count = pred.GetCollisionObjects <Obj_AI_Minion>().Count(x =>
                                                                                             x.GetTotalHealth() < Damages.GetQDamage(x) &&
                                                                                             x.IsValidTarget() && x.IsEnemy)
                                            where count >= Config.LaneMenu.GetValue("laneclear.minQ")
                                            where !Player.Instance.IsDashing()
                                            select pred).FirstOrDefault();

                if (Spells.Q.IsReady() && predictionResult != null)
                {
                    Spells.Q.Cast(predictionResult.CastPosition);
                }
            }

            if (Config.LaneMenu.IsChecked("laneclear.useE") &&
                Player.Instance.ManaPercent > Config.LaneMenu.GetValue("laneclear.minManaE") &&
                Spells.E.IsReady())
            {
                var count = minions.Count(x => x.IsRendKillable() && x.Health > 10);
                if (count >= Config.LaneMenu.GetValue("laneclear.minE"))
                {
                    Spells.E.Cast();
                }
            }

            if (Config.LaneMenu.IsChecked("laneclear.harassEnemyE"))
            {
                MinionHarass();
            }
        }
Exemple #2
0
        public static bool IsRendKillable(this Obj_AI_Base target)
        {
            if (target == null ||
                !target.IsValidTarget(Spells.E.Range + 200) ||
                !target.HasRendBuff() ||
                target.Health <= 0 ||
                !Spells.E.IsReady())
            {
                return(false);
            }

            var hero = target as AIHeroClient;

            if (hero != null)
            {
                if (hero.HasUndyingBuff() || hero.HasSpellShield())
                {
                    return(false);
                }

                if (hero.ChampionName == "Blitzcrank")
                {
                    if (!hero.HasBuff("BlitzcrankManaBarrierCD") && !hero.HasBuff("ManaBarrier"))
                    {
                        return(Damages.GetActualDamage(target) > (target.GetTotalHealth() + (hero.Mana / 2)));
                    }

                    if (hero.HasBuff("ManaBarrier") && !(hero.AllShield > 0))
                    {
                        return(false);
                    }
                }
            }

            return(Damages.GetActualDamage(target) > target.GetTotalHealth());
        }
        private static void OnDraw(EventArgs args)
        {
            if (Config.DrawMenu.IsChecked("draw.Q"))
            {
                Circle.Draw(Color.DarkRed, Spells.Q.Range, Player.Instance.Position);
            }

            if (Config.DrawMenu.IsChecked("draw.W"))
            {
                Circle.Draw(Color.DarkRed, Spells.W.Range, Player.Instance.Position);
            }

            if (Config.DrawMenu.IsChecked("draw.E"))
            {
                Circle.Draw(Color.DarkRed, Spells.E.Range, Player.Instance.Position);
            }

            if (Config.DrawMenu.IsChecked("draw.R"))
            {
                Circle.Draw(Color.DarkRed, Spells.R.Range, Player.Instance.Position);
            }

            if (Config.DrawMenu.IsChecked("draw.killableMinions"))
            {
                foreach (var killableMinion in
                         EntityManager.MinionsAndMonsters.GetLaneMinions(
                             EntityManager.UnitTeam.Enemy, Player.Instance.Position, Spells.E.Range)
                         .Where(x => x.IsRendKillable()))
                {
                    Circle.Draw(Color.GreenYellow, 25f, 2f, killableMinion.Position);
                }
            }

            if (Config.DrawMenu.IsChecked("draw.percentage"))
            {
                foreach (var enemy in
                         EntityManager.Heroes.Enemies
                         .Where(x => Player.Instance.Distance(x) <= 2000f && !x.IsDead && x.IsVisible && x.HasRendBuff()))
                {
                    var percent = Math.Floor((Damages.GetActualDamage(enemy) / enemy.GetTotalHealth()) * 100);

                    if (percent >= 100 && !enemy.IsRendKillable())
                    {
                        Drawing.DrawText(enemy.HPBarPosition.X + 140, enemy.HPBarPosition.Y + 5, System.Drawing.Color.Red, "Can't kill!", 20);
                    }
                    else
                    {
                        Drawing.DrawText(enemy.HPBarPosition.X + 140, enemy.HPBarPosition.Y + 5, System.Drawing.Color.White,
                                         enemy.IsRendKillable() ? "Killable!" : percent + "%", 20);
                    }
                }
            }

            if (Config.DrawMenu.IsChecked("draw.stacks"))
            {
                foreach (var enemy in
                         EntityManager.Heroes.Enemies
                         .Where(x => Player.Instance.Distance(x) <= 2000f && !x.IsDead && x.IsVisible && x.HasRendBuff()))
                {
                    var stacks = enemy.GetRendBuff().Count;
                    Drawing.DrawText(enemy.Position.X, enemy.Position.Y, System.Drawing.Color.White, "Stacks: " + stacks);
                }
            }

            if (Config.DrawMenu.IsChecked("draw.jumpSpots"))
            {
                foreach (var spot in WallJump.JumpSpots.Where(s => Player.Instance.Distance(s[0]) <= 2000))
                {
                    Circle.Draw(Color.DarkGray, 30f, spot[0]);
                }
            }

            if (BalistaPossible && Config.DrawMenu.IsChecked("draw.balista") && Config.BalistaMenu.IsChecked("balista.use"))
            {
                Circle.Draw(Color.Aqua, Config.BalistaMenu.GetValue("balista.distance"), Player.Instance.Position);
            }
        }