Beispiel #1
0
 public static Result GetLineAoePrediction(this Spell spell, AIHeroClient target, HitChance hitChance,
                                           bool boundingRadius = true, bool maxRange = true, Vector3?sourcePosition = null)
 {
     try
     {
         if (spell == null || target == null)
         {
             return(new Result(Vector3.Zero, new List <AIHeroClient>()));
         }
         var fromPosition = sourcePosition ?? ObjectManager.Player.PreviousPosition;
         var range        = (spell.IsChargedSpell && maxRange ? spell.ChargedMaxRange : spell.Range) +
                            spell.Width * 0.9f +
                            (boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : 0);
         var positions = (from t in GameObjects.EnemyHeroes
                          where t.IsValidTarget(range, true, fromPosition)
                          let prediction = spell.GetPrediction(t)
                                           where prediction.Hitchance >= hitChance
                                           select new Position(t, prediction.UnitPosition)).ToList();
         if (positions.Any())
         {
             var hits = new List <AIHeroClient>();
             var pred = spell.GetPrediction(target);
             if (pred.Hitchance >= hitChance)
             {
                 hits.Add(target);
                 var rect = new Geometry.Rectangle(
                     spell.From, spell.From.Extend(pred.CastPosition, range), spell.Width);
                 if (boundingRadius)
                 {
                     hits.AddRange(
                         from point in positions.Where(p => p.Hero.NetworkId != target.NetworkId)
                         let circle =
                             new Geometry.Circle(
                                 point.UnitPosition, point.Hero.BoundingRadius * BoundingRadiusMultiplicator)
                             where circle.Points.Any(p => rect.IsInside(p))
                             select point.Hero);
                 }
                 else
                 {
                     hits.AddRange(
                         from position in positions
                         where rect.IsInside(position.UnitPosition)
                         select position.Hero);
                 }
                 return(new Result(pred.CastPosition, hits));
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     return(new Result(Vector3.Zero, new List <AIHeroClient>()));
 }
Beispiel #2
0
        //private static void OnGapcloser(AIHeroClient target, GapcloserArgs Args)
        //{
        //    if (E.IsReady() && target != null && target.IsValidTarget(E.Range))
        //    {
        //        switch (Args.Type)
        //        {
        //            case SpellType.Melee:
        //                {
        //                    if (target.IsValidTarget(target.AttackRange + target.BoundingRadius + 100))
        //                    {
        //                        E.Cast(Me.PreviousPosition.Extend(target.PreviousPosition, -E.Range));
        //                    }
        //                }
        //                break;
        //            case SpellType.Dash:
        //                {
        //                    if (Args.EndPosition.DistanceToPlayer() <= 250 ||
        //                        target.PreviousPosition.DistanceToPlayer() <= 300)
        //                    {
        //                        E.Cast(Me.PreviousPosition.Extend(target.PreviousPosition, -E.Range));
        //                    }
        //                }
        //                break;
        //            case SpellType.SkillShot:
        //            case SpellType.Targeted:
        //                {
        //                    if (target.PreviousPosition.DistanceToPlayer() <= 300)
        //                    {
        //                        E.Cast(Me.PreviousPosition.Extend(target.PreviousPosition, -E.Range));
        //                    }
        //                }
        //                break;
        //        }
        //    }
        //}

        private static void QLogic(AIHeroClient target, bool useExtendQ = true)
        {
            if (!Q.IsReady() || target == null || target.IsDead || target.IsUnKillable())
            {
                return;
            }

            if (target.IsValidTarget(Q.Range))
            {
                Q.CastOnUnit(target);
            }
            else if (target.IsValidTarget(Q2.Range) && useExtendQ)
            {
                var collisions =
                    GameObjects.EnemyMinions.Where(x => x.IsValidTarget(Q.Range) && (x.IsMinion() || x.GetJungleType() != JungleType.Unknown))
                    .ToList();

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

                foreach (var minion in collisions)
                {
                    var qPred    = Q2.GetPrediction(target);
                    var qPloygon = new Geometry.Rectangle(Me.PreviousPosition, Me.PreviousPosition.Extend(minion.Position, Q2.Range), Q2.Width);

                    if (qPloygon.IsInside(qPred.UnitPosition.ToVector2()) && minion.IsValidTarget(Q.Range))
                    {
                        Q.CastOnUnit(minion);
                        break;
                    }
                }
            }
        }
Beispiel #3
0
        public static void CastQ(Obj_AI_Base target, int minHit = 1)
        {
            if (Global.Player.Mana < Global.Player.GetSpell(SpellSlot.Q).Cost)
            {
                return;
            }

            if (target.IsValidTarget(Q.Range))
            {
                Q.Cast(target);
                return;
            }

            foreach (var shadow in ShadowManager.Shadows)
            {
                if (minHit == 1)
                {
                    Q.Cast(target.ServerPosition);
                }
                else
                {
                    var pred = Q.GetPrediction(target, shadow.ServerPosition, shadow.ServerPosition);
                    var rect = new Geometry.Rectangle(shadow.ServerPosition.To2D(), pred.CastPosition.To2D(), Q.Width);
                    if (GameObjects.EnemyMinions.Count(x => rect.IsInside(x.ServerPosition.To2D())) >= minHit)
                    {
                        Q.Cast(pred.CastPosition);
                    }
                }
            }
        }
Beispiel #4
0
        public static void OnUpdate()
        {
            var target = Global.TargetSelector.GetTarget(SpellConfig.Q.Range + 400);

            if (target == null)
            {
                return;
            }

            var dist = target.Distance(Global.Player) - Global.Player.BoundingRadius - target.BoundingRadius;

            if (SpellConfig.Q.Ready && MenuConfig.Harass["Q"].Enabled && Global.Player.ManaPercent() > MenuConfig.Harass["Q"].Value && dist < SpellConfig.Q.Range + 200)
            {
                SpellConfig.CastQ(target);
            }

            if (SpellConfig.W.Ready && MenuConfig.Harass["W"].Enabled && Global.Player.ManaPercent() > MenuConfig.Harass["W"].Value)
            {
                SpellConfig.W.Cast(Global.Player.ServerPosition.Extend(target.ServerPosition, SpellConfig.W.Range));
            }

            if (SpellConfig.E.Ready && MenuConfig.Harass["E"].Enabled && Global.Player.ManaPercent() > MenuConfig.Harass["E"].Value)
            {
                foreach (var soldier in SoldierManager.Soldiers)
                {
                    var rect  = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), soldier.ServerPosition.To2D(), SpellConfig.E.Width);
                    var count = GameObjects.EnemyHeroes.Count(x => rect.IsInside(x.ServerPosition.To2D()));

                    if (count >= 1)
                    {
                        SpellConfig.E.Cast(soldier.ServerPosition);
                    }
                }
            }
        }
Beispiel #5
0
        public static void OnUpdate()
        {
            var target = GameObjects.EnemyHeroes.FirstOrDefault(x => x.IsValidTarget(5000));

            if (target == null)
            {
                return;
            }

            if (MenuConfig.Killsteal["AA"].Enabled && target.IsValidAutoRange() && target.Health < Global.Player.GetAutoAttackDamage(target))
            {
                Global.Orbwalker.ForceTarget(target);
            }

            if (Global.Orbwalker.IsWindingUp)
            {
                return;
            }

            if (SpellConfig.Q.Ready &&
                target.Health < Global.Player.GetSpellDamage(target, SpellSlot.Q) &&
                target.IsValidTarget(SpellConfig.Q.Range) &&
                MenuConfig.Killsteal["Q"].Enabled)
            {
                SpellConfig.Q.Cast(target);
            }
            else if (SpellConfig.W.Ready &&
                     target.Health < Global.Player.GetSpellDamage(target, SpellSlot.W) &&
                     target.IsValidTarget(SpellConfig.W.Range) &&
                     MenuConfig.Killsteal["W"].Enabled)
            {
                SpellConfig.W.Cast(target);
            }
            else if (SpellConfig.E.Ready &&
                     target.Health < Global.Player.GetSpellDamage(target, SpellSlot.E) &&
                     target.IsValidTarget(SpellConfig.E.Range) &&
                     MenuConfig.Killsteal["E"].Enabled)
            {
                SpellConfig.E.Cast(target);
            }
            else if (SpellConfig.R.Ready &&
                     target.Health < Global.Player.GetSpellDamage(target, SpellSlot.R) &&
                     target.IsValidTarget(MenuConfig.Killsteal["Range"].Value) &&
                     MenuConfig.Killsteal["Range"].Enabled &&
                     target.Distance(Global.Player) > Global.Player.AttackRange + 275)
            {
                var rectangle = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), target.ServerPosition.To2D(), SpellConfig.R.Width);
                if (GameObjects.EnemyHeroes.Count(x => rectangle.IsInside(x.ServerPosition.To2D())) >= 2 &&
                    target.Health > Global.Player.GetSpellDamage(target, SpellSlot.R, DamageStage.AreaOfEffect))
                {
                    return;
                }

                SpellConfig.R.Cast(target);
            }
        }
