Exemplo n.º 1
0
Arquivo: Lux.cs Projeto: jayblah/Seph
        static void Harass(Obj_AI_Hero target)
        {
            if (Player.ManaPercent < LuxUtils.GetSlider("Harass.Mana"))
            {
                if (LuxUtils.Active("Harass.UseE") && LuxE != null &&
                    Vector3.Distance(LuxE.Position, target.ServerPosition) <=
                    LuxE.BoundingRadius + target.BoundingRadius)
                {
                    Spells[SpellSlot.E].Cast();
                }
                return;
            }

            if (Spells[SpellSlot.Q].IsReady() && LuxUtils.Active("Harass.UseQ") && Player.Distance(target) <= Spells[SpellSlot.Q].Range)
            {
                var pred = Spells[SpellSlot.Q].GetPrediction(target, true);
                if (pred.CollisionObjects.Count <= 1 && pred.Hitchance >= LuxUtils.GetHitChance("Hitchance.Q"))
                {
                    Spells[SpellSlot.Q].Cast(pred.CastPosition);
                }
            }
            if (Spells[SpellSlot.E].IsReady() && LuxE == null && LuxUtils.Active("Harass.UseE") && Player.Distance(target) <= Spells[SpellSlot.E].Range)
            {
                Spells[SpellSlot.E].SPredictionCast(target, LuxUtils.GetHitChance("Hitchance.E"));

                /*
                 * var pred = Spells[SpellSlot.E].GetPrediction(target, true);
                 * if (pred.Hitchance >= LuxUtils.GetHitChance("Hitchance.E"))
                 * {
                 * Spells[SpellSlot.E].Cast(pred.CastPosition);
                 * }
                 */
            }
            else if (LuxUtils.Active("Harass.UseE") && LuxE != null &&
                     Vector3.Distance(LuxE.Position, target.ServerPosition) <=
                     LuxE.BoundingRadius + target.BoundingRadius)
            {
                Spells[SpellSlot.E].Cast();
            }
        }
Exemplo n.º 2
0
Arquivo: Lux.cs Projeto: jayblah/Seph
        static void MixedModeLogic(Obj_AI_Hero target, bool isMixed)
        {
            if (isMixed && target != null)
            {
                Harass(target);
            }

            if (!LuxUtils.Active("Farm.Enable") || target == null || Player.ManaPercent < LuxUtils.GetSlider("Farm.Mana"))
            {
                return;
            }

            var Minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    m.IsValidTarget() &&
                    (Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.E].Range)).ToList();

            if (!Minions.Any())
            {
                return;
            }
            if (SpellSlot.Q.IsReady() && LuxUtils.Active("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[SpellSlot.Q].Cast(KillableMinionsQ.FirstOrDefault().ServerPosition);
                }
            }
            if (SpellSlot.E.IsReady() && LuxUtils.Active("Farm.UseE"))
            {
                var KillableMinionsE = Minions.Where(m => m.Health < Player.GetSpellDamage(m, SpellSlot.W) && Vector3.Distance(Player.ServerPosition, m.ServerPosition) < Spells[SpellSlot.E].Range);
                if (KillableMinionsE.Any())
                {
                    Spells[SpellSlot.E].Cast(KillableMinionsE.FirstOrDefault().ServerPosition);
                }
            }

            if (LuxE != null && LuxE.Position == LuxE.EndPosition)
            {
                Spells[SpellSlot.E].Cast();
            }
        }
