Exemplo n.º 1
0
        void LH()
        {
            List <Obj_AI_Base> allMinions = MinionManager.GetMinions(Khazix.ServerPosition, Q.Range);

            if (Config.GetBool("UseQFarm") && Q.IsReady())
            {
                foreach (Obj_AI_Base minion in
                         allMinions.Where(
                             minion =>
                             minion.IsValidTarget() &&
                             HealthPrediction.GetHealthPrediction(
                                 minion, (int)(Khazix.Distance(minion) * 1000 / 1400)) <
                             0.75 * Khazix.GetSpellDamage(minion, SpellSlot.Q)))
                {
                    if (Vector3.Distance(minion.ServerPosition, Khazix.ServerPosition) >
                        Orbwalking.GetRealAutoAttackRange(Khazix) && Khazix.Distance(minion) <= Q.Range)
                    {
                        Q.CastOnUnit(minion);
                        return;
                    }
                }
            }
            if (Config.GetBool("UseWFarm") && W.IsReady())
            {
                MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(
                    MinionManager.GetMinions(Khazix.ServerPosition, W.Range).Where(minion => HealthPrediction.GetHealthPrediction(
                                                                                       minion, (int)(Khazix.Distance(minion) * 1000 / 1400)) <
                                                                                   0.75 * Khazix.GetSpellDamage(minion, SpellSlot.W))
                    .Select(minion => minion.ServerPosition.To2D())
                    .ToList(), W.Width, W.Range);
                if (farmLocation.MinionsHit >= 1)
                {
                    if (!EvolvedW)
                    {
                        if (Khazix.Distance(farmLocation.Position) <= W.Range)
                        {
                            W.Cast(farmLocation.Position);
                        }
                    }

                    if (EvolvedW)
                    {
                        if (Khazix.Distance(farmLocation.Position) <= W.Range)
                        {
                            W.Cast(farmLocation.Position);
                        }
                    }
                }
            }

            if (Config.GetBool("UseEFarm") && E.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, E.Range).Where(minion => HealthPrediction.GetHealthPrediction(
                                                                                           minion, (int)(Khazix.Distance(minion) * 1000 / 1400)) <
                                                                                       0.75 * Khazix.GetSpellDamage(minion, SpellSlot.W))
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), E.Width, E.Range);

                if (farmLocation.MinionsHit >= 1)
                {
                    if (Khazix.Distance(farmLocation.Position) <= E.Range)
                    {
                        E.Cast(farmLocation.Position);
                    }
                }
            }


            if (Config.GetBool("UseItemsFarm"))
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, Hydra.Range)
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), Hydra.Range, Hydra.Range);

                if (Hydra.IsReady() && Khazix.Distance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, Khazix);
                }
                if (Tiamat.IsReady() && Khazix.Distance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, Khazix);
                }
            }
        }
Exemplo n.º 2
0
        public static AttackableUnit GetPossibleTarget()
        {
            if (ForcedTarget != null)
            {
                if (InAutoAttackRange(ForcedTarget))
                {
                    return(ForcedTarget);
                }
                ForcedTarget = null;
            }


            AttackableUnit tempTarget = null;

            if (Menu.Item("orb_Misc_Priority_Unit").GetValue <StringList>().SelectedIndex == 1 &&
                (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear))
            {
                tempTarget = GetBestHeroTarget();
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            //last hit
            if (CurrentMode == Mode.Harass || CurrentMode == Mode.Lasthit || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze)
            {
                foreach (var minion in from minion in ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget() && minion.Name != "Beacon" && InAutoAttackRange(minion) &&
                                                                                                minion.Health < 2 * (MyHero.BaseAttackDamage + MyHero.FlatPhysicalDamageMod))
                         let t = (int)(MyHero.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                                 1000 * (int)MyHero.Distance(minion.Position) / (int)MyProjectileSpeed()
                                 let predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay())
                                                  where minion.Team != GameObjectTeam.Neutral && predHealth > 0 &&
                                                  predHealth <= MyHero.GetAutoAttackDamage(minion, true)
                                                  select minion)
                {
                    return(minion);
                }

                if (MyHero.ChampionName == "Azir" && Soilders.Count > 0)
                {
                    var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, 800, MinionTypes.All, MinionTeam.NotAlly);
                    foreach (var minion in from minion in minions.Where(minion => minion.IsValidTarget() && minion.Name != "Beacon" && InSoldierAttackRange(minion))
                             let t = (int)(MyHero.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)MyHero.Distance(minion.Position) / (int)MyProjectileSpeed()
                                     let predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay(Menu.Item("azir_Misc_Farmdelay").GetValue <Slider>().Value))
                                                      where minion.Team != GameObjectTeam.Neutral && predHealth > 0 &&
                                                      predHealth <= GetAzirAaSandwarriorDamage(minion)
                                                      select minion)
                    {
                        return(minion);
                    }
                }
            }

            if (CurrentMode != Mode.Lasthit)
            {
                tempTarget = GetBestHeroTarget();
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze)
            {
                foreach (
                    var turret in
                    ObjectManager.Get <Obj_AI_Turret>().Where(turret => turret.IsValidTarget(GetAutoAttackRange(MyHero, turret))))
                {
                    return(turret);
                }
            }

            //jungle
            float[] maxhealth;
            if (CurrentMode == Mode.LaneClear || CurrentMode == Mode.Harass || CurrentMode == Mode.LaneFreeze)
            {
                if (MyHero.ChampionName == "Azir" && Soilders.Count > 0)
                {
                    maxhealth = new float[] { 0 };
                    var maxhealth1 = maxhealth;
                    var minions    = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, 800, MinionTypes.All, MinionTeam.Neutral);
                    foreach (
                        var minion in
                        minions
                        .Where(minion => InSoldierAttackRange(minion) && minion.Name != "Beacon" && minion.IsValidTarget())
                        .Where(minion => minion.MaxHealth >= maxhealth1[0] || Math.Abs(maxhealth1[0] - float.MaxValue) < float.Epsilon))
                    {
                        tempTarget   = minion;
                        maxhealth[0] = minion.MaxHealth;
                    }
                    if (tempTarget != null)
                    {
                        return(tempTarget);
                    }
                }

                maxhealth = new float[] { 0 };
                var maxhealth2 = maxhealth;
                foreach (var minion in ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget(GetAutoAttackRange(MyHero, minion)) && minion.Name != "Beacon" && minion.Team == GameObjectTeam.Neutral).Where(minion => minion.MaxHealth >= maxhealth2[0] || Math.Abs(maxhealth2[0] - float.MaxValue) < float.Epsilon))
                {
                    tempTarget   = minion;
                    maxhealth[0] = minion.MaxHealth;
                }
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            //LANE CLEAR
            if (CurrentMode != Mode.LaneClear || ShouldWait())
            {
                //ResetAutoAttackTimer();
                return(null);
            }

            if (MyHero.ChampionName == "Azir" && Soilders.Count > 0)
            {
                maxhealth = new float[] { 0 };
                float[] maxhealth1 = maxhealth;
                var     minions    = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, 800, MinionTypes.All, MinionTeam.NotAlly);
                foreach (var minion in from minion in minions
                         .Where(minion => minion.IsValidTarget() && minion.Name != "Beacon" && InSoldierAttackRange(minion))
                         let predHealth = HealthPrediction.LaneClearHealthPrediction(minion, (int)((MyHero.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay(Menu.Item("azir_Misc_Farmdelay").GetValue <Slider>().Value))
                                          where predHealth >=
                                          GetAzirAaSandwarriorDamage(minion) + MyHero.GetAutoAttackDamage(minion, true) ||
                                          Math.Abs(predHealth - minion.Health) < float.Epsilon
                                          where minion.Health >= maxhealth1[0] || Math.Abs(maxhealth1[0] - float.MaxValue) < float.Epsilon
                                          select minion)
                {
                    tempTarget   = minion;
                    maxhealth[0] = minion.MaxHealth;
                }
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }
            else
            {
                maxhealth = new float[] { 0 };
                foreach (var minion in from minion in ObjectManager.Get <Obj_AI_Minion>()
                         .Where(minion => minion.IsValidTarget(GetAutoAttackRange(MyHero, minion)) && minion.Name != "Beacon")
                         let predHealth = HealthPrediction.LaneClearHealthPrediction(minion, (int)((MyHero.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay())
                                          where predHealth >=
                                          2 * MyHero.GetAutoAttackDamage(minion, true) ||
                                          Math.Abs(predHealth - minion.Health) < float.Epsilon
                                          where minion.Health >= maxhealth[0] || Math.Abs(maxhealth[0] - float.MaxValue) < float.Epsilon
                                          select minion)
                {
                    tempTarget   = minion;
                    maxhealth[0] = minion.MaxHealth;
                }
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            return(null);
        }
Exemplo n.º 3
0
        private static void onUpdate(EventArgs args)
        {
            if (lck || !menu.Item("Q").GetValue <KeyBind>().Active || !Q.IsReady())
            {
                return;
            }
            IEnumerable <Obj_AI_Base> a = ObjectManager.Get <Obj_AI_Base>().Where(obj => obj.IsValidTarget() && me.Distance(obj) < me.AttackRange && HealthPrediction.GetHealthPrediction(obj, (int)((me.AttackCastDelay + 1000 * me.Distance(obj) / me.BasicAttack.MissileSpeed) * (menu.Item("delaymul").GetValue <Slider>().Value / 100f) + menu.Item("delayflat").GetValue <Slider>().Value)) > me.CalcDamage(obj, Damage.DamageType.Physical, me.GetAutoAttackDamage(obj)) * me.PercentArmorPenetrationMod);

            if (!a.Any())
            {
                return;
            }
            Obj_AI_Base tgt = a.OrderByDescending(obj => me.Distance(obj)).Last();

            pos = Game.CursorPos;
            lck = true;
            int delay = (int)((me.AttackCastDelay + 1000 * me.Distance(tgt) / me.BasicAttack.MissileSpeed) * (menu.Item("delaymul").GetValue <Slider>().Value / 100f) + menu.Item("delayflat").GetValue <Slider>().Value);

            me.IssueOrder(GameObjectOrder.AttackUnit, tgt);
            Utility.DelayAction.Add(delay, castQ);
        }
Exemplo n.º 4
0
        public static Obj_AI_Base GetPossibleTarget()
        {
            if (ObjectManager.Get <Obj_Building>()
                .Any(
                    obj =>
                    obj.Position.Distance(MyHero.Position) <= GetAutoAttackRange() + obj.BoundingRadius / 2 && obj.IsTargetable &&
                    obj.Name.StartsWith("HQ_")))
            {
                return(null);
            }

            if (ForcedTarget != null)
            {
                if (InAutoAttackRange(ForcedTarget))
                {
                    return(ForcedTarget);
                }
                ForcedTarget = null;
            }

            Obj_AI_Base tempTarget = null;

            if (Menu.Item("lxOrbwalker_Misc_Priority_Unit").GetValue <StringList>().SelectedIndex == 1 &&
                (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear))
            {
                tempTarget = GetBestHeroTarget();
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            if (CurrentMode == Mode.Harass || CurrentMode == Mode.Lasthit || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze)
            {
                if (MyHero.ChampionName == "Azir")
                {
                    foreach (
                        var minion in
                        from minion in
                        ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget() && InSoldierAttackRange(minion))
                        let t = (int)(MyHero.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                                1000 * (int)MyHero.Distance(minion) / (int)MyProjectileSpeed()
                                let predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay(-125))
                                                 where minion.Team != GameObjectTeam.Neutral && predHealth > 0 &&
                                                 predHealth <= GetAzirAASandwarriorDamage(minion)
                                                 select minion)
                    {
                        return(minion);
                    }
                }

                foreach (
                    var minion in
                    from minion in
                    ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion))
                    let t = (int)(MyHero.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                            1000 * (int)MyHero.Distance(minion) / (int)MyProjectileSpeed()
                            let predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay())
                                             where minion.Team != GameObjectTeam.Neutral && predHealth > 0 &&
                                             predHealth <= MyHero.GetAutoAttackDamage(minion, true)
                                             select minion)
                {
                    return(minion);
                }
            }

            if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze)
            {
                foreach (
                    var turret in
                    ObjectManager.Get <Obj_AI_Turret>().Where(turret => turret.IsValidTarget(GetAutoAttackRange(MyHero, turret))))
                {
                    return(turret);
                }
                if (
                    ObjectManager.Get <Obj_Building>()
                    .Any(
                        obj =>
                        obj.Position.Distance(MyHero.Position) <= GetAutoAttackRange() + obj.BoundingRadius / 2 && obj.IsTargetable &&
                        (obj.Name.StartsWith("Barracks_") || obj.Name.StartsWith("HQ_"))))
                {
                    return(null);
                }
            }

            if (CurrentMode != Mode.Lasthit)
            {
                tempTarget = GetBestHeroTarget();
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            float[] maxhealth;
            if (CurrentMode == Mode.LaneClear || CurrentMode == Mode.Harass || CurrentMode == Mode.LaneFreeze)
            {
                if (MyHero.ChampionName == "Azir")
                {
                    maxhealth = new float[] { 0 };
                    var maxhealth1 = maxhealth;
                    foreach (
                        var minion in
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(minion => InSoldierAttackRange(minion) && minion.IsValidTarget() && minion.Team == GameObjectTeam.Neutral)
                        .Where(minion => minion.MaxHealth >= maxhealth1[0] || Math.Abs(maxhealth1[0] - float.MaxValue) < float.Epsilon))
                    {
                        tempTarget   = minion;
                        maxhealth[0] = minion.MaxHealth;
                    }
                    if (tempTarget != null)
                    {
                        return(tempTarget);
                    }
                }

                maxhealth = new float[] { 0 };
                var maxhealth2 = maxhealth;
                foreach (var minion in ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget(GetAutoAttackRange(MyHero, minion)) && minion.Team == GameObjectTeam.Neutral).Where(minion => minion.MaxHealth >= maxhealth2[0] || Math.Abs(maxhealth2[0] - float.MaxValue) < float.Epsilon))
                {
                    tempTarget   = minion;
                    maxhealth[0] = minion.MaxHealth;
                }
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            if (CurrentMode != Mode.LaneClear || ShouldWait())
            {
                ResetAutoAttackTimer();
                return(null);
            }

            if (MyHero.ChampionName == "Azir")
            {
                maxhealth = new float[] { 0 };
                foreach (var minion in from minion in ObjectManager.Get <Obj_AI_Minion>()
                         .Where(minion => minion.IsValidTarget() && InSoldierAttackRange(minion))
                         let predHealth = HealthPrediction.LaneClearHealthPrediction(minion, (int)((MyHero.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay(-125))
                                          where predHealth >=
                                          GetAzirAASandwarriorDamage(minion) + MyHero.GetAutoAttackDamage(minion, true) ||
                                          Math.Abs(predHealth - minion.Health) < float.Epsilon
                                          where minion.Health >= maxhealth[0] || Math.Abs(maxhealth[0] - float.MaxValue) < float.Epsilon
                                          select minion)
                {
                    tempTarget   = minion;
                    maxhealth[0] = minion.MaxHealth;
                }
                if (tempTarget != null)
                {
                    return(tempTarget);
                }
            }

            maxhealth = new float[] { 0 };
            foreach (var minion in from minion in ObjectManager.Get <Obj_AI_Minion>()
                     .Where(minion => minion.IsValidTarget(GetAutoAttackRange(MyHero, minion)))
                     let predHealth = HealthPrediction.LaneClearHealthPrediction(minion, (int)((MyHero.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay())
                                      where predHealth >=
                                      2 * MyHero.GetAutoAttackDamage(minion, true) ||
                                      Math.Abs(predHealth - minion.Health) < float.Epsilon
                                      where minion.Health >= maxhealth[0] || Math.Abs(maxhealth[0] - float.MaxValue) < float.Epsilon
                                      select minion)
            {
                tempTarget   = minion;
                maxhealth[0] = minion.MaxHealth;
            }
            if (tempTarget != null)
            {
                return(tempTarget);
            }

            return(null);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Note: Do not use autoattacks as additionalSpellDamage!
        /// </summary>
        /// <param name="target"></param>
        /// <param name="additionalSpellDamage"></param>
        /// <returns></returns>
        public virtual bool ShouldBeDead(Obj_AI_Base target, float additionalSpellDamage = 0f)
        {
            var healthPred = HealthPrediction.GetHealthPrediction(target, 1000);

            return(healthPred - (target.GetRemainingIgniteDamage() + additionalSpellDamage) <= 0);
        }
Exemplo n.º 6
0
        private static void OnWaveClear()
        {
            List <Obj_AI_Base> allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range);

            if (Config.Item("UseQFarm").GetValue <bool>() && Q.IsReady())
            {
                foreach (Obj_AI_Base minion in
                         allMinions.Where(
                             minion =>
                             minion.IsValidTarget() &&
                             HealthPrediction.GetHealthPrediction(
                                 minion, (int)(Vector3.Distance(Player.ServerPosition, minion.ServerPosition) * 1000 / 1400)) <
                             0.75 * Player.GetSpellDamage(minion, SpellSlot.Q)))
                {
                    if (Vector3.Distance(minion.ServerPosition, ObjectManager.Player.ServerPosition) >
                        Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) && Vector3.Distance(Player.ServerPosition, minion.ServerPosition) <= Q.Range)
                    {
                        Orbwalker.SetAttack(false);
                        Q.CastOnUnit(minion, false);
                        Orbwalker.SetAttack(true);
                        return;
                    }
                }
            }
            if (Config.Item("UseWFarm").GetValue <bool>() && W.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Player.Position, W.Range)
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), W.Width, W.Range);
                if (Wnorm && !Wevolved)
                {
                    if (Vector2.Distance(Player.ServerPosition.To2D(), farmLocation.Position) <= W.Range)
                    {
                        W.Cast(farmLocation.Position);
                    }
                }
                if (Wevolved && !Wnorm)
                {
                    if (Vector2.Distance(Player.ServerPosition.To2D(), farmLocation.Position) <= WE.Range)
                    {
                        W.Cast(farmLocation.Position);
                    }
                }
            }

            if (Config.Item("UseEFarm").GetValue <bool>() && E.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Player.Position, E.Range)
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), E.Width, E.Range);

                if (Vector2.Distance(Player.ServerPosition.To2D(), farmLocation.Position) <= W.Range)
                {
                    E.Cast(farmLocation.Position);
                }
            }


            if (Config.Item("UseItemsFarm").GetValue <bool>())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Player.Position, HDR.Range)
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), HDR.Range, HDR.Range);

                if (HDR.IsReady() && Vector2.Distance(Player.ServerPosition.To2D(), farmLocation.Position) <= HDR.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, ObjectManager.Player);
                }
                if (TIA.IsReady() && Vector2.Distance(Player.ServerPosition.To2D(), farmLocation.Position) <= TIA.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, ObjectManager.Player);
                }
            }
        }
