Example #1
0
 private static void EToMouse(Vector3 Position)
 {
     if (Spells["E"].IsReady() && LissEMissile == null && !LissUtils.CanSecondE())
     {
         Spells["E"].Cast(Position);
         jumping = true;
     }
 }
Example #2
0
        private static void FarmHandler()
        {
            if (Player.ManaPercent < getSliderItem(lastHitMenu, "Farm.Mana"))
            {
                return;
            }
            var Minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    m.IsValidTarget() &&
                    (Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["Q"].Range ||
                     Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["W"].Range ||
                     Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["E"].Range));

            if (SpellSlot.Q.IsReady() && getCheckBoxItem(lastHitMenu, "Farm.UseQ"))
            {
                var KillableMinionsQ =
                    Minions.Where(
                        m =>
                        m.Health <Player.GetSpellDamage(m, SpellSlot.Q) &&
                                  Vector3.Distance(m.ServerPosition, Player.ServerPosition)> Player.AttackRange);
                if (KillableMinionsQ.Any())
                {
                    Spells["Q"].Cast(KillableMinionsQ.FirstOrDefault().ServerPosition);
                }
            }
            if (SpellSlot.W.IsReady() && getCheckBoxItem(lastHitMenu, "Farm.UseW"))
            {
                var KillableMinionsW =
                    Minions.Where(
                        m =>
                        m.Health < Player.GetSpellDamage(m, SpellSlot.W) &&
                        Vector3.Distance(Player.ServerPosition, m.ServerPosition) < Spells["W"].Range);
                if (KillableMinionsW.Any())
                {
                    Spells["W"].CastOnUnit(Player);
                }
            }

            if (SpellSlot.E.IsReady() && getCheckBoxItem(lastHitMenu, "Farm.UseE") && LissEMissile == null &&
                !LissUtils.CanSecondE() && LissEMissile == null)
            {
                var KillableMinionsE =
                    Minions.Where(
                        m =>
                        m.Health <Player.GetSpellDamage(m, SpellSlot.E) &&
                                  Vector3.Distance(m.ServerPosition, Player.ServerPosition)> Player.AttackRange);
                if (KillableMinionsE.Any())
                {
                    Spells["E"].Cast(KillableMinionsE.FirstOrDefault().ServerPosition);
                }
            }
        }
Example #3
0
        private static void CastQ(AIHeroClient target)
        {
            var maxhit = (from hero in
                          HeroManager.Enemies.Where(
                              h =>
                              h.IsValidTarget() && !h.IsInvulnerable &&
                              Vector3.Distance(h.ServerPosition, Player.ServerPosition) < Spells["Q2"].Range)
                          select Spells["Q2"].GetPrediction(hero)
                          into prediction
                          where
                          prediction.CollisionObjects.Count > 0 &&
                          prediction.Hitchance >= LissUtils.GetHitChance("Hitchance.Q")
                          let enemieshit = prediction.CollisionObjects.Where(x => x is AIHeroClient)
                                           select prediction).ToDictionary(prediction => prediction.CastPosition,
                                                                           prediction => prediction.CollisionObjects.Count);

            var bestpair = maxhit.MaxOrDefault(x => x.Value);

            if (bestpair.Value > 0)
            {
                var bestpos = bestpair.Key;
                Spells["Q2"].Cast(bestpos);
                return;
            }


            var distbw = Vector3.Distance(Player.ServerPosition, target.ServerPosition);

            if (distbw < Spells["Q"].Range)
            {
                var prediction2 = Spells["Q"].GetPrediction(target);
                if (prediction2.Hitchance >= LissUtils.GetHitChance("Hitchance.Q"))
                {
                    Spells["Q"].Cast(target);
                    return;
                }
            }

            if (distbw > Spells["Qtest"].Range && distbw < Spells["Q2"].Range)
            {
                var testQ    = Spells["Qtest"].GetPrediction(target);
                var collobjs = testQ.CollisionObjects;
                if ((testQ.Hitchance == HitChance.Collision || collobjs.Count > 0) && collobjs.All(x => x.IsTargetable))
                {
                    var pred = Spells["Q2"].GetPrediction(target);
                    if (pred.Hitchance >= LissUtils.GetHitChance("Hitchance.Q"))
                    {
                        Spells["Q2"].Cast(target);
                    }
                }
            }
        }
