Beispiel #1
0
        public static void Routine()
        {
            var targetR = TargetSelector.GetTarget(R1.Range, TargetSelector.DamageType.Magical);
            var target  = TargetSelector.GetTarget(Q1.Range, TargetSelector.DamageType.Magical);

            if (target == null || !target.IsValid || targetR == null || !targetR.IsValid)
            {
                return;
            }

            Ignite = player.GetSpellSlot("summonerdot");

            //[R] Aoe Cast
            byte hitcount;

            hitcount = (byte)Config.Item("advanced.R.aoe.count").GetValue <Slider>().Value;

            if (Config.Item("advanced.R.aoe").GetValue <bool>() && R1.IsReady() && !E1.IsReady() && target.IsValidTarget(E1.Range + E1.Width))
            {
                R1.CastIfWillHit(target, hitcount);
            }

            #region -- Variables/Floats etc.
            float qdmg    = Q1.GetDamage(target);
            float edmg    = E1.GetDamage(target);
            float rdmg    = R1.GetDamage(target);
            float aa      = (float)Player.GetAutoAttackDamage(target);
            var   insideE = Lux_E != null && target.Distance(Lux_E.Position) <= E1.Width;
            var   thp     = target.Health;
            var   AArange = Orbwalking.GetRealAutoAttackRange(player);
            var   debuff  = target.HasBuff("luxilluminatingfraulein");
            if (debuff)
            {
                rdmg += PassiveDMG(target);
            }
            if (debuff)
            {
                aa += PassiveDMG(target);
            }
            if (insideE)
            {
                rdmg += edmg;
            }
            var rooted = target.HasBuff("LuxLightBindingMis");
            #endregion


            if (insideE && thp < edmg && target.IsValidTarget(R1.Range))
            {
                return;
            }

            if (rooted && insideE && rdmg + edmg > thp && target.IsValidTarget(R1.Range))
            {
                SpellCastR(targetR);
            }

            #region -- Q spellcast

            var prediction = Q1.GetPrediction(target, true);
            var collision  = Q1.GetCollision(Player.Position.To2D(), new List <Vector2> {
                prediction.UnitPosition.To2D()
            });
            if (Config.Item("combo.Q").GetValue <bool>() &&
                Environment.TickCount - E1.LastCastAttemptT > 400 && Environment.TickCount - R1.LastCastAttemptT > 800 && prediction.Hitchance >= PredQ("prediction.Q"))
            {
                if (collision.Count == 2)
                {
                    if (collision[0].IsChampion() || collision[1].IsChampion())
                    {
                        Q1.Cast(prediction.CastPosition);
                    }
                }
                else if (collision.Count == 1 && collision[0].IsChampion())
                {
                    Q1.Cast(prediction.CastPosition);
                }
                else if (collision.Count <= 1)
                {
                    Q1.Cast(prediction.CastPosition);
                }
                #endregion -- Q spellcast end


                if (rooted && thp < aa && target.IsValidTarget(AArange))
                {
                    return;
                }

                if (Config.Item("combo.E").GetValue <bool>() && Environment.TickCount - Q1.LastCastAttemptT > 875 && Environment.TickCount - R1.LastCastAttemptT > 800)
                {
                    SpellCast(target, E1.Range, E1, false, 1, true, PredE("prediction.E"));
                }

                if (IgniteKillCheck() < thp && target.HasBuff("summonerdot"))
                {
                    return;
                }

                if (Config.Item("combo.R").GetValue <bool>() && R1.IsReady())
                {
                    SpellCastR(targetR);
                }

                if (!target.IsValidTarget(600))
                {
                    return;
                }

                var ignitemenu = Config.Item("autospells.ignite").GetValue <bool>();

                if (thp > IgniteDamage(target) && thp < IgniteDamage(target) + edmg + aa && rooted && E1.IsReady() && target.IsValidTarget(600) && Ignite.IsReady() && ignitemenu)
                {
                    player.Spellbook.CastSpell(Ignite, target);
                    Printchat("Ignite casted");
                }

                if (thp < IgniteDamage(target) + rdmg + aa && rooted && Ignite.IsReady() && R1.IsReady() && ignitemenu)
                {
                    player.Spellbook.CastSpell(Ignite, target);
                    Printchat("Ignite casted");
                }

                if (thp < IgniteDamage(target) + rdmg + aa && Ignite.IsReady() && R1.IsReady() && ignitemenu)
                {
                    player.Spellbook.CastSpell(Ignite, target);
                    Printchat("Ignite casted");
                }

                if (thp < IgniteDamage(target) && target.IsValidTarget(600) && AllyCheck(target, 600) < 1 && Ignite.IsReady() && ignitemenu)
                {
                    player.Spellbook.CastSpell(Ignite, target);
                    Printchat("Ignite casted");
                }
            }
        }