Exemplo n.º 7
0
        private void Harass()
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(Q.Range, TargetSelector.DamageType.Physical);
            float        perc   = config.Item("minmanaH", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc)
            {
                return;
            }
            if (target == null)
            {
                return;
            }
            if (config.Item("useqH", true).GetValue <bool>() && Q.IsReady())
            {
                var miniPred =
                    MinionManager.GetMinions(
                        Orbwalking.GetRealAutoAttackRange(player), MinionTypes.All, MinionTeam.NotAlly)
                    .FirstOrDefault(
                        minion =>
                        minion.Health > 5 &&
                        HealthPrediction.GetHealthPrediction(
                            minion,
                            (int)(player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                            1000 * (int)player.Distance(minion) / (int)Orbwalking.GetMyProjectileSpeed()) < 0);
                var priortarg = orbwalker.GetTarget();
                var canHArass = priortarg != null && !(priortarg is AIHeroClient);
                if (canHArass || (!canHArass && miniPred == null))
                {
                    if (Program.IsSPrediction)
                    {
                        Q.SPredictionCast(target, HitChance.High);
                    }
                    else
                    {
                        var targQ = Q.GetPrediction(target);
                        if (Q.Range - 100 > targQ.CastPosition.Distance(player.Position) &&
                            targQ.Hitchance >= HitChance.High)
                        {
                            Q.Cast(targQ.CastPosition);
                        }
                    }
                }
            }
            if (config.Item("usewH", true).GetValue <bool>() && W.IsReady())
            {
                if (Program.IsSPrediction)
                {
                    W.SPredictionCast(target, HitChance.High);
                }
                else
                {
                    var tarPered = W.GetPrediction(target);
                    if (W.Range - 80 > tarPered.CastPosition.Distance(player.Position) &&
                        tarPered.Hitchance >= HitChance.High)
                    {
                        W.Cast(tarPered.CastPosition);
                    }
                }
            }
        }