Beispiel #6
0
        /// <summary>
        ///     Returns the number of feathers which can hit the target unit.
        /// </summary>
        public int CountFeathersHitOnUnit(Obj_AI_Base unit)
        {
            var hit = 0;

            foreach (var feather in Feathers)
            {
                var playerToFeatherRectangle = new Geometry.Rectangle((Vector2)UtilityClass.Player.ServerPosition, (Vector2)feather.Value, SpellClass.Q.Width);
                if (playerToFeatherRectangle.IsInside((Vector2)unit.ServerPosition))
                {
                    hit++;
                }
            }

            return(hit);
        }
Beispiel #7
0
        /// <summary>
        ///     Gets the approximative number of mines hit by the target inside the MineField after W Cast.
        /// </summary>
        /// <param name="unit">The unit.</param>
        public int GetBestBouldersHitPositionHitBoulders(Obj_AI_Base unit)
        {
            var mostBouldersHit = 0;

            foreach (var mine in MineField)
            {
                var unitToMineRectangle = new Geometry.Rectangle((Vector2)unit.Position, (Vector2)unit.Position.Extend((Vector2)mine.Value, WPushDistance), unit.BoundingRadius);
                var bouldersHit         = MineField.Count(o => unitToMineRectangle.IsInside((Vector2)o.Value));
                if (bouldersHit > mostBouldersHit)
                {
                    mostBouldersHit = bouldersHit;
                }
            }

            return(mostBouldersHit);
        }
