public static void InsecCombo(Obj_AI_Hero target)
        {
            if (target == null)
            {
                return;
            }

            if (ObjectManager.Player.Distance(GetInsecPos(target)) < 200)
            {
                insecComboStep = InsecComboStepSelect.Pressr;
            }
            else if ((insecComboStep == InsecComboStepSelect.None)
                     && (GetInsecPos(target).Distance(ObjectManager.Player.Position) < 600))
            {
                insecComboStep = InsecComboStepSelect.Wgapclose;
            }
            else if ((insecComboStep == InsecComboStepSelect.None)
                     && (target.Distance(ObjectManager.Player) < LeeSin.spells[LeeSin.Spells.Q].Range))
            {
                insecComboStep = InsecComboStepSelect.Qgapclose;
            }

            switch (insecComboStep)
            {
                case InsecComboStepSelect.Qgapclose:
                    if (Misc.IsQOne)
                    {
                        var pred1 = LeeSin.spells[LeeSin.Spells.Q].GetPrediction(target);
                        if (pred1.Hitchance >= HitChance.High)
                        {
                            LeeSin.CastQ(target, Misc.GetMenuItem("ElLeeSin.Smite.Q"));
                        }

                        if (!Misc.GetMenuItem("checkOthers2"))
                        {
                            return;
                        }

                        var insectObjects =
                            HeroManager.Enemies.Where(
                                    x =>
                                        x.IsValidTarget(LeeSin.spells[LeeSin.Spells.Q].Range) && !x.Compare(target)
                                        && (LeeSin.spells[LeeSin.Spells.Q].GetHealthPrediction(x)
                                            > LeeSin.spells[LeeSin.Spells.Q].GetDamage(x))
                                        && (x.Distance(target) < target.DistanceToPlayer()) && (x.Distance(target) < 750))
                                .Concat(
                                    MinionManager.GetMinions(
                                        ObjectManager.Player.ServerPosition,
                                        LeeSin.spells[LeeSin.Spells.Q].Range,
                                        MinionTypes.All,
                                        MinionTeam.NotAlly))
                                .Where(
                                    m =>
                                        m.IsValidTarget(LeeSin.spells[LeeSin.Spells.Q].Range)
                                        && LeeSin.spells[LeeSin.Spells.Q].GetHealthPrediction(m)
                                        > LeeSin.spells[LeeSin.Spells.Q].GetDamage(m) && m.Distance(target) < 400f)
                                .OrderBy(i => i.Distance(target))
                                .FirstOrDefault();

                        if (insectObjects == null)
                        {
                            return;
                        }

                        LeeSin.spells[LeeSin.Spells.Q].Cast(insectObjects);
                    }

                    if (!target.HasQBuff() && Misc.IsQOne)
                    {
                        LeeSin.CastQ(target, Misc.GetMenuItem("ElLeeSin.Smite.Q"));
                    }
                    else if (target.HasQBuff())
                    {
                        LeeSin.spells[LeeSin.Spells.Q].Cast();
                        insecComboStep = InsecComboStepSelect.Wgapclose;
                    }
                    else
                    {
                        if (LeeSin.spells[LeeSin.Spells.Q].Instance.Name.Equals(
                                "blindmonkqtwo",
                                StringComparison.InvariantCultureIgnoreCase)
                            && (Misc.ReturnQBuff()?.Distance(target) <= 600))
                        {
                            LeeSin.spells[LeeSin.Spells.Q].Cast();
                        }
                    }
                    break;

                case InsecComboStepSelect.Wgapclose:

                    if (ObjectManager.Player.Distance(target) < WardRange)
                    {
                        Wardmanager.WardJump(GetInsecPos(target), false, true, true);

                        if ((Wardmanager.FindBestWardItem() == null) && LeeSin.spells[LeeSin.Spells.R].IsReady()
                            && Misc.GetMenuItem("ElLeeSin.Flash.Insec")
                            && (ObjectManager.Player.Spellbook.CanUseSpell(LeeSin.flashSlot) == SpellState.Ready))
                        {
                            if (((GetInsecPos(target).Distance(ObjectManager.Player.Position) < FlashRange)
                                 && (Wardmanager.LastWard + 1000 < Environment.TickCount)) || !LeeSin.spells[LeeSin.Spells.W].IsReady())
                            {
                                ObjectManager.Player.Spellbook.CastSpell(LeeSin.flashSlot, GetInsecPos(target));
                            }
                        }
                    }
                    else if (ObjectManager.Player.Distance(target) < Misc.WardFlashRange)
                    {
                        Wardmanager.WardJump(target.Position);

                        if (LeeSin.spells[LeeSin.Spells.R].IsReady() && Misc.GetMenuItem("ElLeeSin.Flash.Insec")
                            && (ObjectManager.Player.Spellbook.CanUseSpell(LeeSin.flashSlot) == SpellState.Ready))
                        {
                            if (ObjectManager.Player.Distance(target) < FlashRange - 25)
                            {
                                if ((Wardmanager.FindBestWardItem() == null) || (Wardmanager.LastWard + 1000 < Environment.TickCount))
                                {
                                    ObjectManager.Player.Spellbook.CastSpell(LeeSin.flashSlot, GetInsecPos(target));
                                }
                            }
                        }
                    }
                    break;

                case InsecComboStepSelect.Pressr:
                    LeeSin.spells[LeeSin.Spells.R].CastOnUnit(target);
                    break;
            }
        }