Example #4
0
 static void OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (Player.IsDead)
     {
         return;
     }
     if (LissUtils.Active("Interrupter") && sender.IsValidTarget())
     {
         if (LissUtils.Active("Interrupter.UseW") && Vector3.Distance(sender.ServerPosition, Player.ServerPosition) <= Spells["W"].Range)
         {
             Spells["W"].CastOnUnit(Player);
             return;
         }
         if (LissUtils.Active("Interrupter.UseR") && !LissUtils.Active("Blacklist." + sender.ChampionName) && Vector3.Distance(sender.ServerPosition, Player.ServerPosition) <= Spells["R"].Range)
         {
             Spells["R"].Cast(sender);
         }
     }
 }
Example #5
0
        //return asap to check the most amount of times
        private static void SecondEChecker(AIHeroClient target)
        {
            if (LissUtils.AutoSecondE() && LissUtils.isHealthy() && LissEMissile != null && Spells["E"].IsReady())
            {
                if (Vector2.Distance(MissilePosition, target.ServerPosition.To2D()) <
                    Vector3.Distance(Player.ServerPosition, target.ServerPosition) &&
                    !LissUtils.PointUnderEnemyTurret(MissilePosition) &&
                    Vector3.Distance(target.ServerPosition, LissEMissile.EndPosition) >
                    Vector3.Distance(Player.ServerPosition, target.ServerPosition))
                {
                    Spells["E"].CastOnUnit(Player);
                    return;
                }
                var Enemiesatpoint  = LissEMissile.Position.GetEnemiesInRange(Spells["R"].Range);
                var enemiesatpointR = Enemiesatpoint.Count;

                if ((enemiesatpointR >= getSliderItem(comboMenu, "Combo.ecountR") && SpellSlot.R.IsReady()) ||
                    Enemiesatpoint.Any(
                        e =>
                        e.IsKillableFromPoint(LissEMissile.Position) &&
                        Vector3.Distance(LissEMissile.Position, e.ServerPosition) <
                        Vector3.Distance(Player.ServerPosition, e.ServerPosition)))
                {
                    if (LissUtils.PointUnderEnemyTurret(MissilePosition) &&
                        getCheckBoxItem(miscMenu, "Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                    return;
                }
                var enemiesatpointW = LissEMissile.Position.CountEnemiesInRange(Spells["W"].Range);
                if (enemiesatpointW >= getSliderItem(comboMenu, "Combo.ecountW") && SpellSlot.W.IsReady())
                {
                    if (LissUtils.PointUnderEnemyTurret(MissilePosition) &&
                        getCheckBoxItem(miscMenu, "Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                }
            }
        }
Example #6
0
        static void OnGapClose(ActiveGapcloser args)
        {
            if (Player.IsDead)
            {
                return;
            }
            var sender = args.Sender;

            if (LissUtils.Active("Interrupter.AntiGapClose") && sender.IsValidTarget())
            {
                if (LissUtils.Active("Interrupter.AG.UseW") && Vector3.Distance(args.End, Player.ServerPosition) <= Spells["W"].Range)
                {
                    Spells["W"].CastOnUnit(Player);
                    return;
                }
                if (LissUtils.Active("Interrupter.AG.UseR") && !LissUtils.Active("Blacklist." + sender.ChampionName) && Vector3.Distance(sender.ServerPosition, Player.ServerPosition) <= Spells["R"].Range)
                {
                    Spells["R"].Cast(sender);
                }
            }
        }
Example #7
0
        private static void OnDraw(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }
            if (LissUtils.Active("Misc.Debug"))
            {
                if (LissEMissile != null)
                {
                    var misposwts = Drawing.WorldToScreen(LissEMissile.Position);
                    Drawing.DrawText(misposwts.X, misposwts.Y, Color.Red, LissEMissile.Position.ToString());
                    Render.Circle.DrawCircle(LissEMissile.Position, 200, Color.Red);
                }
            }

            var DrawQ = Config.Item("Drawing.DrawQ").GetValue <Circle>();
            var DrawW = Config.Item("Drawing.DrawW").GetValue <Circle>();
            var DrawE = Config.Item("Drawing.DrawE").GetValue <Circle>();
            var DrawR = Config.Item("Drawing.DrawR").GetValue <Circle>();

            if (DrawQ.Active)
            {
                Render.Circle.DrawCircle(Player.Position, Spells["Q"].Range, DrawQ.Color);
            }
            if (DrawW.Active)
            {
                Render.Circle.DrawCircle(Player.Position, Spells["W"].Range, DrawW.Color);
            }
            if (DrawE.Active)
            {
                Render.Circle.DrawCircle(Player.Position, Spells["E"].Range, DrawE.Color);
            }
            if (DrawR.Active)
            {
                Render.Circle.DrawCircle(Player.Position, Spells["R"].Range, DrawE.Color);
            }
        }
Example #8
0
        private static void CastE(AIHeroClient target)
        {
            if (LissEMissile == null && !LissUtils.CanSecondE())
            {
                var PredManager =
                    HeroManager.Enemies.Where(
                        h =>
                        h.IsValidTarget() && !h.IsZombie &&
                        Vector3.Distance(h.ServerPosition, Player.ServerPosition) <= Spells["E"].Range)
                    .Select(hero => Spells["E"].GetPrediction(hero))
                    .Select(
                        pred =>
                        new Tuple <Vector3, int, HitChance, List <AIHeroClient> >(pred.CastPosition,
                                                                                  pred.AoeTargetsHitCount, pred.Hitchance, pred.AoeTargetsHit));

                var BestLocation = PredManager.MaxOrDefault(x => x.Item4.Count);
                if (BestLocation.Item3 >= LissUtils.GetHitChance("Hitchance.E") && Spells["E"].IsReady())
                {
                    Spells["E"].Cast(BestLocation.Item1);
                }
            }
            SecondEChecker(target);
        }
Example #9
0
        static void KillSteal()
        {
            var targets =
                HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.IsInvulnerable & !x.IsZombie);

            if (SpellSlot.Q.IsReady() && LissUtils.Active("Killsteal.UseQ"))
            {
                Obj_AI_Hero qtarget =
                    targets.Where(x => x.Distance(Player.Position) < Spells["Q"].Range)
                    .MinOrDefault(x => x.Health);
                if (qtarget != null)
                {
                    var qdmg = Player.GetSpellDamage(qtarget, SpellSlot.Q);
                    if (qtarget.Health < qdmg)
                    {
                        var pred = Spells["Q"].GetPrediction(qtarget, false);
                        if (pred != null)
                        {
                            Spells["Q"].Cast(pred.CastPosition);
                        }
                    }
                }
            }
            if (SpellSlot.W.IsReady() && LissUtils.Active("Killsteal.UseW"))
            {
                Obj_AI_Hero wtarget =
                    targets.Where(x => x.Distance(Player.Position) < Spells["W"].Range)
                    .MinOrDefault(x => x.Health);
                if (wtarget != null)
                {
                    var wdmg = Player.GetSpellDamage(wtarget, SpellSlot.W);
                    if (wtarget.Health < wdmg)
                    {
                        Spells["W"].CastOnUnit(Player);
                    }
                }
            }

            Obj_AI_Hero etarget =
                targets.Where(x => x.Distance(Player.Position) < Spells["E"].Range).MinOrDefault(x => x.Health);

            if (SpellSlot.E.IsReady() && LissEMissile == null && !LissUtils.CanSecondE() && LissUtils.Active("Killsteal.UseE"))
            {
                if (etarget != null)
                {
                    var edmg = Player.GetSpellDamage(etarget, SpellSlot.E);
                    if (etarget.Health < edmg)
                    {
                        var pred = Spells["E"].GetPrediction(etarget, false);
                        if (pred != null)
                        {
                            Spells["E"].Cast(pred.CastPosition);
                        }
                    }
                }
            }

            if (LissEMissile != null && etarget != null && etarget.HealthPercent > 5 && etarget.HealthPercent < 15 && LissUtils.isHealthy() && LissUtils.Active("Killsteal.UseE2"))
            {
                if (Vector3.Distance(LissEMissile.Position, etarget.Position) < Spells["Q"].Range && SpellSlot.Q.IsReady() && etarget.Health < Player.GetSpellDamage(etarget, SpellSlot.Q))
                {
                    if (LissUtils.PointUnderEnemyTurret(LissEMissile.Position) && LissUtils.Active("Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                }
            }

            if (Spells["Ignite"].IsReady() && LissUtils.Active("Killsteal.UseIgnite"))
            {
                Obj_AI_Hero igntarget =
                    targets.Where(x => x.Distance(Player.Position) < Spells["Ignite"].Range)
                    .MinOrDefault(x => x.Health);
                if (igntarget != null)
                {
                    var igniteDmg = Player.GetSummonerSpellDamage(igntarget, Damage.SummonerSpell.Ignite);
                    if (igniteDmg > igntarget.Health)
                    {
                        Spells["Ignite"].Cast(igntarget);
                    }
                }
            }

            if (SpellSlot.R.IsReady() && LissUtils.Active("Killsteal.UseR"))
            {
                var Rtarget = targets.Where(h =>
                                            (Vector3.Distance(Player.ServerPosition, h.ServerPosition) < Spells["R"].Range) && h.CountEnemiesInRange(Spells["R"].Range) > 1 && h.Health < Player.GetSpellDamage(h, SpellSlot.R) && !LissUtils.Active("Blacklist." + h.ChampionName)).MinOrDefault(h => h.Health);
                if (Rtarget != null)
                {
                    Spells["R"].Cast(Rtarget);
                }
            }
        }
Example #10
0
        static void CastR(Obj_AI_Hero currenttarget)
        {
            var Check =
                HeroManager.Enemies
                .Where(
                    h => h.IsValidTarget(Spells["R"].Range) && h.CountEnemiesInRange(Spells["R"].Range) >= LissUtils.GetSlider("Combo.Rcount") && !LissUtils.Active("Blacklist." + h.ChampionName)).ToList();

            if (Player.CountEnemiesInRange(Spells["R"].Range) >= LissUtils.GetSlider("Combo.Rcount"))
            {
                Check.Add(Player);
            }
            if (Check != null)
            {
                if (Check.Contains(Player) && !LissUtils.isHealthy())
                {
                    Spells["R"].CastOnUnit(Player);
                    return;
                }
                var target = Check.FirstOrDefault();
                if (target != null)
                {
                    Spells["R"].Cast(target);
                    return;
                }
            }
            if (LissUtils.Active("Blacklist." + currenttarget.ChampionName))
            {
                return;
            }
            if (currenttarget.IsKillableFromPoint(Player.ServerPosition))
            {
                Spells["R"].Cast(currenttarget);
                return;
            }


            if (LissUtils.PointUnderAllyTurret(currenttarget.ServerPosition))
            {
                Spells["R"].Cast(currenttarget);
                return;
            }

            var dmgto = Player.GetSpellDamage(currenttarget, SpellSlot.R);

            if (dmgto > currenttarget.Health && currenttarget.Health >= 0.40 * dmgto)
            {
                Spells["R"].Cast(currenttarget);
                return;
            }

            var enemycount = LissUtils.GetSlider("Combo.Rcount");

            if (!LissUtils.isHealthy() && Player.CountEnemiesInRange(Spells["R"].Range - 100) >= enemycount)
            {
                Spells["R"].CastOnUnit(Player);
                return;
            }

            var possibilities = HeroManager.Enemies.Where(h => (h.IsValidTarget() && Vector3.Distance(h.ServerPosition, Player.ServerPosition) <= Spells["R"].Range || (h.IsKillableFromPoint(Player.ServerPosition) && h.IsValidTarget() && !h.IsInvulnerable)) && !LissUtils.Active("Blacklist." + h.ChampionName)).ToList();

            var arranged = possibilities.OrderByDescending(h => h.CountEnemiesInRange(Spells["R"].Range));

            if (LissUtils.Active("Misc.PrioritizeUnderTurret"))
            {
                var EnemyUnderTurret = arranged.Where(h => LissUtils.PointUnderAllyTurret(h.ServerPosition) && !h.IsInvulnerable);
                if (EnemyUnderTurret != null)
                {
                    var Enemytofocus = EnemyUnderTurret.MaxOrDefault(h => h.CountEnemiesInRange(Spells["R"].Range));
                    if (Enemytofocus != null)
                    {
                        Spells["R"].Cast(Enemytofocus);
                        return;
                    }
                }
            }

            var UltTarget = arranged.FirstOrDefault();

            if (UltTarget != null)
            {
                if (!LissUtils.isHealthy() &&
                    Player.CountEnemiesInRange(Spells["R"].Range) >
                    UltTarget.CountEnemiesInRange(Spells["R"].Range) + 1)
                {
                    Spells["R"].CastOnUnit(Player);
                    return;
                }
                Spells["R"].Cast(UltTarget);
            }
        }
Example #11
0
        public static bool IsKillableFromPoint(this Obj_AI_Hero target, Vector3 Point, bool ExcludeE = false)
        {
            double totaldmgavailable = 0;

            if (SpellSlot.Q.IsReady() && LissUtils.Active("Combo.UseQ") && Vector3.Distance(Point, target.ServerPosition) < Spells["Q"].Range + 35)
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.Q);
            }
            if (SpellSlot.W.IsReady() && LissUtils.Active("Combo.UseW") && Vector3.Distance(Point, target.ServerPosition) < Spells["W"].Range + 35)
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.W);
            }
            if (SpellSlot.E.IsReady() && LissUtils.Active("Combo.UseE") && Vector3.Distance(Point, target.ServerPosition) < Spells["E"].Range + 35 && !LissUtils.CanSecondE() && LissEMissile == null && !ExcludeE)
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.E);
            }
            if (SpellSlot.R.IsReady() && LissUtils.Active("Combo.UseR") && Vector3.Distance(Point, target.ServerPosition) < Spells["Q"].Range + 35)
            {
                totaldmgavailable += Player.GetSpellDamage(target, SpellSlot.R);
            }

            if (Spells["Ignite"].IsReady() && LissUtils.Active("Killsteal.UseIgnite") && Vector3.Distance(Point, target.ServerPosition) < Spells["Ignite"].Range + 15)
            {
                totaldmgavailable += Player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            }
            return(totaldmgavailable > target.Health);
        }