Exemplo n.º 8
0
        public void farmQ()
        {
            if (Program.LaneClear)
            {
                var mobs = MinionManager.GetMinions(Player.ServerPosition, 800, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
                if (mobs.Count > 0)
                {
                    var mob = mobs[0];
                    Q.Cast(mob, true);
                }
            }

            var minions   = MinionManager.GetMinions(Player.ServerPosition, Q.Range);
            int orbTarget = 0;

            if (Orbwalker.GetTarget() != null)
            {
                orbTarget = Orbwalker.GetTarget().NetworkId;
            }

            if (Config.Item("FQ", true).GetValue <bool>())
            {
                foreach (var minion in minions.Where(minion => minion.IsValidTarget() && orbTarget != minion.NetworkId && minion.HealthPercent < 70 && !Orbwalker.InAutoAttackRange(minion) && minion.Health < Q.GetDamage(minion)))
                {
                    if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                    {
                        return;
                    }
                }
            }

            if (Config.Item("farmQ", true).GetValue <bool>() && Program.LaneClear && !Orbwalking.CanAttack() && Player.ManaPercent > Config.Item("Mana", true).GetValue <Slider>().Value)
            {
                var LCP = Config.Item("LCP", true).GetValue <bool>();
                var PT  = Game.Time - GetPassiveTime() > -1.5 || !E.IsReady();

                foreach (var minion in minions.Where(minion => minion.IsValidTarget() && minion.HealthPercent < 70 && Orbwalker.InAutoAttackRange(minion) && orbTarget != minion.NetworkId))
                {
                    var hpPred = HealthPrediction.GetHealthPrediction(minion, 300);
                    if (hpPred < 10)
                    {
                        continue;
                    }

                    var qDmg = Q.GetDamage(minion);
                    if (hpPred < qDmg)
                    {
                        if (hpPred > minion.GetAutoAttackDamage(minion))
                        {
                            if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                            {
                                return;
                            }
                        }
                    }
                    else if (PT || LCP)
                    {
                        if (hpPred > minion.GetAutoAttackDamage(minion) + qDmg)
                        {
                            if (Q.Cast(minion) == Spell.CastStates.SuccessfullyCasted)
                            {
                                return;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 9
0
        static void Laneclear()
        {
            if (!(AIO_Func.getManaPercent(Player) > AIO_Menu.Champion.Laneclear.IfMana))
            {
                return;
            }
            var Minions = MinionManager.GetMinions(1000, MinionTypes.All, MinionTeam.Enemy);

            if (Minions.Count <= 0)
            {
                return;
            }

            if (AIO_Menu.Champion.Laneclear.UseQ && Q.IsReady())
            {
                var _m = MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.MaxHealth).FirstOrDefault(m => m.Health < ((Player.GetSpellDamage(m, SpellSlot.Q))) && HealthPrediction.GetHealthPrediction(m, (int)(Player.Distance(m, false) / Q.Speed), (int)(Q.Delay * 1000 + Game.Ping / 2)) > 0);
                if (_m != null)
                {
                    CastQ(_m);
                }
            }
        }
Exemplo n.º 10
0
        private static void Farm()
        {
            if (!Orbwalking.CanMove(40))
            {
                return;
            }
            var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range);
            var useQ       = Config.Item("UseQFarm").GetValue <bool>();
            var useW       = Config.Item("UseWFarm").GetValue <bool>();

            if (useQ && Q.IsReady())
            {
                foreach (var minion in allMinions.Where(minion => minion.IsValidTarget() && HealthPrediction.GetHealthPrediction(minion, (int)(ObjectManager.Player.Distance(minion) * 1000 / 1400))
                                                        < 0.75 * DamageLib.getDmg(minion, DamageLib.SpellType.Q, DamageLib.StageType.FirstDamage)))
                {
                    if (Vector3.Distance(minion.ServerPosition, ObjectManager.Player.ServerPosition) > Orbwalking.GetRealAutoAttackRange(ObjectManager.Player))
                    {
                        Q.CastOnUnit(minion, Config.Item("QNFE").GetValue <bool>());
                        return;
                    }
                }
            }
            else if (useW && W.IsReady())
            {
                if (!allMinions.Any(minion => minion.IsValidTarget(W.Range) && minion.Health < 0.75 * DamageLib.getDmg(minion, DamageLib.SpellType.W)))
                {
                    return;
                }

                W.Cast();
                return;
            }
        }
Exemplo n.º 11
0
        private void Combo(float combodmg)
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(1100, TargetSelector.DamageType.Magical, true);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() &&
                ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) &&
                ((savedQ == null ||
                  (savedQ != null && target.Distance(savedQ.position) < QExplosionRange &&
                   getQdamage(target) > target.Health)) || useIgnite))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            var rqCombo = R.GetDamage(target) + getQdamage(target) + (hasIgnite ? ignitedmg : 0);

            if (Q.CanCast(target) && config.Item("useq", true).GetValue <bool>() && savedQ == null && SimpleQ)
            {
                if (Program.IsSPrediction)
                {
                    if (Q.SPredictionCast(target, HitChance.High))
                    {
                        return;
                    }
                }
                else
                {
                    if (Q.CastIfHitchanceEquals(target, HitChance.High))
                    {
                        return;
                    }
                }
            }
            if (Q.IsReady() && config.Item("useq", true).GetValue <bool>() && savedQ != null &&
                target.Distance(savedQ.position) < QExplosionRange)
            {
                DetonateQ();
            }
            if (config.Item("usee", true).GetValue <bool>())
            {
                CastE(target);
            }
            if (W.IsReady() && (!SimpleQ || !Q.IsReady()) && config.Item("usew", true).GetValue <bool>() &&
                player.Distance(target) < 300 && Orbwalking.CanMove(100) &&
                target.Health > combodmg - getWdamage(target))
            {
                W.Cast();
            }
            if (R.IsReady())
            {
                if (R.CastIfWillHit(target, config.Item("Rmin", true).GetValue <Slider>().Value))
                {
                    return;
                }
                var logic = config.Item("user", true).GetValue <bool>();
                if (config.Item("rtoq", true).GetValue <bool>() && savedQ != null && !SimpleQ &&
                    (target.Distance(qPos) > QExplosionRange ||
                     (target.Health < rqCombo && target.Health > getQdamage(target))) &&
                    target.Distance(player) < R.Range - 100 &&
                    (target.Health < rqCombo || CheckRPushForAlly(target, rqCombo)) &&
                    target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2)
                {
                    var cast = Prediction.GetPrediction(target, 1000f).UnitPosition.Extend(savedQ.position, -200);
                    if (cast.Distance(player.Position) < R.Range)
                    {
                        //Console.WriteLine("R to Q");
                        if (target.Health < rqCombo && target.Health > rqCombo - ignitedmg &&
                            player.Distance(target) < 580)
                        {
                            useIgnite = true;
                        }

                        LeagueSharp.Common.Utility.DelayAction.Add(400, () => useIgnite = false);
                        HandeR(target, savedQ.position, true);
                        return;
                    }
                }

                if (config.Item("rtoq", true).GetValue <bool>() && logic &&
                    (target.Health < rqCombo && target.Health > getQdamage(target)))
                {
                    castInsec(target);
                }
                if (config.Item("rtoally", true).GetValue <bool>() && logic &&
                    target.Health - rqCombo < target.MaxHealth * 0.5f)
                {
                    var allies =
                        HeroManager.Allies.Where(
                            a =>
                            !a.IsDead && !a.IsMe && a.HealthPercent > 40 && a.Distance(target) < 700 &&
                            a.Distance(target) > 300).OrderByDescending(a => TargetSelector.GetPriority(a));
                    if (allies.Any())
                    {
                        foreach (var ally in allies)
                        {
                            var cast =
                                Prediction.GetPrediction(target, 1000f)
                                .UnitPosition.Extend(Prediction.GetPrediction(ally, 400f).UnitPosition, -200);
                            if (cast.CountEnemiesInRange(1000) <= cast.CountAlliesInRange(1000) &&
                                cast.Distance(player.Position) < R.Range &&
                                cast.Extend(target.Position, 500).Distance(ally.Position) <
                                target.Distance(ally.Position))
                            {
                                //Console.WriteLine("R to Ally: " + ally.Name);
                                HandeR(target, Prediction.GetPrediction(ally, 400f).UnitPosition, false);
                                return;
                            }
                        }
                    }
                    var turret =
                        ObjectManager.Get <Obj_AI_Turret>()
                        .OrderBy(t => t.Distance(target))
                        .FirstOrDefault(t => t.Distance(target) < 2000 && t.IsAlly && !t.IsDead);

                    if (config.Item("rtoturret", true).GetValue <bool>() && turret != null)
                    {
                        var pos = target.Position.Extend(turret.Position, -200);
                        if (target.Distance(turret) > pos.Extend(target.Position, 500).Distance(turret.Position))
                        {
                            //nothing
                        }
                        else if ((pos.CountEnemiesInRange(1000) < pos.CountAlliesInRange(1000) &&
                                  target.Health - rqCombo < target.MaxHealth * 0.4f) ||
                                 (ObjectManager.Get <Obj_AI_Turret>()
                                  .Count(t => t.Distance(pos) < 950 && t.IsAlly && t.IsValid && !t.IsDead) > 0 &&
                                  target.Health - combodmg < target.MaxHealth * 0.5f))
                        {
                            //Console.WriteLine("R to Turret");
                            HandeR(target, turret.Position, false);
                            return;
                        }
                    }
                }
                if (config.Item("rtokill", true).GetValue <bool>() && config.Item("user", true).GetValue <bool>() &&
                    R.GetDamage(target) > target.Health && !justE && !justQ &&
                    (savedQ == null ||
                     (savedQ != null && !qPos.IsValid() && target.Distance(savedQ.position) > QExplosionRange)) &&
                    (target.CountAlliesInRange(700) <= 1 || player.HealthPercent < 35))
                {
                    //Console.WriteLine("R to Kill");
                    var pred = R.GetPrediction(target, true);
                    if (pred.Hitchance >= HitChance.VeryHigh)
                    {
                        R.Cast(pred.CastPosition);
                    }
                    //R.CastIfHitchanceEquals(target, HitChance.VeryHigh);
                    return;
                }
            }
        }
Exemplo n.º 12
0
        private static void Farm() // Credits TC-CREW
        {
            if (!Orbwalking.CanMove(40))
            {
                return;
            }
            var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range);
            var useQ       = Config.Item("UseQFarm").GetValue <bool>();
            var useW       = Config.Item("UseWFarm").GetValue <bool>();

            if (useQ && Q.IsReady())
            {
                foreach (var minion in allMinions.Where(minion => minion.IsValidTarget() && HealthPrediction.GetHealthPrediction(minion, (int)(ObjectManager.Player.Distance(minion) * 1000 / 1400))
                                                        < 0.75 * ObjectManager.Player.GetSpellDamage(minion, SpellSlot.Q, 1)))
                {
                    Q.Cast(minion);
                    return;
                }
            }
            else if (useW && W.IsReady())
            {
                if (!allMinions.Any(minion => minion.IsValidTarget(W.Range) && minion.Health < 0.75 * Player.GetSpellDamage(minion, SpellSlot.W)))
                {
                    return;
                }

                W.Cast();
                return;
            }
        }
Exemplo n.º 13
0
        private void Cast_Q(bool combo, int mode = 0)
        {
            if (!Q.IsReady())
            {
                return;
            }
            if (combo)
            {
                var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

                if (!target.IsValidTarget(Q.Range))
                {
                    return;
                }
                if (target.HasBuff("AkaliMota"))
                {
                    return;
                }

                if (CheckMark(Q.Range) != null)
                {
                    target = CheckMark(Q.Range);
                }

                if (mode == 0)
                {
                    Q.Cast(target);
                }
                else if (mode == 1)
                {
                    if (!target.HasBuff("AkaliMota"))
                    {
                        Q.Cast(target);
                    }
                }
            }
            else
            {
                if (MinionManager.GetMinions(Player.Position, Q.Range).Any(minion => minion.HasBuff("AkaliMota") && Orbwalker.InAutoAttackRange(minion)))
                {
                    return;
                }

                foreach (var minion in MinionManager.GetMinions(Player.Position, Q.Range).Where(minion => HealthPrediction.GetHealthPrediction(minion,
                                                                                                                                               (int)(E.Delay + (minion.Distance(Player.Position) / E.Speed)) * 1000) <
                                                                                                Player.GetSpellDamage(minion, SpellSlot.Q) &&
                                                                                                HealthPrediction.GetHealthPrediction(minion,
                                                                                                                                     (int)(E.Delay + (minion.Distance(Player.Position) / E.Speed)) * 1000) > 0 &&
                                                                                                Orbwalker.InAutoAttackRange(minion)))
                {
                    Q.Cast(minion);
                }

                foreach (var minion in MinionManager.GetMinions(Player.Position, Q.Range).Where(minion => HealthPrediction.GetHealthPrediction(minion,
                                                                                                                                               (int)(Q.Delay + (minion.Distance(Player.Position) / Q.Speed))) <
                                                                                                Player.GetSpellDamage(minion, SpellSlot.Q)))
                {
                    Q.Cast(minion);
                }

                foreach (var minion in MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).Where(minion => Player.Distance(minion.Position) <= Q.Range))
                {
                    Q.Cast(minion);
                }
            }
        }
Exemplo n.º 14
0
        void Waveclear()
        {
            List <Obj_AI_Minion> allMinions = ObjectManager.Get <Obj_AI_Minion>().OrderBy(x => x.Health).Where(x => x.IsValidTarget(W.Range) && !MinionManager.IsWard(x)).ToList();

            if (Config.GetBool("UseQFarm") && Q.IsReady())
            {
                var minion = Orbwalker.GetTarget() as Obj_AI_Minion;
                if (minion != null && HealthPrediction.GetHealthPrediction(
                        minion, (int)(Khazix.Distance(minion) * 1000 / 1400)) >
                    0.35f * Khazix.GetSpellDamage(minion, SpellSlot.Q) && Khazix.Distance(minion) <= Q.Range)
                {
                    Q.Cast(minion);
                }
                else if (minion == null || !minion.IsValid)
                {
                    foreach (var min in allMinions.Where(x => x.IsValidTarget(Q.Range)))
                    {
                        if (HealthPrediction.GetHealthPrediction(
                                min, (int)(Khazix.Distance(min) * 1000 / 1400)) >
                            3 * Khazix.GetSpellDamage(min, SpellSlot.Q) && Khazix.Distance(min) <= Q.Range)
                        {
                            Q.Cast(min);
                            break;
                        }
                    }
                }
            }

            if (Config.GetBool("UseWFarm") && W.IsReady() && Khazix.HealthPercent <= Config.GetSlider("Farm.WHealth"))
            {
                var wmins = EvolvedW ? allMinions.Where(x => x.IsValidTarget(WE.Range)) : allMinions.Where(x => x.IsValidTarget(W.Range));
                MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(wmins
                                                                                                    .Select(minion => minion.ServerPosition.To2D())
                                                                                                    .ToList(), EvolvedW ? WE.Width : W.Width, EvolvedW ? WE.Range : W.Range);
                var distcheck = EvolvedW ? Khazix.Distance(farmLocation.Position) <= WE.Range : Khazix.Distance(farmLocation.Position) <= W.Range;
                if (distcheck)
                {
                    W.Cast(farmLocation.Position);
                }
            }

            if (Config.GetBool("UseEFarm") && E.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, E.Range)
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), E.Width, E.Range);
                if (Khazix.Distance(farmLocation.Position) <= E.Range)
                {
                    E.Cast(farmLocation.Position);
                }
            }


            if (Config.GetBool("UseItemsFarm"))
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, Hydra.Range)
                        .Select(minion => minion.ServerPosition.To2D())
                        .ToList(), Hydra.Range, Hydra.Range);

                if (Hydra.IsReady() && Khazix.Distance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, Khazix);
                }
                if (Tiamat.IsReady() && Khazix.Distance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, Khazix);
                }
                if (Titanic.IsReady() && Khazix.Distance(farmLocation.Position) <= Titanic.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3748, Khazix);
                }
            }
        }
Exemplo n.º 15
0
        private static void LaneClear()
        {
            var Minions = MinionManager.GetMinions(MyHero.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.Health);

            foreach (var minion in Minions)
            {
                if ((Config.Item("UseQFarm").GetValue <bool>()) && (minion.IsValidTarget(Q.Range)) && (HealthPrediction.GetHealthPrediction(minion, (int)Q.Delay) < (DamageLib.getDmg(minion, DamageLib.SpellType.Q) * 0.9)))
                {
                    Q.Cast(minion, packets);
                }
            }
        }
Exemplo n.º 16
0
        private static void Farm(bool laneClear)
        {
            if (!Orbwalking.CanMove(40))
            {
                return;
            }
            var allMinions = MinionManager.GetMinions(Player.ServerPosition, Q.Range);
            var useQi      = Config.Item("UseQFarm").GetValue <StringList>().SelectedIndex;
            var useWi      = Config.Item("UseWFarm").GetValue <StringList>().SelectedIndex;
            var useEi      = Config.Item("UseEFarm").GetValue <StringList>().SelectedIndex;
            var useQ       = (laneClear && (useQi == 1 || useQi == 2)) || (!laneClear && (useQi == 0 || useQi == 2));
            var useW       = (laneClear && (useWi == 1 || useWi == 2)) || (!laneClear && (useWi == 0 || useWi == 2));
            var useE       = (laneClear && (useEi == 1 || useEi == 2)) || (!laneClear && (useEi == 0 || useEi == 2));

            if (useQ && Q.IsReady())
            {
                foreach (var minion in allMinions)
                {
                    if (minion.IsValidTarget() &&
                        HealthPrediction.GetHealthPrediction(minion,
                                                             (int)(Player.Distance((AttackableUnit)minion) * 1000 / 1700)) <
                        Player.GetSpellDamage(minion, SpellSlot.Q))
                    {
                        var collided = Q.GetPrediction(minion, false, -1f, new[] { CollisionableObjects.Minions });
                        if (collided.Hitchance > HitChance.Medium)
                        {
                            ObjectManager.Player.Spellbook.CastSpell(Q.Slot, collided.CastPosition, false);
                            return;
                        }
                    }
                }
            }
            else if (useW && W.IsReady())
            {
                foreach (var minion in allMinions)
                {
                    if (minion.IsValidTarget(W.Range) &&
                        minion.Health < Player.GetSpellDamage(minion, SpellSlot.Q))
                    {
                        W.CastOnUnit(minion);
                        return;
                    }
                }
            }
            else if (useE && E.IsReady())
            {
                foreach (var minion in allMinions)
                {
                    if (minion.IsValidTarget(E.Range) &&
                        HealthPrediction.GetHealthPrediction(minion,
                                                             (int)(Player.Distance((AttackableUnit)minion) * 1000 / 1000)) <
                        Player.GetSpellDamage(minion, SpellSlot.Q) - 10)
                    {
                        E.CastOnUnit(minion);
                        return;
                    }
                }
            }

            if (laneClear)
            {
                foreach (var minion in allMinions)
                {
                    if (useQ)
                    {
                        Q.Cast(minion.Position);
                    }

                    if (useW)
                    {
                        W.CastOnUnit(minion);
                    }

                    if (useE)
                    {
                        E.CastOnUnit(minion);
                    }
                }
            }
        }