Beispiel #8
0
        public static bool GetLineAoeCanHit(float spellrange, float spellwidth, AIBaseClient target, HitChance hitChance, Vector3 endRange,
                                            bool boundingRadius = true)
        {
            if (target == null || target.IsDashing())
            {
                return(false);
            }

            var targetPosition = target.PreviousPosition.ToVector2();
            var fromPosition   = ObjectManager.Player.PreviousPosition;
            var width          = spellwidth + (boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : 0);
            var boundradius    = (boundingRadius
                ? target.BoundingRadius * BoundingRadiusMultiplicator
                : target.BoundingRadius);

            var rect = new Geometry.Rectangle(fromPosition, endRange, width);
            var circ = new Geometry.Circle(targetPosition, boundradius);

            return(circ.Points.Select(point => rect.IsInside(point)).FirstOrDefault());
        }
Beispiel #9
0
        /// <summary>
        ///     Gets the Best position inside the MineField for W Cast.
        /// </summary>
        /// <param name="unit">The unit.</param>
        public Vector3 GetBestBouldersHitPosition(Obj_AI_Base unit)
        {
            var mostBouldersHit    = 0;
            var mostBouldersHitPos = Vector3.Zero;

            foreach (var mine in MineField)
            {
                var unitToMineRectangle = new Geometry.Rectangle((Vector2)unit.Position, (Vector2)unit.Position.Extend((Vector2)mine.Value, WPushDistance), unit.BoundingRadius);
                var bouldersHit         = MineField.Count(o => unitToMineRectangle.IsInside((Vector2)o.Value));
                if (bouldersHit > mostBouldersHit)
                {
                    mostBouldersHit    = bouldersHit;
                    mostBouldersHitPos = mine.Value;

                    if (bouldersHit >= MaxHittableBoulders)
                    {
                        break;
                    }
                }
            }

            return(mostBouldersHitPos);
        }