Example #12
0
        //return asap to check the most amount of times
        static void SecondEChecker(Obj_AI_Hero target)
        {
            if (LissUtils.AutoSecondE() && LissUtils.isHealthy() && LissEMissile != null && Spells["E"].IsReady())
            {
                if (Vector3.Distance(MissilePosition, target.ServerPosition) < Vector3.Distance(Player.ServerPosition, target.ServerPosition) && !LissUtils.PointUnderEnemyTurret(MissilePosition))
                {
                    Spells["E"].CastOnUnit(Player);
                    return;
                }
                var Enemiesatpoint  = Utility.GetEnemiesInRange(LissEMissile.Position, Spells["R"].Range);
                var enemiesatpointR = Enemiesatpoint.Count;

                if ((enemiesatpointR >= Config.Item("Combo.ecountR").GetValue <Slider>().Value&& SpellSlot.R.IsReady()) || (Enemiesatpoint.Any(e => e.IsKillableFromPoint(LissEMissile.Position) && Vector3.Distance(LissEMissile.Position, e.ServerPosition) < Vector3.Distance(Player.ServerPosition, e.ServerPosition))))
                {
                    if (LissUtils.PointUnderEnemyTurret(LissEMissile.Position) && LissUtils.Active("Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                    return;
                }
                var enemiesatpointW = Utility.CountEnemiesInRange(LissEMissile.Position, Spells["W"].Range);
                if (enemiesatpointW >= Config.Item("Combo.ecountW").GetValue <Slider>().Value&& SpellSlot.W.IsReady())
                {
                    if (LissUtils.PointUnderEnemyTurret(LissEMissile.Position) && LissUtils.Active("Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                    return;
                }
            }
        }
Example #13
0
        private static void WaveClearHandler()
        {
            var Minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    m.IsValidTarget() &&
                    (Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["Q"].Range ||
                     Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["W"].Range ||
                     Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["E"].Range));


            if (SpellSlot.Q.IsReady() && getCheckBoxItem(clearMenu, "Waveclear.UseQ"))
            {
                var qminions =
                    Minions.Where(
                        m =>
                        Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["Q"].Range &&
                        m.IsValidTarget());
                var QLocation =
                    MinionManager.GetBestLineFarmLocation(qminions.Select(m => m.ServerPosition.To2D()).ToList(),
                                                          Spells["Q"].Width, Spells["Q"].Range);
                if (QLocation.Position != null && QLocation.MinionsHit > 1)
                {
                    Spells["Q"].Cast(QLocation.Position);
                }
            }

            if (SpellSlot.E.IsReady() && getCheckBoxItem(clearMenu, "Waveclear.UseE"))
            {
                if (LissEMissile == null && !LissUtils.CanSecondE())
                {
                    var Eminions =
                        Minions.Where(
                            m => Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["E"].Range);
                    var ELocation =
                        MinionManager.GetBestLineFarmLocation(Eminions.Select(m => m.ServerPosition.To2D()).ToList(),
                                                              Spells["E"].Width, Spells["E"].Range);
                    if (ELocation.Position != null && ELocation.MinionsHit > 0)
                    {
                        Spells["E"].Cast(ELocation.Position);
                    }
                }
                else if (LissEMissile != null && getCheckBoxItem(clearMenu, "Waveclear.UseE2") &&
                         Vector2.Distance(MissilePosition, LissEMissile.EndPosition.To2D()) <= 15 &&
                         SpellSlot.E.IsReady())
                {
                    if (LissUtils.PointUnderEnemyTurret(MissilePosition) &&
                        getCheckBoxItem(miscMenu, "Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                }
            }

            if (SpellSlot.W.IsReady() && getCheckBoxItem(clearMenu, "Waveclear.UseW"))
            {
                var wminions =
                    Minions.Where(
                        m =>
                        Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells["W"].Range &&
                        m.IsValidTarget());
                if (wminions.Count() > getSliderItem(clearMenu, "Waveclear.Wcount"))
                {
                    Spells["W"].CastOnUnit(Player);
                }
            }
        }
Example #14
0
 private static void HarassHandler()
 {
     if (Player.ManaPercent < getSliderItem(harassMenu, "Harass.Mana"))
     {
         return;
     }
     if (getCheckBoxItem(harassMenu, "Harass.UseQ"))
     {
         var target = TargetSelector.GetTarget(Spells["Q2"].Range, DamageType.Magical);
         if (target != null)
         {
             CastQ(target);
         }
     }
     if (getCheckBoxItem(harassMenu, "Harass.UseW"))
     {
         var target = TargetSelector.GetTarget(Spells["W"].Range, DamageType.Magical);
         if (target != null && target.IsValidTarget())
         {
             CastW(target);
         }
     }
     if (getCheckBoxItem(harassMenu, "Harass.UseE") && LissEMissile == null && !LissUtils.CanSecondE())
     {
         var target = TargetSelector.GetTarget(Spells["E"].Range, DamageType.Magical);
         if (target != null && !target.IsInvulnerable)
         {
             CastE(target);
         }
     }
 }
Example #15
0
        private static void KillSteal()
        {
            var targets = HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.IsInvulnerable & !x.IsZombie);

            var objAiHeroes = targets as IList <AIHeroClient> ?? targets.ToList();

            if (SpellSlot.Q.IsReady() && getCheckBoxItem(ksMenu, "Killsteal.UseQ"))
            {
                var qtarget =
                    objAiHeroes.Where(x => x.Distance(Player.Position) < Spells["Q"].Range)
                    .MinOrDefault(x => x.Health);
                if (qtarget != null)
                {
                    var qdmg = Player.GetSpellDamage(qtarget, SpellSlot.Q);
                    if (qtarget.Health < qdmg)
                    {
                        var pred = Spells["Q"].GetPrediction(qtarget);
                        if (pred != null)
                        {
                            Spells["Q"].Cast(qtarget);
                        }
                    }
                }
            }
            if (SpellSlot.W.IsReady() && getCheckBoxItem(ksMenu, "Killsteal.UseW"))
            {
                var wtarget =
                    objAiHeroes.Where(x => x.Distance(Player.Position) < Spells["W"].Range)
                    .MinOrDefault(x => x.Health);
                if (wtarget != null)
                {
                    var wdmg = Player.GetSpellDamage(wtarget, SpellSlot.W);
                    if (wtarget.Health < wdmg)
                    {
                        Spells["W"].CastOnUnit(Player);
                    }
                }
            }

            var etarget =
                objAiHeroes.Where(x => x.Distance(Player.Position) < Spells["E"].Range).MinOrDefault(x => x.Health);

            if (SpellSlot.E.IsReady() && LissEMissile == null && !LissUtils.CanSecondE() &&
                getCheckBoxItem(ksMenu, "Killsteal.UseE"))
            {
                if (etarget != null)
                {
                    var edmg = Player.GetSpellDamage(etarget, SpellSlot.E);
                    if (etarget.Health < edmg)
                    {
                        var pred = Spells["E"].GetPrediction(etarget);
                        if (pred != null)
                        {
                            Spells["E"].Cast(etarget);
                        }
                    }
                }
            }

            if (LissEMissile != null && etarget != null && etarget.HealthPercent > 5 && etarget.HealthPercent < 15 &&
                LissUtils.isHealthy() && getCheckBoxItem(ksMenu, "Killsteal.UseE2"))
            {
                if (Vector3.Distance(LissEMissile.Position, etarget.Position) < Spells["Q"].Range &&
                    SpellSlot.Q.IsReady() && etarget.Health < Player.GetSpellDamage(etarget, SpellSlot.Q))
                {
                    if (LissUtils.PointUnderEnemyTurret(MissilePosition) &&
                        getCheckBoxItem(miscMenu, "Misc.DontETurret"))
                    {
                        return;
                    }
                    Spells["E"].CastOnUnit(Player);
                }
            }

            if (Spells["Ignite"].IsReady() && getCheckBoxItem(ksMenu, "Killsteal.UseIgnite"))
            {
                var igntarget =
                    objAiHeroes.Where(x => x.Distance(Player.Position) < Spells["Ignite"].Range)
                    .MinOrDefault(x => x.Health);
                if (igntarget != null)
                {
                    var igniteDmg = Player.GetSummonerSpellDamage(igntarget, Damage.SummonerSpell.Ignite);
                    if (igniteDmg > igntarget.Health)
                    {
                        Spells["Ignite"].Cast(igntarget);
                    }
                }
            }

            if (SpellSlot.R.IsReady() && getCheckBoxItem(ksMenu, "Killsteal.UseR"))
            {
                var Rtarget =
                    objAiHeroes.Where(
                        h =>
                        (Vector3.Distance(Player.ServerPosition, h.ServerPosition) < Spells["R"].Range) &&
                        h.CountEnemiesInRange(Spells["R"].Range) > 1 &&
                        h.Health < Player.GetSpellDamage(h, SpellSlot.R) &&
                        !getCheckBoxItem(blackListMenu, "Blacklist." + h.NetworkId)).MinOrDefault(h => h.Health);
                if (Rtarget != null)
                {
                    Spells["R"].Cast(Rtarget);
                }
            }
        }
Example #16
0
        private static void CastR(AIHeroClient currenttarget)
        {
            var Check =
                HeroManager.Enemies
                .Where(
                    h =>
                    h.LSIsValidTarget(Spells["R"].Range) &&
                    h.LSCountEnemiesInRange(Spells["R"].Range) >= getSliderItem(comboMenu, "Combo.Rcount") &&
                    !getCheckBoxItem(blackListMenu, "Blacklist." + h.NetworkId) && h.HealthPercent > getSliderItem(comboMenu, "Combo.MinRHealth")).ToList();

            if (Player.LSCountEnemiesInRange(Spells["R"].Range) >= getSliderItem(comboMenu, "Combo.Rcount"))
            {
                Check.Add(Player);
            }
            if (Check.Any())
            {
                if (Check.Contains(Player) && !LissUtils.isHealthy())
                {
                    Spells["R"].CastOnUnit(Player);
                    return;
                }
                var target = Check.MaxOrDefault(TargetSelector.GetPriority);
                if (target != null)
                {
                    Spells["R"].Cast(target);
                    return;
                }
            }
            if (getCheckBoxItem(blackListMenu, "Blacklist." + currenttarget.NetworkId))
            {
                return;
            }
            if (currenttarget.IsKillableFromPoint(Player.ServerPosition) && Player.LSDistance(currenttarget) < Spells["R"].Range)
            {
                Spells["R"].Cast(currenttarget);
                return;
            }


            if (LissUtils.PointUnderAllyTurret(currenttarget.ServerPosition))
            {
                Spells["R"].Cast(currenttarget);
                return;
            }

            var dmgto = Player.LSGetSpellDamage(currenttarget, SpellSlot.R);

            if (dmgto > currenttarget.Health && currenttarget.Health >= 0.40 * dmgto)
            {
                Spells["R"].Cast(currenttarget);
                return;
            }

            var enemycount = getSliderItem(comboMenu, "Combo.Rcount");

            if (!LissUtils.isHealthy() && Player.LSCountEnemiesInRange(Spells["R"].Range - 100) >= enemycount)
            {
                Spells["R"].CastOnUnit(Player);
                return;
            }

            var possibilities =
                HeroManager.Enemies.Where(
                    h =>
                    (h.LSIsValidTarget() &&
                     Vector3.Distance(h.ServerPosition, Player.ServerPosition) <= Spells["R"].Range ||
                     (h.IsKillableFromPoint(Player.ServerPosition) && h.LSIsValidTarget() && !h.IsInvulnerable)) &&
                    !getCheckBoxItem(blackListMenu, "Blacklist." + h.NetworkId)).ToList();

            var arranged = possibilities.OrderByDescending(h => h.LSCountEnemiesInRange(Spells["R"].Range));

            if (getCheckBoxItem(miscMenu, "Misc.PrioritizeUnderTurret"))
            {
                var EnemyUnderTurret =
                    arranged.Where(h => LissUtils.PointUnderAllyTurret(h.ServerPosition) && !h.IsInvulnerable);

                var Enemytofocus = EnemyUnderTurret.MaxOrDefault(h => h.LSCountEnemiesInRange(Spells["R"].Range));
                if (Enemytofocus != null)
                {
                    Spells["R"].Cast(Enemytofocus);
                    return;
                }
            }

            var UltTarget = arranged.FirstOrDefault();

            if (UltTarget != null)
            {
                if (!LissUtils.isHealthy() &&
                    Player.LSCountEnemiesInRange(Spells["R"].Range) >
                    UltTarget.LSCountEnemiesInRange(Spells["R"].Range) + 1)
                {
                    Spells["R"].CastOnUnit(Player);
                    return;
                }
                Spells["R"].Cast(UltTarget);
            }
        }