Exemplo n.º 1
0
        internal static void EGapTarget(Obj_AI_Hero target, bool UnderTurret, int GapcloserDis, bool includeChampion = true)
        {
            var dashtargets = new List <Obj_AI_Base>();

            dashtargets.AddRange(
                HeroManager.Enemies.Where(
                    x =>
                    !x.IsDead && (includeChampion || x.NetworkId != target.NetworkId) && x.IsValidTarget(E.Range) &&
                    CanCastE(x)));
            dashtargets.AddRange(
                MinionManager.GetMinions(Me.Position, E.Range, MinionTypes.All, MinionTeam.NotAlly)
                .Where(CanCastE));

            if (dashtargets.Any())
            {
                var dash = dashtargets.Where(x => x.IsValidTarget(E.Range))
                           .OrderBy(x => target.Position.Distance(PosAfterE(x)))
                           .FirstOrDefault(x => Evade.EvadeManager.IsSafe(PosAfterE(x).To2D()).IsSafe);

                if (dash != null && dash.DistanceToPlayer() <= E.Range && CanCastE(dash) &&
                    target.DistanceToPlayer() >= GapcloserDis &&
                    target.Position.Distance(PosAfterE(dash)) <= target.DistanceToPlayer() &&
                    Me.IsFacing(dash) && (UnderTurret || !UnderTower(PosAfterE(dash))))
                {
                    E.CastOnUnit(dash, true);
                }
            }
        }