Exemplo n.º 17
0
            public virtual AttackableUnit GetTarget()
            {
                AttackableUnit result = null;

                if ((ActiveMode == OrbwalkingMode.Mixed || ActiveMode == OrbwalkingMode.LaneClear) &&
                    !_config.Item("PriorizeFarm").GetValue <bool>())
                {
                    var target = TargetSelector.GetTarget(-1, DamageType.Physical);
                    if (target != null)
                    {
                        return(target);
                    }
                }

                /*Killable Minion*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed ||
                    ActiveMode == OrbwalkingMode.LastHit)
                {
                    var minionList =
                        MinionManager.GetMinions(Player.Position, float.MaxValue)
                        .Where(
                            minion =>
                            InAutoAttackRange(minion) &&
                            minion.Health <
                            2 *
                            (ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod))
                        .OrderByDescending(minion => minion.CharData.BaseSkinName.Contains("Siege"))
                        .ThenBy(minion => minion.CharData.BaseSkinName.Contains("Super"))
                        .ThenByDescending(minion => minion.MaxHealth)
                        .ThenBy(minion => minion.Health);

                    foreach (var minion in minionList)
                    {
                        var t = (int)(_player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                                1000 * (int)_player.Distance(minion) / (int)GetMyProjectileSpeed();
                        var predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay);
                        if (predHealth <= 0)
                        {
                            FireOnNonKillableMinion(minion);
                        }

                        if (predHealth > 0 && predHealth <= _player.GetAutoAttackDamage(minion, true))
                        {
                            return(minion);
                        }
                    }
                }

                //Forced target
                if (_forcedTarget.IsValidTarget() && InAutoAttackRange(_forcedTarget))
                {
                    return(_forcedTarget);
                }

                /* turrets / inhibitors / nexus */
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    /* turrets */
                    foreach (var turret in
                             GameObjects.EnemyTurrets.Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* inhibitor */
                    foreach (var turret in
                             GameObjects.EnemyInhibitors.Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* nexus */
                    if (GameObjects.EnemyNexus != null && GameObjects.EnemyNexus.IsValidTarget() &&
                        InAutoAttackRange(GameObjects.EnemyNexus))
                    {
                        return(GameObjects.EnemyNexus);
                    }
                }

                /*Champions*/
                if (ActiveMode != OrbwalkingMode.LastHit)
                {
                    var target = TargetSelector.GetTarget(-1, DamageType.Physical);
                    if (target.IsValidTarget())
                    {
                        return(target);
                    }
                }

                /*Jungle minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed)
                {
                    result =
                        MinionManager.GetMinions(Player.Position, float.MaxValue, MinionTypes.All, MinionTeam.Neutral)
                        .Where(InAutoAttackRange)
                        .MaxOrDefault(mob => mob.MaxHealth);

                    if (result != null)
                    {
                        return(result);
                    }
                }

                /*Lane Clear minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    if (!ShouldWait())
                    {
                        if (_prevMinion.IsValidTarget() && InAutoAttackRange(_prevMinion))
                        {
                            var predHealth = HealthPrediction.LaneClearHealthPrediction(
                                _prevMinion, (int)((_player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay);
                            if (predHealth >= 2 * _player.GetAutoAttackDamage(_prevMinion) ||
                                Math.Abs(predHealth - _prevMinion.Health) < float.Epsilon)
                            {
                                return(_prevMinion);
                            }
                        }

                        result = (from minion in
                                  MinionManager.GetMinions(Player.Position, float.MaxValue).Where(InAutoAttackRange)
                                  let predHealth =
                                      HealthPrediction.LaneClearHealthPrediction(
                                          minion, (int)((_player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay)
                                      where
                                      predHealth >= 2 * _player.GetAutoAttackDamage(minion) ||
                                      Math.Abs(predHealth - minion.Health) < float.Epsilon
                                      select minion).MaxOrDefault(m => m.Health);

                        if (result != null)
                        {
                            _prevMinion = (Obj_AI_Minion)result;
                        }
                    }
                }

                return(result);
            }
Exemplo n.º 18
0
        public override void ExecuteLaneClear()
        {
            var prepareMinions = GetValue <StringList>("UseE.Prepare.Lane").SelectedIndex;

            if (prepareMinions != 0)
            {
                List <Obj_AI_Minion>        list    = new List <Obj_AI_Minion>();
                IEnumerable <Obj_AI_Minion> minions =
                    from m in
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(
                        m =>
                        m.Health > ObjectManager.Player.TotalAttackDamage &&
                        m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65))
                    select m;
                if (prepareMinions == 2)
                {
                    minions = minions.Where(m => m.IsUnderAllyTurret());
                }

                var objAiMinions = minions as Obj_AI_Minion[] ?? minions.ToArray();
                foreach (var m in objAiMinions)
                {
                    if (m.GetBuffCount(kalistaEBuffName) >= 0)
                    {
                        Render.Circle.DrawCircle(m.Position, 105f, Color.Blue);
                        list.Add(m);
                    }
                    else
                    {
                        list.Remove(m);
                    }
                }
                var enemy = HeroManager.Enemies.Find(e => e.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65));
                if (enemy == null)
                {
                    foreach (var l in objAiMinions.Except(list).ToList())
                    {
                        Program.CClass.Orbwalker.ForceTarget(l);
                    }
                }
                else
                {
                    Program.CClass.Orbwalker.ForceTarget(enemy);
                }
            }

            if (Q.IsReady())
            {
                var qCount = GetValue <StringList>("UseQ.Lane").SelectedIndex;
                if (qCount != 0)
                {
                    var minions = MinionManager.GetMinions(
                        ObjectManager.Player.ServerPosition,
                        Q.Range,
                        MinionTypes.All,
                        MinionTeam.Enemy);

                    foreach (var minion in minions.Where(x => x.Health <= Q.GetDamage(x)))
                    {
                        var killableMinionCount = 0;
                        foreach (
                            var colminion in
                            qGetCollisionMinions(
                                ObjectManager.Player,
                                ObjectManager.Player.ServerPosition.Extend(minion.ServerPosition, Q.Range)))
                        {
                            if (colminion.Health <= Q.GetDamage(colminion))
                            {
                                if (GetValue <StringList>("UseQ.Mode.Lane").SelectedIndex == 1 &&
                                    colminion.Distance(ObjectManager.Player)
                                    > Orbwalking.GetRealAutoAttackRange(null) + 65)
                                {
                                    killableMinionCount++;
                                }
                                else
                                {
                                    killableMinionCount++;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }

                        if (killableMinionCount >= qCount)
                        {
                            if (!ObjectManager.Player.IsWindingUp && !ObjectManager.Player.IsDashing())
                            {
                                Q.Cast(minion.ServerPosition);
                                break;
                            }
                        }
                    }
                }
            }

            if (E.IsReady())
            {
                var minECount = GetValue <StringList>("UseE.Lane").SelectedIndex;
                if (minECount != 0)
                {
                    var killableMinionCount = 0;
                    foreach (var m in
                             MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range)
                             .Where(x => E.CanCast(x) && x.Health < E.GetDamage(x)))
                    {
                        if (m.SkinName.ToLower().Contains("siege") || m.SkinName.ToLower().Contains("super"))
                        {
                            killableMinionCount += 2;
                        }
                        else
                        {
                            killableMinionCount++;
                        }
                    }

                    if (killableMinionCount >= minECount && E.IsReady() &&
                        ObjectManager.Player.ManaPercent > E.ManaCost * 2)
                    {
                        E.Cast();
                    }
                }
            }

            // Don't miss minion
            if (GetValue <bool>("UseE.LaneNon"))
            {
                var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range * 1);

                foreach (var n in minions)
                {
                    var xH = HealthPrediction.GetHealthPrediction(n, (int)(ObjectManager.Player.AttackCastDelay * 1000), Game.Ping / 2 + 100);
                    if (xH < 0)
                    {
                        if (n.Health < E.GetDamage(n) && E.CanCast(n))
                        {
                            E.Cast(n);
                        }
                        else if (Q.IsReady() && Q.CanCast(n) && n.Distance(ObjectManager.Player.Position) < Orbwalking.GetRealAutoAttackRange(null) + 75)
                        {
                            xH = HealthPrediction.GetHealthPrediction(n, (int)(ObjectManager.Player.AttackCastDelay * 1000), (int)Q.Speed);
                            if (xH < 0)
                            {
                                var input = new PredictionInput {
                                    Unit = ObjectManager.Player, Radius = Q.Width, Delay = Q.Delay, Speed = Q.Speed,
                                };

                                input.CollisionObjects[0] = CollisionableObjects.Minions;

                                int count = Collision.GetCollision(new List <Vector3> {
                                    n.Position
                                }, input).OrderBy(obj => obj.Distance(ObjectManager.Player)).Count(obj => obj.NetworkId != n.NetworkId);
                                if (count == 0)
                                {
                                    Q.Cast(n);
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
            /// <summary>
            /// Gets the target.
            /// </summary>
            /// <returns>AttackableUnit.</returns>
            public virtual AttackableUnit GetTarget()
            {
                AttackableUnit result = null;

                if ((ActiveMode == OrbwalkingMode.Mixed || ActiveMode == OrbwalkingMode.LaneClear) &&
                    !config.Item("PriorizeFarm").GetValue <bool>())
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);
                    if (target != null && InAutoAttackRange(target))
                    {
                        return(target);
                    }
                }

                /*Killable Minion*/
                if (ActiveMode == OrbwalkingMode.LaneClear || (ActiveMode == OrbwalkingMode.Mixed && config.Item("LWH").GetValue <bool>()) ||
                    ActiveMode == OrbwalkingMode.LastHit)
                {
                    var minionList =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            minion =>
                            minion.IsValidTarget() && InAutoAttackRange(minion))
                        .OrderByDescending(minion => minion.CharData.BaseSkinName.Contains("Siege"))
                        .ThenBy(minion => minion.CharData.BaseSkinName.Contains("Super"))
                        .ThenBy(minion => minion.Health)
                        .ThenByDescending(minion => minion.MaxHealth);

                    foreach (var minion in minionList)
                    {
                        var t = (int)(player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                                1000 * (int)Math.Max(0, player.Distance(minion) - player.BoundingRadius) / int.MaxValue;
                        var predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay);

                        if (minion.Team != GameObjectTeam.Neutral && (config.Item("AttackPetsnTraps").GetValue <bool>() &&
                                                                      minion.CharData.BaseSkinName != "jarvanivstandard" || MinionManager.IsMinion(minion, config.Item("AttackWards").GetValue <bool>())))
                        {
                            if (predHealth <= 0)
                            {
                                FireOnNonKillableMinion(minion);
                            }

                            if (predHealth > 0 && predHealth <= player.GetAutoAttackDamage(minion, true))
                            {
                                return(minion);
                            }
                        }

                        if (minion.Team == GameObjectTeam.Neutral && (config.Item("AttackBarrel").GetValue <bool>() &&
                                                                      minion.CharData.BaseSkinName == "gangplankbarrel" && minion.IsHPBarRendered))
                        {
                            if (minion.Health < 2)
                            {
                                return(minion);
                            }
                        }
                    }
                }

                //Forced target
                if (forcedTarget.IsValidTarget() && InAutoAttackRange(forcedTarget))
                {
                    return(forcedTarget);
                }

                /* turrets / inhibitors / nexus */
                if (ActiveMode == OrbwalkingMode.LaneClear && (!config.Item("FocusMinionsOverTurrets").GetValue <KeyBind>().Active || !MinionManager.GetMinions(ObjectManager.Player.Position, GetRealAutoAttackRange(ObjectManager.Player)).Any()))
                {
                    /* turrets */
                    foreach (var turret in
                             ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* inhibitor */
                    foreach (var turret in
                             ObjectManager.Get <Obj_BarracksDampener>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* nexus */
                    foreach (var nexus in
                             ObjectManager.Get <Obj_HQ>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(nexus);
                    }
                }

                /*Champions*/
                if (ActiveMode != OrbwalkingMode.LastHit && ActiveMode != OrbwalkingMode.Flee)
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);
                    if (target.IsValidTarget() && InAutoAttackRange(target))
                    {
                        return(target);
                    }
                }

                /*Jungle minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed)
                {
                    var jminions =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            mob =>
                            mob.IsValidTarget() && mob.Team == GameObjectTeam.Neutral && this.InAutoAttackRange(mob) &&
                            mob.CharData.BaseSkinName != "gangplankbarrel");

                    result = config.Item("Smallminionsprio").GetValue <bool>()
                                 ? jminions.MinOrDefault(mob => mob.MaxHealth)
                                 : jminions.MaxOrDefault(mob => mob.MaxHealth);

                    if (result != null)
                    {
                        return(result);
                    }
                }

                /*Lane Clear minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    if (!ShouldWait())
                    {
                        if (prevMinion.IsValidTarget() && InAutoAttackRange(prevMinion))
                        {
                            var predHealth = HealthPrediction.LaneClearHealthPrediction(
                                prevMinion, (int)((player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay);
                            if (predHealth >= 2 * player.GetAutoAttackDamage(prevMinion) ||
                                Math.Abs(predHealth - prevMinion.Health) < float.Epsilon)
                            {
                                return(prevMinion);
                            }
                        }

                        result = (from minion in
                                  ObjectManager.Get <Obj_AI_Minion>()
                                  .Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion) &&
                                         (config.Item("AttackWards").GetValue <bool>() || !MinionManager.IsWard(minion)) &&
                                         (config.Item("AttackPetsnTraps").GetValue <bool>() && minion.CharData.BaseSkinName != "jarvanivstandard" || MinionManager.IsMinion(minion, config.Item("AttackWards").GetValue <bool>())) &&
                                         minion.CharData.BaseSkinName != "gangplankbarrel")
                                  let predHealth =
                                      HealthPrediction.LaneClearHealthPrediction(
                                          minion, (int)((player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay)
                                      where
                                      predHealth >= 2 * player.GetAutoAttackDamage(minion) ||
                                      Math.Abs(predHealth - minion.Health) < float.Epsilon
                                      select minion).MaxOrDefault(m => !MinionManager.IsMinion(m, true) ? float.MaxValue : m.Health);

                        if (result != null)
                        {
                            prevMinion = (Obj_AI_Minion)result;
                        }
                    }
                }

                return(result);
            }
Exemplo n.º 20
0
            public virtual AttackableUnit GetTarget()
            {
                AttackableUnit result = null;

                var mode = ActiveMode;

                if ((mode == OrbwalkingMode.Mixed || mode == OrbwalkingMode.LaneClear) && !Menu.Item("PriorizeFarm").GetValue <bool>())
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);

                    if (target != null && InAutoAttackRange(target))
                    {
                        return(target);
                    }
                }

                var attackGankPlankBarrels = Menu.Item("AttackGPBarrel").GetValue <StringList>().SelectedIndex;

                if (attackGankPlankBarrels != 2 && (attackGankPlankBarrels == 0 || (mode == OrbwalkingMode.LaneClear || mode == OrbwalkingMode.Mixed || mode == OrbwalkingMode.LastHit || mode == OrbwalkingMode.Freeze)))
                {
                    var enemyGangPlank = HeroManager.Enemies.FirstOrDefault(e => e.ChampionName.Equals("gangplank", StringComparison.InvariantCultureIgnoreCase));

                    if (enemyGangPlank != null)
                    {
                        var barrels = Get <Obj_AI_Minion>().Where(minion => minion.Team == GameObjectTeam.Neutral && minion.CharData.BaseSkinName == "gangplankbarrel" && minion.IsHPBarRendered && minion.IsValidTarget() && InAutoAttackRange(minion));

                        var objAiMinions = barrels as Obj_AI_Minion[] ?? barrels.ToArray();

                        foreach (var barrel in objAiMinions)
                        {
                            if (barrel.Health <= 1f)
                            {
                                return(barrel);
                            }

                            var t          = (int)(player.AttackCastDelay * 1000) + Game.Ping / 2 + 1000 * (int)Math.Max(0, player.Distance(barrel) - player.BoundingRadius) / (int)GetMyProjectileSpeed();
                            var barrelBuff = barrel.Buffs.FirstOrDefault(b => b.Name.Equals("gangplankebarrelactive", StringComparison.InvariantCultureIgnoreCase));

                            if (barrelBuff != null && barrel.Health <= 2f)
                            {
                                var healthDecayRate     = enemyGangPlank.Level >= 13 ? 0.5f : (enemyGangPlank.Level >= 7 ? 1f : 2f);
                                var nextHealthDecayTime = Game.Time < barrelBuff.StartTime + healthDecayRate ? barrelBuff.StartTime + healthDecayRate : barrelBuff.StartTime + healthDecayRate * 2;

                                if (nextHealthDecayTime <= Game.Time + t / 1000f)
                                {
                                    return(barrel);
                                }
                            }
                        }

                        if (objAiMinions.Any())
                        {
                            return(null);
                        }
                    }
                }

                if (mode == OrbwalkingMode.LaneClear || mode == OrbwalkingMode.Mixed || mode == OrbwalkingMode.LastHit || mode == OrbwalkingMode.Freeze)
                {
                    var MinionList = Get <Obj_AI_Minion>()
                                     .Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion))
                                     .OrderByDescending(minion => minion.CharData.BaseSkinName.Contains("Siege"))
                                     .ThenBy(minion => minion.CharData.BaseSkinName.Contains("Super"))
                                     .ThenBy(minion => minion.Health)
                                     .ThenByDescending(minion => minion.MaxHealth);

                    foreach (var minion in MinionList)
                    {
                        var t = (int)(player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)Math.Max(0, player.Distance(minion) - player.BoundingRadius) / (int)GetMyProjectileSpeed();

                        if (mode == OrbwalkingMode.Freeze)
                        {
                            t += 200 + Game.Ping / 2;
                        }

                        var predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay);

                        if (minion.Team != GameObjectTeam.Neutral && ShouldAttackMinion(minion))
                        {
                            var damage   = player.GetAutoAttackDamage(minion, true);
                            var killable = predHealth <= damage;

                            if (mode == OrbwalkingMode.Freeze)
                            {
                                if (minion.Health < 50 || predHealth <= 50)
                                {
                                    return(minion);
                                }
                            }
                            else
                            {
                                if (predHealth <= 0)
                                {
                                    FireOnNonKillableMinion(minion);
                                }

                                if (killable)
                                {
                                    return(minion);
                                }
                            }
                        }
                    }
                }

                if (_forcedTarget.IsValidTarget() && InAutoAttackRange(_forcedTarget))
                {
                    return(_forcedTarget);
                }

                if (mode == OrbwalkingMode.LaneClear && (!Menu.Item("FocusMinionsOverTurrets").GetValue <KeyBind>().Active || !MinionManager.GetMinions(ObjectManager.Player.Position, GetRealAutoAttackRange(ObjectManager.Player)).Any()))
                {
                    foreach (var turret in Get <Obj_AI_Turret>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    foreach (var turret in Get <Obj_BarracksDampener>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    foreach (var nexus in Get <Obj_HQ>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(nexus);
                    }
                }

                if (mode != OrbwalkingMode.LastHit)
                {
                    if (mode != OrbwalkingMode.LaneClear || !ShouldWait())
                    {
                        var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);

                        if (target.IsValidTarget() && InAutoAttackRange(target))
                        {
                            return(target);
                        }
                    }
                }

                if (mode == OrbwalkingMode.LaneClear || mode == OrbwalkingMode.Mixed)
                {
                    var jminions = Get <Obj_AI_Minion>().Where(mob => mob.IsValidTarget() && mob.Team == GameObjectTeam.Neutral && InAutoAttackRange(mob) && mob.CharData.BaseSkinName != "gangplankbarrel" && mob.Name != "WardCorpse");

                    result = Menu.Item("Smallminionsprio").GetValue <bool>() ? jminions.MinOrDefault(mob => mob.MaxHealth) : jminions.MaxOrDefault(mob => mob.MaxHealth);

                    if (result != null)
                    {
                        return(result);
                    }
                }

                if (mode == OrbwalkingMode.LaneClear || mode == OrbwalkingMode.Mixed || mode == OrbwalkingMode.LastHit || mode == OrbwalkingMode.Freeze)
                {
                    var closestTower = Get <Obj_AI_Turret>().MinOrDefault(t => t.IsAlly && !t.IsDead ? player.Distance(t, true) : float.MaxValue);

                    if (closestTower != null && player.Distance(closestTower, true) < 1500 * 1500)
                    {
                        Obj_AI_Minion farmUnderTurretMinion = null;
                        Obj_AI_Minion noneKillableMinion    = null;

                        var minions = MinionManager.GetMinions(player.Position, player.AttackRange + 200)
                                      .Where(minion => InAutoAttackRange(minion) && closestTower.Distance(minion, true) < 900 * 900)
                                      .OrderByDescending(minion => minion.CharData.BaseSkinName.Contains("Siege"))
                                      .ThenBy(minion => minion.CharData.BaseSkinName.Contains("Super"))
                                      .ThenByDescending(minion => minion.MaxHealth)
                                      .ThenByDescending(minion => minion.Health);

                        if (minions.Any())
                        {
                            var turretMinion = minions.FirstOrDefault(minion => minion is Obj_AI_Minion && HealthPrediction.HasTurretAggro((Obj_AI_Minion)minion));

                            if (turretMinion != null)
                            {
                                var hpLeftBeforeDie   = 0;
                                var hpLeft            = 0;
                                var turretAttackCount = 0;
                                var turretStarTick    = HealthPrediction.TurretAggroStartTick(turretMinion as Obj_AI_Minion);
                                var turretLandTick    = turretStarTick + (int)(closestTower.AttackCastDelay * 1000) + 1000 * Math.Max(0, (int)(turretMinion.Distance(closestTower) - closestTower.BoundingRadius)) / (int)(closestTower.BasicAttack.MissileSpeed + 70);

                                for (float i = turretLandTick + 50; i < turretLandTick + 10 * closestTower.AttackDelay * 1000 + 50; i = i + closestTower.AttackDelay * 1000)
                                {
                                    var time   = (int)i - Utils.GameTimeTickCount + Game.Ping / 2;
                                    var predHP = (int)HealthPrediction.LaneClearHealthPrediction(turretMinion, time > 0 ? time : 0);

                                    if (predHP > 0)
                                    {
                                        hpLeft             = predHP;
                                        turretAttackCount += 1;

                                        continue;
                                    }

                                    hpLeftBeforeDie = hpLeft;
                                    hpLeft          = 0;

                                    break;
                                }

                                if (hpLeft == 0 && turretAttackCount != 0 && hpLeftBeforeDie != 0)
                                {
                                    var damage               = (int)player.GetAutoAttackDamage(turretMinion, true);
                                    var hits                 = hpLeftBeforeDie / damage;
                                    var timeBeforeDie        = turretLandTick + (turretAttackCount + 1) * (int)(closestTower.AttackDelay * 1000) - Utils.GameTimeTickCount;
                                    var timeUntilAttackReady = LastAATick + (int)(player.AttackDelay * 1000) > Utils.GameTimeTickCount + Game.Ping / 2 + 25 ? LastAATick + (int)(player.AttackDelay * 1000) - (Utils.GameTimeTickCount + Game.Ping / 2 + 25) : 0;
                                    var timeToLandAttack     = player.IsMelee ? player.AttackCastDelay * 1000 : player.AttackCastDelay * 1000 + 1000 * Math.Max(0, turretMinion.Distance(player) - player.BoundingRadius) / player.BasicAttack.MissileSpeed;

                                    if (hits >= 1 && hits * player.AttackDelay * 1000 + timeUntilAttackReady + timeToLandAttack < timeBeforeDie)
                                    {
                                        farmUnderTurretMinion = turretMinion as Obj_AI_Minion;
                                    }
                                    else if (hits >= 1 && hits * player.AttackDelay * 1000 + timeUntilAttackReady + timeToLandAttack > timeBeforeDie)
                                    {
                                        noneKillableMinion = turretMinion as Obj_AI_Minion;
                                    }
                                }
                                else if (hpLeft == 0 && turretAttackCount == 0 && hpLeftBeforeDie == 0)
                                {
                                    noneKillableMinion = turretMinion as Obj_AI_Minion;
                                }

                                if (ShouldWaitUnderTurret(noneKillableMinion))
                                {
                                    return(null);
                                }

                                if (farmUnderTurretMinion != null)
                                {
                                    return(farmUnderTurretMinion);
                                }

                                foreach (var minion in minions.Where(x => x.NetworkId != turretMinion.NetworkId && x is Obj_AI_Minion && !HealthPrediction.HasMinionAggro((Obj_AI_Minion)x)))
                                {
                                    var playerDamage = (int)player.GetAutoAttackDamage(minion);
                                    var turretDamage = (int)closestTower.GetAutoAttackDamage(minion, true);
                                    var leftHP       = (int)minion.Health % turretDamage;

                                    if (leftHP > playerDamage)
                                    {
                                        return(minion);
                                    }
                                }

                                var lastminion = minions.LastOrDefault(x => x.NetworkId != turretMinion.NetworkId && x is Obj_AI_Minion && !HealthPrediction.HasMinionAggro((Obj_AI_Minion)x));

                                if (lastminion != null && minions.Count() >= 2)
                                {
                                    if (1f / player.AttackDelay >= 1f && (int)(turretAttackCount * closestTower.AttackDelay / player.AttackDelay) * player.GetAutoAttackDamage(lastminion) > lastminion.Health)
                                    {
                                        return(lastminion);
                                    }

                                    if (minions.Count() >= 5 && 1f / player.AttackDelay >= 1.2)
                                    {
                                        return(lastminion);
                                    }
                                }
                            }
                            else
                            {
                                if (ShouldWaitUnderTurret(noneKillableMinion))
                                {
                                    return(null);
                                }

                                foreach (
                                    var minion in
                                    minions.Where(
                                        x =>
                                        x is Obj_AI_Minion &&
                                        !HealthPrediction.HasMinionAggro((Obj_AI_Minion)x)))
                                {
                                    {
                                        var playerDamage = (int)player.GetAutoAttackDamage(minion);
                                        var turretDamage = (int)closestTower.GetAutoAttackDamage(minion, true);
                                        var leftHP       = (int)minion.Health % turretDamage;
                                        if (leftHP > playerDamage)
                                        {
                                            return(minion);
                                        }
                                    }
                                }

                                var lastminion =
                                    minions.LastOrDefault(
                                        x =>
                                        x is Obj_AI_Minion &&
                                        !HealthPrediction.HasMinionAggro((Obj_AI_Minion)x));

                                if (lastminion == null || minions.Count() < 2)
                                {
                                    return(null);
                                }

                                if (minions.Count() >= 5 && 1f / player.AttackDelay >= 1.2)
                                {
                                    return(lastminion);
                                }
                            }
                            return(null);
                        }
                    }
                }

                if (mode == OrbwalkingMode.LaneClear)
                {
                    if (!ShouldWait())
                    {
                        if (_prevMinion.IsValidTarget() && InAutoAttackRange(_prevMinion))
                        {
                            var predHealth = HealthPrediction.LaneClearHealthPrediction(_prevMinion, (int)(player.AttackDelay * 1000 * LaneClearWaitTimeMod), FarmDelay);

                            if (predHealth >= 2 * player.GetAutoAttackDamage(_prevMinion) || Math.Abs(predHealth - _prevMinion.Health) < float.Epsilon)
                            {
                                return(_prevMinion);
                            }
                        }

                        result = Get <Obj_AI_Minion>()
                                 .Where(
                            minion =>
                            minion.IsValidTarget() && InAutoAttackRange(minion) && ShouldAttackMinion(minion))
                                 .Select(
                            minion =>
                            new
                        {
                            minion,
                            predHealth =
                                HealthPrediction.LaneClearHealthPrediction(minion,
                                                                           (int)(player.AttackDelay * 1000 * LaneClearWaitTimeMod), FarmDelay)
                        })
                                 .Where(
                            t =>
                            t.predHealth >= 2 * player.GetAutoAttackDamage(t.minion) ||
                            Math.Abs(t.predHealth - t.minion.Health) < float.Epsilon)
                                 .Select(t => t.minion).MaxOrDefault(m => !MinionManager.IsMinion(m, true) ? float.MaxValue : m.Health);

                        if (result != null)
                        {
                            _prevMinion = (Obj_AI_Minion)result;
                        }
                    }
                }

                return(result);
            }
Exemplo n.º 21
0
        private static AttackableUnit GetTarget(bool isCombo, bool isFarm, bool isLastHit, int targetMode)
        {
            AttackableUnit gtarget = null;

            if (isCombo)
            {
                switch (targetMode)
                {
                case 0:
                    gtarget = DrawHelper.GetBetterTarget(range, TargetSelector.DamageType.Magical);
                    break;

                case 1:
                    gtarget =
                        HeroManager.Enemies.Where(i => player.Distance(i) <= range)
                        .OrderBy(i => i.Health)
                        .FirstOrDefault();
                    break;

                case 2:
                    gtarget =
                        HeroManager.Enemies.Where(i => player.Distance(i) <= range)
                        .OrderBy(i => player.Distance(i))
                        .FirstOrDefault();
                    break;

                default:
                    break;
                }
            }
            else
            {
                List <AttackableUnit> otherTarget =
                    MinionManager.GetMinions(1000, MinionTypes.All, MinionTeam.NotAlly)
                    .Where(
                        m =>
                        HealthPrediction.GetHealthPrediction(m, 2000) > Pet.GetAutoAttackDamage(m) ||
                        m.Health < Pet.GetAutoAttackDamage(m))
                    .Select(m => m as AttackableUnit)
                    .ToList()
                    .Concat(
                        ObjectManager.Get <Obj_AI_Turret>()
                        .Where(t => t.IsValidTarget() && t.Position.Distance(player.Position) < range))
                    .ToList();
                if (isFarm)
                {
                    gtarget =
                        otherTarget.OrderByDescending(m => Pet.GetAutoAttackDamage((Obj_AI_Base)m) > m.Health)
                        .ThenByDescending(m => m.MaxHealth)
                        .ThenByDescending(m => player.Distance(m))
                        .FirstOrDefault();
                }
                if (isLastHit)
                {
                    gtarget =
                        otherTarget.Where(m => Pet.GetAutoAttackDamage((Obj_AI_Base)m) > m.Health)
                        .OrderByDescending(m => player.Distance(m))
                        .FirstOrDefault();
                }
            }
            return(gtarget);
        }
Exemplo n.º 22
0
            public virtual AttackableUnit GetTarget()
            {
                AttackableUnit result = null;

                if ((ActiveMode == OrbwalkingMode.Mixed || ActiveMode == OrbwalkingMode.LaneClear) &&
                    !_config.Item("PriorizeFarm").GetValue <bool>())
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);
                    if (target != null && InAutoAttackRange(target))
                    {
                        return(target);
                    }
                }

                /*Killable Minion*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed && _config.Item("Harass.MLH").GetValue <bool>() ||
                    ActiveMode == OrbwalkingMode.LastHit)
                {
                    var MinionList =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            minion =>
                            minion.IsValidTarget() && InAutoAttackRange(minion))
                        .OrderByDescending(minion => minion.CharData.BaseSkinName.Contains("Siege"))
                        .ThenBy(minion => minion.CharData.BaseSkinName.Contains("Super"))
                        .ThenBy(minion => minion.Health)
                        .ThenByDescending(minion => minion.MaxHealth);

                    foreach (var minion in MinionList)
                    {
                        var t = (int)(Player.AttackCastDelay * 1000) - 100 +
                                1000 * (int)Math.Max(0, Player.Distance(minion) - Player.BoundingRadius) / (int)Player.BasicAttack.MissileSpeed;
                        var predHealth = HealthPrediction.GetHealthPrediction(minion, t, 0);

                        if (minion.Team != GameObjectTeam.Neutral && (_config.Item("AttackPetsnTraps").GetValue <bool>() || MinionManager.IsMinion(minion, _config.Item("AttackWards").GetValue <bool>())))
                        {
                            if (predHealth <= 0)
                            {
                                FireOnNonKillableMinion(minion);
                            }

                            if (predHealth > 0 && predHealth <= Player.GetAutoAttackDamage(minion, true))
                            {
                                return(minion);
                            }
                        }
                    }
                }

                //Forced target
                if (_forcedTarget.IsValidTarget() && InAutoAttackRange(_forcedTarget))
                {
                    return(_forcedTarget);
                }

                /* turrets / inhibitors / nexus */
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    /* turrets */
                    foreach (var turret in
                             ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* inhibitor */
                    foreach (var turret in
                             ObjectManager.Get <Obj_BarracksDampener>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* nexus */
                    foreach (var nexus in
                             ObjectManager.Get <Obj_HQ>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(nexus);
                    }
                }

                /*Champions*/
                if (ActiveMode != OrbwalkingMode.LastHit)
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);
                    if (target.IsValidTarget() && InAutoAttackRange(target))
                    {
                        return(target);
                    }
                }

                /*Jungle minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed)
                {
                    var jminions =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            mob =>
                            mob.IsValidTarget() && mob.Team == GameObjectTeam.Neutral && InAutoAttackRange(mob) &&
                            mob.CharData.BaseSkinName != "gangplankbarrel");

                    result = _config.Item("Smallminionsprio").GetValue <bool>() ? jminions.MinOrDefault(mob => mob.MaxHealth) : jminions.MaxOrDefault(mob => mob.MaxHealth);

                    if (result != null)
                    {
                        return(result);
                    }
                }

                /*Lane Clear minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    if (!ShouldWait())
                    {
                        if (_prevMinion.IsValidTarget() && InAutoAttackRange(_prevMinion))
                        {
                            var predHealth = HealthPrediction.LaneClearHealthPrediction(
                                _prevMinion, (int)((Player.AttackDelay * 1000) * LaneClearWaitTimeMod), 0);
                            if (predHealth >= 2 * Player.GetAutoAttackDamage(_prevMinion) ||
                                Math.Abs(predHealth - _prevMinion.Health) < float.Epsilon)
                            {
                                return(_prevMinion);
                            }
                        }

                        result = (from minion in
                                  ObjectManager.Get <Obj_AI_Minion>()
                                  .Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion) &&
                                         (_config.Item("AttackWards").GetValue <bool>() || !MinionManager.IsWard(minion.CharData.BaseSkinName.ToLower())) &&
                                         (_config.Item("AttackPetsnTraps").GetValue <bool>() && minion.CharData.BaseSkinName != "jarvanivstandard" || MinionManager.IsMinion(minion, _config.Item("AttackWards").GetValue <bool>())) &&
                                         minion.CharData.BaseSkinName != "gangplankbarrel")
                                  let predHealth =
                                      HealthPrediction.LaneClearHealthPrediction(
                                          minion, (int)((Player.AttackDelay * 1000) * LaneClearWaitTimeMod), 0)
                                      where
                                      predHealth >= 2 * Player.GetAutoAttackDamage(minion) ||
                                      Math.Abs(predHealth - minion.Health) < float.Epsilon
                                      select minion).MaxOrDefault(m => !MinionManager.IsMinion(m, true) ? float.MaxValue : m.Health);

                        if (result != null)
                        {
                            _prevMinion = (Obj_AI_Minion)result;
                        }
                    }
                }

                return(result);
            }
Exemplo n.º 23
0
        public override void ExecuteLaneClear()
        {
            List <Obj_AI_Base> laneMinions;

            var laneWValue = GetValue <StringList>("Lane.UseW").SelectedIndex;

            if (laneWValue != 0 && W.IsReady())
            {
                var totalAa =
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(
                        m =>
                        m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65 + W.Range))
                    .Sum(mob => (int)mob.Health);

                totalAa = (int)(totalAa / ObjectManager.Player.TotalAttackDamage);
                if (totalAa > laneWValue * 5)
                {
                    W.Cast();
                }
            }

            var laneQValue = GetValue <StringList>("Lane.UseQ").SelectedIndex;

            if (laneQValue != 0 && W.IsReady())
            {
                if (laneQValue == 1 || laneQValue == 3)
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (var minions in vMinions
                             .Where(minions => minions.Health < ObjectManager.Player.GetSpellDamage(minions, SpellSlot.Q))
                             .Where(
                                 m =>
                                 m.IsValidTarget(Q.Range) &&
                                 m.Distance(ObjectManager.Player.Position) > GetRealAARange)
                             )
                    {
                        var qP  = Q.GetPrediction(minions);
                        var hit = qP.CastPosition.Extend(ObjectManager.Player.Position, -140);
                        if (qP.Hitchance >= HitChance.High)
                        {
                            Q.Cast(hit);
                        }
                    }
                }
                if (laneQValue == 2 || laneQValue == 3)
                {
                    var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range * 1);

                    foreach (var n in from n in minions
                             let xH =
                                 HealthPrediction.GetHealthPrediction(n,
                                                                      (int)(ObjectManager.Player.AttackCastDelay * 1000), Game.Ping / 2 + 100)
                                 where xH < 0
                                 where n.Health < Q.GetDamage(n)
                                 select n)
                    {
                        Q.Cast(n);
                    }
                }
            }

            var laneEValue = GetValue <StringList>("Lane.UseE").SelectedIndex;

            if (laneEValue != 0 && E.IsReady())
            {
                laneMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range,
                                                       MinionTypes.All);

                if (laneMinions != null)
                {
                    var locE = E.GetLineFarmLocation(laneMinions);
                    if (laneMinions.Count == laneMinions.Count(m => ObjectManager.Player.Distance(m) < E.Range) &&
                        locE.MinionsHit > laneEValue && locE.Position.IsValid())
                    {
                        E.Cast(locE.Position);
                    }
                }
            }

            var laneRValue = GetValue <StringList>("Lane.UseR").SelectedIndex;

            if (laneRValue != 0 && R.IsReady() && UltiBuffStacks < GetValue <Slider>("Lane.UseRLim").Value)
            {
                switch (laneRValue)
                {
                case 1:
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (var minions in vMinions
                             .Where(minions => minions.Health < R.GetDamage(minions))
                             .Where(
                                 m =>
                                 m.IsValidTarget(R.Range) &&
                                 m.Distance(ObjectManager.Player.Position) > GetRealAARange)
                             )
                    {
                        R.Cast(minions);
                    }

                    break;
                }

                case 2:
                {
                    laneMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, R.Range + R.Width + 30,
                                                           MinionTypes.Ranged);

                    if (laneMinions != null)
                    {
                        var locR = R.GetCircularFarmLocation(laneMinions, R.Width * 0.75f);
                        if (locR.MinionsHit >= laneEValue && R.IsInRange(locR.Position.To3D()))
                        {
                            R.Cast(locR.Position);
                        }
                    }

                    break;
                }
                }
            }
        }
Exemplo n.º 24
0
            public virtual AttackableUnit GetTarget()
            {
                AttackableUnit result = null;

                if ((ActiveMode == OrbwalkingMode.Mixed || ActiveMode == OrbwalkingMode.LaneClear) &&
                    !_config.Item("PriorizeFarm").GetValue <bool>())
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);
                    if (target != null)
                    {
                        return(target);
                    }
                }

                /*Killable Minion*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed ||
                    ActiveMode == OrbwalkingMode.LastHit)
                {
                    var MinionList =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            minion =>
                            minion.IsValidTarget() && InAutoAttackRange(minion) &&
                            minion.Health <
                            2 *
                            (ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod)).OrderByDescending(minion => minion.MaxHealth);

                    foreach (var minion in MinionList)
                    {
                        var t = (int)(Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                                1000 * (int)Player.ServerPosition.Distance(minion.ServerPosition) / (int)GetMyProjectileSpeed();
                        var predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay);

                        if (minion.Team != GameObjectTeam.Neutral && MinionManager.IsMinion(minion, true))
                        {
                            if (predHealth <= 0)
                            {
                                FireOnNonKillableMinion(minion);
                            }

                            if (predHealth > 0 && predHealth <= GetAADamage(minion))
                            {
                                return(minion);
                            }
                        }
                    }
                }

                //Forced target
                if (_forcedTarget.IsValidTarget() && InAutoAttackRange(_forcedTarget))
                {
                    return(_forcedTarget);
                }

                /* turrets / inhibitors / nexus */
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    /* turrets */
                    foreach (var turret in
                             ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* inhibitor */
                    foreach (var turret in
                             ObjectManager.Get <Obj_BarracksDampener>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(turret);
                    }

                    /* nexus */
                    foreach (var nexus in
                             ObjectManager.Get <Obj_HQ>().Where(t => t.IsValidTarget() && InAutoAttackRange(t)))
                    {
                        return(nexus);
                    }
                }

                /*Champions*/
                if (ActiveMode != OrbwalkingMode.LastHit)
                {
                    var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical);
                    if (target.IsValidTarget())
                    {
                        return(target);
                    }
                }

                /*Jungle minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed)
                {
                    result =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            mob =>
                            mob.IsValidTarget() && mob.Team == GameObjectTeam.Neutral && InAutoAttackRange(mob) && mob.CharData.BaseSkinName != "gangplankbarrel")
                        .MaxOrDefault(mob => mob.MaxHealth);
                    if (result != null)
                    {
                        return(result);
                    }
                }

                /*Lane Clear minions*/
                if (ActiveMode == OrbwalkingMode.LaneClear)
                {
                    if (!ShouldWait())
                    {
                        if (_prevMinion.IsValidTarget() && InAutoAttackRange(_prevMinion))
                        {
                            var predHealth = HealthPrediction.LaneClearHealthPrediction(
                                _prevMinion, (int)((Player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay);
                            if (predHealth >= 2 * GetAADamage(_prevMinion) ||
                                Math.Abs(predHealth - _prevMinion.Health) < float.Epsilon)
                            {
                                return(_prevMinion);
                            }
                        }

                        result = (from minion in
                                  ObjectManager.Get <Obj_AI_Minion>()
                                  .Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion) && minion.CharData.BaseSkinName != "gangplankbarrel")
                                  let predHealth =
                                      HealthPrediction.LaneClearHealthPrediction(
                                          minion, (int)((Player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay)
                                      where
                                      predHealth >= 2 * GetAADamage(minion) ||
                                      Math.Abs(predHealth - minion.Health) < float.Epsilon
                                      select minion).MaxOrDefault(m => m.Health);

                        if (result != null)
                        {
                            _prevMinion = (Obj_AI_Minion)result;
                        }
                    }
                }

                return(result);
            }
Exemplo n.º 25
0
        private void Combo()
        {
            Obj_AI_Hero target = DrawHelper.GetBetterTarget(R.Range, TargetSelector.DamageType.Magical, true);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            var  data      = Program.IncDamages.GetAllyData(player.NetworkId);
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() &&
                ignitedmg > HealthPrediction.GetHealthPrediction(target, 700) && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) &&
                target.Distance(player) > Orbwalking.GetRealAutoAttackRange(target) + 25 && !justQ)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (Q.CanCast(target) && config.Item("useq", true).GetValue <bool>() && !player.IsWindingUp &&
                !data.IncSkillShot)
            {
                Q.CastOnUnit(target);
            }
            var cmbdmg = ComboDamage(target) + ItemHandler.GetItemsDamage(target);

            if (E.IsReady() && config.Item("usee", true).GetValue <bool>() && !player.IsWindingUp)
            {
                var enemyPred = E.GetPrediction(target);
                if (!OnTrident)
                {
                    if (config.Item("useedmg", true).GetValue <bool>() &&
                        data.ProjectileDamageTaken > target.GetAutoAttackDamage(player, true) + 10)
                    {
                        E.Cast(enemyPred.CastPosition);
                    }
                    if (config.Item("useehighdmg", true).GetValue <bool>() && data.DamageTaken > player.Health * 0.4f)
                    {
                        E.Cast(enemyPred.CastPosition);
                    }
                    if (config.Item("useeaa", true).GetValue <bool>() &&
                        data.AADamageTaken < target.GetAutoAttackDamage(player, true) + 10 &&
                        !SpellDatabase.AnyReadyCC(player.Position, 700, true))
                    {
                        E.Cast(enemyPred.CastPosition);
                    }
                    if (config.Item("useecq", true).GetValue <bool>() &&
                        cmbdmg > HeroManager.Enemies.Where(e => target.Distance(e) < 1500).Sum(e => e.Health) &&
                        !target.UnderTurret(true))
                    {
                        E.Cast(enemyPred.CastPosition);
                    }
                }
                else
                {
                    if (data.DamageTaken < 10 && enemyPred.Hitchance >= HitChance.High)
                    {
                        E.Cast(enemyPred.CastPosition);
                    }
                }
            }
            if (config.Item("usew", true).GetValue <bool>() && W.IsReady() && player.IsWindingUp)
            {
                W.Cast();
            }
            if (config.Item("user", true).GetValue <bool>() && R.IsReady() && player.IsWindingUp &&
                cmbdmg * 1.6 + player.GetAutoAttackDamage(target, true) * 5 > target.Health &&
                (target.Health > R.GetDamage(target) * 1.4f || player.HealthPercent < 40))
            {
                CastR(target);
            }
        }