Example #2
0
        private static void InsecCombo(Obj_AI_Hero target)
        {
            if (target != null && target.IsVisible)
            {
                if (Player.Distance(GetInsecPos(target)) < 200)
                {
                    insecComboStep = InsecComboStepSelect.Pressr;
                }
                else if (insecComboStep == InsecComboStepSelect.None
                         && GetInsecPos(target).Distance(Player.Position) < 600)
                {
                    insecComboStep = InsecComboStepSelect.Wgapclose;
                }
                else if (insecComboStep == InsecComboStepSelect.None
                         && target.Distance(Player) < spells[Spells.Q].Range)
                {
                    insecComboStep = InsecComboStepSelect.Qgapclose;
                }

                switch (insecComboStep)
                {
                    case InsecComboStepSelect.Qgapclose:

                        if (!(target.HasQBuff()) && QState)
                        {
                            if (ParamBool("checkOthers"))
                            {
                                foreach (var insecMinion in
                                    ObjectManager.Get<Obj_AI_Minion>()
                                        .Where(
                                            x =>
                                            x.Health > spells[Spells.Q].GetDamage(x) && x.IsValidTarget()
                                            && x.Distance(GetInsecPos(target)) < 0x1c2)
                                        .ToList())
                                {
                                    spells[Spells.Q].Cast(insecMinion);
                                }

                                /*foreach (var insecEnemy in ObjectManager.Get<Obj_AI_Hero>()
                                  .Where(
                                      x =>
                                      x.Health > spells[Spells.Q].GetDamage(x) && x.IsValidTarget()
                                      && x.Distance(GetInsecPos(target)) < 0x1c2)
                                  .ToList())
                                {
                                    spells[Spells.Q].Cast(insecEnemy);
                                }*/
                            }

                            CastQ(target, ParamBool("qSmite"));
                        }

                        else if (target.HasQBuff())
                        {
                            spells[Spells.Q].Cast();
                            insecComboStep = InsecComboStepSelect.Wgapclose;
                        }
                        else
                        {
                            if (spells[Spells.Q].Instance.Name == "blindmonkqtwo"
                                && ReturnQBuff().Distance(target) <= 600)
                            {
                                spells[Spells.Q].Cast();
                            }
                        }
                        break;

                    case InsecComboStepSelect.Wgapclose:
                        if (Player.Distance(target) < 600)
                        {
                            if (FindBestWardItem() == null && GetInsecPos(target).Distance(Player.Position) < 400)
                            {
                                if (spells[Spells.R].IsReady()
                                    && Player.Spellbook.CanUseSpell(flashSlot) == SpellState.Ready
                                    && ParamBool("flashInsec") && LastWard + 1000 < Environment.TickCount)
                                {
                                    Player.Spellbook.CastSpell(flashSlot, GetInsecPos(target));
                                    return;
                                }
                            }
                            WardJump(GetInsecPos(target), false, false, true);
                        }

                        if (Player.Distance(GetInsecPos(target)) < 200)
                        {
                            spells[Spells.R].Cast(target);
                        }
                        break;

                    case InsecComboStepSelect.Pressr:
                        spells[Spells.R].CastOnUnit(target);
                        break;
                }
            }
        }
Example #3
0
        private static void InsecCombo(Obj_AI_Hero target)
        {
            if (target != null && target.IsVisible)
            {
                if (Player.Distance(GetInsecPos(target)) < 250)
                {
                    insecComboStep = InsecComboStepSelect.Pressr;
                }
                else if (insecComboStep == InsecComboStepSelect.None
                         && GetInsecPos(target).Distance(Player.Position) < 600)
                {
                    insecComboStep = InsecComboStepSelect.Wgapclose;
                }
                else if (insecComboStep == InsecComboStepSelect.None
                         && target.Distance(Player) < spells[Spells.Q].Range)
                {
                    insecComboStep = InsecComboStepSelect.Qgapclose;
                }

                switch (insecComboStep)
                {
                    case InsecComboStepSelect.Qgapclose:

                        var prediction = spells[Spells.Q].GetPrediction(target);

                        if (prediction.CollisionObjects.Count > 1 && ParamBool("checkOthers1") && !(target.HasQBuff())
                            && QState && spells[Spells.Q].IsReady())
                        {
                            var insMinion = GetInsecMinion(target);
                            if (insMinion != null && spells[Spells.Q].IsReady()
                                && spells[Spells.Q].GetDamage(insMinion) < insMinion.Health + 10)
                            {
                                spells[Spells.Q].Cast(insMinion);
                            }
                        }

                        if (!(target.HasQBuff()) && QState)
                        {
                            CastQ(target, ParamBool("qSmite"));
                        }
                        else if (target.HasQBuff())
                        {
                            spells[Spells.Q].Cast();
                            insecComboStep = InsecComboStepSelect.Wgapclose;
                        }
                        else
                        {
                            if (spells[Spells.Q].Instance.Name == "blindmonkqtwo"
                                && ReturnQBuff().Distance(target) <= 600)
                            {
                                spells[Spells.Q].Cast();
                            }
                        }
                        break;

                    case InsecComboStepSelect.Wgapclose:
                        if (Player.Distance(target) < 600)
                        {
                            if (FindBestWardItem() == null && GetInsecPos(target).Distance(Player.Position) < 500)
                            {
                                if (spells[Spells.R].IsReady()
                                    && Player.Spellbook.CanUseSpell(flashSlot) == SpellState.Ready
                                    && ParamBool("flashInsec")) //&& LastWard + 1000 < Environment.TickCount
                                {
                                    Player.Spellbook.CastSpell(flashSlot, GetInsecPos(target));
                                    return;
                                }
                            }
                            WardJump(GetInsecPos(target), false, false, true);
                        }

                        if (Player.Distance(GetInsecPos(target)) < 200)
                        {
                            spells[Spells.R].Cast(target);
                        }
                        break;

                    case InsecComboStepSelect.Pressr:
                        spells[Spells.R].CastOnUnit(target);
                        break;
                }
            }
        }