Esempio n. 1
0
        private static void Grab(bool enable)
        {
            if (Q.IsReady() && enable)
            {
                var QT = TargetSelector.GetTarget(Root.Item("maxq").GetValue <Slider>().Value, TargetSelector.DamageType.Magical);
                if (QT != null && Root.Item("blq" + QT.ChampionName).GetValue <bool>())
                {
                    return;
                }

                if (!(Player.HealthPercent < Root.Item("grabhp").GetValue <Slider>().Value))
                {
                    if (QT.IsValidTarget() && QT.Distance(Player.ServerPosition) > Root.Item("minq").GetValue <Slider>().Value)
                    {
                        if (!QT.IsZombie && !TargetSelector.IsInvulnerable(QT, TargetSelector.DamageType.Magical))
                        {
                            var poutput = Q.GetPrediction(QT); // prediction output
                            if (Utils.GameTimeTickCount - LastFlash < 1500)
                            {
                                if (poutput.Hitchance == (HitChance)Root.Item("fpred").GetValue <Slider>().Value + 2)
                                {
                                    Q.Cast(poutput.CastPosition);
                                }
                            }

                            if (poutput.Hitchance == (HitChance)Root.Item("pred").GetValue <Slider>().Value + 2)
                            {
                                Q.Cast(poutput.CastPosition);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private static void Secure(bool useq, bool user)
        {
            if (useq && Q.IsReady())
            {
                var QT = HeroManager.Enemies.FirstOrDefault(x => Q.GetDamage(x) > x.Health);
                if (QT.IsValidTarget(Root.Item("maxq").GetValue <Slider>().Value))
                {
                    var poutput = Q.GetPrediction(QT); // prediction output
                    if (poutput.Hitchance >= (HitChance)Root.Item("pred").GetValue <Slider>().Value + 2)
                    {
                        if (!QT.IsZombie && !TargetSelector.IsInvulnerable(QT, TargetSelector.DamageType.Magical))
                        {
                            Q.Cast(poutput.CastPosition);
                        }
                    }
                }
            }

            if (user && R.IsReady())
            {
                var RT = HeroManager.Enemies.FirstOrDefault(x => R.GetDamage(x) > x.Health);
                if (RT.IsValidTarget(R.Range) && !RT.IsZombie)
                {
                    if (!TargetSelector.IsInvulnerable(RT, TargetSelector.DamageType.Magical))
                    {
                        R.Cast();
                    }
                }
            }
        }
Esempio n. 3
0
        private static void Combo(bool useq, bool usee, bool user)
        {
            if (!Root.Item("usecombo").GetValue <KeyBind>().Active)
            {
                return;
            }

            if (useq && Q.IsReady())
            {
                var QT = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
                if (QT != null && Root.Item("blq" + QT.ChampionName).GetValue <bool>())
                {
                    return;
                }

                if (QT.IsValidTarget() && QT.Distance(Player.ServerPosition) > E.Range + 325)
                {
                    var poutput = Q.GetPrediction(QT); // prediction output
                    if (poutput.Hitchance >= (HitChance)Root.Item("pred").GetValue <Slider>().Value + 2 ||
                        poutput.Hitchance >= (HitChance)Root.Item("fpred").GetValue <Slider>().Value + 2 &&
                        Utils.GameTimeTickCount - LastFlash < 1500)
                    {
                        if (!QT.IsZombie && !TargetSelector.IsInvulnerable(QT, TargetSelector.DamageType.Magical))
                        {
                            Q.Cast(poutput.CastPosition);
                        }
                    }
                }
            }

            if (usee && E.IsReady())
            {
                var ET =
                    HeroManager.Enemies.FirstOrDefault(
                        x => x.HasBuff("rocketgrab2") || x.Distance(Player.ServerPosition) <= E.Range + 200);

                if (ET.IsValidTarget())
                {
                    if (!ET.IsZombie && !TargetSelector.IsInvulnerable(ET, TargetSelector.DamageType.Magical))
                    {
                        E.Cast();
                    }
                }
            }

            if (user && R.IsReady())
            {
                var RT = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);
                if (RT.IsValidTarget() && !RT.IsZombie)
                {
                    if (!TargetSelector.IsInvulnerable(RT, TargetSelector.DamageType.Magical))
                    {
                        if (RT.Health > R.GetDamage(RT) && !E.IsReady() && RT.HasBuffOfType(BuffType.Knockup))
                        {
                            R.Cast();
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        protected override Obj_AI_Hero SelectTarget()
        {
            var  target       = base.SelectTarget();
            var  valid        = target.IsValidTarget();
            bool invulnerable = false;

            if (valid)
            {
                invulnerable = TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Magical);
            }

            if (!valid || target.IsBehindWindWall() || invulnerable)
            {
                var newTarget = HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(TargetRange) && !enemy.IsBehindWindWall() && !TargetSelector.IsInvulnerable(enemy, TargetSelector.DamageType.Magical)).MaxOrDefault(TargetSelector.GetPriority);
                if (newTarget != null)
                {
                    target = newTarget;
                }
            }

            //if (EnablePoisonTargetSelection && target.IsValidTarget() && !target.IsPoisoned())
            //{
            //    var newTarget = HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(TargetRange) && !enemy.IsBehindWindWall() && enemy.IsPoisoned() && !TargetSelector.IsInvulnerable(enemy, TargetSelector.DamageType.Magical)).MaxOrDefault(TargetSelector.GetPriority);
            //    if (newTarget != null && TargetSelector.GetPriority(target) - TargetSelector.GetPriority(newTarget) < 0.5f)
            //        return newTarget;
            //}

            return(target);
        }
Esempio n. 5
0
        private static Obj_AI_Hero GetTargetNearMouse(float distance)
        {
            Obj_AI_Hero bestTarget = null;
            var         bestRatio  = 0f;

            if (TargetSelector.SelectedTarget.IsValidTarget() && !TargetSelector.IsInvulnerable(TargetSelector.SelectedTarget, TargetSelector.DamageType.Magical, true) &&
                (Game.CursorPos.Distance(TargetSelector.SelectedTarget.ServerPosition) < distance && ObjectManager.Player.Distance(TargetSelector.SelectedTarget) < R.Range))
            {
                return(TargetSelector.SelectedTarget);
            }

            foreach (var hero in ObjectManager.Get <Obj_AI_Hero>())
            {
                if (!hero.IsValidTarget(R.Range) || TargetSelector.IsInvulnerable(hero, TargetSelector.DamageType.Magical, true) || Game.CursorPos.Distance(hero.ServerPosition) > distance)
                {
                    continue;
                }

                var damage = (float)ObjectManager.Player.CalcDamage(hero, Damage.DamageType.Magical, 100);
                var ratio  = damage / (1 + hero.Health) * TargetSelector.GetPriority(hero);

                if (ratio > bestRatio)
                {
                    bestRatio  = ratio;
                    bestTarget = hero;
                }
            }

            return(bestTarget);
        }
Esempio n. 6
0
        public static bool IsNotInvulnerable(Obj_AI_Base target)
        {
            var TSInvulnerable = TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Physical, false);
            var invulnerable   = (target.IsInvulnerable);

            return(!invulnerable && !TSInvulnerable);
        }
Esempio n. 7
0
        internal static bool CanQ(Obj_AI_Base unit)
        {
            if (!unit.IsValidTarget() || unit.IsZombie ||
                TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.Physical))
            {
                return(false);
            }

            if (KL.Player.Distance(unit.ServerPosition) < 175)
            {
                return(false);
            }

            if (KL.Spellbook["R"].IsReady() &&
                KL.Player.Mana - QCost[KL.Spellbook["Q"].Level - 1] < RCost[KL.Spellbook["R"].Level - 1])
            {
                return(false);
            }

            if (KL.Spellbook["W"].IsReady() && KL.WDmg(unit) >= unit.Health &&
                unit.Distance(KL.Player.ServerPosition) <= 200)
            {
                return(false);
            }

            if (Utils.GameTimeTickCount - LastGrabTimeStamp < 250)
            {
                return(false);
            }

            if (KL.Spellbook["W"].IsReady() && KL.Player.HasBuff("DariusNoxonTactictsONH") &&
                unit.Distance(KL.Player.ServerPosition) <= 205)
            {
                return(false);
            }

            if (KL.Player.Distance(unit.ServerPosition) > KL.Spellbook["Q"].Range)
            {
                return(false);
            }

            if (KL.Spellbook["R"].IsReady() && unit.Distance(KL.Player.ServerPosition) <= 460 &&
                KL.RDmg(unit, PassiveCount(unit)) - KL.Hemorrhage(unit, 1) >= unit.Health)
            {
                return(false);
            }

            if (KL.Player.GetAutoAttackDamage(unit) * 2 + KL.Hemorrhage(unit, PassiveCount(unit)) >= unit.Health)
            {
                if (KL.Player.Distance(unit.ServerPosition) <= 180)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 8
0
        public static Obj_AI_Hero GetTarget(float range)
        {
            var target = TargetSelector.GetTarget(range, TargetSelector.DamageType.Magical);

            return(target.IsValidTarget(range) &&
                   !TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Magical, false)
                ? target
                : null);
        }
Esempio n. 9
0
        protected override AIHeroClient SelectTarget()
        {
            var target = base.SelectTarget();

            if (target.IsValidTarget() && TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Physical))
            {
                return(HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(TargetRange) && !enemy.IsBehindWindWall() && !TargetSelector.IsInvulnerable(enemy, TargetSelector.DamageType.Physical)).MaxOrDefault(TargetSelector.GetPriority));
            }
            return(target);
        }
Esempio n. 10
0
        internal static void Game_OnUpdate(EventArgs args)
        {
            if (KL.Spellbook["R"].IsReady() && Config.Item("ksr").GetValue <bool>())
            {
                foreach (var unit in HeroManager.Enemies.Where(ene => ene.IsValidTarget(KL.Spellbook["R"].Range) && !ene.IsZombie))
                {
                    if (unit.CountEnemiesInRange(1200) <= 1 && Config.Item("ksr1").GetValue <bool>())
                    {
                        if (KL.RDmg(unit, PassiveCount(unit)) + RModifier +
                            KL.Hemorrhage(unit, PassiveCount(unit) - 1) >= unit.Health + MordeShield(unit))
                        {
                            if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                            {
                                if (!unit.HasBuff("kindredrnodeathbuff"))
                                {
                                    KL.Spellbook["R"].CastOnUnit(unit);
                                }
                            }
                        }
                    }

                    if (KL.RDmg(unit, PassiveCount(unit)) + RModifier >= unit.Health +
                        KL.Hemorrhage(unit, 1) + MordeShield(unit))
                    {
                        if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                        {
                            if (!unit.HasBuff("kindredrnodeathbuff"))
                            {
                                KL.Spellbook["R"].CastOnUnit(unit);
                            }
                        }
                    }
                }
            }

            if (Config.Item("useca").GetValue <KeyBind>().Active)
            {
                Combo(Config.Item("useq").GetValue <bool>(), Config.Item("usew").GetValue <bool>(),
                      Config.Item("usee").GetValue <bool>(), Config.Item("user").GetValue <bool>());
            }

            if (Config.Item("useha").GetValue <KeyBind>().Active)
            {
                Harass();
            }

            if (Config.Item("caste").GetValue <KeyBind>().Active)
            {
                Orbwalking.Orbwalk(null, Game.CursorPos);
                Combo(false, false, true, false);
            }
        }
Esempio n. 11
0
        /// <summary>
        ///     <c>OnCombo</c> subscribed orb walker function.
        /// </summary>
        public override void OnCombo()
        {
            /*if (this.GetItemValue<bool>("com.iseries.tristana.combo.useE") && this.spells[SpellSlot.E].IsReady())
             * {
             *  var target = TargetSelector.GetTarget(
             *      this.spells[SpellSlot.E].Range,
             *      TargetSelector.DamageType.Physical);
             *
             *  if (target.IsValidTarget(this.spells[SpellSlot.E].Range))
             *  {
             *      this.spells[SpellSlot.E].CastOnUnit(target);
             *  }
             * }*/
            if (this.GetItemValue <bool>("com.iseries.tristana.combo.useR") && this.spells[SpellSlot.R].IsReady())
            {
                var target =
                    HeroManager.Enemies.FirstOrDefault(
                        x =>
                        x.Health + 10 <= this.spells[SpellSlot.R].GetDamage(x) &&
                        x.IsValidTarget(this.spells[SpellSlot.R].Range) && !x.HasBuffOfType(BuffType.Invulnerability) &&
                        !x.HasBuffOfType(BuffType.SpellShield) && !x.IsInvulnerable);

                if (target != null && !TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Magical, false))
                {
                    this.spells[SpellSlot.R].CastOnUnit(target);
                }
            }

            if (this.GetItemValue <bool>("com.iseries.tristana.misc.useRE") && this.spells[SpellSlot.R].IsReady())
            {
                var target = TargetSelector.GetTarget(
                    this.spells[SpellSlot.R].Range,
                    TargetSelector.DamageType.Physical);
                var stacks = target.GetBuffCount("tristanaecharge");

                var totalDamage = this.spells[SpellSlot.E].GetDamage(target) * (0.30 * stacks) + this.GetActualRDamage(target);

                if (target.IsValidTarget(this.spells[SpellSlot.R].Range) &&
                    !TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Magical, false) &&
                    !target.IsInvulnerable && totalDamage > target.Health + 10 &&
                    !target.HasBuffOfType(BuffType.SpellShield))
                {
                    this.spells[SpellSlot.R].CastOnUnit(target);
                }
            }
        }
Esempio n. 12
0
        internal static void Game_OnUpdate(EventArgs args)
        {
            Rmodi = Config.Item("rmodi").GetValue <Slider>().Value;

            if (KL.Spellbook["R"].IsReady() && Config.Item("ksr").GetValue <bool>())
            {
                foreach (var unit in HeroManager.Enemies.Where(ene => ene.IsValidTarget(KL.Spellbook["R"].Range) && !ene.IsZombie))
                {
                    if (unit.CountEnemiesInRange(1200) <= 1 && Config.Item("ksr1").GetValue <bool>())
                    {
                        if (KL.RDmg(unit, PassiveCount(unit)) + Rmodi + KL.Hemorrhage(unit, PassiveCount(unit)) >= unit.Health)
                        {
                            if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                            {
                                KL.Spellbook["R"].CastOnUnit(unit);
                            }
                        }
                    }

                    if (KL.RDmg(unit, PassiveCount(unit)) + Rmodi >= unit.Health + KL.Hemorrhage(unit, 1))
                    {
                        if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                        {
                            KL.Spellbook["R"].CastOnUnit(unit);
                        }
                    }
                }
            }

            switch (Orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo(Config.Item("useq").GetValue <bool>(), Config.Item("usew").GetValue <bool>(),
                      Config.Item("usee").GetValue <bool>(), Config.Item("user").GetValue <bool>());
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;
            }
        }
Esempio n. 13
0
        internal static bool CanR(Obj_AI_Hero unit)
        {
            if (Me.HealthPercent <= 35 && unit.Distance(Me.ServerPosition) <= Me.AttackRange + 65)
            {
                return(true);
            }

            if (unit.IsZombie || TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.Physical))
            {
                return(false);
            }

            if (unit.CountAlliesInRange(400) >= 2 &&
                Me.GetAutoAttackDamage(unit, true) * 6 >= unit.Health)
            {
                return(false);
            }

            if (Orbwalking.InAutoAttackRange(unit) &&
                Me.GetAutoAttackDamage(unit, true) * 3 >= unit.Health)
            {
                return(false);
            }

            if (Buckshot.IsReady() && unit.Distance(Me.ServerPosition) <= Buckshot.Range &&
                Buckshot.GetDamage(unit) >= unit.Health)
            {
                return(false);
            }

            if (Quickdraw.IsReady() && unit.Distance(Me.ServerPosition) <= Quickdraw.Range + 25 &&
                Me.GetAutoAttackDamage(unit, true) * 3 >= unit.Health)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 14
0
        public static void ECheck(Vector3 from, bool castQFirst = false)
        {
            if (!Variables.spells[SpellSlot.E].IsReady())
            {
                return;
            }

            var pushDistance = MenuExtensions.GetItemValue <Slider>("iseriesr.vayne.misc.condemn.pushdist").Value;
            var accuracy     = MenuExtensions.GetItemValue <Slider>("iseriesr.vayne.misc.condemn.acc").Value / 100f;

            if (pushDistance >= 410)
            {
                var PushEx = pushDistance;
                pushDistance -= (10 + (PushEx - 410) / 2);
            }

            foreach (var target in GameObjects.EnemyHeroes.Where(h => !h.IsInvulnerable && !TargetSelector.IsInvulnerable(h, TargetSelector.DamageType.Physical, false) && h.IsValidTarget()))
            {
                var targetPosition = Variables.spells[SpellSlot.E].GetPrediction(target).UnitPosition;

                var finalPosition    = targetPosition.Extend(from, -pushDistance);
                var finalPosition_ex = target.ServerPosition.Extend(from, -pushDistance);

                var condemnRectangle    = new iSRPolygon(iSRPolygon.Rectangle(targetPosition.To2D(), finalPosition.To2D(), target.BoundingRadius));
                var condemnRectangle_ex = new iSRPolygon(iSRPolygon.Rectangle(target.ServerPosition.To2D(), finalPosition_ex.To2D(), target.BoundingRadius));

                if (IsBothNearWall(target))
                {
                    return;
                }

                if (condemnRectangle.Points.Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * accuracy &&
                    condemnRectangle_ex.Points.Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle_ex.Points.Count() * accuracy)
                {
                    if (castQFirst && VayneQ.IsSafe(from))
                    {
                        Variables.spells[SpellSlot.Q].Cast(from);
                        LeagueSharp.Common.Utility.DelayAction.Add((int)(250 + Game.Ping / 2f + 125), () =>
                        {
                            WardBush(from, targetPosition.Extend(from, -pushDistance));
                            Variables.spells[SpellSlot.E].Cast(target);
                        });
                        return;
                    }

                    WardBush(from, targetPosition.Extend(from, -pushDistance));
                    Variables.spells[SpellSlot.E].Cast(target);
                    return;
                }
            }
        }
Esempio n. 15
0
        internal static void Combo(bool useq, bool usew, bool usee, bool user)
        {
            if (useq && KL.Spellbook["Q"].IsReady())
            {
                if (CanQ(TargetSelector.GetTarget(KL.Spellbook["E"].Range, TargetSelector.DamageType.Physical)))
                {
                    KL.Spellbook["Q"].Cast();
                }
            }

            if (usew && KL.Spellbook["W"].IsReady())
            {
                var wtarget = TargetSelector.GetTarget(KL.Spellbook["E"].Range, TargetSelector.DamageType.Physical);
                if (wtarget.IsValidTarget(KL.Spellbook["W"].Range) && !wtarget.IsZombie)
                {
                    if (wtarget.Distance(KL.Player.ServerPosition) <= 200 && KL.WDmg(wtarget) >= wtarget.Health)
                    {
                        if (Utils.GameTimeTickCount - LastDunkTimeStamp >= 500)
                        {
                            KL.Spellbook["W"].Cast();
                        }
                    }
                }
            }

            if (usee && KL.Spellbook["E"].IsReady())
            {
                var etarget = TargetSelector.GetTarget(KL.Spellbook["E"].Range, TargetSelector.DamageType.Physical);
                if (etarget.IsValidTarget())
                {
                    if (etarget.Distance(KL.Player.ServerPosition) > 250)
                    {
                        if (KL.Player.CountAlliesInRange(1000) >= 1)
                        {
                            KL.Spellbook["E"].Cast(etarget.ServerPosition);
                        }

                        if (KL.RDmg(etarget, PassiveCount(etarget)) - KL.Hemorrhage(etarget, 1) >= etarget.Health)
                        {
                            KL.Spellbook["E"].Cast(etarget.ServerPosition);
                        }

                        if (KL.Spellbook["Q"].IsReady() || KL.Spellbook["W"].IsReady())
                        {
                            KL.Spellbook["E"].Cast(etarget.ServerPosition);
                        }

                        if (KL.Player.GetAutoAttackDamage(etarget) + KL.Hemorrhage(etarget, 3) * 3 >= etarget.Health)
                        {
                            KL.Spellbook["E"].Cast(etarget.ServerPosition);
                        }
                    }
                }
            }

            if (user && KL.Spellbook["R"].IsReady())
            {
                var unit = TargetSelector.GetTarget(KL.Spellbook["E"].Range, TargetSelector.DamageType.Physical);

                if (unit.IsValidTarget(KL.Spellbook["R"].Range) && !unit.IsZombie)
                {
                    if (!unit.HasBuffOfType(BuffType.Invulnerability) && !unit.HasBuffOfType(BuffType.SpellShield))
                    {
                        if (KL.RDmg(unit, PassiveCount(unit)) + RModifier >= unit.Health +
                            KL.Hemorrhage(unit, 1) + MordeShield(unit))
                        {
                            if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                            {
                                if (!unit.HasBuff("kindredrnodeathbuff"))
                                {
                                    KL.Spellbook["R"].CastOnUnit(unit);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 16
0
        internal static void Game_OnUpdate(EventArgs args)
        {
            if (Config.Item("useHPot").GetValue <bool>() && Config.Item("useHPotV").GetValue <Slider>().Value > Lib.Player.HealthPercent)
            {
                if (Items.HasItem(HealthPot.Id) && Items.CanUseItem(HealthPot.Id) && !ObjectManager.Player.HasBuff("RegenerationPotion", true) && !ObjectManager.Player.IsRecalling())
                {
                    HealthPot.Cast();
                }
            }
            if (Config.Item("useMPot").GetValue <bool>() && Config.Item("useMPotV").GetValue <Slider>().Value > Lib.Player.ManaPercent)
            {
                if (Items.HasItem(ManaPot.Id) && Items.CanUseItem(ManaPot.Id) && !ObjectManager.Player.HasBuff("ManaRegeneration", true) && !ObjectManager.Player.IsRecalling() && !ObjectManager.Player.InFountain() && !ObjectManager.Player.HasBuff("FlaskOfCrystalWater") && !ObjectManager.Player.HasBuff("ItemCrystalFlask"))
                {
                    ManaPot.Cast();
                }
            }
            if (Config.Item("useCFlask").GetValue <bool>() && Config.Item("useCFlaskH").GetValue <Slider>().Value > Lib.Player.HealthPercent || Config.Item("useCFlaskM").GetValue <Slider>().Value > Lib.Player.ManaPercent)
            {
                if (Items.HasItem(CrystalFlask.Id) && Items.CanUseItem(CrystalFlask.Id) && !ObjectManager.Player.HasBuff("RegenerationPotion", true) && !ObjectManager.Player.IsRecalling() && !ObjectManager.Player.InFountain() && !ObjectManager.Player.HasBuff("FlaskOfCrystalWater") && !ObjectManager.Player.HasBuff("ItemCrystalFlask"))
                {
                    CrystalFlask.Cast();
                }
            }

            if (Lib.Spellbook["E"].IsReady() && Config.Item("tpcancel").GetValue <bool>())
            {
                var etarget = TargetSelector.GetTarget(Lib.Spellbook["E"].Range, TargetSelector.DamageType.Physical);
                if (etarget.IsValidTarget() && etarget.HasBuff("Teleport"))
                {
                    if (etarget.Distance(Lib.Player.ServerPosition) > 250)
                    {
                        Lib.Spellbook["E"].Cast(etarget.ServerPosition);
                    }
                }
            }

            if (IgniteSlot.IsReady() && Config.Item("useIgn").GetValue <bool>())
            {
                var etarget   = TargetSelector.GetTarget(Lib.Spellbook["R"].Range, TargetSelector.DamageType.Physical);
                var Ignitedmg = Damage.GetSummonerSpellDamage(ObjectManager.Player, etarget, Damage.SummonerSpell.Ignite);
                if (etarget.Health < Ignitedmg)
                {
                    //Cast Ignite
                }
            }

            if (Lib.Spellbook["R"].IsReady() && Config.Item("ksr").GetValue <bool>())
            {
                foreach (var unit in HeroManager.Enemies.Where(ene => ene.IsValidTarget(Lib.Spellbook["R"].Range) && !ene.IsZombie))
                {
                    if (unit.CountEnemiesInRange(1200) <= 1 && Config.Item("ksr1").GetValue <bool>())
                    {
                        if (Lib.RDmg(unit, PassiveCount(unit)) + RModifier +
                            Lib.Hemorrhage(unit, PassiveCount(unit)) >= unit.Health + MordeShield(unit))
                        {
                            if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                            {
                                if (!unit.HasBuff("kindredrnodeathbuff"))
                                {
                                    Lib.Spellbook["R"].CastOnUnit(unit);
                                }
                            }
                        }
                    }

                    if (Lib.RDmg(unit, PassiveCount(unit)) + RModifier >= unit.Health +
                        Lib.Hemorrhage(unit, 1) + MordeShield(unit))
                    {
                        if (!TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.True))
                        {
                            if (!unit.HasBuff("kindredrnodeathbuff"))
                            {
                                Lib.Spellbook["R"].CastOnUnit(unit);
                            }
                        }
                    }
                }
            }

            switch (Orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo(Config.Item("useq").GetValue <bool>(), Config.Item("usew").GetValue <bool>(),
                      Config.Item("usee").GetValue <bool>(), Config.Item("user").GetValue <bool>());
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;
            }

            if (Config.Item("caste").GetValue <KeyBind>().Active)
            {
                Orbwalking.Orbwalk(null, Game.CursorPos);
                Combo(false, false, true, false);
            }
        }
Esempio n. 17
0
        public static bool CanBeDamaged(Obj_AI_Base target)
        {
            var invulnerable = !(target.IsInvulnerable || TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Physical, false));

            return(invulnerable);
        }
Esempio n. 18
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            RocketRange = new[] { 75, 75, 100, 125, 150, 175 }[Q.Level];
            var minigunOut = ProSeries.Player.GetSpell(SpellSlot.Q).ToggleState == 1;

            if (ProSeries.CanCombo())
            {
                if (!minigunOut && ProSeries.Config.Item("usecomboq", true).GetValue <bool>())
                {
                    if (ProSeries.Player.ManaPercent < 35 &&
                        HeroManager.Enemies.Any(
                            i => i.IsValidTarget(590 + RocketRange + 10) &&
                            ProSeries.Player.GetAutoAttackDamage(i, true) * 3 < i.Health))
                    {
                        Q.Cast();
                    }
                }

                var qtarget = TargetSelector.GetTarget(525 + RocketRange + 250, TargetSelector.DamageType.Physical);
                if (qtarget.IsValidTarget() && Q.IsReady())
                {
                    if (ProSeries.Config.Item("usecomboq", true).GetValue <bool>())
                    {
                        if (minigunOut && (ProSeries.Player.ManaPercent > 35 ||
                                           ProSeries.Player.GetAutoAttackDamage(qtarget, true) * 3 > qtarget.Health) &&
                            qtarget.Distance(ProSeries.Player.ServerPosition) > 590)
                        {
                            Q.Cast();
                        }

                        if (!minigunOut && ProSeries.Player.ManaPercent < 35)
                        {
                            Q.Cast();
                        }

                        if (!minigunOut && qtarget.Distance(ProSeries.Player.ServerPosition) <= 590)
                        {
                            Q.Cast();
                        }
                    }
                }

                var wtarget = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                if (wtarget.IsValidTarget() && W.IsReady())
                {
                    if (ProSeries.Config.Item("usecombow", true).GetValue <bool>())
                    {
                        if (wtarget.Distance(ProSeries.Player.ServerPosition) > 525)
                        {
                            if (ProSeries.Player.GetAutoAttackDamage(wtarget, true) * 2 < wtarget.Health)
                            {
                                W.CastIfHitchanceEquals(wtarget, HitChance.High);
                            }
                        }
                    }
                }

                if (ProSeries.Config.Item("usecomboe", true).GetValue <bool>() && E.IsReady())
                {
                    foreach (var target in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget(400) && h.IsMelee()))
                    {
                        E.CastIfHitchanceEquals(target, HitChance.VeryHigh);
                    }
                }
            }

            if (ProSeries.CanHarass())
            {
                var qtarget = TargetSelector.GetTarget(525 + RocketRange + 250, TargetSelector.DamageType.Physical);
                if (!qtarget.IsValidTarget() && !minigunOut)
                {
                    if (ProSeries.Config.Item("useharassq", true).GetValue <bool>())
                    {
                        Q.Cast();
                    }
                }

                if (qtarget.IsValidTarget() && Q.IsReady() && ProSeries.IsWhiteListed(qtarget))
                {
                    if (ProSeries.Config.Item("useharassq", true).GetValue <bool>())
                    {
                        if (!minigunOut && ProSeries.Player.ManaPercent < 20)
                        {
                            Q.Cast();
                        }

                        if (minigunOut && ProSeries.Player.ManaPercent > 20)
                        {
                            if (qtarget.Distance(ProSeries.Player.ServerPosition) > 590)
                            {
                                Q.Cast();
                            }
                        }

                        if (!minigunOut && qtarget.Distance(ProSeries.Player.ServerPosition) <= 590)
                        {
                            Q.Cast();
                        }
                    }
                }

                var wtarget = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                if (wtarget.IsValidTarget() && W.IsReady() && ProSeries.IsWhiteListed(wtarget))
                {
                    if (ProSeries.Config.Item("useharassw", true).GetValue <bool>())
                    {
                        W.CastIfHitchanceEquals(wtarget, HitChance.High);
                    }
                }
            }

            if (ProSeries.CanClear() && Q.IsReady())
            {
                if (ProSeries.Config.Item("useclearq", true).GetValue <bool>())
                {
                    if (GetCenterMinion().IsValidTarget())
                    {
                        if (minigunOut)
                        {
                            Q.Cast();
                        }

                        if (!minigunOut)
                        {
                            ProSeries.Orbwalker.ForceTarget(GetCenterMinion());
                        }
                    }

                    else
                    {
                        if (!minigunOut)
                        {
                            Q.Cast();
                        }
                    }
                }
            }

            if (ProSeries.Player.GetSpell(SpellSlot.Q).ToggleState == 2 && Q.IsReady())
            {
                if (ProSeries.Config.Item("useclearq", true).GetValue <bool>())
                {
                    if (ProSeries.Config.Item("useclear").GetValue <KeyBind>().Active)
                    {
                        if (ProSeries.Player.ManaPercent <=
                            ProSeries.Config.Item("clearmana").GetValue <Slider>().Value)
                        {
                            Q.Cast();
                        }
                    }
                }
            }

            if (E.IsReady())
            {
                foreach (var target in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget(E.Range)))
                {
                    if (ProSeries.Config.Item("useeimm", true).GetValue <bool>())
                    {
                        E.CastIfHitchanceEquals(target, HitChance.Immobile);
                    }

                    if (ProSeries.Config.Item("useedash", true).GetValue <bool>())
                    {
                        E.CastIfHitchanceEquals(target, HitChance.Dashing);
                    }
                }
            }

            if (ProSeries.Config.Item("usecombor", true).GetValue <bool>())
            {
                var maxDistance = ProSeries.Config.Item("maxrdist", true).GetValue <Slider>().Value;

                foreach (var target in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget(maxDistance)))
                {
                    var canr = !TargetSelector.IsInvulnerable(target, TargetSelector.DamageType.Physical);

                    var aaDamage = Orbwalking.InAutoAttackRange(target)
                        ? ProSeries.Player.GetAutoAttackDamage(target, true)
                        : 0;

                    if (target.Health - aaDamage <= GetRDamage(target) && canr)
                    {
                        R.Cast(target);
                    }
                }
            }
        }
Esempio n. 19
0
        static void Harass()
        {
            if (!(AIO_Func.getManaPercent(Player) > AIO_Menu.Champion.Harass.IfMana))
            {
                return;
            }

            if (AIO_Menu.Champion.Harass.UseQ && Q.IsReady())
            {
                var Qtarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
                AIO_Func.CCast(Q, Qtarget);
            }

            if (AIO_Menu.Champion.Harass.UseE && E.IsReady())
            {
                var Etarget = HeroManager.Enemies.Where(x => x.IsValidTarget(E.Range) && IsPoisoned(x) && !TargetSelector.IsInvulnerable(x, E.DamageType)).OrderByDescending(x => E.GetDamage(x)).FirstOrDefault();

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

            if (AIO_Menu.Champion.Harass.UseW && W.IsReady())
            {
                var Wtarget = TargetSelector.GetTarget(W.Range, W.DamageType);
                AIO_Func.CCast(W, Wtarget);
            }
        }
Esempio n. 20
0
        static void Combo()
        {
            if (AIO_Menu.Champion.Combo.UseQ && Q.IsReady())
            {
                var Qtarget = TargetSelector.GetTarget(Q.Range, Q.DamageType);
                AIO_Func.CCast(Q, Qtarget);
            }

            if (AIO_Menu.Champion.Combo.UseE && E.IsReady())
            {
                var Etarget = HeroManager.Enemies.Where(x => x.IsValidTarget(E.Range) && IsPoisoned(x) && !TargetSelector.IsInvulnerable(x, E.DamageType)).OrderByDescending(x => E.GetDamage(x)).FirstOrDefault();

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

            if (AIO_Menu.Champion.Combo.UseW && W.IsReady())
            {
                var Wtarget = TargetSelector.GetTarget(W.Range, W.DamageType);
                AIO_Func.CCast(W, Wtarget);
            }

            if (AIO_Menu.Champion.Combo.UseR && R.IsReady())
            {
                //스턴걸리는애들 마릿수 체크 => R시전 (테스트x)
                //var rTarget = R.GetTarget();
                //if (R.GetCollision(Player.ServerPosition.To2D(), new List<Vector2> { rTarget.ServerPosition.To2D() }).Where(x => x.IsFacing(Player)).Count() >= AIO_Menu.Champion.Combo.getSliderValue("R Min Targets").Value)
                //    R.Cast(rTarget);

                //그냥 맞는놈들 마릿수 체크 => R시전
                R.CastIfWillHit(R.GetTarget(), AIO_Menu.Champion.Combo.getSliderValue("R Min Targets").Value);
            }
        }