Beispiel #10
0
        /// <summary>
        ///     Initializes the menus.
        /// </summary>
        public void Drawings()
        {
            /// <summary>
            ///     Loads the Q drawing.
            /// </summary>
            if (SpellClass.Q.Ready &&
                MenuClass.Drawings["q"].As <MenuBool>().Enabled)
            {
                Render.Circle(UtilityClass.Player.Position, SpellClass.Q.Range, 30, Color.LightGreen);
            }

            /// <summary>
            ///     Loads the Feather linking drawing.
            /// </summary>
            if (!UtilityClass.Player.SpellBook.GetSpell(SpellSlot.E).State.HasFlag(SpellState.Cooldown) &&
                MenuClass.Drawings["feathers"].As <MenuBool>().Enabled)
            {
                foreach (var feather in Feathers)
                {
                    var hitbox = new Geometry.Rectangle((Vector2)UtilityClass.Player.Position, (Vector2)feather.Value, SpellClass.Q.Width);
                    hitbox.Draw(
                        GameObjects.EnemyHeroes.Any(h => hitbox.IsInside((Vector2)h.Position))
                            ? Color.Blue
                            : Color.OrangeRed);
                }
            }

            /// <summary>
            ///     Loads the R drawing.
            /// </summary>
            if (SpellClass.R.Ready &&
                MenuClass.Drawings["r"].As <MenuBool>().Enabled)
            {
                Render.Circle(UtilityClass.Player.Position, SpellClass.R.Range, 30, Color.Red);
            }
        }
Beispiel #11
0
        private void CastEIfStun(AIHeroClient target)
        {
            var point = Player.Position.Extend(target.Position, -480);

            Geometry.Rectangle rect = new Geometry.Rectangle(Player.Position, point, 170);
            if (GameObjects.AttackableUnits.Where(e => e != target && (e is AIMinionClient || e is AIHeroClient) && e.IsEnemy && e.IsValidTarget(510) && rect.IsInside(e.Position.ToVector2())).Count() > 0)
            {
                e.Cast(target.Position);
            }
        }
Beispiel #12
0
        public static void OnUpdate()
        {
            var target = Global.TargetSelector.GetTarget(SpellConfig.Q.Range + 400);

            if (target == null)
            {
                return;
            }

            var dist = target.Distance(Global.Player);

            if (SpellConfig.E.Ready && MenuConfig.Combo["E"].Enabled)
            {
                foreach (var soldier in SoldierManager.Soldiers)
                {
                    var rect  = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), soldier.ServerPosition.To2D(), SpellConfig.E.Width);
                    var count = GameObjects.EnemyHeroes.Count(x => rect.IsInside(x.ServerPosition.To2D()));

                    if (count >= 2)
                    {
                        SpellConfig.E.Cast(soldier.ServerPosition);
                    }
                }

                if (target.HealthPercent() <= MenuConfig.Combo["EDmg"].Value)
                {
                    var soldier = SoldierManager.Soldiers.FirstOrDefault(x => x.Distance(target) <= 500 && !x.IsMoving);
                    if (soldier != null && soldier.ServerPosition != Vector3.Zero)
                    {
                        SpellConfig.E.Cast(soldier);
                    }
                }
            }

            if (SpellConfig.Q.Ready && MenuConfig.Combo["Q"].Enabled && dist < SpellConfig.Q.Range + 200)
            {
                if (SoldierManager.Soldiers.All(soldier => soldier.Distance(target) <= 200))
                {
                    return;
                }

                if (SoldierManager.Soldiers.Count >= MenuConfig.Combo["QCount"].Value)
                {
                    SpellConfig.CastQ(target, MenuConfig.Combo["Extend"].Enabled);
                }
            }

            if (SpellConfig.W.Ready && MenuConfig.Combo["W"].Enabled)
            {
                if (SpellConfig.Q.Ready && MenuConfig.Combo["Q"].Enabled)
                {
                    SpellConfig.W.Cast(Global.Player.ServerPosition.Extend(target.ServerPosition, SpellConfig.W.Range));
                }
                else if (dist < SpellConfig.W.Range)
                {
                    SpellConfig.W.Cast(target);
                }
            }

            if (SpellConfig.R.Ready && MenuConfig.Combo["R"].Enabled && target.HealthPercent() <= 40 && dist < SpellConfig.R.Range)
            {
                AzirHelper.Rect = new Geometry.Rectangle(target.ServerPosition.To2D(), Global.Player.ServerPosition.Extend(target.ServerPosition, -SpellConfig.R.Width / 2f).To2D(), SpellConfig.R.Width / 2f);
                if (AzirHelper.Rect.IsInside(target.ServerPosition.To2D()))
                {
                    SpellConfig.R.Cast(target);
                }
            }
        }