Exemplo n.º 3
0
Arquivo: Lux.cs Projeto: jayblah/Seph
        private static void Combo(Obj_AI_Hero target)
        {
            if (Spells[SpellSlot.Q].IsReady() && LuxUtils.Active("Combo.UseQ") && Player.Distance(target) <= Spells[SpellSlot.Q].Range)
            {
                var pred = Spells[SpellSlot.Q].GetPrediction(target, true);
                if (pred.CollisionObjects.Count <= 1 && pred.Hitchance >= LuxUtils.GetHitChance("Hitchance.Q"))
                {
                    Spells[SpellSlot.Q].Cast(pred.CastPosition);
                }
            }
            if (Spells[SpellSlot.E].IsReady() && LuxE == null && LuxUtils.Active("Combo.UseE") && Player.Distance(target) <= Spells[SpellSlot.E].Range)
            {
                Spells[SpellSlot.E].SPredictionCast(target, LuxUtils.GetHitChance("Hitchance.E"));

                /*
                 * var pred = Spells[SpellSlot.E].GetPrediction(target, true);
                 * if (pred.Hitchance >= LuxUtils.GetHitChance("Hitchance.E"))
                 * {
                 * Spells[SpellSlot.E].Cast(pred.CastPosition);
                 * }
                 */
            }
            else if (LuxUtils.Active("Combo.UseE2") && LuxE != null &&
                     Vector3.Distance(LuxE.Position, target.ServerPosition) <=
                     LuxE.BoundingRadius + target.BoundingRadius)
            {
                Spells[SpellSlot.E].Cast();
            }

            if (SpellSlot.R.IsReady() && LuxUtils.Active("Combo.UseR"))
            {
                List <Obj_AI_Hero> targets = new List <Obj_AI_Hero>();
                if (LuxUtils.Active("Combo.RKillable"))
                {
                    targets =
                        HeroManager.Enemies.Where(
                            x =>
                            x.Health <= Player.GetSpellDamage(x, SpellSlot.R) &&
                            x.Distance(Player) <= Spells[SpellSlot.R].Range).ToList();
                }
                else
                {
                    targets = HeroManager.Enemies.Where(x => x.Distance(Player) <= Spells[SpellSlot.R].Range).ToList();
                }

                List <CastPosition1> Positions = new List <CastPosition1>();

                foreach (var h in targets)
                {
                    var pred = Spells[SpellSlot.R].GetPrediction(h, true);
                    int hit  = pred.AoeTargetsHitCount + 1;
                    // List<Obj_AI_Base> collobjs =
                    //  pred.CollisionObjects.FindAll(x => x.Type == GameObjectType.obj_AI_Hero && x.IsEnemy);

                    CastPosition1 cp = new CastPosition1
                    {
                        pos       = pred.CastPosition,
                        hc        = pred.Hitchance,
                        numberhit = hit,
                        hasbuff   = h.HasBuff("LuxLightBindingMis")
                    };
                    Positions.Add(cp);
                }

                var bestpossibleposition =
                    Positions.OrderByDescending(x => x.numberhit)
                    .ThenByDescending(x => x.hc)
                    .ThenByDescending(h => h.hasbuff)
                    .FirstOrDefault();
                if (bestpossibleposition != null && bestpossibleposition.hc >= LuxUtils.GetHitChance("Hitchance.R") &&
                    bestpossibleposition.numberhit >= LuxUtils.GetSlider("Combo.Rcount"))
                {
                    Spells[SpellSlot.R].Cast(bestpossibleposition.pos);
                }
            }


            if (SpellSlot.W.IsReady() && LuxUtils.Active("Combo.UseW"))
            {
                var list = HeroManager.Allies;

                var lowhealthallies =
                    list.Where(ally => ally.HealthPercent <= 40 && Player.Distance(ally) <= Spells[SpellSlot.W].Range);
                Obj_AI_Hero besthero = null;
                int         amthit   = 0;
                foreach (var hero in lowhealthallies)
                {
                    var pred = Prediction.GetPrediction(WInput(hero));
                    if (pred.Hitchance >= HitChance.Collision || pred.Hitchance >= HitChance.Low)
                    {
                        var coll = pred.CollisionObjects.Count;
                        if (coll >= amthit)
                        {
                            amthit   = coll;
                            besthero = hero;
                        }
                    }
                }
                if (besthero != null && Player.HealthPercent <= 30 && Player.CountEnemiesInRange(800) > 0)
                {
                    Spells[SpellSlot.W].Cast(besthero.ServerPosition);
                }
            }
        }