Exemplo n.º 26
0
        public static void WaveClear()
        {
            var MinionList = MinionManager.GetMinions(Player.Position, Q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health)
                             .Where(x => !MinionListToIgnore.Contains(x.NetworkId)).ToList();

            var JungleList = MinionManager.GetMinions(Player.Position, Q.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);

            var UseLaneClearLastHit = Config.Item("UseLaneClearLastHit").GetValue <bool>();
            var useQ          = Config.Item("UseQLaneClear").GetValue <bool>();
            var useW          = Config.Item("UseWLaneClear").GetValue <bool>();
            var useE          = Config.Item("UseELaneClear").GetValue <bool>();
            var ManaLaneClear = Config.Item("ManaLaneClear").GetValue <Slider>().Value;
            var packetCast    = Config.Item("PacketCast").GetValue <bool>();

            if (Q.IsReady() && useQ && Player.GetManaPerc() > ManaLaneClear)
            {
                var queryJungle = JungleList.Where(x => x.IsValidTarget(Q.Range));
                if (queryJungle.Any())
                {
                    var mob = queryJungle.First();
                    Q.CastOnUnit(mob, packetCast);
                }

                var queryMinion = MinionList.Where(x => x.IsValidTarget(Q.Range));
                if (queryMinion.Any())
                {
                    var mob = queryMinion.First();
                    if (UseLaneClearLastHit)
                    {
                        if (HealthPrediction.GetHealthPrediction(mob, (int)Q.Delay * 1000) < Player.GetSpellDamage(mob, SpellSlot.Q) * 0.9)
                        {
                            Q.CastOnUnit(mob, packetCast);
                            MinionListToIgnore.Add(mob.NetworkId);
                            MinionList.Remove(mob);
                        }
                    }
                    else
                    {
                        if (HealthPrediction.GetHealthPrediction(mob, (int)Q.Delay * 1000) < Player.GetSpellDamage(mob, SpellSlot.Q) * 0.9)
                        {
                            Q.CastOnUnit(mob, packetCast);
                            MinionListToIgnore.Add(mob.NetworkId);
                            MinionList.Remove(mob);
                        }
                        else
                        {
                            mob = queryMinion.Last();
                            Q.CastOnUnit(mob, packetCast);
                            MinionList.Remove(mob);
                        }
                    }
                }
            }

            if (W.IsReady() && useW && Player.GetManaPerc() > ManaLaneClear)
            {
                var queryJungle = JungleList.Where(x => x.IsValidTarget(W.Range));
                if (queryJungle.Any())
                {
                    var mob = queryJungle.First();
                    W.CastOnUnit(mob, packetCast);
                }

                var query = MinionList.Where(x => x.IsValidTarget(W.Range));
                if (query.Any())
                {
                    var mob = query.First();
                    if (UseLaneClearLastHit)
                    {
                        if (HealthPrediction.GetHealthPrediction(mob, (int)W.Delay * 1000) < Player.GetSpellDamage(mob, SpellSlot.W) * 0.9)
                        {
                            W.CastOnUnit(mob, packetCast);
                            MinionListToIgnore.Add(mob.NetworkId);
                            MinionList.Remove(mob);
                        }
                    }
                    else
                    {
                        if (HealthPrediction.GetHealthPrediction(mob, (int)W.Delay * 1000) < Player.GetSpellDamage(mob, SpellSlot.W) * 0.9)
                        {
                            W.CastOnUnit(mob, packetCast);
                            MinionListToIgnore.Add(mob.NetworkId);
                            MinionList.Remove(mob);
                        }
                        else
                        {
                            mob = query.Last();
                            W.CastOnUnit(mob, packetCast);
                            MinionList.Remove(mob);
                        }
                    }
                }
            }

            if (E.IsReady() && useE && Player.GetManaPerc() > ManaLaneClear)
            {
                var queryJungle = JungleList.Where(x => x.IsValidTarget(E.Range));
                if (queryJungle.Any())
                {
                    var mob = queryJungle.First();
                    E.CastOnUnit(mob, packetCast);
                }

                var query = MinionList.Where(x => x.IsValidTarget(E.Range));
                if (query.Any())
                {
                    var mob = query.First();
                    if (UseLaneClearLastHit)
                    {
                        if (HealthPrediction.GetHealthPrediction(mob, (int)E.Delay * 1000) < Player.GetSpellDamage(mob, SpellSlot.E) * 0.9)
                        {
                            E.CastOnUnit(mob, packetCast);
                            MinionListToIgnore.Add(mob.NetworkId);
                            MinionList.Remove(mob);
                        }
                    }
                    else
                    {
                        if (HealthPrediction.GetHealthPrediction(mob, (int)E.Delay * 1000) < Player.GetSpellDamage(mob, SpellSlot.E) * 0.9)
                        {
                            E.CastOnUnit(mob, packetCast);
                            MinionListToIgnore.Add(mob.NetworkId);
                            MinionList.Remove(mob);
                        }
                        else
                        {
                            mob = query.Last();
                            E.CastOnUnit(mob, packetCast);
                            MinionList.Remove(mob);
                        }
                    }
                }
            }
        }