Beispiel #13
0
        private void CastUlt(Vector3 pos)
        {
            var rectangle = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), pos.To2D(), _width);

            if (Menu["Collision"].Enabled &&
                GameObjects.EnemyHeroes.Count(x => x.NetworkId != _target.NetworkId && rectangle.IsInside(x.ServerPosition.To2D())) > _maxCollisionObjects ||
                pos.Distance(Global.Player) > _range || pos.Distance(Global.Player) > 15000)
            {
                return;
            }

            Console.WriteLine($"BASEULT SUCCESS | {_target.ChampionName}");

            DelayAction.Queue(1500, () =>
            {
                _lastSeenPosition  = Vector3.Zero;
                _predictedPosition = Vector3.Zero;
            }, new CancellationToken(false));

            _ultimate.Cast(pos);

            Reset();
        }
Beispiel #14
0
        /// <summary>
        ///     Called on tick update.
        /// </summary>
        public void Combo()
        {
            if (BallPosition == null)
            {
                return;
            }

            /// <summary>
            ///     The W Combo Logic.
            /// </summary>
            if (SpellClass.W.Ready &&
                !UtilityClass.Player.GetSpell(SpellSlot.W).State.HasFlag(SpellState.Surpressed) &&
                MenuClass.Spells["w"]["combo"].As <MenuBool>().Enabled)
            {
                if (GameObjects.EnemyHeroes.Any(t =>
                                                !Invulnerable.Check(t, DamageType.Magical, false) &&
                                                t.IsValidTarget(SpellClass.W.Width - t.BoundingRadius - SpellClass.W.Delay * t.BoundingRadius, false, false, (Vector3)BallPosition)))
                {
                    SpellClass.W.Cast();
                }
            }

            /// <summary>
            ///     The E Logics.
            /// </summary>
            if (SpellClass.E.Ready)
            {
                /// <summary>
                ///     The E Engager Logic.
                /// </summary>
                if (MenuClass.Spells["r"]["aoe"] != null &&
                    MenuClass.Spells["r"]["aoe"].As <MenuSliderBool>().Enabled&&
                    MenuClass.Spells["e"]["engager"].As <MenuBool>().Enabled)
                {
                    var bestAllies = GameObjects.AllyHeroes
                                     .Where(a =>
                                            !a.IsMe &&
                                            a.IsValidTarget(SpellClass.E.Range, true) &&
                                            MenuClass.Spells["e"]["engagerswhitelist"][a.ChampionName.ToLower()].As <MenuBool>().Enabled);

                    var bestAlly = bestAllies
                                   .FirstOrDefault(a =>
                                                   GameObjects.EnemyHeroes.Count(t =>
                                                                                 !Invulnerable.Check(t, DamageType.Magical, false) &&
                                                                                 t.IsValidTarget(SpellClass.R.Width - t.BoundingRadius - SpellClass.R.Delay * t.BoundingRadius, false, false, a.ServerPosition)) >= MenuClass.Spells["r"]["aoe"].As <MenuSliderBool>().Value);

                    if (bestAlly != null)
                    {
                        SpellClass.E.CastOnUnit(bestAlly);
                    }
                }

                /// <summary>
                ///     The E Combo Logic.
                /// </summary>
                if (MenuClass.Spells["e"]["combo"].As <MenuBool>().Enabled)
                {
                    var bestAllies = GameObjects.AllyHeroes
                                     .Where(a =>
                                            a.IsValidTarget(SpellClass.E.Range, true) &&
                                            MenuClass.Spells["e"]["combowhitelist"][a.ChampionName.ToLower()].As <MenuBool>().Enabled)
                                     .OrderBy(o => o.GetRealHealth());

                    foreach (var ally in bestAllies)
                    {
                        var allyToBallRectangle = new Geometry.Rectangle(
                            (Vector2)ally.ServerPosition,
                            (Vector2)ally.ServerPosition.Extend((Vector3)BallPosition, ally.Distance((Vector3)BallPosition) + 30f),
                            SpellClass.E.Width);

                        if (GameObjects.EnemyHeroes.Any(
                                t =>
                                t.IsValidTarget() &&
                                !Invulnerable.Check(t, DamageType.Magical) &&
                                allyToBallRectangle.IsInside((Vector2)t.ServerPosition)))
                        {
                            SpellClass.E.CastOnUnit(ally);
                            return;
                        }
                    }
                }
            }

            /// <summary>
            ///     The Combo Q Logic.
            /// </summary>
            if (SpellClass.Q.Ready &&
                MenuClass.Spells["q"]["combo"].As <MenuBool>().Enabled)
            {
                var bestTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.Q.Range);
                if (bestTarget != null)
                {
                    if (SpellClass.E.Ready &&
                        bestTarget.Distance((Vector3)BallPosition) >=
                        bestTarget.Distance(UtilityClass.Player) + 100f &&
                        MenuClass.E2["gaine"].As <MenuBool>().Enabled)
                    {
                        SpellClass.E.CastOnUnit(UtilityClass.Player);
                        return;
                    }

                    SpellClass.Q.GetPredictionInput(bestTarget).From = (Vector3)BallPosition;
                    SpellClass.Q.Cast(SpellClass.Q.GetPrediction(bestTarget).CastPosition);
                }
            }

            /// <summary>
            ///     The Speedup W Logic.
            /// </summary>
            if (SpellClass.W.Ready &&
                !UtilityClass.Player.HasBuff("orianahaste") &&
                MenuClass.Spells["w"]["customization"]["speedw"].As <MenuBool>().Enabled)
            {
                var bestTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.Q.Range + 300f);
                if (bestTarget.IsValidTarget(SpellClass.Q.Range) &&
                    !Invulnerable.Check(bestTarget, DamageType.Magical))
                {
                    if (UtilityClass.Player.Distance((Vector3)BallPosition) < SpellClass.W.Width)
                    {
                        SpellClass.W.Cast();
                    }
                }
            }
        }
        public static bool IRELIA_RCOMBO()
        {
            if (ObjectManager.Player.IsDead)
            {
                GetRPos1 = null;
                GetRPos2 = null;
                return(false);
            }

            if (!Irelia.R.IsReady() || !MenuSettings.RSettings.Rcombo.Enabled)
            {
                GetRPos1 = null;
                GetRPos2 = null;
                return(false);
            }

            var target = TargetSelector.GetTarget(1000);

            if (target == null || target.HasBuff("ireliamark"))
            {
                GetRPos1 = null;
                GetRPos2 = null;
                return(false);
            }
            var pred = FSpred.Prediction.Prediction.PredictUnitPosition(target, 600);

            if (pred.DistanceToPlayer() <= Irelia.R.Range)
            {
                if (target.HealthPercent <= MenuSettings.RSettings.Rheath.Value && pred.DistanceToPlayer() < Irelia.R.Range && target.IsValidTarget(Irelia.R.Range))
                {
                    if (Irelia.R.Cast(pred))
                    {
                        return(true);
                    }
                }
                GetRPos1 = new Geometry.Rectangle(ObjectManager.Player.Position, pred.ToVector3(), 110);
                GetRPos2 = new Geometry.Rectangle(pred, pred.Extend(ObjectManager.Player.Position, -450), 300);

                var TargetCount1 = GameObjects.EnemyHeroes.Where(i => GetRPos1.IsInside(i.Position)).Count();
                var TargetCount2 = GameObjects.EnemyHeroes.Where(i => GetRPos2.IsInside(i.Position) && !GameObjects.EnemyHeroes.Where(a => GetRPos1.IsInside(a.Position)).Any(h => i.NetworkId == h.NetworkId)).Count();

                if (TargetCount1 >= MenuSettings.RSettings.Rhit.Value ||
                    TargetCount2 >= MenuSettings.RSettings.Rhit.Value ||
                    TargetCount1 + TargetCount2 >= MenuSettings.RSettings.Rhit.Value
                    )
                {
                    if (pred.DistanceToPlayer() <= 980)
                    {
                        if (Irelia.R.Cast(pred))
                        {
                            return(true);
                        }
                    }
                }
            }
            else
            {
                GetRPos1 = null;
                GetRPos2 = null;
                return(false);
            }

            return(false);
        }
