Пример #1
0
        public static void Insec()
        {
            #region Target, Slots, Prediction

            Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);

            var target = TargetSelector.GetTarget(Q.Range + 800, TargetSelector.DamageType.Physical);
            if (target != null)
            {
                target = TargetSelector.GetSelectedTarget() == null ? target : TargetSelector.SelectedTarget;
            }

            if (target == null)
            {
                return;
            }
            var qpred = Q.GetPrediction(target);

            var col = qpred.CollisionObjects;

            var slot = WardSorter.Wards();
            #endregion

            if (Player.Distance(target) > 500)
            {
                if (Q2() && Q.IsReady() && (R.IsReady() || Environment.TickCount - Lastr < 4000))
                {
                    if (CanQ2())
                    {
                        Utility.DelayAction.Add(400, () => Q.Cast());
                    }
                }
            }

            if (Q1() && Player.Distance(target) <= Q.Range)
            {
                OnUpdate.CastSpell(Q, target);
            }


            var poss = InsecPos.WardJumpInsecPosition.InsecPos(target, GetValue("fixedwardrange"), true);
            if (!GetBool("laggy", typeof(bool)))
            {
                var min =
                    SebbyLib.Cache.GetMinions(Player.Position, Q.Range)
                    .Where(
                        x => x.Health > Q.GetDamage(x) + 30 && !x.IsDead);

                foreach (var mins in min.Where(mins => mins.Distance(target) < 800 ||
                                               mins.Distance(poss.To3D()) < 530 ||
                                               (CanWardFlash(target) &&
                                                mins.Distance(target) < 600)).Where(mins => col.Count != 0))
                {
                    if (Q1() && Q.IsReady())
                    {
                        Q.Cast(mins);
                    }
                    if (Q1() && Q.IsReady())
                    {
                        Q.Cast(mins);
                    }

                    if (Q2() && mins.HasBuff("blindmonkqtwo"))
                    {
                        Q.Cast();
                    }
                }
            }


            if ((Steps == LeeSin.steps.WardJump || Environment.TickCount - Lastwardjump < 1500) && slot != null && W.IsReady() && R.IsReady())
            {
                if (GetValue("fixedwardrange") + Player.ServerPosition.Distance(target.ServerPosition) < 700 &&
                    Environment.TickCount - LastTeleported > 500)
                {
                    WardManager.WardJump.WardJumped(poss.To3D(), false, false);
                    LeeSin.Lastwardjumpd = Environment.TickCount;
                    Canwardflash         = false;
                }
                else if (CanWardFlash(target))
                {
                    Canwardflash = true;
                }
            }

            if (Environment.TickCount - Lastprocessw < 1500 || (Steps == LeeSin.steps.Flash && HasFlash()) ||
                Environment.TickCount - Lastwcasted < 1500 || Player.Distance(poss) < 50)
            {
                if (R.IsReady())
                {
                    R.Cast(target);
                }
            }

            if ((!W.IsReady() || W2()) && !GetBool("prioflash", typeof(bool)) &&
                Environment.TickCount - Lastwcasted > 1500 && LastQ(target))
            {
                Lastflashoverprio = Environment.TickCount;
                R.Cast(target);
            }
            #region Q Smite

            var prediction = Prediction.GetPrediction(target, Q.Delay);

            var collision = Q.GetCollision(Player.Position.To2D(),
                                           new List <Vector2> {
                prediction.UnitPosition.To2D()
            });

            foreach (var collisions in collision)
            {
                if (collision.Count == 1)
                {
                    if (collision[0].IsMinion && collision[0].IsEnemy)
                    {
                        if (GetBool("UseSmite", typeof(bool)))
                        {
                            if (Q.IsReady())
                            {
                                if (collision[0].Distance(Player) < 500)
                                {
                                    if (collision[0].Health <= ActiveModes.Smite.GetFuckingSmiteDamage() &&
                                        Smite.IsReady())
                                    {
                                        Q.Cast(prediction.CastPosition);
                                        Player.Spellbook.CastSpell(Smite, collision[0]);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            #endregion
            #region Determine if we want to flash or ward jump

            if (R.IsReady())
            {
                if (slot != null && (W.IsReady() || Environment.TickCount - Lastprocessw < 1500))
                {
                    if (GetBool("prioflash", typeof(bool)) && Player.GetSpellSlot("summonerflash").IsReady())
                    {
                        Steps = LeeSin.steps.Flash;
                        if (Environment.TickCount - Lastqcasted < 600)
                        {
                            Canwardflash = false;
                        }
                        else if (CanWardFlash(target))
                        {
                            Canwardflash = true;
                        }
                    }
                    else if (GetValue("fixedwardrange") + Player.ServerPosition.Distance(target.ServerPosition) < 900)
                    {
                        if (CanWardFlash(target))
                        {
                            Canwardflash = true;
                        }
                        Lastwardjump = Environment.TickCount;
                    }
                }
                else if (GetBool("useflash", typeof(bool)) && target.Distance(Player) < 400 &&
                         Player.GetSpellSlot("SummonerFlash").IsReady() && (slot == null || !W.IsReady() || W2()) &&
                         (Environment.TickCount - Lastwcasted > 2000 || Environment.TickCount - Lastprocessw > 2000))
                {
                    Steps = LeeSin.steps.Flash;
                }
            }

            var wardtotargetpos = Player.Position.Extend(target.Position, Player.Distance(target) - 150);

            if (!Canwardflash)
            {
                return;
            }
            if (Player.HasBuff("blindmonkqtwodash"))
            {
                return;
            }

            if (Player.Distance(target) < 350 || target.Distance(Player) > 900 ||
                Environment.TickCount - Lastq1Casted < 500 ||
                !CanWardFlash(target) || Environment.TickCount - LeeSin.Lsatcanjump1 < 3000 ||
                target.Buffs.Any(x => x.Name.ToLower().Contains("blindmonkqone")))
            {
                return;
            }



            if (!Checkno1(target))
            {
                return;
            }
            // if ( Q2()) return;
            //  if (!HasFlash()) return;
            if (LastQ(target) &&
                Environment.TickCount - LastTeleported > 500)
            {
                WardManager.WardJump.WardJumped(wardtotargetpos, true, false);
                Wardjumpedto       = Environment.TickCount;
                Wardjumpedtotarget = true;
                Lastflashward      = Environment.TickCount;
            }

            #endregion
        }
Пример #2
0
        public static void Combo()
        {
            #region R combos

            var unit =
                HeroManager.Enemies.Where(
                    x => x.Distance(Player) < 500 && !x.IsDead && x.IsValidTarget(500) && x.Health < R.GetDamage(x) + 50)
                .OrderBy(x => x.Distance(Player))
                .FirstOrDefault();
            if (unit != null)
            {
                foreach (var targets in
                         HeroManager.Enemies.Where(
                             x =>
                             !x.IsDead && x.IsValidTarget() && x.IsVisible && x.Distance(unit) < 1000 &&
                             x.Distance(unit) > 300 && x.NetworkId != unit.NetworkId && x.Health < R.GetDamage(x)))
                {
                    var prediction = Prediction.GetPrediction(targets, 0.1f);

                    var pos = prediction.UnitPosition.Extend(unit.ServerPosition,
                                                             prediction.UnitPosition.Distance(unit.ServerPosition) + 250);

                    RCombo = pos;

                    var slot = WardSorter.Wards();
                    if (unit.Distance(Player) > 500)
                    {
                        RCombo = null;
                    }

                    if (W.IsReady() && R.IsReady() && Player.ServerPosition.Distance(unit.ServerPosition) < 500 &&
                        slot != null)
                    {
                        WardJump.WardJumped(pos, false, true);
                    }
                }

                if (Player.IsDead)
                {
                    UltPoly            = null;
                    UltPolyExpectedPos = null;
                    return;
                }

                UltPoly = new Geometry.Polygon.Rectangle(Player.ServerPosition,
                                                         Player.ServerPosition.Extend(unit.Position, 1100), unit.BoundingRadius + 30);

                var counts =
                    HeroManager.Enemies.Where(
                        x => x.Distance(Player) < 1100 && x.IsValidTarget(1100) && x.Health < R.GetDamage(x))
                    .Count(h => h.NetworkId != unit.NetworkId && UltPoly.IsInside(h.ServerPosition));

                if (counts >= 1 && R.IsReady() && Created && R.IsReady())
                {
                    R.Cast(unit);
                }
            }

            #endregion

            #region Regular combo

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
            if (target == null)
            {
                return;
            }

            var useq  = GetBool("useq", typeof(bool));
            var usee  = GetBool("usee", typeof(bool));
            var user  = GetBool("user", typeof(bool));
            var usew  = GetBool("wardjumpcombo", typeof(bool));
            var smite = GetBool("usessmite", typeof(bool));
            if (GetStringValue("hydrati") == 0 || GetStringValue("hydrati") == 2)
            {
                if (target.IsValidTarget(400) && (ItemReady(Tiamat) || ItemReady(Hydra)) &&
                    (HasItem(Tiamat) || HasItem(Hydra)))
                {
                    SelfCast(HasItem(Hydra) ? Hydra : Tiamat);
                }
            }

            if (GetBool("youm", typeof(bool)) && HasItem(Youm) && ItemReady(Youm) &&
                target.Distance(Player) < Q.Range - 300)
            {
                SelfCast(Youm);
            }

            if (GetBool("omen", typeof(bool)) && HasItem(Omen) && ItemReady(Omen) &&
                Player.CountAlliesInRange(400) >= GetValue("minrand"))
            {
                SelfCast(Omen);
            }
            if (usew)
            {
                if (Environment.TickCount - Lastqc > 300 && Environment.TickCount - Laste > 300 &&
                    Environment.TickCount - Lastwcombo > 300)
                {
                    if (W.IsReady() && target.Distance(Player) <= Player.AttackRange && W1())
                    {
                        W.Cast(Player);
                        Lastwcombo = Environment.TickCount;
                    }

                    if (W.IsReady() && target.Distance(Player) <= Player.AttackRange && W2() && !HasPassive())
                    {
                        W.Cast();
                    }
                }
            }

            if (useq)
            {
                if (Environment.TickCount - Lastqc > 300 && Environment.TickCount - Laste > 300 && Environment.TickCount - Lastwcombo > 300)
                {
                    var qpred = Q.GetPrediction(target);
                    if (Q.IsReady() && Q1())
                    {
                        OnUpdate.CastSpell(Q, target);
                        Lastqc = Environment.TickCount;
                    }

                    if (Q2() && Q.IsReady() && GetBool("useq2", typeof(bool)))
                    {
                        LeagueSharp.Common.Utility.DelayAction.Add(GetValue("secondqdelay"), () => Q.Cast());
                        Lastqc = Environment.TickCount;
                    }
                }
            }

            if (usee)
            {
                if (target.Distance(Player) <= E.Range && E1())
                {
                    E.Cast();
                    Laste = Environment.TickCount;
                }
                if ((Player.Distance(target) >
                     Player.AttackRange + Player.BoundingRadius + target.BoundingRadius + 100 ||
                     Environment.TickCount - Laste > 2300) && E2())
                {
                    E.Cast();
                    Laste = Environment.TickCount;
                }
            }

            if (user && target.IsValidTarget(R.Range) && R.IsReady())
            {
                if (Q.GetDamage(target) + 70 < target.Health)
                {
                    // Chat.Print("firstcheck");
                    if (target.Health > Player.GetAutoAttackDamage(target) + 30)
                    {
                        //   Chat.Print("secondCheck");
                        if (Q.IsReady() &&
                            target.Health <=
                            R.GetDamage(target) + GetQDamage(target) + Player.GetAutoAttackDamage(target) &&
                            Q.IsReady() && target.Health > GetQDamage(target))
                        {
                            R.Cast(target);
                        }

                        if (target.Health <= R.GetDamage(target) + Q.GetDamage(target) && Q.IsReady() &&
                            Player.Mana > 30)
                        {
                            R.Cast(target);
                        }
                    }
                }
            }


            if (Smite.IsReady() && target.Distance(Player) < 500 && smite && target.Health < ActiveModes.Smite.GetFuckingSmiteDamage())
            {
                Player.Spellbook.CastSpell(Smite, target);
            }

            var poss = Player.ServerPosition.Extend(target.ServerPosition, 600);
            if (!GetBool("wardjumpcombo1", typeof(bool)))
            {
                return;
            }

            if (!E.IsReady() || !W.IsReady() || !(target.Distance(Player) > E.Range) || !LastQ(target))
            {
                return;
            }
            if (!Q.IsReady() && Environment.TickCount - Q.LastCastAttemptT > 1000)
            {
                WardManager.WardJump.WardJumped(poss, true, true);
            }

            #endregion
        }