Exemplo n.º 4
0
Arquivo: Lux.cs Projeto: jayblah/Seph
        private static void WaveClear()
        {
            var Minions =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(
                    m =>
                    m.IsValidTarget() &&
                    (Vector3.Distance(m.ServerPosition, Player.ServerPosition) <= Spells[SpellSlot.R].Range));

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

            if (SpellSlot.E.IsReady() && LuxUtils.Active("Waveclear.UseE"))
            {
                if (LuxE == null)
                {
                    var Eminions =
                        Minions.Where(
                            m =>
                            Vector3.Distance(m.ServerPosition, Player.ServerPosition) <=
                            Spells[SpellSlot.E].Range + Spells[SpellSlot.E].Width);
                    MinionManager.FarmLocation ELocation =
                        MinionManager.GetBestCircularFarmLocation(
                            Eminions.Select(m => m.ServerPosition.To2D()).ToList(), Spells[SpellSlot.E].Width,
                            Spells[SpellSlot.E].Range);
                    if (ELocation.MinionsHit >= 2)
                    {
                        Spells[SpellSlot.E].Cast(ELocation.Position);
                    }
                }

                if (LuxUtils.Active("Waveclear.UseE2") && LuxE != null && LuxE.Position == LuxE.EndPosition)
                {
                    Spells[SpellSlot.E].Cast();
                }
            }


            if (SpellSlot.R.IsReady() && LuxUtils.Active("Waveclear.UseR"))
            {
                MinionManager.FarmLocation RLocation =
                    MinionManager.GetBestLineFarmLocation(
                        Minions.Select(m => m.ServerPosition.To2D()).ToList(), Spells[SpellSlot.R].Width,
                        Spells[SpellSlot.R].Range);
                if (RLocation.MinionsHit > LuxUtils.GetSlider("Waveclear.Rcount"))
                {
                    Spells[SpellSlot.R].Cast(RLocation.Position);
                }
            }
        }
Exemplo n.º 5
0
Arquivo: Lux.cs Projeto: jayblah/Seph
        private static void AutoSpells(EventArgs args)
        {
            foreach (var target in HeroManager.Enemies)
            {
                if (LuxUtils.Active("Combo.UseE2") && LuxE != null &&
                    Vector3.Distance(LuxE.Position, target.ServerPosition) <=
                    LuxE.BoundingRadius + target.BoundingRadius)
                {
                    Spells[SpellSlot.E].Cast();
                }
            }

            if (SpellSlot.R.IsReady() && LuxUtils.Active("Auto.R"))
            {
                List <Obj_AI_Hero> targets = new List <Obj_AI_Hero>();
                targets = HeroManager.Enemies.Where(x => x.Distance(Player) <= Spells[SpellSlot.R].Range).ToList();
                List <CastPosition1> Positions = new List <CastPosition1>();


                foreach (var h in targets)
                {
                    var pred = Spells[SpellSlot.R].GetPrediction(h, true);

                    //List<Obj_AI_Base> collobjs =
                    // pred.CollisionObjects.FindAll(x => x.Type == GameObjectType.obj_AI_Hero && x.IsEnemy);

                    if (pred != null)
                    {
                        CastPosition1 cp = new CastPosition1
                        {
                            pos       = pred.CastPosition,
                            hc        = pred.Hitchance,
                            numberhit = pred.AoeTargetsHitCount + 1,
                            hasbuff   = h.HasBuff("LuxLightBindingMis")
                        };

                        Positions.Add(cp);
                    }
                }

                var bestpossibleposition =
                    Positions.OrderByDescending(x => x.numberhit)
                    .ThenByDescending(x => x.hc)
                    .ThenByDescending(h => h.hasbuff)
                    .FirstOrDefault();

                if (bestpossibleposition != null && bestpossibleposition.hc >= LuxUtils.GetHitChance("Hitchance.R") &&
                    bestpossibleposition.numberhit >= LuxUtils.GetSlider("Auto.Rcount"))
                {
                    Spells[SpellSlot.R].Cast(bestpossibleposition.pos);
                }
            }

            if (SpellSlot.W.IsReady() && LuxUtils.Active("Auto.W"))
            {
                var list = HeroManager.Allies;

                var lowhealthallies =
                    list.Where(ally => ally.HealthPercent <= LuxUtils.GetSlider("Auto.Whp") && Player.Distance(ally) <= Spells[SpellSlot.W].Range);
                Obj_AI_Hero besthero = null;
                int         amthit   = 0;
                foreach (var hero in lowhealthallies)
                {
                    var pred = Prediction.GetPrediction(WInput(hero));
                    if (pred.Hitchance >= HitChance.Collision || pred.Hitchance >= HitChance.Low)
                    {
                        var coll = pred.CollisionObjects.Count;
                        if (coll >= amthit)
                        {
                            amthit   = coll;
                            besthero = hero;
                        }
                    }
                }
                if (besthero != null && amthit >= LuxUtils.GetSlider("Auto.Wcount"))
                {
                    Spells[SpellSlot.W].Cast(besthero.ServerPosition);
                }
            }
        }