Exemplo n.º 27
0
        private static void Farm(bool laneClear)
        {
            if (!Config.Item("EnabledFarm").GetValue <bool>())
            {
                return;
            }

            var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range + W.Width,
                                                      MinionTypes.All);
            var rangedMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range + W.Width,
                                                         MinionTypes.Ranged);

            var useQi = Config.Item("UseQFarm").GetValue <StringList>().SelectedIndex;
            var useWi = Config.Item("UseWFarm").GetValue <StringList>().SelectedIndex;
            var useEi = Config.Item("UseWFarm").GetValue <StringList>().SelectedIndex;

            var useQ = (laneClear && (useQi == 1 || useQi == 2)) || (!laneClear && (useQi == 0 || useQi == 2));
            var useW = (laneClear && (useWi == 1 || useWi == 2)) || (!laneClear && (useWi == 0 || useWi == 2));
            var useE = (laneClear && (useEi == 1 || useEi == 2)) || (!laneClear && (useEi == 0 || useEi == 2));

            if (useQ && QIsReady)
            {
                if (useW)
                {
                    var qLocation    = Q.GetCircularFarmLocation(allMinions, W.Range);
                    var q2Location   = Q.GetCircularFarmLocation(rangedMinions, W.Range);
                    var bestLocation = (qLocation.MinionsHit > q2Location.MinionsHit + 1) ? qLocation : q2Location;

                    if (bestLocation.MinionsHit > 0)
                    {
                        Q.Cast(bestLocation.Position, true);
                        return;
                    }
                }
                else
                {
                    foreach (var minion in allMinions.FindAll(m => !Orbwalking.InAutoAttackRange(m)))
                    {
                        if (HealthPrediction.GetHealthPrediction(minion, Math.Max((int)(minion.ServerPosition.Distance(BallManager.BallPosition) / Q.Speed * 1000) - 100, 0)) < 50)
                        {
                            Q.Cast(minion.ServerPosition, true);
                            return;
                        }
                    }
                }
            }

            if (useW && WIsReady)
            {
                var n = 0;
                var d = 0;
                foreach (var m in allMinions)
                {
                    if (m.Distance(BallManager.BallPosition) <= W.Range)
                    {
                        n++;
                        if (W.GetDamage(m) > m.Health)
                        {
                            d++;
                        }
                    }
                }
                if (n >= 3 || d >= 2)
                {
                    W.Cast(Player.ServerPosition, true);
                    return;
                }
            }

            if (useE && EIsReady)
            {
                if (W.CountHits(allMinions, Player.ServerPosition) >= 3)
                {
                    E.CastOnUnit(Player, true);
                    return;
                }
            }
        }