Exemplo n.º 2
0
        internal static void EGapMouse(Obj_AI_Hero target, bool UnderTurret, int GapcloserDis, bool includeChampion = true)
        {
            if (target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me) * 1.2 ||
                target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(target) * 0.8 ||
                Game.CursorPos.DistanceToPlayer() >= Orbwalking.GetRealAutoAttackRange(Me) * 1.2)
            {
                var dashtargets = new List <Obj_AI_Base>();
                dashtargets.AddRange(
                    HeroManager.Enemies.Where(
                        x =>
                        !x.IsDead && (includeChampion || x.NetworkId != target.NetworkId) && x.IsValidTarget(E.Range) &&
                        CanCastE(x)));
                dashtargets.AddRange(
                    MinionManager.GetMinions(Me.Position, E.Range, MinionTypes.All, MinionTeam.NotAlly)
                    .Where(CanCastE));

                if (dashtargets.Any())
                {
                    var dash =
                        dashtargets.Where(x => x.IsValidTarget(E.Range) && Evade.EvadeManager.IsSafe(PosAfterE(x).To2D()).IsSafe)
                        .MinOrDefault(x => PosAfterE(x).Distance(Game.CursorPos));

                    if (dash != null && dash.DistanceToPlayer() <= E.Range && CanCastE(dash) &&
                        target.DistanceToPlayer() >= GapcloserDis && Me.IsFacing(dash) &&
                        (UnderTurret || !UnderTower(PosAfterE(dash))))
                    {
                        E.CastOnUnit(dash, true);
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal static void EGapTarget(Obj_AI_Hero target, bool UnderTurret, float GapcloserDis,
                                        bool includeChampion = true)
        {
            var dashtargets = new List <Obj_AI_Base>();

            dashtargets.AddRange(
                GameObjects.EnemyHeroes.Where(
                    x =>
                    !x.IsDead && (includeChampion || x.NetworkId != target.NetworkId) && x.IsValidTarget(475) &&
                    CanCastE(x)));
            dashtargets.AddRange(
                GameObjects.EnemyMinions.Where(x => x.IsValidTarget(475) && x.MaxHealth > 5)
                .Where(CanCastE));

            if (dashtargets.Any())
            {
                var dash = dashtargets.Where(x => x.IsValidTarget(475) && IsSafePosition(PosAfterE(x)))
                           .OrderBy(x => target.Position.Distance(PosAfterE(x)))
                           .FirstOrDefault();

                if (dash != null && dash.DistanceToPlayer() <= 475 && CanCastE(dash) &&
                    target.DistanceToPlayer() >= GapcloserDis &&
                    target.Position.Distance(PosAfterE(dash)) <= target.DistanceToPlayer() &&
                    ObjectManager.GetLocalPlayer().IsFacing(dash) && (UnderTurret || !UnderTower(PosAfterE(dash))))
                {
                    MyLogic.E.CastOnUnit(dash);
                }
            }
        }
Exemplo n.º 4
0
        private static void EFlash()
        {
            Orbwalking.MoveTo(Game.CursorPos);

            if (Flash != SpellSlot.Unknown && Flash.IsReady() && E.IsReady())
            {
                Obj_AI_Hero target = null;

                target = TargetSelector.GetSelectedTarget() ??
                         TargetSelector.GetTarget(700f, TargetSelector.DamageType.Magical);

                if (CheckTarget(target, 700f) && target.DistanceToPlayer() > E.Range)
                {
                    var pos = Me.Position.Extend(target.Position, 425f);

                    if (target.Position.Distance(pos) < 350f && target.DistanceToPlayer() > E.Range)
                    {
                        E.Cast();
                        Utility.DelayAction.Add(100 + Game.Ping * 2, () =>
                        {
                            Me.Spellbook.CastSpell(Flash, target.Position);
                        });
                    }
                }
            }
        }
Exemplo n.º 5
0
        internal static void EGapMouse(Obj_AI_Hero target, bool UnderTurret, float GapcloserDis,
                                       bool includeChampion = true)
        {
            if (target.DistanceToPlayer() > (ObjectManager.GetLocalPlayer().AttackRange + ObjectManager.GetLocalPlayer().BoundingRadius) * 1.2 ||
                target.DistanceToPlayer() >
                (ObjectManager.GetLocalPlayer().AttackRange + ObjectManager.GetLocalPlayer().BoundingRadius + target.BoundingRadius) * 0.8 ||
                Game.CursorPos.DistanceToPlayer() >=
                (ObjectManager.GetLocalPlayer().AttackRange + ObjectManager.GetLocalPlayer().BoundingRadius) * 1.2)
            {
                var dashtargets = new List <Obj_AI_Base>();
                dashtargets.AddRange(
                    GameObjects.EnemyHeroes.Where(
                        x =>
                        !x.IsDead && (includeChampion || x.NetworkId != target.NetworkId) && x.IsValidTarget(475) &&
                        CanCastE(x)));
                dashtargets.AddRange(
                    GameObjects.EnemyMinions.Where(x => x.IsValidTarget(475) && x.MaxHealth > 5)
                    .Where(CanCastE));

                if (dashtargets.Any())
                {
                    var dash =
                        dashtargets.Where(x => x.IsValidTarget(475) && IsSafePosition(PosAfterE(x)))
                        .MinOrDefault(x => PosAfterE(x).Distance(Game.CursorPos));

                    if (dash != null && dash.DistanceToPlayer() <= 475 && CanCastE(dash) &&
                        target.DistanceToPlayer() >= GapcloserDis && ObjectManager.GetLocalPlayer().IsFacing(dash) &&
                        (UnderTurret || !UnderTower(PosAfterE(dash))))
                    {
                        MyLogic.E.CastOnUnit(dash);
                    }
                }
            }
        }
Exemplo n.º 6
0
        private static void EDash(Obj_AI_Hero target)
        {
            if (target == null || target.IsDead || !E.IsReady())
            {
                return;
            }

            if (Menu.GetBool("ComboQ") && Q.IsReady() && qStack == 0 &&
                target.DistanceToPlayer() < Q.Range + Orbwalking.GetRealAutoAttackRange(Me))
            {
                return;
            }

            if (target.DistanceToPlayer() <= E.Range + (Q.IsReady() && qStack == 0 ? Q.Range : 0))
            {
                E.Cast(target.Position, true);
            }

            if (target.DistanceToPlayer() <= E.Range + (W.IsReady() ? W.Range : 0))
            {
                E.Cast(target.Position, true);
            }

            if (!Q.IsReady() && !W.IsReady() && target.DistanceToPlayer() < E.Range + Me.AttackRange)
            {
                E.Cast(target.Position, true);
            }
        }
Exemplo n.º 7
0
        internal static void R2Logic(Obj_AI_Hero target)
        {
            if (target == null || R.Instance.Name == "RivenFengShuiEngine")
            {
                return;
            }

            if (target.Check(850))
            {
                switch (Menu.GetList("R2Mode"))
                {
                case 0:
                    if (DamageCalculate.GetRDamage(target) > target.Health && target.DistanceToPlayer() < 600)
                    {
                        var pred = R.GetPrediction(target, true);

                        if (pred.Hitchance >= HitChance.VeryHigh)
                        {
                            R.Cast(pred.CastPosition, true);
                        }
                    }
                    break;

                case 1:
                    if (target.HealthPercent < 20 ||
                        (target.Health > DamageCalculate.GetRDamage(target) + Me.GetAutoAttackDamage(target) * 2 &&
                         target.HealthPercent < 40) ||
                        (target.Health <= DamageCalculate.GetRDamage(target)) ||
                        (target.Health <= DamageCalculate.GetComboDamage(target) * 1.3))
                    {
                        var pred = R.GetPrediction(target, true);

                        if (pred.Hitchance >= HitChance.VeryHigh)
                        {
                            R.Cast(pred.CastPosition, true);
                        }
                    }
                    break;

                case 2:
                    if (target.DistanceToPlayer() < 600)
                    {
                        var pred = R.GetPrediction(target, true);

                        if (pred.Hitchance >= HitChance.VeryHigh)
                        {
                            R.Cast(pred.CastPosition, true);
                        }
                    }
                    break;
                }
            }
        }
Exemplo n.º 8
0
 private static SpellSlot CanW(Obj_AI_Hero target)
 {
     if (E.IsReady() && Player.Mana >= E.Instance.ManaCost + W.Instance.ManaCost &&
         target.DistanceToPlayer() < W.Range + E.Range - 20)
     {
         return(SpellSlot.E);
     }
     if (Q.IsReady() && Player.Mana >= Q.Instance.ManaCost + W.Instance.ManaCost &&
         target.DistanceToPlayer() < W.Range + Q.Range)
     {
         return(SpellSlot.Q);
     }
     return(SpellSlot.Unknown);
 }
Exemplo n.º 9
0
 private static SpellSlot CanW(Obj_AI_Hero target, float dist = -1)
 {
     if (E.IsReady() && Player.Mana >= E.Instance.ManaCost + W.Instance.ManaCost &&
         (dist > -1 ? dist : target.DistanceToPlayer()) < W.Range + E.Range)
     {
         return(SpellSlot.E);
     }
     if (Q.IsReady() && Player.Mana >= Q.Instance.ManaCost + W.Instance.ManaCost &&
         (dist > -1 ? dist : target.DistanceToPlayer()) < W.Range + Q.Range - 50)
     {
         return(SpellSlot.Q);
     }
     return(SpellSlot.Unknown);
 }
Exemplo n.º 10
0
        internal static Vector3 GetEPosition(Obj_AI_Hero target)
        {
            var pos = Vector3.Zero;

            if (!target.IsValidTarget(MyLogic.E.Range + MyLogic.PassiveRange))
            {
                pos = Vector3.Zero;
            }
            else
            {
                if (MyLogic.Daggers.Any(
                        x =>
                        GameObjects.EnemyHeroes.Any(a => a.Distance(x.pos) <= MyLogic.PassiveRange) &&
                        x.pos.DistanceToPlayer() <= MyLogic.E.Range))
                {
                    foreach (
                        var obj in
                        MyLogic.Daggers.Where(x => x.pos.Distance(target.ServerPosition) <= MyLogic.PassiveRange)
                        .OrderByDescending(x => x.pos.Distance(target.ServerPosition)))
                    {
                        if (obj.obj != null && obj.obj.IsValid && obj.pos.DistanceToPlayer() <= MyLogic.E.Range)
                        {
                            pos = obj.pos;
                        }
                    }
                }
                else if (
                    MyLogic.Daggers.Any(
                        x =>
                        GameObjects.EnemyHeroes.Any(a => a.Distance(x.pos) <= MyLogic.E.Range) &&
                        x.pos.DistanceToPlayer() <= MyLogic.E.Range))
                {
                    foreach (
                        var obj in
                        MyLogic.Daggers.Where(x => x.pos.Distance(target.ServerPosition) <= MyLogic.E.Range)
                        .OrderBy(x => x.pos.Distance(target.ServerPosition)))
                    {
                        if (obj.obj != null && obj.obj.IsValid && obj.pos.DistanceToPlayer() <= MyLogic.E.Range)
                        {
                            pos = obj.pos;
                        }
                    }
                }
                else if (target.DistanceToPlayer() <= MyLogic.E.Range - 130)
                {
                    pos = ObjectManager.GetLocalPlayer().ServerPosition.Extend(target.ServerPosition, target.DistanceToPlayer() + 130);
                }
                else if (target.IsValidTarget(MyLogic.E.Range))
                {
                    pos = target.ServerPosition;
                }
                else
                {
                    pos = Vector3.Zero;
                }
            }

            return(pos);
        }
Exemplo n.º 11
0
        internal static bool CanQHit(Obj_AI_Hero target)
        {
            if (target == null)
            {
                return(false);
            }

            if (target.DistanceToPlayer() > Q.Range)
            {
                return(false);
            }

            if (target.DistanceToPlayer() <= 240)
            {
                return(false);
            }

            if (target.Health < DamageCalculate.GetRDamage(target) && R.IsReady() && target.IsValidTarget(R.Range))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 12
0
        private static bool CheckQSafe(Obj_AI_Hero target)
        {
            if (!Q1.IsReady())
            {
                return(false);
            }

            if (target.DistanceToPlayer() <= Q.Range + Me.BoundingRadius)
            {
                return(false);
            }

            if (Menu.Item("QCheck", true).GetValue <bool>())
            {
                var pos = target.ServerPosition;

                if (pos.CountEnemiesInRange(500) >= Menu.Item("QCheckcount", true).GetValue <Slider>().Value)
                {
                    return(false);
                }

                if (!Menu.Item("SmartIgnore", true).GetValue <bool>() && Menu.Item("TurretCheck", true).GetValue <bool>() &&
                    pos.UnderTurret(true))
                {
                    return(false);
                }

                if (Menu.Item("SmartIgnore", true).GetValue <bool>() && pos.UnderTurret(true))
                {
                    if (Menu.Item("IgnoteCanKill", true).GetValue <bool>() &&
                        target.Health + target.HPRegenRate * 2 > ComboDamage(target))
                    {
                        return(false);
                    }

                    if (Me.HealthPercent <= Menu.Item("IgnoteHp", true).GetValue <Slider>().Value)
                    {
                        return(false);
                    }

                    return(true);
                }

                return(true);
            }

            return(true);
        }
Exemplo n.º 13
0
        private static void ForcusAttack(Obj_AI_Hero target)
        {
            if (Me.Spellbook.IsAutoAttacking ||
                (target.DistanceToPlayer() <= Orbwalking.GetRealAutoAttackRange(Me) && Orbwalking.CanAttack()))
            {
                return;
            }

            if (Q.IsReady())
            {
                return;
            }

            var pos  = PassiveManager.OrbwalkerPosition(target);
            var path = Me.GetPath(pos);

            Orbwalker.SetOrbwalkingPoint(target.IsMoving
                ? (path.Length < 3 ? pos : path.Skip(path.Length / 2).FirstOrDefault()): pos);
        }
Exemplo n.º 14
0
        internal static bool R2Logic(Obj_AI_Hero target)
        {
            if (target == null || !target.IsValidTarget() || !MyLogic.isRActive ||
                MyLogic.ComboMenu["FlowersRiven.ComboMenu.RMode"].As <MenuList>().Value == 3 ||
                !MyLogic.ComboMenu["FlowersRiven.ComboMenu.RTargetFor" + target.ChampionName].Enabled)
            {
                return(false);
            }

            switch (MyLogic.ComboMenu["FlowersRiven.ComboMenu.RMode"].As <MenuList>().Value)
            {
            case 0:
                if (target.HealthPercent() < 20 ||
                    target.Health >
                    ObjectManager.GetLocalPlayer().GetSpellDamage(target, SpellSlot.R) +
                    ObjectManager.GetLocalPlayer().GetAutoAttackDamage(target) * 2 && target.HealthPercent() < 40 ||
                    target.Health <= ObjectManager.GetLocalPlayer().GetSpellDamage(target, SpellSlot.R) ||
                    target.Health <= GetComboDamage(target))
                {
                    return(MyLogic.R.Cast(target.ServerPosition));
                }
                break;

            case 1:
                if (ObjectManager.GetLocalPlayer().GetSpellDamage(target, SpellSlot.R) > target.Health && target.DistanceToPlayer() < 600)
                {
                    return(MyLogic.R.Cast(target.ServerPosition));
                }
                break;

            case 2:
                if (target.DistanceToPlayer() < 600)
                {
                    return(MyLogic.R.Cast(target.ServerPosition));
                }
                break;
            }

            return(false);
        }
Exemplo n.º 15
0
        private static void ComboELogic(Obj_AI_Hero target)
        {
            if (target == null || !target.IsValidTarget())
            {
                return;
            }

            if (ComboOption.GetBool("ComboECheck").Enabled&& !Me.IsUnderEnemyTurret() && Me.CountEnemyHeroesInRange(1200f) <= 2)
            {
                if (target.DistanceToPlayer() > Me.GetFullAttackRange(target) && target.IsValidTarget())
                {
                    if (target.Health < Me.GetSpellDamage(target, SpellSlot.E) + Me.GetAutoAttackDamage(target) &&
                        target.ServerPosition.Distance(Game.CursorPos) < Me.ServerPosition.Distance(Game.CursorPos))
                    {
                        var CastEPos = Me.ServerPosition.Extend(target.ServerPosition, 475f);

                        if (ComboOption.GetBool("ComboEWall").Enabled)
                        {
                            if (!CastEPos.IsWall())
                            {
                                E.Cast(Me.ServerPosition.Extend(target.ServerPosition, 475f));
                            }
                        }
                        else
                        {
                            E.Cast(Me.ServerPosition.Extend(target.ServerPosition, 475f));
                        }
                        return;
                    }

                    if (target.Health <
                        Me.GetSpellDamage(target, SpellSlot.E) + Me.GetSpellDamage(target, SpellSlot.W) &&
                        W.Ready &&
                        target.ServerPosition.Distance(Game.CursorPos) + 350 < Me.ServerPosition.Distance(Game.CursorPos))
                    {
                        var CastEPos = Me.ServerPosition.Extend(target.ServerPosition, 475f);

                        if (ComboOption.GetBool("ComboEWall").Enabled)
                        {
                            if (!CastEPos.IsWall())
                            {
                                E.Cast(Me.ServerPosition.Extend(target.ServerPosition, 475f));
                            }
                        }
                        else
                        {
                            E.Cast(Me.ServerPosition.Extend(target.ServerPosition, 475f));
                        }
                        return;
                    }

                    if (target.Health <
                        Me.GetSpellDamage(target, SpellSlot.E) + Me.GetSpellDamage(target, SpellSlot.Q) &&
                        Q.Ready &&
                        target.ServerPosition.Distance(Game.CursorPos) + 300 < Me.ServerPosition.Distance(Game.CursorPos))
                    {
                        var CastEPos = Me.ServerPosition.Extend(target.ServerPosition, 475f);

                        if (ComboOption.GetBool("ComboEWall").Enabled)
                        {
                            if (!CastEPos.IsWall())
                            {
                                E.Cast(Me.ServerPosition.Extend(target.ServerPosition, 475f));
                            }
                        }
                        else
                        {
                            E.Cast(Me.ServerPosition.Extend(target.ServerPosition, 475f));
                        }
                    }
                }
            }
        }
Exemplo n.º 16
0
        private static void RLogic()
        {
            Obj_AI_Hero target = null;

            if (Variables.TargetSelector.GetSelectedTarget() != null && Variables.TargetSelector.GetSelectedTarget().DistanceToPlayer() <= Menu["R"]["RMaxRange"].GetValue <MenuSlider>().Value)
            {
                target = Variables.TargetSelector.GetSelectedTarget();
            }
            else
            {
                target = GetTarget(R.Range, DamageType.Physical);
            }

            if (R.IsReady() && CheckTarget(target) && R.IsInRange(target))
            {
                if (R.Instance.Name == StartR)
                {
                    if (Menu["R"]["RKey"].GetValue <MenuKeyBind>().Active)
                    {
                        R.Cast(R.GetPrediction(target).UnitPosition);
                    }

                    if (!Menu["R"]["AutoR"])
                    {
                        return;
                    }

                    if (Menu["R"]["RCheck"] && Player.CountEnemyHeroesInRange(800f) > 0)
                    {
                        return;
                    }

                    if (target.DistanceToPlayer() <= Menu["R"]["RMinRange"].GetValue <MenuSlider>().Value)
                    {
                        return;
                    }

                    if (target.DistanceToPlayer() > Menu["R"]["RMaxRange"].GetValue <MenuSlider>().Value)
                    {
                        return;
                    }

                    if (target.Health > Player.GetSpellDamage(target, SpellSlot.R) * Menu["R"]["RKill"].GetValue <MenuSlider>().Value)
                    {
                        return;
                    }
                    R.Cast(R.GetPrediction(target).CastPosition);
                }

                if (R.Instance.Name == IsJhinRShot)
                {
                    if (Menu["R"]["RKey"].GetValue <MenuKeyBind>().Active)
                    {
                        AutoUse(target);
                        R.Cast(R.GetPrediction(target).UnitPosition);
                    }

                    if (Menu["R"]["ComboR"] && Variables.Orbwalker.ActiveMode == OrbwalkingMode.Combo)
                    {
                        AutoUse(target);
                        R.Cast(R.GetPrediction(target).UnitPosition);
                    }

                    if (!Menu["R"]["AutoR"])
                    {
                        return;
                    }
                    AutoUse(target);
                    R.Cast(R.GetPrediction(target).UnitPosition);
                }
            }
        }
Exemplo n.º 17
0
        public static double ComboDamage(Obj_AI_Hero target)
        {
            if (target != null && !target.IsDead && !target.IsZombie)
            {
                if (target.HasBuff("KindredRNoDeathBuff"))
                {
                    return(0);
                }

                if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
                {
                    return(0);
                }

                if (target.HasBuff("JudicatorIntervention"))
                {
                    return(0);
                }

                if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
                {
                    return(0);
                }

                if (target.HasBuff("FioraW"))
                {
                    return(0);
                }

                if (target.HasBuff("ShroudofDarkness"))
                {
                    return(0);
                }

                if (target.HasBuff("SivirShield"))
                {
                    return(0);
                }

                var damage = 0d;

                damage += ObjectManager.Player.GetAutoAttackDamage(target) + GetPassiveDamage(target) +
                          (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).IsReady()
                              ? (target.DistanceToPlayer() <= 170f + target.BoundingRadius
                                  ? GetQ1Damage(target)
                                  : GetQDamage(target))
                              : 0d) +
                          (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).IsReady()
                              ? GetWDamage(target) + GetW1Damage(target)
                              : 0d) +
                          (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).IsReady()
                              ? GetRDamage(target)
                              : 0d) +
                          ((ObjectManager.Player.GetSpellSlot("SummonerDot") != SpellSlot.Unknown &&
                            ObjectManager.Player.GetSpellSlot("SummonerDot").IsReady())
                              ? 50 + 20 * ObjectManager.Player.Level - (target.HPRegenRate / 5 * 3)
                              : 0d);

                if (target.ChampionName == "Moredkaiser")
                {
                    damage -= target.Mana;
                }

                if (ObjectManager.Player.HasBuff("SummonerExhaust"))
                {
                    damage = damage * 0.6f;
                }

                if (target.HasBuff("GarenW"))
                {
                    damage = damage * 0.7f;
                }

                if (target.HasBuff("ferocioushowl"))
                {
                    damage = damage * 0.7f;
                }

                if (target.HasBuff("BlitzcrankManaBarrierCD") && target.HasBuff("ManaBarrier"))
                {
                    damage -= target.Mana / 2f;
                }

                return(damage);
            }

            return(0d);
        }
Exemplo n.º 18
0
        private void QLogic(Obj_AI_Hero target, bool UseQ1 = false)// SFX Challenger MissFortune QLogic (im so lazy, kappa)
        {
            if (target != null)
            {
                if (target.IsValidTarget(Q.Range))
                {
                    Q.CastOnUnit(target);
                }
                else if (UseQ1 && target.IsValidTarget(Q1.Range) && target.DistanceToPlayer() > Q.Range)
                {
                    var heroPositions = (from t in HeroManager.Enemies
                                         where t.IsValidTarget(Q1.Range)
                                         let prediction = Q.GetPrediction(t)
                                                          select new CPrediction.Position(t, prediction.UnitPosition)).Where(
                        t => t.UnitPosition.Distance(Me.Position) < Q1.Range).ToList();

                    if (heroPositions.Any())
                    {
                        var minions = MinionManager.GetMinions(Q1.Range, MinionTypes.All, MinionTeam.NotAlly);

                        if (minions.Any(m => m.IsMoving) &&
                            !heroPositions.Any(h => h.Hero.HasBuff("missfortunepassive")))
                        {
                            return;
                        }

                        var outerMinions   = minions.Where(m => m.Distance(Me) > Q.Range).ToList();
                        var innerPositions = minions.Where(m => m.Distance(Me) < Q.Range).ToList();

                        foreach (var minion in innerPositions)
                        {
                            var lMinion  = minion;
                            var coneBuff = new Geometry.Polygon.Sector(
                                minion.Position,
                                Me.Position.Extend(minion.Position, Me.Distance(minion) + Q.Range * 0.5f),
                                (float)(40 * Math.PI / 180), Q1.Range - Q.Range);
                            var coneNormal = new Geometry.Polygon.Sector(
                                minion.Position,
                                Me.Position.Extend(minion.Position, Me.Distance(minion) + Q.Range * 0.5f),
                                (float)(60 * Math.PI / 180), Q1.Range - Q.Range);

                            foreach (var enemy in
                                     heroPositions.Where(
                                         m => m.UnitPosition.Distance(lMinion.Position) < Q1.Range - Q.Range))
                            {
                                if (coneBuff.IsInside(enemy.Hero) && enemy.Hero.HasBuff("missfortunepassive"))
                                {
                                    Q.CastOnUnit(minion);
                                    return;
                                }
                                if (coneNormal.IsInside(enemy.UnitPosition))
                                {
                                    var insideCone =
                                        outerMinions.Where(m => coneNormal.IsInside(m.Position)).ToList();

                                    if (!insideCone.Any() ||
                                        enemy.UnitPosition.Distance(minion.Position) <
                                        insideCone.Select(
                                            m => m.Position.Distance(minion.Position) - m.BoundingRadius)
                                        .DefaultIfEmpty(float.MaxValue)
                                        .Min())
                                    {
                                        Q.CastOnUnit(minion);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
 internal static void Start(Obj_AI_Hero target)
 {
     if (CanRFlash)
     {
         var lastSpell = Player.GetLastCastedSpell();
         if (lastSpell.IsValid && lastSpell.Name == R.Instance.SData.Name
             && Variables.TickCount - lastSpell.StartTime < 2000)
         {
             var targetRFlash = lastSpell.Target as Obj_AI_Hero;
             if (targetRFlash != null && targetRFlash.IsValidTarget(FlashRange)
                 && targetRFlash.Health + targetRFlash.PhysicalShield > R.GetDamage(targetRFlash))
             {
                 Player.Spellbook.CastSpell(
                     Flash,
                     targetRFlash.ServerPosition.ToVector2()
                         .Extend(GetPositionKickTo(targetRFlash), -GetDistBehind(targetRFlash))
                         .ToVector3());
                 return;
             }
         }
     }
     if (Variables.Orbwalker.CanMove() && Variables.TickCount - lastMoveTime > 250)
     {
         if (target != null && lastMoveTime > 0 && CanInsec
             && GetPositionKickTo(target).DistanceToPlayer() > target.Distance(GetPositionKickTo(target)))
         {
             Variables.Orbwalker.Move(
                 target.ServerPosition.Extend(GetPositionKickTo(target), -GetDistBehind(target)));
         }
         else
         {
             Variables.Orbwalker.Move(Game.CursorPos);
         }
     }
     if (target == null || !CanInsec)
     {
         return;
     }
     if (!IsRecent)
     {
         var checkFlash = GapCheck(target, true);
         var checkJump = GapCheck(target);
         if (!Player.HasBuff("blindmonkqtwodash") && !canJumpFlash && !checkFlash.Item2 && !checkJump.Item2
             && CanJumpFlash
             && target.DistanceToPlayer()
             < WardManager.WardRange
             + (MainMenu["Insec"]["FlashMode"].GetValue<MenuList>().Index == 0 ? R.Range : FlashRange)
             - GetDistBehind(target))
         {
             canJumpFlash = true;
         }
         if (!canJumpFlash)
         {
             if (MainMenu["Insec"]["PriorFlash"])
             {
                 if (MainMenu["Insec"]["Flash"] && checkFlash.Item2)
                 {
                     GapByFlash(target, checkFlash.Item1);
                 }
                 else if (checkJump.Item2)
                 {
                     GapByWardJump(target, checkJump.Item1);
                 }
             }
             else
             {
                 if (checkJump.Item2)
                 {
                     GapByWardJump(target, checkJump.Item1);
                 }
                 else if (MainMenu["Insec"]["Flash"] && checkFlash.Item2)
                 {
                     GapByFlash(target, checkFlash.Item1);
                 }
             }
         }
         else
         {
             Flee(target.ServerPosition.Extend(GetPositionKickTo(target), -GetDistBehind(target)));
         }
     }
     if (R.IsInRange(target))
     {
         var posEnd = GetPositionKickTo(target);
         if (posEnd.DistanceToPlayer() > target.Distance(posEnd))
         {
             var posTarget = target.ServerPosition.ToVector2();
             var project = posTarget.Extend(Player.ServerPosition, -KickRange)
                 .ProjectOn(posTarget, posEnd.Extend(posTarget, -(KickRange * 0.5f)));
             if (project.IsOnSegment && project.SegmentPoint.Distance(posEnd) <= KickRange * 0.5f
                 && R.CastOnUnit(target))
             {
                 return;
             }
         }
     }
     if (!CanJumpFlash || !canJumpFlash)
     {
         GapByQ(target);
     }
 }
Exemplo n.º 20
0
        internal static void EQWLogic(Obj_AI_Hero target, bool useQ, bool useW, bool useE)
        {
            if (target == null || !target.IsValidTarget())
            {
                target = TargetSelector.GetTarget(MyLogic.E.Range + 300f);
            }

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

            if (useE && MyLogic.E.Ready && target.IsValidTarget(MyLogic.E.Range + 300f))
            {
                var ePos = GetEPosition(target);

                if (ePos != Vector3.Zero && ePos.DistanceToPlayer() <= MyLogic.E.Range && CanCastE(ePos, target))
                {
                    if (MyLogic.MiscMenu["FlowersKatarina.MiscMenu.EHumanizer"].As <MenuSliderBool>().Enabled)
                    {
                        MyDelayAction.Queue(
                            MyLogic.MiscMenu["FlowersKatarina.MiscMenu.EHumanizer"].As <MenuSliderBool>().Value,
                            () => MyLogic.E.Cast(ePos));
                    }
                    else
                    {
                        MyLogic.E.Cast(ePos);
                    }
                }
            }

            if (useQ && MyLogic.Q.Ready && target.IsValidTarget(MyLogic.Q.Range) && !MyLogic.E.Ready)
            {
                if (target.IsValidTarget(MyLogic.Q.Range))
                {
                    if (!(MyLogic.W.Ready && MyLogic.E.Ready) && target.DistanceToPlayer() <= 300 ||
                        !target.IsFacingUnit(ObjectManager.GetLocalPlayer()) && target.DistanceToPlayer() > 300)
                    {
                        MyLogic.Q.CastOnUnit(target);
                    }
                }
                else if (target.IsValidTarget(MyLogic.E.Range) &&
                         (MyLogic.Orbwalker.Mode == OrbwalkingMode.Combo &&
                          MyLogic.ComboMenu["FlowersKatarina.ComboMenu.QOnMinion"].Enabled ||
                          MyLogic.Orbwalker.Mode == OrbwalkingMode.Mixed &&
                          MyLogic.HarassMenu["FlowersKatarina.HarassMenu.QOnMinion"].Enabled))
                {
                    var extraDagger = target.ServerPosition.Extend(ObjectManager.GetLocalPlayer().ServerPosition, 350f);
                    var min         = ObjectManager.Get <Obj_AI_Base>().Aggregate((x, y) => x.Distance(extraDagger) < y.Distance(extraDagger) ? x : y);

                    if (min.Distance(extraDagger) < 130)
                    {
                        MyLogic.Q.CastOnUnit(min);
                    }
                }
            }

            if (useW && MyLogic.W.Ready && target.IsValidTarget(MyLogic.W.Range))
            {
                MyLogic.W.Cast();
            }
        }
Exemplo n.º 21
0
 private static void Swap(Obj_AI_Hero target)
 {
     var eCanKill = E.CanCast(target) && target.Health + target.PhysicalShield <= E.GetDamage(target);
     if (MainMenu["Combo"]["SwapIfKill"])
     {
         if (IsKillByMark(target) || eCanKill)
         {
             SwapCountEnemy();
         }
     }
     if (Player.HealthPercent < MainMenu["Combo"]["SwapIfHpU"])
     {
         if (IsKillByMark(target) || !eCanKill || Player.HealthPercent < target.HealthPercent)
         {
             SwapCountEnemy();
         }
     }
     else if (MainMenu["Combo"]["SwapGap"].GetValue<MenuList>().Index > 0 && !E.IsInRange(target)
              && !IsKillByMark(target))
     {
         var playerDist = target.DistanceToPlayer();
         var wDist = WState == 1 && wShadow.IsValid() ? wShadow.Distance(target) : float.MaxValue;
         var rDist = RState == 1 && rShadow.IsValid() ? rShadow.Distance(target) : float.MaxValue;
         var minDist = Math.Min(Math.Min(wDist, rDist), playerDist);
         if (minDist < playerDist)
         {
             switch (MainMenu["Combo"]["SwapGap"].GetValue<MenuList>().Index)
             {
                 case 1:
                     if (Math.Abs(minDist - wDist) < float.Epsilon)
                     {
                         var comboW = GetCombo(
                             target,
                             Q.IsReady() && minDist < Q.Range,
                             false,
                             E.IsReady() && minDist < E.Range,
                             MainMenu["Combo"]["R"] && MainMenu["Combo"]["RCast" + target.ChampionName]
                             && RState == 0 && minDist < R.Range);
                         if (minDist > target.GetRealAutoAttackRange())
                         {
                             comboW[0] -= Player.GetAutoAttackDamage(target);
                         }
                         if (target.Health + target.PhysicalShield <= comboW[0] && Player.Mana >= comboW[1]
                             && W.Cast())
                         {
                             return;
                         }
                         if (MainMenu["Combo"]["R"] && MainMenu["Combo"]["RCast" + target.ChampionName]
                             && RState == 0 && !R.IsInRange(target) && minDist < R.Range
                             && (MainMenu["Combo"]["RMode"].GetValue<MenuList>().Index == 0 || CanR)
                             && W.Cast())
                         {
                             return;
                         }
                     }
                     else if (Math.Abs(minDist - rDist) < float.Epsilon)
                     {
                         var comboR = GetCombo(
                             target,
                             Q.IsReady() && minDist < Q.Range,
                             false,
                             E.IsReady() && minDist < E.Range,
                             false);
                         if (minDist > target.GetRealAutoAttackRange())
                         {
                             comboR[0] -= Player.GetAutoAttackDamage(target);
                         }
                         if (target.Health + target.PhysicalShield <= comboR[0] && Player.Mana >= comboR[1]
                             && R.Cast())
                         {
                             return;
                         }
                     }
                     if (minDist < E.Range && target.HealthPercent <= 20
                         && target.HealthPercent < Player.HealthPercent && (Q.IsReady() || E.IsReady()))
                     {
                         if (Math.Abs(minDist - wDist) < float.Epsilon)
                         {
                             W.Cast();
                         }
                         else if (Math.Abs(minDist - rDist) < float.Epsilon)
                         {
                             R.Cast();
                         }
                     }
                     break;
                 case 2:
                     if (minDist <= 500)
                     {
                         if (Math.Abs(minDist - wDist) < float.Epsilon)
                         {
                             W.Cast();
                         }
                         else if (Math.Abs(minDist - rDist) < float.Epsilon)
                         {
                             R.Cast();
                         }
                     }
                     break;
             }
         }
     }
 }
Exemplo n.º 22
0
 private static bool IsInRangeQ(Obj_AI_Hero target)
 {
     var distPlayer = target.DistanceToPlayer();
     var distW = wShadow.IsValid() ? wShadow.Distance(target) : float.MaxValue;
     var distR = rShadow.IsValid() ? rShadow.Distance(target) : float.MaxValue;
     return Math.Min(Math.Min(distR, distW), distPlayer) < Q.Range + Q.Width / 2;
 }
Exemplo n.º 23
0
 private static bool GapByQ(Obj_AI_Hero target)
 {
     if (!MainMenu["Insec"]["Q"] || !Q.IsReady())
     {
         return false;
     }
     var minDist = CanJumpFlash
                       ? WardManager.WardRange + R.Range
                       : WardManager.WardRange - GetDistBehind(target);
     if (IsQOne)
     {
         var pred = Q.VPrediction(target, false, CollisionableObjects.YasuoWall);
         if (pred.Hitchance >= Q.MinHitChance)
         {
             var col = pred.VCollision();
             if (col.Count == 0 && Q.Cast(pred.CastPosition))
             {
                 return true;
             }
             if (Smite.IsReady() && col.Count == 1 && MainMenu["Insec"]["QCol"])
             {
                 var obj = col.First();
                 if (obj.Health <= GetSmiteDmg && obj.DistanceToPlayer() < SmiteRange
                     && Player.Spellbook.CastSpell(Smite, obj))
                 {
                     Q.Cast(pred.CastPosition);
                     return true;
                 }
             }
         }
         if (!MainMenu["Insec"]["QObj"])
         {
             return false;
         }
         if (
             GameObjects.EnemyHeroes.Where(i => i.NetworkId != target.NetworkId)
                 .Cast<Obj_AI_Base>()
                 .Concat(
                     GameObjects.EnemyMinions.Where(i => i.IsMinion() || i.IsPet())
                         .Concat(GameObjects.Jungle))
                 .Where(
                     i =>
                     i.IsValidTarget(Q.Range) && Q.GetHealthPrediction(i) > Q.GetDamage(i)
                     && target.DistanceToPlayer() > i.Distance(target) && i.Distance(target) < minDist - 80)
                 .OrderBy(i => i.Distance(target))
                 .Select(i => Q.VPrediction(i))
                 .Where(i => i.Hitchance >= Q.MinHitChance)
                 .OrderByDescending(i => i.Hitchance)
                 .Any(i => Q.Cast(i.CastPosition)))
         {
             return true;
         }
     }
     else if (target.DistanceToPlayer() > minDist
              && (HaveQ(target) || (objQ.IsValidTarget(Q2.Range) && target.Distance(objQ) < minDist - 80))
              && ((WardManager.CanWardJump && Player.Mana >= 80)
                  || (MainMenu["Insec"]["Flash"] && Flash.IsReady())) && Q.Cast())
     {
         Variables.TargetSelector.SetTarget(target);
         return true;
     }
     return false;
 }
Exemplo n.º 24
0
        private void RLogic()
        {
            Obj_AI_Hero target = null;

            if (TargetSelector.GetSelectedTarget() != null &&
                TargetSelector.GetSelectedTarget().DistanceToPlayer() <=
                Menu.Item("RMenuMax", true).GetValue <Slider>().Value)
            {
                target = TargetSelector.GetSelectedTarget();
            }
            else
            {
                target = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
            }

            if (R.IsReady() && CheckTarget(target, R.Range))
            {
                if (R.Instance.Name == "JhinR")
                {
                    if (Menu.Item("RMenuSemi", true).GetValue <KeyBind>().Active)
                    {
                        R.Cast(R.GetPrediction(target).UnitPosition, true);
                    }

                    if (!Menu.Item("RMenuAuto", true).GetValue <bool>())
                    {
                        return;
                    }

                    if (Menu.Item("RMenuCheck", true).GetValue <bool>() && Me.CountEnemiesInRange(800f) > 0)
                    {
                        return;
                    }

                    if (target.DistanceToPlayer() <= Menu.Item("RMenuMin", true).GetValue <Slider>().Value)
                    {
                        return;
                    }

                    if (target.DistanceToPlayer() > Menu.Item("RMenuMax", true).GetValue <Slider>().Value)
                    {
                        return;
                    }

                    if (target.Health > Me.GetSpellDamage(target, SpellSlot.R) * Menu.Item("RMenuKill", true).GetValue <Slider>().Value)
                    {
                        return;
                    }

                    R.Cast(R.GetPrediction(target).UnitPosition, true);
                }

                if (R.Instance.Name == "JhinRShot")
                {
                    foreach (var t in HeroManager.Enemies.Where(x => x.IsValidTarget(R.Range) && InRCone(x)))
                    {
                        if (!InRCone(t))
                        {
                            return;
                        }

                        if (Menu.Item("RMenuSemi", true).GetValue <KeyBind>().Active)
                        {
                            AutoUse(t);
                            R.Cast(R.GetPrediction(t).UnitPosition, true);
                        }

                        if (Menu.Item("ComboR", true).GetValue <bool>() &&
                            Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
                        {
                            AutoUse(t);
                            R.Cast(R.GetPrediction(t).UnitPosition, true);
                        }

                        if (!Menu.Item("RMenuAuto", true).GetValue <bool>())
                        {
                            return;
                        }

                        AutoUse(t);
                        R.Cast(R.GetPrediction(t).UnitPosition, true);
                    }
                }
            }
        }
Exemplo n.º 25
0
        private static void Swap(Obj_AI_Hero target)
        {
            var eCanKill = E.CanCast(target) && E.CanHitCircle(target) &&
                           target.Health + target.PhysicalShield <= E.GetDamage(target);
            var markCanKill = IsKillByMark(target);

            if (MainMenu["Combo"]["SwapIfKill"] && (markCanKill || eCanKill))
            {
                SwapCountEnemy();
                return;
            }
            if (Player.HealthPercent < MainMenu["Combo"]["SwapIfHpU"])
            {
                if (markCanKill || !eCanKill || Player.HealthPercent < target.HealthPercent)
                {
                    SwapCountEnemy();
                }
            }
            else if (MainMenu["Combo"]["SwapGap"].GetValue <MenuList>().Index > 0 && !E.IsInRange(target) && !markCanKill)
            {
                var wDist   = WState == 1 && wShadow.IsValid() ? wShadow.Distance(target) : float.MaxValue;
                var rDist   = RState == 1 && rShadow.IsValid() ? rShadow.Distance(target) : float.MaxValue;
                var minDist = Math.Min(wDist, rDist);
                if (minDist.Equals(float.MaxValue) || target.DistanceToPlayer() <= minDist)
                {
                    return;
                }
                var swapByW = Math.Abs(minDist - wDist) < float.Epsilon;
                var swapByR = Math.Abs(minDist - rDist) < float.Epsilon;
                if (swapByW && minDist < R.Range && !R.IsInRange(target) &&
                    MainMenu["Combo"]["R"].GetValue <MenuKeyBind>().Active &&
                    MainMenu["Combo"]["RCast" + target.ChampionName] && RState == 0 && CanR && W.Cast())
                {
                    return;
                }
                switch (MainMenu["Combo"]["SwapGap"].GetValue <MenuList>().Index)
                {
                case 1:
                    if (IsInRangeE(target) && target.HealthPercent < 15 && Player.HealthPercent > 30 &&
                        (Q.IsReady() || E.IsReady()))
                    {
                        if (swapByW)
                        {
                            W.Cast();
                        }
                        else if (swapByR)
                        {
                            R.Cast();
                        }
                        return;
                    }
                    var combo = GetCombo(
                        target,
                        Q.IsReady() && minDist < Q.Range,
                        false,
                        E.IsReady() && minDist < E.Range);
                    if (minDist > target.GetRealAutoAttackRange())
                    {
                        combo[0] -= Player.GetAutoAttackDamage(target);
                    }
                    if (minDist > target.GetRealAutoAttackRange() + 100)
                    {
                        combo[0] -= Player.GetAutoAttackDamage(target);
                    }
                    if (target.Health + target.PhysicalShield > combo[0] || Player.Mana < combo[1])
                    {
                        return;
                    }
                    if (swapByW)
                    {
                        W.Cast();
                    }
                    else if (swapByR)
                    {
                        R.Cast();
                    }
                    break;

                case 2:
                    if (minDist > 500)
                    {
                        return;
                    }
                    if (swapByW)
                    {
                        W.Cast();
                    }
                    else if (swapByR)
                    {
                        R.Cast();
                    }
                    break;
                }
            }
        }
Exemplo n.º 26
0
        private static void RLogic()
        {
            Obj_AI_Hero target = null;

            if (TargetSelector.GetSelectedTarget() != null &&
                TargetSelector.GetSelectedTarget().DistanceToPlayer() <= MiscOption.GetSlider("R", "rMenuMax").Value)
            {
                target = TargetSelector.GetSelectedTarget();
            }
            else
            {
                target = MyTargetSelector.GetTarget(R.Range);
            }

            if (R.Ready)
            {
                switch (R.GetBasicSpell().Name)
                {
                case "JhinR":
                {
                    if (target.IsValidTarget(R.Range))
                    {
                        var rPred = R.GetPrediction(target);

                        if (MiscOption.GetKey("R", "rMenuSemi").Value)
                        {
                            if (R.Cast(rPred.UnitPosition))
                            {
                                rShotTarget = target;
                                return;
                            }
                        }

                        if (!MiscOption.GetBool("R", "rMenuAuto").Enabled)
                        {
                            return;
                        }

                        if (MiscOption.GetBool("R", "rMenuCheck").Enabled&& Me.CountEnemyHeroesInRange(800f) > 0)
                        {
                            return;
                        }

                        if (target.DistanceToPlayer() <= MiscOption.GetSlider("R", "rMenuMin").Value)
                        {
                            return;
                        }

                        if (target.DistanceToPlayer() > MiscOption.GetSlider("R", "rMenuMax").Value)
                        {
                            return;
                        }

                        if (MiscOption.GetSlider("R", "rMenuKill").Value == 0 ||
                            target.Health > Me.GetSpellDamage(target, SpellSlot.R) * MiscOption.GetSlider("R", "rMenuKill").Value)
                        {
                            return;
                        }

                        if (IsSpellHeroCollision(target, R))
                        {
                            return;
                        }

                        if (R.Cast(rPred.UnitPosition))
                        {
                            rShotTarget = target;
                        }
                    }
                }
                break;

                case "JhinRShot":
                {
                    var selectTarget = TargetSelector.GetSelectedTarget();

                    if (selectTarget != null && selectTarget.IsValidTarget(R.Range) && InRCone(selectTarget))
                    {
                        var rPred = R.GetPrediction(selectTarget);

                        if (MiscOption.GetKey("R", "rMenuSemi").Enabled)
                        {
                            AutoUse(rShotTarget);

                            if (rPred.HitChance >= HitChance.High)
                            {
                                R.Cast(rPred.CastPosition);
                            }

                            return;
                        }

                        if (ComboOption.UseR && Orbwalker.Mode == OrbwalkingMode.Combo)
                        {
                            AutoUse(rShotTarget);

                            if (rPred.HitChance >= HitChance.High)
                            {
                                R.Cast(rPred.CastPosition);
                            }

                            return;
                        }

                        if (!MiscOption.GetBool("R", "rMenuAuto").Enabled)
                        {
                            return;
                        }

                        AutoUse(rShotTarget);

                        if (rPred.HitChance >= HitChance.High)
                        {
                            R.Cast(rPred.CastPosition);
                        }

                        return;
                    }

                    foreach (
                        var t in
                        GameObjects.EnemyHeroes.Where(x => x.IsValidTarget(R.Range) && InRCone(x))
                        .OrderBy(x => x.Health).ThenByDescending(x => Me.GetSpellDamage(x, SpellSlot.R)))
                    {
                        if (t.IsValidTarget(R.Range) && !target.IsUnKillable())
                        {
                            var rPred = R.GetPrediction(t);

                            if (MiscOption.GetKey("R", "rMenuSemi").Enabled)
                            {
                                AutoUse(t);

                                if (rPred.HitChance >= HitChance.High)
                                {
                                    R.Cast(rPred.CastPosition);
                                }

                                return;
                            }

                            if (ComboOption.UseR && Orbwalker.Mode == OrbwalkingMode.Combo)
                            {
                                AutoUse(t);

                                if (rPred.HitChance >= HitChance.High)
                                {
                                    R.Cast(rPred.CastPosition);
                                }

                                return;
                            }

                            if (!MiscOption.GetBool("R", "rMenuAuto").Enabled)
                            {
                                return;
                            }

                            AutoUse(t);

                            if (rPred.HitChance >= HitChance.High)
                            {
                                R.Cast(rPred.CastPosition);
                            }

                            return;
                        }
                    }
                }
                break;
                }
            }
        }
Exemplo n.º 27
0
        private static void Combo()
        {
            Obj_AI_Hero target = null;

            target = TargetSelector.GetSelectedTarget() ??
                     TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

            if (CheckTarget(target, Q.Range))
            {
                if (Menu.Item("ComboDot", true).GetValue <bool>() &&
                    Ignite != SpellSlot.Unknown && Ignite.IsReady())
                {
                    if (ComboDamage(target) > target.Health - 150 || target.HealthPercent < 20)
                    {
                        Me.Spellbook.CastSpell(Ignite, target);
                    }
                }

                if (Me.Level < 6)
                {
                    if (Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady() && target.IsValidTarget(Q.Range))
                    {
                        Q.CastTo(target);
                    }

                    if (Menu.Item("ComboW", true).GetValue <bool>() && W.IsReady() && target.IsValidTarget(W.Range))
                    {
                        W.Cast(true);
                    }

                    if (Menu.Item("ComboE", true).GetValue <bool>() && E.IsReady() &&
                        target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me) + 50 &&
                        target.IsValidTarget(E.Range - 30) && !target.HasBuffOfType(BuffType.SpellShield))
                    {
                        E.Cast(true);
                    }
                }
                else
                {
                    switch (Menu.Item("ComboMode", true).GetValue <StringList>().SelectedIndex)
                    {
                    case 0:
                        if (Menu.Item("ComboR", true).GetValue <bool>() && R.IsReady() &&
                            Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady() && target.IsValidTarget(R.Range) &&
                            target.DistanceToPlayer() >= 600)
                        {
                            Q.Cast(target, true);
                            R.Cast(target, true);
                        }

                        if (Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady() && target.IsValidTarget(Q.Range))
                        {
                            Q.CastTo(target);
                        }

                        if (Menu.Item("ComboR", true).GetValue <bool>() && R.IsReady() && target.IsValidTarget(R.Range))
                        {
                            LogicCast(target);
                        }

                        if (Menu.Item("ComboW", true).GetValue <bool>() && W.IsReady() && target.IsValidTarget(W.Range))
                        {
                            W.Cast(true);
                        }

                        if (Menu.Item("ComboE", true).GetValue <bool>() && E.IsReady() &&
                            target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me) + 50 &&
                            target.IsValidTarget(E.Range - 30) && !target.HasBuffOfType(BuffType.SpellShield))
                        {
                            E.Cast(true);
                        }
                        break;

                    case 1:
                        if (target.IsValidTarget(R.Range))
                        {
                            if (Menu.Item("ComboR", true).GetValue <bool>() && R.IsReady() &&
                                Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady() && target.IsValidTarget(R.Range) &&
                                target.DistanceToPlayer() >= Menu.Item("MisayaRange", true).GetValue <Slider>().Value)
                            {
                                R.Cast(target, true);
                                Q.Cast(target, true);
                            }

                            if (Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady() && target.IsValidTarget(Q.Range))
                            {
                                Q.CastTo(target);
                            }

                            if (Menu.Item("ComboR", true).GetValue <bool>() && R.IsReady() && target.IsValidTarget(R.Range))
                            {
                                LogicCast(target);
                            }

                            if (Menu.Item("ComboW", true).GetValue <bool>() && W.IsReady() && target.IsValidTarget(W.Range))
                            {
                                W.Cast(true);
                            }

                            if (Menu.Item("ComboE", true).GetValue <bool>() && E.IsReady() &&
                                target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me) + 50 &&
                                target.IsValidTarget(E.Range - 30) && !target.HasBuffOfType(BuffType.SpellShield))
                            {
                                E.Cast(true);
                            }
                        }
                        break;
                    }
                }
            }
        }
Exemplo n.º 28
0
 internal static void Start(Obj_AI_Hero target)
 {
     if (CanRFlash && objR.Health + objR.PhysicalShield > R.GetDamage(objR)
         && Player.Spellbook.CastSpell(Flash, GetPositionBehind(objR)))
     {
         return;
     }
     if (Variables.Orbwalker.CanMove() && Variables.TickCount - lastMoveTime > 1000)
     {
         if (target != null && lastMoveTime > 0 && CanInsec
             && GetPositionKickTo(target).DistanceToPlayer() > target.Distance(GetPositionKickTo(target)))
         {
             Variables.Orbwalker.Move(GetPositionBehind(target));
         }
         else
         {
             Variables.Orbwalker.Move(Game.CursorPos);
         }
     }
     if (target == null || !CanInsec)
     {
         return;
     }
     if ((!CanJumpFlash || !canJumpFlash) && GapByQ(target))
     {
         return;
     }
     if (!IsRecent)
     {
         var checkFlash = GapCheck(target, true);
         var checkJump = GapCheck(target);
         if (!isDashing && CanJumpFlash && !canJumpFlash && !checkFlash.Item2 && !checkJump.Item2
             && target.DistanceToPlayer() < WardManager.WardRange + R.Range)
         {
             canJumpFlash = true;
         }
         if (!canJumpFlash)
         {
             if (checkJump.Item2)
             {
                 GapByWardJump(target, checkJump.Item1);
                 return;
             }
             if (MainMenu["Insec"]["Flash"] && checkFlash.Item2)
             {
                 GapByFlash(target, checkFlash.Item1);
                 return;
             }
         }
         else if (WardManager.Place(target.ServerPosition, false, true))
         {
             return;
         }
     }
     if (R.IsInRange(target))
     {
         var posEnd = GetPositionKickTo(target);
         if (posEnd.DistanceToPlayer() > target.Distance(posEnd))
         {
             var posTarget = target.ServerPosition.ToVector2();
             var project = posTarget.Extend(Player.ServerPosition, -KickRange)
                 .ProjectOn(posTarget, posEnd.Extend(posTarget, -(KickRange * 0.5f)));
             if (project.IsOnSegment && project.SegmentPoint.Distance(posEnd) <= KickRange * 0.5f)
             {
                 R.CastOnUnit(target);
             }
         }
     }
 }
Exemplo n.º 29
0
        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;
            }
        }
Exemplo n.º 30
0
 private static SpellSlot CanW(Obj_AI_Hero target)
 {
     if (Q.IsReady() && Player.Mana >= Q.Instance.ManaCost + W.Instance.ManaCost
         && target.DistanceToPlayer() < W.Range + Q.Range)
     {
         return SpellSlot.Q;
     }
     if (E.IsReady() && Player.Mana >= E.Instance.ManaCost + W.Instance.ManaCost
         && target.DistanceToPlayer() < W.Range + E.Range)
     {
         return SpellSlot.E;
     }
     return SpellSlot.Unknown;
 }
Exemplo n.º 31
0
 private static void GapByQ(Obj_AI_Hero target)
 {
     if (!MainMenu["Insec"]["Q"] || !Q.IsReady())
     {
         return;
     }
     var minDist = WardManager.WardRange - GetDistBehind(target);
     if (IsQOne)
     {
         var pred = Q.VPrediction(target);
         if (pred.Hitchance == HitChance.Collision || pred.Hitchance == HitChance.OutOfRange)
         {
             if (pred.Hitchance == HitChance.Collision && MainMenu["Insec"]["QCol"] && Smite.IsReady()
                 && !pred.CollisionObjects.Any(i => i.IsMe))
             {
                 var col =
                     pred.CollisionObjects.Select(i => i as Obj_AI_Minion).Where(i => i.IsValid()).ToList();
                 if (col.Count == 1
                     && col.Any(i => i.Health <= GetSmiteDmg && i.DistanceToPlayer() < SmiteRange)
                     && Player.Spellbook.CastSpell(Smite, col.First()))
                 {
                     Q.Cast(pred.CastPosition);
                     return;
                 }
             }
             if (MainMenu["Insec"]["QObj"])
             {
                 foreach (var predNear in
                     GameObjects.EnemyHeroes.Where(i => i.NetworkId != target.NetworkId)
                         .Cast<Obj_AI_Base>()
                         .Concat(
                             GameObjects.EnemyMinions.Where(i => i.IsMinion() || i.IsPet())
                                 .Concat(GameObjects.Jungle))
                         .Where(
                             i =>
                             i.IsValidTarget(Q.Range) && Q.GetHealthPrediction(i) > Q.GetDamage(i)
                             && target.DistanceToPlayer() > i.Distance(target)
                             && i.Distance(target) < minDist - 80)
                         .OrderBy(i => i.Distance(target))
                         .Select(i => Q.VPrediction(i))
                         .Where(i => i.Hitchance >= Q.MinHitChance)
                         .OrderByDescending(i => i.Hitchance))
                 {
                     Q.Cast(predNear.CastPosition);
                 }
             }
         }
         else if (pred.Hitchance >= Q.MinHitChance)
         {
             Q.Cast(pred.CastPosition);
         }
     }
     else if (target.DistanceToPlayer() > minDist
              && (HaveQ(target) || (GetQ2Obj != null && target.Distance(GetQ2Obj) < minDist - 80))
              && ((WardManager.CanWardJump && Player.Mana >= 80)
                  || (MainMenu["Insec"]["Flash"] && Flash.IsReady())) && Q.Cast())
     {
         Variables.TargetSelector.SetTarget(target);
     }
 }
Exemplo n.º 32
0
        private static void RLogic(Obj_AI_Hero Target)
        {
            if (!CheckTarget(Target) || !Target.IsValidTarget(900f))
            {
                return;
            }

            var DashPos = Vector3.Zero;

            DashPos = Player.ServerPosition.Extend(Game.CursorPos, 450f);

            if ((DashPos.IsWall() && Menu["R"]["RCheck"]) || (DashPos.IsUnderEnemyTurret() && Menu["R"]["RTurret"]) || (Target.Health < GetDamage(Target, false, true, true, true, false) && Target.IsValidTarget(650)))
            {
                return;
            }

            if (Player.HasBuff("AhriTumble"))
            {
                var buffTime = Player.GetBuff("AhriTumble").EndTime;

                if (buffTime - Game.Time <= 3)
                {
                    R.Cast(DashPos);
                }

                if (QReturn != null && QReturn.IsValid)
                {
                    var ReturnPos = QReturn.Position;

                    if (Target.DistanceToPlayer() > ReturnPos.DistanceToPlayer())
                    {
                        var targetdis  = Target.Position.Distance(ReturnPos);
                        var QReturnEnd = QReturn.EndPosition;

                        if (!(targetdis < Q.Range))
                        {
                            return;
                        }

                        var CastPos = QReturnEnd.Extend(Target.ServerPosition, Target.ServerPosition.Distance(DashPos));

                        if ((CastPos.IsWall() && Menu["R"]["RCheck"]) || Player.ServerPosition.Distance(CastPos) > R.Range || CastPos.CountEnemyHeroesInRange(R.Range) > 2 || (DashPos.IsUnderEnemyTurret() && Menu["R"]["RTurret"]))
                        {
                            return;
                        }
                        R.Cast(CastPos);
                    }
                }
                else
                {
                    if (Q.IsReady() || DashPos.CountEnemyHeroesInRange(R.Range) > 2 || !Target.IsValidTarget(800f))
                    {
                        return;
                    }

                    if (Game.CursorPos.Distance(Target.Position) > Target.DistanceToPlayer() && Target.IsValidTarget(R.Range))
                    {
                        R.Cast(DashPos);
                    }
                    else if (Game.CursorPos.Distance(Target.Position) < Target.DistanceToPlayer() && !Target.IsValidTarget(R.Range) && Target.IsValidTarget(800f))
                    {
                        R.Cast(DashPos);
                    }
                }
            }
            else
            {
                var AllDamage = GetDamage(Target, false);
                var QDamage   = Q.GetDamage(Target) * 2;
                var WDamage   = W.GetDamage(Target);
                var RDamage   = R.GetDamage(Target) * 3;

                if (!Target.IsValidTarget(800) || !(Target.Distance(DashPos) <= R.Range))
                {
                    return;
                }

                if (DashPos.CountEnemyHeroesInRange(R.Range) > 2 ||
                    Target.CountAllyHeroesInRange(R.Range) > 2)
                {
                    return;
                }

                if (Target.Health >= AllDamage && Target.Health <= QDamage + WDamage + RDamage)
                {
                    R.Cast(DashPos);
                }
                else if (Target.Health < RDamage + QDamage)
                {
                    R.Cast(DashPos);
                }
                else if (Target.Health < RDamage + WDamage)
                {
                    R.Cast(DashPos);
                }
            }
        }
Exemplo n.º 33
0
        private void RLogic()
        {
            Obj_AI_Hero target = null;

            if (TargetSelector.GetSelectedTarget() != null &&
                TargetSelector.GetSelectedTarget().DistanceToPlayer() <= Menu.GetSlider("rMenuMax"))
            {
                target = TargetSelector.GetSelectedTarget();
            }
            else
            {
                target = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
            }

            if (R.IsReady() && target.Check(R.Range))
            {
                switch (R.Instance.Name)
                {
                case "JhinR":
                    if (Menu.GetKey("rMenuSemi"))
                    {
                        if (R.Cast(R.GetPrediction(target).UnitPosition))
                        {
                            rShotTarget = target;
                            return;
                        }
                    }

                    if (!Menu.GetBool("rMenuAuto"))
                    {
                        return;
                    }

                    if (Menu.GetBool("rMenuCheck") && Me.CountEnemiesInRange(800f) > 0)
                    {
                        return;
                    }

                    if (target.DistanceToPlayer() <= Menu.GetSlider("rMenuMin"))
                    {
                        return;
                    }

                    if (target.DistanceToPlayer() > Menu.GetSlider("rMenuMax"))
                    {
                        return;
                    }

                    if (target.Health >
                        Me.GetSpellDamage(target, SpellSlot.R) * Menu.GetSlider("rMenuKill"))
                    {
                        return;
                    }

                    if (IsSpellHeroCollision(target, R))
                    {
                        return;
                    }

                    if (R.Cast(R.GetPrediction(target).UnitPosition))
                    {
                        rShotTarget = target;
                    }
                    break;

                case "JhinRShot":
                    var selectTarget = TargetSelector.GetSelectedTarget();

                    if (selectTarget != null && selectTarget.IsValidTarget(R.Range) && InRCone(selectTarget))
                    {
                        if (Menu.GetKey("rMenuSemi"))
                        {
                            AutoUse(rShotTarget);
                            SpellManager.PredCast(R, rShotTarget);
                            return;
                        }

                        if (Menu.GetBool("ComboR") && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
                        {
                            AutoUse(rShotTarget);
                            SpellManager.PredCast(R, rShotTarget);
                            return;
                        }

                        if (!Menu.GetBool("rMenuAuto"))
                        {
                            return;
                        }

                        AutoUse(rShotTarget);
                        SpellManager.PredCast(R, rShotTarget);
                        return;
                    }

                    foreach (
                        var t in
                        HeroManager.Enemies.Where(x => x.IsValidTarget(R.Range) && InRCone(x))
                        .OrderBy(x => x.Health))
                    {
                        if (Menu.GetKey("rMenuSemi"))
                        {
                            AutoUse(t);
                            SpellManager.PredCast(R, t);
                            return;
                        }

                        if (Menu.GetBool("ComboR") && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
                        {
                            AutoUse(t);
                            SpellManager.PredCast(R, t);
                            return;
                        }

                        if (!Menu.GetBool("rMenuAuto"))
                        {
                            return;
                        }

                        AutoUse(t);
                        SpellManager.PredCast(R, t);
                        return;
                    }
                    break;
                }
            }
        }