Beispiel #16
0
        public static void OnUpdate()
        {
            if (SpellConfig.E.Ready && !MenuConfig.LaneClear["EAA"].Enabled)
            {
                var minion = GameObjects.EnemyMinions.FirstOrDefault(x => x.IsValidTarget() && x.Distance(Global.Player) <= SpellConfig.E.Range && !x.HasBuff("YasuoDashWrapper"));

                if (!SpellConfig.E.Ready || minion == null || MenuConfig.LaneClear["Turret"].Enabled && minion.IsUnderEnemyTurret() || MenuConfig.LaneClear["Check"].Enabled && Global.Player.CountEnemyHeroesInRange(2000) != 0)
                {
                    return;
                }

                switch (MenuConfig.LaneClear["Mode"].Value)
                {
                case 1:

                    if (minion.Health > Global.Player.GetSpellDamage(minion, SpellSlot.E))
                    {
                        return;
                    }

                    SpellConfig.E.CastOnUnit(minion);
                    break;

                case 2:
                    SpellConfig.E.CastOnUnit(minion);
                    break;
                }
            }

            if (SpellConfig.Q.Ready)
            {
                switch (Extension.CurrentMode)
                {
                case Mode.Tornado:

                    var m = GameObjects.EnemyMinions.LastOrDefault(x => x.IsValidSpellTarget(SpellConfig.Q.Range));
                    if (m == null)
                    {
                        return;
                    }

                    var rect  = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), m.ServerPosition.To2D(), SpellConfig.Q.Width);
                    var count = GameObjects.EnemyMinions.Count(x => rect.IsInside(x.ServerPosition.To2D()));

                    if (MenuConfig.LaneClear["Q3"].Enabled && count >= 2)
                    {
                        SpellConfig.Q.Cast(m);
                    }
                    break;

                case Mode.Normal:
                    var nM = GameObjects.EnemyMinions.FirstOrDefault(x => x.IsValidSpellTarget(SpellConfig.Q.Range - 100));
                    if (nM == null)
                    {
                        return;
                    }
                    SpellConfig.Q.Cast(nM);
                    break;

                case Mode.DashingTornado:
                case Mode.Dashing:
                    var dashM = GameObjects.EnemyMinions.FirstOrDefault(x => x.IsValidSpellTarget(SpellConfig.Q.Range));
                    if (dashM == null || !dashM.IsValidTarget())
                    {
                        return;
                    }

                    var circle      = new Geometry.Circle(Global.Player.GetDashInfo().EndPos, 220);
                    var circleCount = GameObjects.EnemyMinions.Count(x => circle.Center.Distance(x.ServerPosition) <= circle.Radius);

                    if (circleCount >= 1)
                    {
                        SpellConfig.Q.Cast(dashM);
                    }
                    break;
                }
            }
        }