Exemplo n.º 28
0
        private void Game_OnUpdate(EventArgs args)
        {
            _w.MinHitChance = MenuProvider.Champion.Misc.WSelectedHitchance;

            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.CountEnemiesInRange(2000f) > 0)
                                {
                                    var target =
                                        HeroManager.Enemies.Where(
                                            x =>
                                            x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                        GetQRange)))
                                        .OrderByDescending(a => TargetSelector.GetPriority(a))
                                        .FirstOrDefault();
                                    if (target != null)
                                    {
                                        if (target.CountEnemiesInRange(200) >=
                                            MenuProvider.Champion.Combo.GetSliderValue(
                                                "Switch to Rocket If will hit enemy Number >=").Value)
                                        {
                                            QSwitch(true);
                                        }
                                        else
                                        {
                                            QSwitch(
                                                !target.IsValidTarget(
                                                    ObjectManager.Player.GetRealAutoAttackRange(target, DefaultRange)));
                                        }
                                    }
                                    else
                                    {
                                        QSwitch(true);
                                    }
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseW)
                        {
                            if (ObjectManager.Player.CountEnemiesInRange(400f) == 0)
                            {
                                if (_w.IsReadyPerfectly())
                                {
                                    var target = TargetSelector.GetTargetNoCollision(_w);
                                    if (target.IsValidTarget(_w.Range))
                                    {
                                        _w.Cast(target);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                var target =
                                    HeroManager.Enemies.Where(
                                        x =>
                                        x.IsValidTarget(600) && _e.GetPrediction(x).Hitchance >= _e.MinHitChance &&
                                        x.IsMoving)
                                    .OrderBy(x => x.Distance(ObjectManager.Player))
                                    .FirstOrDefault();
                                if (target != null)
                                {
                                    _e.Cast(target, false, true);
                                }
                                else
                                {
                                    _e.CastWithExtraTrapLogic();
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseR)
                        {
                            if (_r.IsReadyPerfectly())
                            {
                                if (_wCastTime + 1060 <= Environment.TickCount)
                                {
                                    var target =
                                        HeroManager.Enemies.FirstOrDefault(
                                            x =>
                                            !x.IsZombie && x.CountAlliesInRange(500) < 2 &&
                                            HealthPrediction.GetHealthPrediction(x, 5000) > 0 &&
                                            ObjectManager.Player.Distance(x) >= GetQRange &&
                                            x.IsKillableAndValidTarget(GetRDamage(x),
                                                                       TargetSelector.DamageType.Physical, _r.Range) &&
                                            _r.GetPrediction(x).Hitchance >= HitChance.High);
                                    if (target != null)
                                    {
                                        var prediction = _r.GetPrediction(target);
                                        var collision  =
                                            Collision.GetCollision(new List <Vector3> {
                                                prediction.UnitPosition
                                            },
                                                                   new PredictionInput
                                            {
                                                UseBoundingRadius = true,
                                                Unit             = ObjectManager.Player,
                                                Delay            = _r.Delay,
                                                Speed            = _r.Speed,
                                                Radius           = 200,
                                                CollisionObjects = new[] { CollisionableObjects.Heroes }
                                            })
                                            .Any(x => x.NetworkId != target.NetworkId);
                                        if (!collision)
                                        {
                                            _r.Cast(target);
                                        }
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                                {
                                    if (ObjectManager.Player.CountEnemiesInRange(2000f) > 0)
                                    {
                                        var target =
                                            HeroManager.Enemies.Where(
                                                x =>
                                                x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                            GetQRange)))
                                            .OrderByDescending(a => TargetSelector.GetPriority(a))
                                            .FirstOrDefault();
                                        QSwitch(
                                            !target.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(
                                                                      target, DefaultRange)));
                                    }
                                    else
                                    {
                                        QSwitch(false);
                                    }
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }
                        else
                        {
                            QSwitch(false);
                        }

                        if (MenuProvider.Champion.Harass.UseW)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (ObjectManager.Player.CountEnemiesInRange(400f) == 0)
                                {
                                    if (_w.IsReadyPerfectly())
                                    {
                                        var target = TargetSelector.GetTargetNoCollision(_w);
                                        if (target.IsValidTarget(_w.Range))
                                        {
                                            _w.Cast(target);
                                        }
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                                {
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }
                        else
                        {
                            QSwitch(false);
                        }

                        //Jungleclear
                        if (MenuProvider.Champion.Jungleclear.UseW)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                            {
                                if (_w.IsReadyPerfectly())
                                {
                                    var target =
                                        MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth)
                                        .FirstOrDefault(
                                            x =>
                                            x.IsValidTarget(600) &&
                                            _w.GetPrediction(x).Hitchance >= _w.MinHitChance);
                                    if (target != null)
                                    {
                                        _w.Cast(target);
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LastHit:
                    {
                        if (MenuProvider.Champion.Lasthit.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Lasthit.IfMana))
                                {
                                    var target =
                                        MinionManager.GetMinions(float.MaxValue)
                                        .FirstOrDefault(
                                            x =>
                                            x.IsKillableAndValidTarget(
                                                ObjectManager.Player.GetAutoAttackDamage(x, false) +
                                                _q.GetDamage(x), TargetSelector.DamageType.Physical) &&
                                            x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                        GetQRange)) &&
                                            !x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                         DefaultRange)));
                                    if (target != null)
                                    {
                                        QSwitch(true);

                                        if (Orbwalking.InAutoAttackRange(target))
                                        {
                                            MenuProvider.Orbwalker.ForceTarget(target);
                                        }
                                    }
                                    else
                                    {
                                        QSwitch(false);
                                    }
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }
                        else
                        {
                            QSwitch(false);
                        }

                        break;
                    }
                    }

                    if (MenuProvider.Champion.Misc.GetBoolValue("Auto R on Killable Target"))
                    {
                        if (_r.IsReadyPerfectly())
                        {
                            if (_wCastTime + 1060 <= Environment.TickCount)
                            {
                                var target =
                                    HeroManager.Enemies.FirstOrDefault(
                                        x =>
                                        !x.IsZombie && x.CountAlliesInRange(500) < 2 &&
                                        HealthPrediction.GetHealthPrediction(x, 5000) > 0 &&
                                        ObjectManager.Player.Distance(x) >= GetQRange &&
                                        x.IsKillableAndValidTarget(GetRDamage(x), TargetSelector.DamageType.Physical,
                                                                   _r.Range) && _r.GetPrediction(x).Hitchance >= HitChance.High);
                                if (target != null)
                                {
                                    var prediction = _r.GetPrediction(target);
                                    var collision  =
                                        Collision.GetCollision(new List <Vector3> {
                                        prediction.UnitPosition
                                    },
                                                               new PredictionInput
                                    {
                                        Unit             = ObjectManager.Player,
                                        Delay            = _r.Delay,
                                        Speed            = _r.Speed,
                                        Radius           = _r.Width,
                                        CollisionObjects = new[] { CollisionableObjects.Heroes }
                                    })
                                        .Any(x => x.NetworkId != target.NetworkId);
                                    if (!collision)
                                    {
                                        _r.Cast(target);
                                    }
                                }
                            }
                        }
                    }

                    if (MenuProvider.Champion.Misc.GetBoolValue("Auto E on Immobile Target"))
                    {
                        if (_e.IsReadyPerfectly())
                        {
                            var target =
                                HeroManager.Enemies.FirstOrDefault(
                                    x => x.IsValidTarget(_e.Range) && x.IsImmobileUntil() > 0.5f);
                            if (target != null)
                            {
                                _e.Cast(target, false, true);
                            }
                        }
                    }

                    if (MenuProvider.Champion.Harass.AutoHarass)
                    {
                        if (MenuProvider.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo)
                        {
                            if (!ObjectManager.Player.IsRecalling())
                            {
                                if (MenuProvider.Champion.Harass.UseW)
                                {
                                    if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                                    {
                                        var target = TargetSelector.GetTargetNoCollision(_w);
                                        if (target != null)
                                        {
                                            if (ObjectManager.Player.UnderTurret(true)
                                                ? !target.UnderTurret(true)
                                                : true)
                                            {
                                                _w.Cast(target);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 29
0
        private void Farm()
        {
            if (!ManaManager.HasMana("LaneClear"))
            {
                return;
            }

            var useQ = menu.Item("UseQFarm", true).GetValue <bool>();
            var useW = menu.Item("UseWFarm", true).GetValue <bool>();
            var useE = menu.Item("UseEFarm", true).GetValue <bool>();

            if (useQ)
            {
                var min     = menu.Item("QMinHit", true).GetValue <Slider>().Value;
                var minionQ = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly);

                var pred = Q.GetCircularFarmLocation(minionQ, 120);

                if (pred.MinionsHit >= min)
                {
                    Q.Cast(pred.Position);
                }
            }
            if (useW)
            {
                var min     = menu.Item("WMinHit", true).GetValue <Slider>().Value;
                var minionW = MinionManager.GetMinions(Player.ServerPosition, W.Range, MinionTypes.All, MinionTeam.NotAlly);

                var pred = W.GetCircularFarmLocation(minionW, 200);

                if (pred.MinionsHit >= min)
                {
                    W.Cast(pred.Position);
                }
            }
            if (useE)
            {
                var mode    = menu.Item("EMode", true).GetValue <StringList>().SelectedIndex;
                var minions = MinionManager.GetMinions(Player.ServerPosition, E.Range, MinionTypes.All, MinionTeam.NotAlly);

                if (minions.Count == 0)
                {
                    return;
                }

                if (mode == 0)
                {
                    var minion = minions.FirstOrDefault(x => PoisonDuration(x) > E.Delay);

                    if (minion != null)
                    {
                        E.Cast(minion);
                    }
                }
                else if (mode == 1)
                {
                    foreach (var x in minions)
                    {
                        var healthPred = HealthPrediction.GetHealthPrediction(x, (int)Player.Distance(x), Game.Ping + 200);

                        if (healthPred <= Player.GetSpellDamage(x, SpellSlot.E))
                        {
                            E.Cast(x);
                        }
                    }
                }
                else if (mode == 2)
                {
                    foreach (var x in minions.Where(x => PoisonDuration(x) > E.Delay))
                    {
                        var healthPred = HealthPrediction.GetHealthPrediction(x, (int)Player.Distance(x), Game.Ping + 200);

                        if (healthPred <= Player.GetSpellDamage(x, SpellSlot.E))
                        {
                            E.Cast(x);
                        }
                    }
                }
            }
        }
Exemplo n.º 30
0
 private void LastHitQ(bool auto = false)
 {
     if (!Q.IsReady())
     {
         return;
     }
     if (auto && player.ManaPercent < config.Item("autoQmana", true).GetValue <Slider>().Value)
     {
         return;
     }
     if (config.Item("useqLC", true).GetValue <bool>() || config.Item("useqLH", true).GetValue <bool>() || auto)
     {
         var minions =
             MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly)
             .Where(
                 m =>
                 m.IsValidTargetLS() && m.Health > 5 && m.Distance(player) < Q.Range &&
                 m.Health <
                 Q.GetDamage(m) * config.Item("qLHDamage", true).GetValue <Slider>().Value / 100);
         var objAiBases = from minion in minions
                          let pred =
             Q.GetCollision(
                 player.Position.To2D(),
                 new List <Vector2>()
         {
             player.Position.Extend(minion.Position, Q.Range).To3DWorld().To2D()
         }, 70f)
             orderby pred.Count descending
             select minion;
         if (objAiBases.Any())
         {
             //       Obj_AI_Base target = null;
             foreach (var minion in
                      objAiBases.Where(
                          minion =>
                          HealthPrediction.GetHealthPrediction(
                              minion, (int)(minion.Distance(player) / Q.Speed * 1000 + 500f)) > 0))
             {
                 var collision =
                     Q.GetCollision(
                         player.Position.To2D(),
                         new List <Vector2>()
                 {
                     player.Position.Extend(minion.Position, Q.Range).To3DWorld().To2D()
                 }, 70f)
                     .OrderBy(c => c.Distance(player))
                     .ToList();
                 if (collision.Count <= 2 || collision[0].NetworkId == minion.NetworkId ||
                     collision[1].NetworkId == minion.NetworkId)
                 {
                     if (collision.Count == 1)
                     {
                         Q.Cast(minion);
                     }
                     else
                     {
                         var other = collision.FirstOrDefault(c => c.NetworkId != minion.NetworkId);
                         if (other != null &&
                             (player.GetAutoAttackDamage(other) * 2 > other.Health - Q.GetDamage(other)) &&
                             Q.GetDamage(other) < other.Health)
                         {
                             qMiniForWait = other;
                             qMiniTarget  = minion;
                             if (EloBuddy.SDK.Orbwalker.CanAutoAttack &&
                                 other.Distance(player) < Orbwalking.GetRealAutoAttackRange(other))
                             {
                                 EloBuddy.Player.IssueOrder(GameObjectOrder.AutoAttack, other);
                             }
                         }
                         else
                         {
                             Q.Cast(minion);
                         }
                     }
                 }
             }
         }
     }
 }