Пример #1
0
 public bool ShouldWait()
 {
     return(Get <Obj_AI_Minion>().Any(minion => minion.IsValidTarget() && minion.Team != GameObjectTeam.Neutral && InAutoAttackRange(minion) && MinionManager.IsMinion(minion) && HealthPrediction.LaneClearHealthPrediction(minion, (int)(player.AttackDelay * 1000 * LaneClearWaitTimeMod), FarmDelay) <= player.GetAutoAttackDamage(minion)));
 }
Пример #2
0
        /// <summary>
        /// Execute Q Clear
        /// </summary>
        private static void ExecuteQ()
        {
            var min = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Jhin.Q.Range).MinOrDefault(x => x.Health);

            Jhin.Q.CastOnUnit(min);
        }
Пример #3
0
        public override void Drawing_OnDraw(EventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            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() == "sru_chaosminionsiege" || m.SkinName.ToLower() == "sru_chaosminionsuper")
                {
                    killableMinionCount += 2;
                }
                else
                {
                    killableMinionCount++;
                }

                Render.Circle.DrawCircle(m.Position, (float)(m.BoundingRadius * 1.5), Color.White, 5);
            }

            foreach (var m in
                     MinionManager.GetMinions(
                         ObjectManager.Player.ServerPosition,
                         E.Range,
                         MinionTypes.All,
                         MinionTeam.Neutral).Where(m => E.CanCast(m) && m.Health < E.GetDamage(m)))
            {
                if (m.SkinName.ToLower().Contains("baron") || m.SkinName.ToLower().Contains("dragon") && E.CanCast(m))
                {
                    E.Cast(m);
                }
                else
                {
                    Render.Circle.DrawCircle(m.Position, (float)(m.BoundingRadius * 1.5), Color.White, 5);
                }
            }

            Spell[] spellList = { Q, E, R };
            foreach (var spell in spellList)
            {
                var menuItem = GetValue <Circle>("Draw" + spell.Slot);
                if (menuItem.Active && spell.Level > 0)
                {
                    Render.Circle.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
                }
            }

            var drawEStackCount = GetValue <Circle>("DrawEStackCount");

            if (drawEStackCount.Active)
            {
                xEnemyMarker.Clear();
                foreach (var xEnemy in
                         HeroManager.Enemies.Where(
                             tx => tx.IsEnemy && !tx.IsDead && ObjectManager.Player.Distance(tx) < E.Range))
                {
                    foreach (var buff in xEnemy.Buffs.Where(buff => buff.Name.Contains("kalistaexpungemarker")))
                    {
                        xEnemyMarker.Add(
                            new EnemyMarker
                        {
                            ChampionName = xEnemy.ChampionName, ExpireTime = Game.Time + 4, BuffCount = buff.Count
                        });
                    }
                }

                foreach (var markedEnemies in xEnemyMarker)
                {
                    foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>())
                    {
                        if (enemy.IsEnemy && !enemy.IsDead && ObjectManager.Player.Distance(enemy) <= E.Range &&
                            enemy.ChampionName == markedEnemies.ChampionName)
                        {
                            if (!(markedEnemies.ExpireTime > Game.Time))
                            {
                                continue;
                            }
                            var xCoolDown = TimeSpan.FromSeconds(markedEnemies.ExpireTime - Game.Time);
                            var display   = string.Format("{0}", markedEnemies.BuffCount);
                            Utils.Utils.DrawText(
                                font,
                                display,
                                (int)enemy.HPBarPosition.X - 10,
                                (int)enemy.HPBarPosition.Y,
                                SharpDX.Color.Wheat);
                            //Drawing.DrawText(enemy.HPBarPosition.X + 145, enemy.HPBarPosition.Y + 20, drawEStackCount.Color, display);
                        }
                    }
                }
            }
            var drawJumpPos = GetValue <Circle>("DrawJumpPos");

            if (drawJumpPos.Active)
            {
                foreach (var pos in JumpPos)
                {
                    if (ObjectManager.Player.Distance(pos.Key) <= 500f ||
                        ObjectManager.Player.Distance(pos.Value) <= 500f)
                    {
                        Drawing.DrawCircle(pos.Key, 75f, drawJumpPos.Color);
                        Drawing.DrawCircle(pos.Value, 75f, drawJumpPos.Color);
                    }
                    if (ObjectManager.Player.Distance(pos.Key) <= 35f || ObjectManager.Player.Distance(pos.Value) <= 35f)
                    {
                        Render.Circle.DrawCircle(pos.Key, 70f, Color.GreenYellow);
                        Render.Circle.DrawCircle(pos.Value, 70f, Color.GreenYellow);
                    }
                }
            }
        }
Пример #4
0
        private void QLogic(Obj_AI_Hero target, bool UseQ1 = false)// SFX Challenger MissFortune QLogic (im so lazy, kappa)
        {
            if (target != null)
            {
                if (target.IsValidTarget(Q.Range))
                {
                    Q.CastOnUnit(target);
                }
                else if (UseQ1 && target.IsValidTarget(Q1.Range) && target.DistanceToPlayer() > Q.Range)
                {
                    var heroPositions = (from t in HeroManager.Enemies
                                         where t.IsValidTarget(Q1.Range)
                                         let prediction = Q.GetPrediction(t)
                                                          select new CPrediction.Position(t, prediction.UnitPosition)).Where(
                        t => t.UnitPosition.Distance(Me.Position) < Q1.Range).ToList();

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

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

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

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

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

                                    if (!insideCone.Any() ||
                                        enemy.UnitPosition.Distance(minion.Position) <
                                        insideCone.Select(
                                            m => m.Position.Distance(minion.Position) - m.BoundingRadius)
                                        .DefaultIfEmpty(float.MaxValue)
                                        .Min())
                                    {
                                        Q.CastOnUnit(minion);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #5
0
        public static Vector2 GetCollisionPoint(Skillshot skillshot)
        {
            var collisions = new List <DetectedCollision>();
            var from       = skillshot.GetMissilePosition(0);

            skillshot.ForceDisabled = false;
            foreach (var cObject in skillshot.SpellData.CollisionObjects)
            {
                switch (cObject)
                {
                case CollisionObjectTypes.Minion:

                    foreach (var minion in
                             MinionManager.GetMinions(
                                 from.To3D(), 1200, MinionTypes.All,
                                 skillshot.Unit.Team == ObjectManager.Player.Team
                                    ? MinionTeam.NotAlly
                                    : MinionTeam.NotAllyForEnemy))
                    {
                        var pred = FastPrediction(
                            from, minion,
                            Math.Max(0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)),
                            skillshot.SpellData.MissileSpeed);
                        var pos = pred.PredictedPos;
                        var w   = skillshot.SpellData.RawRadius + (!pred.IsMoving ? (minion.BoundingRadius - 15) : 0) -
                                  pos.Distance(from, skillshot.End, true);
                        if (w > 0)
                        {
                            collisions.Add(
                                new DetectedCollision
                            {
                                Position =
                                    pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint +
                                    skillshot.Direction * 30,
                                Unit     = minion,
                                Type     = CollisionObjectTypes.Minion,
                                Distance = pos.Distance(from),
                                Diff     = w
                            });
                        }
                    }

                    break;

                case CollisionObjectTypes.Champions:
                    foreach (var hero in
                             ObjectManager.Get <Obj_AI_Hero>()
                             .Where(
                                 h =>
                                 (h.IsValidTarget(1200, false) && h.Team == ObjectManager.Player.Team && !h.IsMe ||
                                  h.Team != ObjectManager.Player.Team)))
                    {
                        var pred = FastPrediction(
                            from, hero,
                            Math.Max(0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)),
                            skillshot.SpellData.MissileSpeed);
                        var pos = pred.PredictedPos;

                        var w = skillshot.SpellData.RawRadius + 30 - pos.Distance(from, skillshot.End, true);
                        if (w > 0)
                        {
                            collisions.Add(
                                new DetectedCollision
                            {
                                Position =
                                    pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint +
                                    skillshot.Direction * 30,
                                Unit     = hero,
                                Type     = CollisionObjectTypes.Minion,
                                Distance = pos.Distance(from),
                                Diff     = w
                            });
                        }
                    }
                    break;

                case CollisionObjectTypes.YasuoWall:
                    if (
                        !ObjectManager.Get <Obj_AI_Hero>()
                        .Any(
                            hero =>
                            hero.IsValidTarget(float.MaxValue, false) &&
                            hero.Team == ObjectManager.Player.Team && hero.ChampionName == "Yasuo"))
                    {
                        break;
                    }
                    GameObject wall = null;
                    foreach (var gameObject in ObjectManager.Get <GameObject>())
                    {
                        if (gameObject.IsValid &&
                            Regex.IsMatch(gameObject.Name, "_w_windwall.\\.troy", RegexOptions.IgnoreCase))
                        {
                            wall = gameObject;
                        }
                    }
                    if (wall == null)
                    {
                        break;
                    }
                    var level     = wall.Name.Substring(wall.Name.Length - 6, 1);
                    var wallWidth = (300 + 50 * Convert.ToInt32(level));


                    var wallDirection = (wall.Position.To2D() - YasuoWallCastedPos).Normalized().Perpendicular();
                    var wallStart     = wall.Position.To2D() + wallWidth / 2 * wallDirection;
                    var wallEnd       = wallStart - wallWidth * wallDirection;
                    var wallPolygon   = new Geometry.Rectangle(wallStart, wallEnd, 75).ToPolygon();
                    var intersection  = new Vector2();
                    var intersections = new List <Vector2>();

                    for (var i = 0; i < wallPolygon.Points.Count; i++)
                    {
                        var inter =
                            wallPolygon.Points[i].Intersection(
                                wallPolygon.Points[i != wallPolygon.Points.Count - 1 ? i + 1 : 0], from,
                                skillshot.End);
                        if (inter.Intersects)
                        {
                            intersections.Add(inter.Point);
                        }
                    }

                    if (intersections.Count > 0)
                    {
                        intersection = intersections.OrderBy(item => item.Distance(from)).ToList()[0];
                        var collisionT = Environment.TickCount +
                                         Math.Max(
                            0,
                            skillshot.SpellData.Delay -
                            (Environment.TickCount - skillshot.StartTick)) + 100 +
                                         (1000 * intersection.Distance(from)) / skillshot.SpellData.MissileSpeed;
                        if (collisionT - WallCastT < 4000)
                        {
                            if (skillshot.SpellData.Type != SkillShotType.SkillshotMissileLine)
                            {
                                skillshot.ForceDisabled = true;
                            }
                            return(intersection);
                        }
                    }

                    break;
                }
            }

            Vector2 result;

            if (collisions.Count > 0)
            {
                result = collisions.OrderBy(c => c.Distance).ToList()[0].Position;
            }
            else
            {
                result = new Vector2();
            }

            return(result);
        }
Пример #6
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;
                            }
                        }
                    }
                }
            }
        }
Пример #7
0
        void Waveclear()
        {
            List <Obj_AI_Minion> allMinions = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsValidTarget(W.Range) && !MinionManager.IsWard(x)).ToList();

            if (getCheckBoxItem(farm, "UseQFarm") && Q.IsReady())
            {
                var minion = Orbwalker.LastTarget as Obj_AI_Minion;
                if (minion != null && HealthPrediction.GetHealthPrediction(
                        minion, (int)(Khazix.LSDistance(minion) * 1000 / 1400)) >
                    0.35f * Khazix.GetSpellDamage(minion, SpellSlot.Q) && Khazix.LSDistance(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.LSDistance(min) * 1000 / 1400)) >
                            3 * Khazix.GetSpellDamage(min, SpellSlot.Q) && Khazix.LSDistance(min) <= Q.Range)
                        {
                            Q.Cast(min);
                            break;
                        }
                    }
                }
            }

            if (getCheckBoxItem(farm, "UseWFarm") && W.IsReady() && Khazix.HealthPercent <= getSliderItem(farm, "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.LSDistance(farmLocation.Position) <= WE.Range : Khazix.LSDistance(farmLocation.Position) <= W.Range;
                if (distcheck)
                {
                    W.Cast(farmLocation.Position);
                }
            }

            if (getCheckBoxItem(farm, "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.LSDistance(farmLocation.Position) <= E.Range)
                {
                    E.Cast(farmLocation.Position);
                }
            }


            if (getCheckBoxItem(farm, "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.LSDistance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, Khazix);
                }
                if (Tiamat.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, Khazix);
                }
                if (Titanic.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Titanic.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3748, Khazix);
                }
            }
        }
Пример #8
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (!Me.IsValidTarget(300, false))
            {
                return;
            }

            UseItemCount("Odyns", 3180, 450f);
            UseItemCount("Randuins", 3143, 450f);

            if (OC.IncomeDamage >= 1)
            {
                UseItem("allyshieldlocket", "Locket", 3190, 600f);
                UseItem("selfshieldseraph", "Seraphs", 3040);
                UseItem("selfshieldzhonya", "Zhonyas", 3157);
                UseItem("allyshieldmountain", "Mountain", 3401, 700f);
                UseItem("selfshieldzhonya", "Wooglets", 3090);
            }

            // Oracle's Lens
            if (Items.HasItem(3364) && Items.CanUseItem(3364) && _mainMenu.Item("useOracles").GetValue <bool>())
            {
                if (!OC.Origin.Item("ComboKey").GetValue <KeyBind>().Active&&
                    _mainMenu.Item("oracleMode").GetValue <StringList>().SelectedIndex == 1)
                {
                    return;
                }

                var target = OC.Friendly();
                if (target.Distance(Me.ServerPosition, true) <= 600 * 600 && OC.Stealth || target.HasBuff("RengarRBuff", true))
                {
                    Items.UseItem(3364, target.ServerPosition);
                }
            }

            // Banner of command (basic)
            if (Items.HasItem(3060) && Items.CanUseItem(3060) && _mainMenu.Item("useBanner").GetValue <bool>())
            {
                var minionList = MinionManager.GetMinions(Me.Position, 1000);

                foreach (
                    var minyone in
                    minionList.Where(minion => minion.IsValidTarget(1000) && minion.BaseSkinName.Contains("MechCannon")))
                {
                    if (minyone.Health > minyone.Health / minyone.MaxHealth * 50)
                    {
                        Items.UseItem(3060, minyone);
                    }
                }
            }

            // Talisman of Ascension
            if (Items.HasItem(3069) && Items.CanUseItem(3069) && _mainMenu.Item("useTalisman").GetValue <bool>())
            {
                if (!OC.Origin.Item("ComboKey").GetValue <KeyBind>().Active&&
                    _mainMenu.Item("talismanMode").GetValue <StringList>().SelectedIndex == 1)
                {
                    return;
                }

                var target = OC.Friendly();
                if (target.Distance(Me.ServerPosition, true) > 600 * 600)
                {
                    return;
                }

                var LowHpEnemy =
                    ObjectManager.Get <Obj_AI_Hero>()
                    .OrderByDescending(ex => ex.Health / ex.MaxHealth * 100)
                    .First(x => x.IsValidTarget(1000));

                var aHealthPercent = target.Health / target.MaxHealth * 100;
                var eHealthPercent = LowHpEnemy.Health / LowHpEnemy.MaxHealth * 100;

                if (LowHpEnemy.Distance(target.ServerPosition, true) <= 900 * 900 &&
                    (target.CountHerosInRange("allies") > target.CountHerosInRange("hostile") &&
                     eHealthPercent <= _mainMenu.Item("useEnemyPct").GetValue <Slider>().Value))
                {
                    Items.UseItem(3069);
                }

                if (target.CountHerosInRange("hostile") > target.CountHerosInRange("allies") &&
                    aHealthPercent <= _mainMenu.Item("useAllyPct").GetValue <Slider>().Value)
                {
                    Items.UseItem(3069);
                }
            }
        }
Пример #9
0
        private static void Farm(bool laneClear)
        {
            var rangedMinionsQ = MinionManager.GetMinions(
                ObjectManager.Player.ServerPosition, Q.Range + Q.Width + 30, MinionTypes.Ranged);
            var allMinionsQ = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range + Q.Width + 30);
            var allMinionsW = MinionManager.GetMinions(BallManager.CurrentBallPosition, W.Range + W.Width + 30);

            var useQi = Config.Item("UseQFarm").GetValue <StringList>().SelectedIndex;
            var useWi = 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));

            if (useQ && Q.IsReady())
            {
                if (laneClear)
                {
                    var fl1 = Q.GetCircularFarmLocation(rangedMinionsQ, Q.Width);
                    var fl2 = Q.GetCircularFarmLocation(allMinionsQ, Q.Width);

                    if (fl1.MinionsHit >= 3)
                    {
                        Q.Cast(fl1.Position);
                    }
                    else if (fl2.MinionsHit >= 2 || allMinionsQ.Count == 1)
                    {
                        Q.Cast(fl2.Position);
                    }
                }
                else
                {
                    foreach (var minion in
                             allMinionsQ.Where(
                                 minion =>
                                 !Orbwalking.InAutoAttackRange(minion) && minion.Health < 0.75 * Q.GetDamage(minion)))
                    {
                        Q.Cast(minion);
                    }
                }
            }

            if (useW && W.IsReady())
            {
                if (laneClear)
                {
                    var i =
                        allMinionsW.Count(
                            minion =>
                            minion.IsValidTarget(W.Range + W.Width + 30, true, BallManager.CurrentBallPosition));

                    if (i >= 2)
                    {
                        W.Cast();
                    }
                }
                else
                {
                    // ReSharper disable once UnusedVariable
                    foreach (var minion in
                             allMinionsW.Where(
                                 minion =>
                                 !Orbwalking.InAutoAttackRange(minion) && minion.Health < 0.75 * W.GetDamage(minion)))
                    {
                        W.Cast();
                    }
                }
            }
        }
Пример #10
0
        void LH()
        {
            List <Obj_AI_Base> allMinions = MinionManager.GetMinions(Khazix.ServerPosition, Q.Range);

            if (getCheckBoxItem(farm, "UseQFarm") && Q.IsReady())
            {
                foreach (Obj_AI_Base minion in
                         allMinions.Where(
                             minion =>
                             minion.IsValidTarget() &&
                             HealthPrediction.GetHealthPrediction(
                                 minion, (int)(Khazix.LSDistance(minion) * 1000 / 1400)) <
                             0.75 * Khazix.GetSpellDamage(minion, SpellSlot.Q)))
                {
                    if (Vector3.Distance(minion.ServerPosition, Khazix.ServerPosition) >
                        Orbwalking.GetRealAutoAttackRange(Khazix) && Khazix.LSDistance(minion) <= Q.Range)
                    {
                        Q.CastOnUnit(minion);
                        return;
                    }
                }
            }
            if (getCheckBoxItem(farm, "UseWFarm") && W.IsReady())
            {
                MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(
                    MinionManager.GetMinions(Khazix.ServerPosition, W.Range).Where(minion => HealthPrediction.GetHealthPrediction(
                                                                                       minion, (int)(Khazix.LSDistance(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.LSDistance(farmLocation.Position) <= W.Range)
                        {
                            W.Cast(farmLocation.Position);
                        }
                    }

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

            if (getCheckBoxItem(farm, "UseEFarm") && E.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, E.Range).Where(minion => HealthPrediction.GetHealthPrediction(
                                                                                           minion, (int)(Khazix.LSDistance(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.LSDistance(farmLocation.Position) <= E.Range)
                    {
                        E.Cast(farmLocation.Position);
                    }
                }
            }


            if (getCheckBoxItem(farm, "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.LSDistance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, Khazix);
                }
                if (Tiamat.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, Khazix);
                }
            }
        }
Пример #11
0
        private static void OnDraw(EventArgs args)
        {
            if (!_drawing)
            {
                return;
            }

            if (Menu.Item("lxOrbwalker_Draw_AARange").GetValue <Circle>().Active)
            {
                Utility.DrawCircle(MyHero.Position, GetAutoAttackRange(),
                                   Menu.Item("lxOrbwalker_Draw_AARange").GetValue <Circle>().Color);
            }

            if (Menu.Item("lxOrbwalker_Draw_AARange_Enemy").GetValue <Circle>().Active ||
                Menu.Item("lxOrbwalker_Draw_hitbox").GetValue <Circle>().Active)
            {
                foreach (Obj_AI_Hero enemy in AllEnemys.Where(enemy => enemy.IsValidTarget(1500)))
                {
                    if (Menu.Item("lxOrbwalker_Draw_AARange_Enemy").GetValue <Circle>().Active)
                    {
                        Utility.DrawCircle(enemy.Position, GetAutoAttackRange(enemy, MyHero),
                                           Menu.Item("lxOrbwalker_Draw_AARange_Enemy").GetValue <Circle>().Color);
                    }
                    if (Menu.Item("lxOrbwalker_Draw_hitbox").GetValue <Circle>().Active)
                    {
                        Utility.DrawCircle(enemy.Position, enemy.BoundingRadius,
                                           Menu.Item("lxOrbwalker_Draw_hitbox").GetValue <Circle>().Color);
                    }
                }
            }

            if (Menu.Item("lxOrbwalker_Draw_AARange_Enemy").GetValue <Circle>().Active)
            {
                foreach (Obj_AI_Hero enemy in AllEnemys.Where(enemy => enemy.IsValidTarget(1500)))
                {
                    Utility.DrawCircle(enemy.Position, GetAutoAttackRange(enemy, MyHero),
                                       Menu.Item("lxOrbwalker_Draw_AARange_Enemy").GetValue <Circle>().Color);
                }
            }

            if (Menu.Item("lxOrbwalker_Draw_Holdzone").GetValue <Circle>().Active)
            {
                Utility.DrawCircle(MyHero.Position, Menu.Item("lxOrbwalker_Misc_Holdzone").GetValue <Slider>().Value,
                                   Menu.Item("lxOrbwalker_Draw_Holdzone").GetValue <Circle>().Color);
            }

            if (Menu.Item("lxOrbwalker_Draw_MinionHPBar").GetValue <Circle>().Active ||
                Menu.Item("lxOrbwalker_Draw_Lasthit").GetValue <Circle>().Active ||
                Menu.Item("lxOrbwalker_Draw_nearKill").GetValue <Circle>().Active)
            {
                List <Obj_AI_Base> minionList = MinionManager.GetMinions(MyHero.Position, GetAutoAttackRange() + 500,
                                                                         MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.MaxHealth);
                foreach (
                    Obj_AI_Base minion in minionList.Where(minion => minion.IsValidTarget(GetAutoAttackRange() + 500)))
                {
                    double  attackToKill  = Math.Ceiling(minion.MaxHealth / MyHero.GetAutoAttackDamage(minion, true));
                    Vector2 hpBarPosition = minion.HPBarPosition;
                    int     barWidth      = minion.IsMelee() ? 75 : 80;
                    if (minion.HasBuff("turretshield", true))
                    {
                        barWidth = 70;
                    }
                    var barDistance = (float)(barWidth / attackToKill);
                    if (Menu.Item("lxOrbwalker_Draw_MinionHPBar").GetValue <Circle>().Active)
                    {
                        for (int i = 1; i < attackToKill; i++)
                        {
                            float startposition = hpBarPosition.X + 45 + barDistance * i;
                            Drawing.DrawLine(
                                new Vector2(startposition, hpBarPosition.Y + 18),
                                new Vector2(startposition, hpBarPosition.Y + 23),
                                Menu.Item("lxOrbwalker_Draw_MinionHPBar_thickness").GetValue <Slider>().Value,
                                Menu.Item("lxOrbwalker_Draw_MinionHPBar").GetValue <Circle>().Color);
                        }
                    }
                    if (Menu.Item("lxOrbwalker_Draw_Lasthit").GetValue <Circle>().Active&&
                        minion.Health <= MyHero.GetAutoAttackDamage(minion, true))
                    {
                        Utility.DrawCircle(minion.Position, minion.BoundingRadius,
                                           Menu.Item("lxOrbwalker_Draw_Lasthit").GetValue <Circle>().Color);
                    }
                    else if (Menu.Item("lxOrbwalker_Draw_nearKill").GetValue <Circle>().Active&&
                             minion.Health <= MyHero.GetAutoAttackDamage(minion, true) * 2)
                    {
                        Utility.DrawCircle(minion.Position, minion.BoundingRadius,
                                           Menu.Item("lxOrbwalker_Draw_nearKill").GetValue <Circle>().Color);
                    }
                }
            }
        }
Пример #12
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (R.Level > 0)
            {
                R.Range = 150 * R.Level + 400;
            }

            if (GetValue <KeyBind>("UltOp1").Active)
            {
                UltUnderTurret();
            }

            if (GetValue <KeyBind>("UltOp2").Active)
            {
                UltInMyTeam();
            }

            if (!ComboActive)
            {
                var t = TargetSelector.GetTarget(QEx.Range, TargetSelector.DamageType.Physical);
                if (!t.LSIsValidTarget())
                {
                    return;
                }

                if (HarassActive && GetValue <bool>("UseQH"))
                {
                    CastQ(t);
                }

                if (GetValue <KeyBind>("UseQTH").Active)
                {
                    CastQ(t);
                }
            }

            if (ComboActive)
            {
                var t = TargetSelector.GetTarget(QEx.Range, TargetSelector.DamageType.Physical);

                if (E.IsReady() && GetValue <bool>("UseEC"))
                {
                    if (t.LSIsValidTarget(E.Range))
                    {
                        E.CastIfHitchanceEquals(t, HitChance.Medium);
                    }
                }

                if (Q.IsReady() && GetValue <bool>("UseQC"))
                {
                    if (getInfectedEnemy != null)
                    {
                        if (W.IsReady())
                        {
                            W.Cast();
                        }
                        QEx.Cast(getInfectedEnemy);
                    }
                    else
                    {
                        if (t.LSIsValidTarget(Q.Range))
                        {
                            CastQ(t);
                        }
                    }
                }
            }

            if (LaneClearActive)
            {
                var useQ = GetValue <bool>("UseQL");

                if (Q.IsReady() && useQ)
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (
                        var minions in
                        vMinions.Where(
                            minions => minions.Health < ObjectManager.Player.GetSpellDamage(minions, SpellSlot.Q)))
                    {
                        Q.Cast(minions);
                    }
                }
            }
        }
Пример #13
0
        private static void Usepotion()
        {
            var mobs = MinionManager.GetMinions(_player.ServerPosition, _q.Range,
                                                MinionTypes.All,
                                                MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
            var iusehppotion = _config.Item("usehppotions").GetValue <bool>();
            var iusepotionhp = _player.Health <=
                               (_player.MaxHealth * (_config.Item("usepotionhp").GetValue <Slider>().Value) / 100);
            var iusemppotion = _config.Item("usemppotions").GetValue <bool>();
            var iusepotionmp = _player.Mana <=
                               (_player.MaxMana * (_config.Item("usepotionmp").GetValue <Slider>().Value) / 100);

            if (_player.InFountain() || ObjectManager.Player.HasBuff("Recall"))
            {
                return;
            }

            if (_player.CountEnemiesInRange(800f) > 0 ||
                (mobs.Count > 0 && _config.Item("ActiveJungle").GetValue <KeyBind>().Active&& (Items.HasItem(1039) ||
                                                                                               SmiteBlue.Any(i => Items.HasItem(i)) || SmiteRed.Any(i => Items.HasItem(i)) || SmitePurple.Any(i => Items.HasItem(i)) ||
                                                                                               SmiteBlue.Any(i => Items.HasItem(i)) || SmiteGrey.Any(i => Items.HasItem(i))
                                                                                               )))
            {
                if (iusepotionhp && iusehppotion &&
                    !(ObjectManager.Player.HasBuff("RegenerationPotion", true) ||
                      ObjectManager.Player.HasBuff("ItemCrystalFlask", true) ||
                      ObjectManager.Player.HasBuff("ItemMiniRegenPotion", true)))
                {
                    if (Items.HasItem(2041) && Items.CanUseItem(2041))
                    {
                        Items.UseItem(2041);
                    }
                    else if (Items.HasItem(2010) && Items.CanUseItem(2010))
                    {
                        Items.UseItem(2010);
                    }
                    else if (Items.HasItem(2003) && Items.CanUseItem(2003))
                    {
                        Items.UseItem(2003);
                    }
                }


                if (iusepotionmp && iusemppotion &&
                    !(ObjectManager.Player.HasBuff("FlaskOfCrystalWater", true) ||
                      ObjectManager.Player.HasBuff("ItemCrystalFlask", true) ||
                      ObjectManager.Player.HasBuff("ItemMiniRegenPotion", true)))
                {
                    if (Items.HasItem(2041) && Items.CanUseItem(2041))
                    {
                        Items.UseItem(2041);
                    }
                    else if (Items.HasItem(2010) && Items.CanUseItem(2010))
                    {
                        Items.UseItem(2010);
                    }
                    else if (Items.HasItem(2004) && Items.CanUseItem(2004))
                    {
                        Items.UseItem(2004);
                    }
                }
            }
        }
Пример #14
0
        private void Game_OnUpdate(EventArgs args)
        {
            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.GetBoolValue("Attack Minion For Chasing"))
                        {
                            if (MenuProvider.Orbwalker.GetTarget() == null)
                            {
                                if (
                                    !HeroManager.Enemies.Any(
                                        x => x.IsValidTarget() && Orbwalking.InAutoAttackRange(x)))
                                {
                                    var minion =
                                        MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(null) + 65,
                                                                 MinionTypes.All, MinionTeam.NotAlly)
                                        .Where(x => x.IsValidTarget())
                                        .OrderBy(x => x.Distance(ObjectManager.Player))
                                        .FirstOrDefault();
                                    if (minion != null)
                                    {
                                        Orbwalking.Orbwalk(minion, Game.CursorPos, 0f);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (!ObjectManager.Player.IsDashing())
                                {
                                    if (!ObjectManager.Player.IsWindingUp)
                                    {
                                        var target = TargetSelector.GetTargetNoCollision(_q);
                                        if (target != null)
                                        {
                                            if (ObjectManager.Player.Mana - _qManaCost[_q.Level] >= 40)
                                            {
                                                _q.Cast(target);
                                            }
                                            else
                                            {
                                                var killableTarget =
                                                    HeroManager.Enemies.FirstOrDefault(
                                                        x =>
                                                        !Orbwalking.InAutoAttackRange(x) &&
                                                        x.IsKillableAndValidTarget(_q.GetDamage(x),
                                                                                   TargetSelector.DamageType.Physical, _q.Range) &&
                                                        _q.GetPrediction(x).Hitchance >= _q.MinHitChance);
                                                if (killableTarget != null)
                                                {
                                                    _q.Cast(killableTarget);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                foreach (var enemy in HeroManager.Enemies.Where(x =>
                                                                                HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                                                                x.IsKillableAndValidTarget(_e.GetDamage(x) - 30,
                                                                                                           TargetSelector.DamageType.Physical, _e.Range)))
                                {
                                    _e.Cast();
                                }
                            }
                        }


                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (!ObjectManager.Player.IsDashing())
                                {
                                    if (!ObjectManager.Player.IsWindingUp)
                                    {
                                        if (_q.IsReadyPerfectly())
                                        {
                                            var target = TargetSelector.GetTargetNoCollision(_q);
                                            if (target != null)
                                            {
                                                _q.Cast(target);
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        //Lane
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (!ObjectManager.Player.IsDashing())
                                {
                                    if (!ObjectManager.Player.IsWindingUp)
                                    {
                                        if (
                                            ObjectManager.Player.IsManaPercentOkay(
                                                MenuProvider.Champion.Laneclear.IfMana))
                                        {
                                            foreach (
                                                var killableMinion in
                                                MinionManager.GetMinions(_q.Range)
                                                .Where(
                                                    x =>
                                                    _q.GetPrediction(x).Hitchance >= _q.MinHitChance &&
                                                    x.IsKillableAndValidTarget(_q.GetDamage(x),
                                                                               TargetSelector.DamageType.Physical, _q.Range)))
                                            {
                                                var killableNumber = 0;

                                                var collisionMinions =
                                                    Collision.GetCollision(
                                                        new List <Vector3>
                                                    {
                                                        ObjectManager.Player.ServerPosition.Extend(
                                                            killableMinion.ServerPosition, _q.Range)
                                                    },
                                                        new PredictionInput
                                                    {
                                                        Unit              = ObjectManager.Player,
                                                        Delay             = _q.Delay,
                                                        Speed             = _q.Speed,
                                                        Radius            = _q.Width,
                                                        Range             = _q.Range,
                                                        CollisionObjects  = new[] { CollisionableObjects.Minions },
                                                        UseBoundingRadius = false
                                                    }
                                                        ).OrderBy(x => x.Distance(ObjectManager.Player));

                                                foreach (Obj_AI_Minion collisionMinion in collisionMinions)
                                                {
                                                    if (
                                                        collisionMinion.IsKillableAndValidTarget(
                                                            ObjectManager.Player.GetSpellDamage(collisionMinion,
                                                                                                SpellSlot.Q), TargetSelector.DamageType.Physical,
                                                            _q.Range))
                                                    {
                                                        killableNumber++;
                                                    }
                                                    else
                                                    {
                                                        break;
                                                    }
                                                }

                                                if (killableNumber >=
                                                    MenuProvider.Champion.Laneclear.GetSliderValue(
                                                        "Cast Q if Killable Minion Number >=").Value)
                                                {
                                                    if (!ObjectManager.Player.IsWindingUp)
                                                    {
                                                        _q.Cast(killableMinion.ServerPosition);
                                                        break;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Laneclear.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                                {
                                    if (
                                        MinionManager.GetMinions(_e.Range)
                                        .Count(
                                            x =>
                                            HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                            x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                       TargetSelector.DamageType.Physical)) >=
                                        MenuProvider.Champion.Laneclear.GetSliderValue(
                                            "Cast E if Killable Minion Number >=").Value)
                                    {
                                        _e.Cast();
                                    }
                                }
                            }
                        }

                        //Jugnle
                        if (MenuProvider.Champion.Jungleclear.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                                {
                                    var qTarget =
                                        MinionManager.GetMinions(_q.Range, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth)
                                        .FirstOrDefault(
                                            x =>
                                            x.IsValidTarget(_q.Range) &&
                                            _q.GetPrediction(x).Hitchance >= HitChance.High);

                                    if (qTarget != null)
                                    {
                                        _q.Cast(qTarget);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Jungleclear.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                                {
                                    if (
                                        MinionManager.GetMinions(_e.Range, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth)
                                        .Any(
                                            x =>
                                            HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                            x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                       TargetSelector.DamageType.Physical)))
                                    {
                                        _e.Cast();
                                    }
                                }
                            }
                        }

                        break;
                    }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Use Killsteal (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            HeroManager.Enemies.Any(
                                x =>
                                HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                x.IsKillableAndValidTarget(_e.GetDamage(x) - 30, TargetSelector.DamageType.Physical,
                                                           _e.Range)))
                        {
                            _e.Cast();
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Use Mobsteal (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            MinionManager.GetMinions(_e.Range, MinionTypes.All, MinionTeam.Neutral,
                                                     MinionOrderTypes.MaxHealth)
                            .Any(
                                x =>
                                HealthPrediction.GetHealthPrediction(x, 500) > 0 &&
                                x.IsKillableAndValidTarget(_e.GetDamage(x), TargetSelector.DamageType.Physical)))
                        {
                            _e.Cast();
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto Steal Siege minion & Super minion (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            MinionManager.GetMinions(_e.Range)
                            .Any(
                                x =>
                                HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                x.IsKillableAndValidTarget(_e.GetDamage(x), TargetSelector.DamageType.Physical) &&
                                (x.CharData.BaseSkinName.ToLower().Contains("siege") ||
                                 x.CharData.BaseSkinName.ToLower().Contains("super"))))
                        {
                            _e.Cast();
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto Balista Combo (With R)"))
                {
                    if (_r.IsReadyPerfectly())
                    {
                        var myBlitzcrank =
                            HeroManager.Allies.FirstOrDefault(
                                x => !x.IsDead && x.HasBuff("kalistacoopstrikeally") && x.ChampionName == "Blitzcrank");
                        if (myBlitzcrank != null)
                        {
                            var grabTarget =
                                HeroManager.Enemies.FirstOrDefault(x => !x.IsDead && x.HasBuff("rocketgrab2"));
                            if (grabTarget != null)
                            {
                                if (ObjectManager.Player.Distance(grabTarget) > myBlitzcrank.Distance(grabTarget))
                                {
                                    _r.Cast();
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto E Harass (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            !(MenuProvider.Champion.Misc.GetBoolValue("^ Don't do this in ComboMode") &&
                              MenuProvider.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo))
                        {
                            if (ObjectManager.Player.Mana - _e.ManaCost >= _e.ManaCost)
                            {
                                if (HeroManager.Enemies.Any(x => x.IsValidTarget(_e.Range) && _e.GetDamage(x) > 10))
                                {
                                    if (
                                        MinionManager.GetMinions(_e.Range, MinionTypes.All, MinionTeam.NotAlly)
                                        .Any(
                                            x =>
                                            HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                            x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                       TargetSelector.DamageType.Physical, _e.Range)))
                                    {
                                        _e.Cast();
                                    }
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto W on Dragon or Baron (With W)"))
                {
                    if (ObjectManager.Player.IsManaPercentOkay(50))
                    {
                        if (!ObjectManager.Player.IsRecalling())
                        {
                            if (ObjectManager.Player.Position.CountEnemiesInRange(1500f) <= 0)
                            {
                                if (MenuProvider.Orbwalker.GetTarget() == null)
                                {
                                    if (_w.IsReadyPerfectly())
                                    {
                                        if (ObjectManager.Player.Distance(_baronLocation) <= _w.Range)
                                        {
                                            _w.Cast(_baronLocation);
                                        }
                                    }

                                    if (_w.IsReadyPerfectly())
                                    {
                                        if (ObjectManager.Player.Distance(_dragonLocation) <= _w.Range)
                                        {
                                            _w.Cast(_dragonLocation);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetKeyBindValue("Cast W on Dragon").Active)
                {
                    if (_w.IsReadyPerfectly())
                    {
                        if (ObjectManager.Player.Distance(_dragonLocation) <= _w.Range)
                        {
                            _w.Cast(_dragonLocation);
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetKeyBindValue("Cast W on Baron").Active)
                {
                    if (_w.IsReadyPerfectly())
                    {
                        if (ObjectManager.Player.Distance(_baronLocation) <= _w.Range)
                        {
                            _w.Cast(_baronLocation);
                        }
                    }
                }
            }
        }
Пример #15
0
        /// <summary>
        ///     Jungle clear
        /// </summary>
        public static void Jungleclear()
        {
            if (RengarR)
            {
                return;
            }
            try
            {
                var minion =
                    MinionManager.GetMinions(
                        Player.ServerPosition,
                        spells[Spells.W].Range,
                        MinionTypes.All,
                        MinionTeam.Neutral,
                        MinionOrderTypes.MaxHealth).FirstOrDefault();

                if (minion == null)
                {
                    return;
                }

                CastItems(minion);

                if (Ferocity == 5 && MenuInit.getCheckBoxItem(MenuInit.jungleClear, "Jungle.Save.Ferocity"))
                {
                    if (minion.LSIsValidTarget(spells[Spells.W].Range) && !HasPassive)
                    {
                        LaneItems(minion);
                    }
                    return;
                }

                if (MenuInit.getCheckBoxItem(MenuInit.jungleClear, "Jungle.Use.Q") && spells[Spells.Q].IsReady() &&
                    minion.LSIsValidTarget(spells[Spells.Q].Range + 100))
                {
                    spells[Spells.Q].Cast();
                }

                LaneItems(minion);

                if (Ferocity == 5 && (Player.Health / Player.MaxHealth) * 100 <= 20)
                {
                    spells[Spells.W].Cast();
                }

                if (!HasPassive)
                {
                    if (MenuInit.getCheckBoxItem(MenuInit.jungleClear, "Jungle.Use.W") && spells[Spells.W].IsReady() &&
                        minion.LSIsValidTarget(spells[Spells.W].Range))
                    {
                        if (Ferocity == 5 && spells[Spells.Q].IsReady())
                        {
                            return;
                        }
                        spells[Spells.W].Cast();
                    }
                }

                if (MenuInit.getCheckBoxItem(MenuInit.jungleClear, "Jungle.Use.E") && spells[Spells.E].IsReady() &&
                    minion.LSIsValidTarget(spells[Spells.E].Range))
                {
                    if (Ferocity == 5)
                    {
                        return;
                    }

                    spells[Spells.E].Cast(minion.Position);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #16
0
        private void Clear()
        {
            var target = Jungle.GetNearest(player.Position, GetTargetRange());

            if (config.Item("useqLC", true).GetValue <bool>() && Q.IsReady() && !E.IsCharging)
            {
                if (target != null && Q.CanCast(target))
                {
                    Q.Cast(target.Position);
                }
                else
                {
                    MinionManager.FarmLocation bestPositionQ =
                        Q.GetLineFarmLocation(MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.NotAlly));
                    if (bestPositionQ.MinionsHit >= config.Item("qMinHit", true).GetValue <Slider>().Value)
                    {
                        Q.Cast(bestPositionQ.Position);
                    }
                }
            }
            if (config.Item("usewLC", true).GetValue <bool>() && W.IsReady() && !E.IsCharging)
            {
                if (target != null && target.Distance(player) < W.Range)
                {
                    W.Cast();
                }
                else
                {
                    if (Environment.Minion.countMinionsInrange(player.Position, W.Range) >=
                        config.Item("wMinHit", true).GetValue <Slider>().Value)
                    {
                        W.Cast();
                    }
                }
            }
            if (config.Item("collectBlobs", true).GetValue <bool>() && !E.IsCharging)
            {
                var blob =
                    ObjectManager.Get <Obj_AI_Base>()
                    .Where(
                        o =>
                        !o.IsDead && o.IsValid && o.Name == "BlobDrop" && o.Team == player.Team &&
                        o.Distance(player) < Orbwalking.GetRealAutoAttackRange(player))
                    .OrderBy(o => o.Distance(player))
                    .FirstOrDefault();
                if (blob != null && Orbwalking.CanMove(300) && !Orbwalking.CanAttack() && !player.IsWindingUp)
                {
                    orbwalker.SetMovement(false);
                    Orbwalking.Move = false;
                    player.IssueOrder(GameObjectOrder.MoveTo, blob.Position);
                }
            }
            if (config.Item("useeLC", true).GetValue <bool>() && E.IsReady())
            {
                if (target != null && target.IsValidTarget())
                {
                    CastE(target);
                }
                else
                {
                    MinionManager.FarmLocation bestPositionE =
                        E.GetCircularFarmLocation(
                            MinionManager.GetMinions(eRanges[E.Level - 1], MinionTypes.All, MinionTeam.NotAlly));
                    var castPos = Vector3.Zero;
                    if (bestPositionE.MinionsHit < config.Item("eMinHit", true).GetValue <Slider>().Value&&
                        farmPos.IsValid())
                    {
                        castPos = farmPos;
                    }
                    if (bestPositionE.MinionsHit >= config.Item("eMinHit", true).GetValue <Slider>().Value)
                    {
                        castPos = bestPositionE.Position.To3D();
                    }
                    if (castPos.IsValid())
                    {
                        farmPos = bestPositionE.Position.To3D();
                        Utility.DelayAction.Add(5000, () => { farmPos = Vector3.Zero; });
                        CastE(castPos);
                    }
                }
            }
        }
Пример #17
0
        private static void JungleClearLogic()
        {
            var mobs = MinionManager.GetMinions(Me.Position, 700, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);

            if (!mobs.Any())
            {
                return;
            }

            var bigmobs            = mobs.Where(x => !x.CharData.BaseSkinName.ToLower().Contains("mini"));
            var mob                = mobs.FirstOrDefault();
            var canChangeHumanizer = Menu.Item("JungleClearQHumanizer", true).GetValue <bool>() && Qcd <= 1 &&
                                     Me.ManaPercent >= Menu.Item("JungleClearQMana", true).GetValue <Slider>().Value;

            if (IsHumanizer && Me.ManaPercent >= Menu.Item("JungleClearQMana", true).GetValue <Slider>().Value)
            {
                var bigmob = NewMethod(bigmobs);

                if (Menu.Item("JungleClearQHumanizer", true).GetValue <bool>() && Qcd == 0 && bigmob.Any())
                {
                    Q.CastTo(bigmob.FirstOrDefault(), true);
                }

                if (Menu.Item("JungleClearWHumanizer", true).GetValue <bool>() && Wcd == 0 && bigmob.Any())
                {
                    W.CastTo(bigmob.FirstOrDefault(), true);
                }

                if (Me.Level >= 3)
                {
                    if (!canChangeHumanizer && W1Cd == 0 && (Q1Cd == 0 || E1Cd == 0))
                    {
                        R.Cast();
                    }
                }
                else
                {
                    if (!canChangeHumanizer && (W1Cd == 0 || Q1Cd == 0 || E1Cd == 0))
                    {
                        R.Cast();
                    }
                }
            }
            else if (!IsHumanizer)
            {
                if (Menu.Item("JungleClearWCougar", true).GetValue <bool>() && W1Cd == 0 && mob != null)
                {
                    if (HavePassive(mob) && mob.IsValidTarget(W2.Range))
                    {
                        W2.Cast(mob.Position, true);
                    }
                    else if (!HavePassive(mob) && mob.IsValidTarget(W1.Range))
                    {
                        W1.Cast(mob.Position, true);
                    }
                }

                if (Menu.Item("JungleClearECougar", true).GetValue <bool>() && E1Cd == 0 && mob.IsValidTarget(E1.Range) &&
                    Me.IsFacing(mob))
                {
                    if (mob != null)
                    {
                        E1.Cast(mob.Position, true);
                    }
                }

                if (Menu.Item("JungleClearQCougar", true).GetValue <bool>() && Q1Cd == 0 && mob.IsValidTarget(Q1.Range) && E1Cd != 0)
                {
                    Q1.Cast(mob, true);
                }

                if (Me.Level >= 3)
                {
                    if (canChangeHumanizer && bigmobs.Any() && W1Cd > 0 && E1Cd > 0 && Q1Cd > 0)
                    {
                        R.Cast();
                    }
                }
                else
                {
                    if (canChangeHumanizer && bigmobs.Any() && (W1Cd > 0 || E1Cd > 0 || Q1Cd > 0))
                    {
                        R.Cast();
                    }
                }
            }
        }
Пример #18
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            /*
             *
             * var t1 = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
             * var x1 = Q.GetPrediction(t1);
             * if (x1.CollisionObjects.GetType() == ObjectManager.Get<pb>())
             * Game.PrintChat(x1.CollisionObjects.GetType().ToString());
             * //Game.PrintChat(x1.CollisionObjects.Count.ToString());
             */
            Obj_AI_Hero t;

            if (Q.IsReady() && Program.Config.Item("UseQTH").GetValue <KeyBind>().Active&& ToggleActive)
            {
                if (ObjectManager.Player.HasBuff("Recall"))
                {
                    return;
                }

                t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

                var useQt = (Program.Config.Item("DontQToggleHarass" + t.ChampionName) != null &&
                             Program.Config.Item("DontQToggleHarass" + t.ChampionName).GetValue <bool>() == false);
                if (useQt)
                {
                    Q.Cast(t);
                }
            }

            if (W.IsReady() && Program.Config.Item("UseWTH").GetValue <KeyBind>().Active&& ToggleActive)
            {
                if (ObjectManager.Player.HasBuff("Recall"))
                {
                    return;
                }
                t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                var useWt = (Program.Config.Item("DontWToggleHarass" + t.ChampionName) != null &&
                             Program.Config.Item("DontWToggleHarass" + t.ChampionName).GetValue <bool>() == false);
                if (useWt)
                {
                    W.Cast(t);
                }
            }

            if (ComboActive || HarassActive)
            {
                var useQ = GetValue <bool>("UseQ" + (ComboActive ? "C" : "H"));
                var useW = GetValue <bool>("UseW" + (ComboActive ? "C" : "H"));
                var useR = Program.Config.SubMenu("Combo").Item("UseRC").GetValue <bool>();

                if (Orbwalking.CanMove(100))
                {
                    if (Dfg.IsReady())
                    {
                        t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical);
                        Dfg.Cast(t);
                    }

                    if (Q.IsReady() && useQ)
                    {
                        t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
                        if (t != null)
                        {
                            Q.Cast(t);
                        }
                    }

                    if (W.IsReady() && useW)
                    {
                        t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                        if (t != null)
                        {
                            W.Cast(t);
                        }
                    }

                    if (R.IsReady() && useR)
                    {
                        var minRRange = Program.Config.SubMenu("Combo").Item("UseRCMinRange").GetValue <Slider>().Value;
                        var maxRRange = Program.Config.SubMenu("Combo").Item("UseRCMaxRange").GetValue <Slider>().Value;

                        t = TargetSelector.GetTarget(maxRRange, TargetSelector.DamageType.Physical);

                        if (Q.IsReady() && t.IsValidTarget(Q.Range) && Q.GetPrediction(t).CollisionObjects.Count == 0 &&
                            t.Health < ObjectManager.Player.GetSpellDamage(t, SpellSlot.Q))
                        {
                            return;
                        }

                        if (t.IsValidTarget() && ObjectManager.Player.Distance(t) >= minRRange &&
                            t.Health <= ObjectManager.Player.GetSpellDamage(t, SpellSlot.R))
                        {
                            R.Cast(t);
                        }
                    }
                }
            }

            if (LaneClearActive)
            {
                var useQ = GetValue <bool>("UseQL");

                if (Q.IsReady() && useQ)
                {
                    var vMinions = MinionManager.GetMinions(ObjectManager.Player.Position, Q.Range);
                    foreach (Obj_AI_Base minions in
                             vMinions.Where(
                                 minions => minions.Health < ObjectManager.Player.GetSpellDamage(minions, SpellSlot.Q)))
                    {
                        Q.Cast(minions);
                    }
                }
            }

            if (R.IsReady() && GetValue <KeyBind>("CastR").Active)
            {
                t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
                if (t.IsValidTarget())
                {
                    R.Cast(t);
                }
            }
        }
Пример #19
0
        private static void Farm(bool laneClear)
        {
            if (!Orbwalking.CanMove(40))
            {
                return;
            }
            if (Config.Item("ManaSliderFarm").GetValue <Slider>().Value >
                ObjectManager.Player.Mana / ObjectManager.Player.MaxMana * 100)
            {
                return;
            }

            var rangedMinions = MinionManager.GetMinions(
                ObjectManager.Player.ServerPosition, Q2.Range, MinionTypes.Ranged);
            var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q2.Range);

            var useQi = Config.Item("UseQFarm").GetValue <StringList>().SelectedIndex;
            var useEi = Config.Item("UseEFarm").GetValue <StringList>().SelectedIndex;
            var useQ  = (laneClear && (useQi == 1 || useQi == 2)) || (!laneClear && (useQi == 0 || useQi == 2));
            var useE  = (laneClear && (useEi == 1 || useEi == 2)) || (!laneClear && (useEi == 0 || useEi == 2));

            if (laneClear)
            {
                if (Q1.IsReady() && useQ)
                {
                    var rangedLocation = Q2.GetCircularFarmLocation(rangedMinions);
                    var location       = Q2.GetCircularFarmLocation(allMinions);

                    var bLocation = (location.MinionsHit > rangedLocation.MinionsHit + 1) ? location : rangedLocation;

                    if (bLocation.MinionsHit > 0)
                    {
                        Q2.Cast(bLocation.Position.To3D());
                    }
                }

                if (E.IsReady() && useE)
                {
                    var rangedLocation = E.GetCircularFarmLocation(rangedMinions, E.Width * 2);
                    var location       = E.GetCircularFarmLocation(allMinions, E.Width * 2);

                    var bLocation = (location.MinionsHit > rangedLocation.MinionsHit + 1) ? location : rangedLocation;

                    if (bLocation.MinionsHit > 2)
                    {
                        E.Cast(bLocation.Position.To3D());
                    }
                }
            }
            else
            {
                if (useQ && Q1.IsReady())
                {
                    foreach (var minion in allMinions)
                    {
                        if (!Orbwalking.InAutoAttackRange(minion))
                        {
                            var Qdamage = ObjectManager.Player.GetSpellDamage(minion, SpellSlot.Q) * 0.75;

                            if (Qdamage > Q1.GetHealthPrediction(minion))
                            {
                                Q2.Cast(minion);
                            }
                        }
                    }
                }

                if (E.IsReady() && useE)
                {
                    var rangedLocation = E.GetCircularFarmLocation(rangedMinions, E.Width * 2);
                    var location       = E.GetCircularFarmLocation(allMinions, E.Width * 2);

                    var bLocation = (location.MinionsHit > rangedLocation.MinionsHit + 1) ? location : rangedLocation;

                    if (bLocation.MinionsHit > 2)
                    {
                        E.Cast(bLocation.Position.To3D());
                    }
                }
            }
        }
Пример #20
0
        /// <summary>
        ///     Returns all units in Range
        /// </summary>
        /// <param name="position"></param>
        /// <param name="range"></param>
        /// <returns></returns>
        public static int CountMinionsInRange(this Vector3 position, float range)
        {
            var minionList = MinionManager.GetMinions(position, range);

            return(minionList?.Count ?? 0);
        }
Пример #21
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);
                         }
                     }
                 }
             }
         }
     }
 }
Пример #22
0
 void Start()
 {
     this.active  = false;
     this.manager = GetComponent <MinionManager> ();
     this.manager.SetTeam(this.team);
 }
Пример #23
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (Config.Item("PingLH").GetValue <bool>())
            {
                foreach (
                    var enemy in
                    ObjectManager.Get <Obj_AI_Hero>()
                    .Where(
                        h =>
                        ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Ready &&
                        h.IsValidTarget() && ComboDamage(h) > h.Health))
                {
                    Ping(enemy.Position.To2D());
                }
            }

            if (Config.Item("CastQ").GetValue <KeyBind>().Active)
            {
                CastQTick = Utils.TickCount;
            }

            if (Utils.TickCount - CastQTick < 500)
            {
                var qTarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
                if (qTarget != null)
                {
                    Q.Cast(qTarget);
                }
            }

            var combo = Config.Item("Combo").GetValue <KeyBind>().Active;

            //Choose a random card if enemy killable
            if (combo && Config.Item("Misc.SelectRandomCard").GetValue <bool>())
            {
                var wName = ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name;
                var t     = TargetSelector.GetTarget(Orbwalking.GetRealAutoAttackRange(null) + 65, TargetSelector.DamageType.Magical);
                if (t.IsValidTarget() && ObjectManager.Player.CanAttack)
                {
                    if (
                        (wName.Equals("Bluecardlock", StringComparison.InvariantCultureIgnoreCase) && t.Health <= GetCardDamage(0)) ||
                        (wName.Equals("Redcardlock", StringComparison.InvariantCultureIgnoreCase) && t.Health <= GetCardDamage(1)) ||
                        (wName.Equals("Goldcardlock", StringComparison.InvariantCultureIgnoreCase) && t.Health <= GetCardDamage(2))
                        )
                    {
                        ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W, false);
                        Program.PickTick = 0;
                    }
                }
            }

            if (SOW.ActiveMode != Orbwalking.OrbwalkingMode.Combo && SOW.ActiveMode != Orbwalking.OrbwalkingMode.None)
            {
                if (Config.Item("Lane.BlueCard.MinMana").GetValue <Slider>().Value > 0 && Player.ManaPercent < Config.Item("Lane.BlueCard.MinMana").GetValue <Slider>().Value)
                {
                    var minions = MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(null) + 165);
                    {
                        if (minions.Count > 0)
                        {
                            SelectACard(Cards.Blue);
                        }
                    }
                }
            }

            //Select cards.
            if (Config.Item("SelectYellow").GetValue <KeyBind>().Active || combo)
            {
                SelectACard(Cards.Yellow);
            }

            if (Config.Item("SelectBlue").GetValue <KeyBind>().Active)
            {
                SelectACard(Cards.Blue);
            }

            if (Config.Item("SelectRed").GetValue <KeyBind>().Active)
            {
                SelectACard(Cards.Red);
            }

/*
 *          if (CardSelector.Status == SelectStatus.Selected && combo)
 *          {
 *              var target = SOW.GetTarget();
 *              if (target.IsValidTarget() && target is Obj_AI_Hero && Items.HasItem("DeathfireGrasp") && ComboDamage((Obj_AI_Hero)target) >= target.Health)
 *              {
 *                  Items.UseItem("DeathfireGrasp", (Obj_AI_Hero) target);
 *              }
 *          }
 */

            //Auto Q
            var autoQI = Config.Item("AutoQI").GetValue <bool>();
            var autoQD = Config.Item("AutoQD").GetValue <bool>();

            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.Ready && (autoQD || autoQI))
            {
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>())
                {
                    if (enemy.IsValidTarget(Q.Range * 2))
                    {
                        var pred = Q.GetPrediction(enemy);
                        if ((pred.Hitchance == HitChance.Immobile && autoQI) ||
                            (pred.Hitchance == HitChance.Dashing && autoQD))
                        {
                            CastQ(enemy, pred.UnitPosition.To2D());
                        }
                    }
                }
            }


            var useItemModes = Config.Item("itemMode").GetValue <StringList>().SelectedIndex;

            if (
                !((SOW.ActiveMode == Orbwalking.OrbwalkingMode.Combo &&
                   (useItemModes == 2 || useItemModes == 3))
                  ||
                  (SOW.ActiveMode == Orbwalking.OrbwalkingMode.Mixed &&
                   (useItemModes == 1 || useItemModes == 3))))
            {
                return;
            }

            var botrk  = Config.Item("itemBotrk").GetValue <bool>();
            var youmuu = Config.Item("itemYoumuu").GetValue <bool>();
            var target = SOW.GetTarget() as Obj_AI_Base;

            if (botrk)
            {
                if (target != null && target.Type == ObjectManager.Player.Type &&
                    target.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 450)
                {
                    var hasCutGlass = Items.HasItem(3144);
                    var hasBotrk    = Items.HasItem(3153);

                    if (hasBotrk || hasCutGlass)
                    {
                        var itemId = hasCutGlass ? 3144 : 3153;
                        var damage = ObjectManager.Player.GetItemDamage(target, Damage.DamageItems.Botrk);
                        if (hasCutGlass ||
                            ObjectManager.Player.Health + damage < ObjectManager.Player.MaxHealth &&
                            Items.CanUseItem(itemId))
                        {
                            Items.UseItem(itemId, target);
                        }
                    }
                }
            }

            if (youmuu && target != null && target.Type == ObjectManager.Player.Type &&
                Orbwalking.InAutoAttackRange(target) && Items.CanUseItem(3142))
            {
                Items.UseItem(3142);
            }
        }
Пример #24
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);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #25
0
        private static void Jungle()
        {
            var mobs = MinionManager.GetMinions(Player.ServerPosition, Orbwalking.GetRealAutoAttackRange(Player) + 100, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);

            if (mobs == null || (mobs != null && mobs.Count == 0))
            {
                return;
            }
            if (humansexygirl)
            {
                if (Q.IsReady() && Config.Item("qjClear").GetValue <bool>())
                {
                    Q.Cast(mobs[0]);
                }
                if (W.IsReady() && Config.Item("wjClear").GetValue <bool>())
                {
                    W.Cast(mobs[0]);
                }
                if (!Q.IsReady() && !W.IsReady() && Config.Item("autoswitch").GetValue <bool>())
                {
                    R.Cast();
                }
            }
            if (spidergirl)
            {
                if (W.IsReady() && Config.Item("wjClear.Spider").GetValue <bool>())
                {
                    W.Cast();
                }
                if (Q.IsReady() && Config.Item("qjClear.Spider").GetValue <bool>())
                {
                    Q.Cast(mobs[0]);
                }
                if (!SpiderQ.IsReady() && !SpiderW.IsReady() && Config.Item("autoswitch").GetValue <bool>())
                {
                    R.Cast();
                }
            }
            if (Config.Item("junglesteal").GetValue <bool>()) //jung steal check
            {
                foreach (var minyon in mobs)
                {
                    if (minyon.CharData.BaseSkinName.Contains("SRU_Dragon") && Config.Item("drakesteal").GetValue <bool>()) // dragon steal with spider Q and human Q
                    {
                        if (spidergirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                SpiderQ.Cast(minyon);
                            }
                        }
                        if (humansexygirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                Q.Cast(minyon);
                            }
                        }
                    }

                    if (minyon.CharData.BaseSkinName.Contains("SRU_Baron") && Config.Item("baronsteal").GetValue <bool>()) // baron steal with spider Q and human Q
                    {
                        if (spidergirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                SpiderQ.Cast(minyon);
                            }
                        }
                        if (humansexygirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                Q.Cast(minyon);
                            }
                        }
                    }
                    if (minyon.CharData.BaseSkinName.Contains("SRU_Red") && Config.Item("redsteal").GetValue <bool>()) // red steal with spider Q and human Q
                    {
                        if (spidergirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                SpiderQ.Cast(minyon);
                            }
                        }
                        if (humansexygirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                Q.Cast(minyon);
                            }
                        }
                    }
                    if (minyon.CharData.BaseSkinName.Contains("SRU_Blue") && Config.Item("bluesteal").GetValue <bool>()) // blue steal with spider Q and human Q
                    {
                        if (spidergirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                SpiderQ.Cast(minyon);
                            }
                        }
                        if (humansexygirl)
                        {
                            if (Q.IsReady() && Q.IsKillable(minyon))
                            {
                                Q.Cast(minyon);
                            }
                        }
                    }
                }
            }
        }
Пример #26
0
        private static void KillSteal()
        {
            #region Kill Steal

            var target = TargetSelector.GetTarget(GnarSpells.QMini.Range, DamageType.Physical);

            if (target == null)
            {
                return;
            }

            var qSpell  = getCheckBoxItem(ksMenu, "qks");
            var rSpell  = getCheckBoxItem(ksMenu, "rks");
            var eqSpell = getCheckBoxItem(ksMenu, "qeks");

            if (qSpell)
            {
                if (Player.IsMiniGnar())
                {
                    if (GnarSpells.QMini.IsReady() &&
                        target.IsValidTarget(GnarSpells.QMini.Range - 30) &&
                        target.Health <= GnarSpells.QMini.GetDamage(target))
                    {
                        GnarSpells.QMini.Cast(target);
                    }
                }
                if (Player.IsMegaGnar())
                {
                    if (GnarSpells.QMega.IsReady() &&
                        target.IsValidTarget(GnarSpells.QMega.Range - 30) &&
                        target.Health <= GnarSpells.QMega.GetDamage(target))
                    {
                        GnarSpells.QMega.Cast(target);
                    }
                }
            }

            if (rSpell)
            {
                if (Player.IsMegaGnar() &&
                    GnarSpells.RMega.IsReady() &&
                    target.Health <= GnarSpells.RMega.GetDamage(target))
                {
                    GnarSpells.RMega.Cast(target);
                }
            }

            if (eqSpell &&
                Player.IsMiniGnar() &&
                Player.LSDistance(target) > 1400)
            {
                var prediction = GnarSpells.EMini.GetPrediction(target);
                var ed         = Player.ServerPosition.Extend(prediction.CastPosition,
                                                              Player.ServerPosition.LSDistance(prediction.CastPosition) + GnarSpells.EMini.Range);

                if (!ObjectManager.Get <Obj_AI_Turret>().Any(type => type.Team != Player.Team &&
                                                             !type.IsDead &&
                                                             type.LSDistance(ed, true) < 775 * 775))
                {
                    GnarSpells.EMini.Cast(prediction.CastPosition);
                    lastq = Environment.TickCount;
                }

                var minionCount = MinionManager.GetMinions(Player.Position, GnarSpells.QMini.Range, MinionTypes.All,
                                                           MinionTeam.All);
                foreach (var minion in minionCount)
                {
                    var minionPrediction = GnarSpells.EMini.GetPrediction(minion);
                    var k =
                        ObjectManager.Get <Obj_AI_Minion>().Where(x => Player.IsFacing(x) &&
                                                                  x.IsMinion &&
                                                                  x.LSDistance(Player) <= GnarSpells.EMini.Range)
                        .OrderByDescending(x => x.LSDistance(Player))
                        .First();

                    var edm = Player.ServerPosition.Extend(minionPrediction.CastPosition,
                                                           Player.ServerPosition.LSDistance(minionPrediction.CastPosition) + GnarSpells.EMini.Range);
                    if (!ObjectManager.Get <Obj_AI_Turret>().Any(type => type.IsMinion != Player.IsMinion &&
                                                                 !type.IsDead &&
                                                                 type.LSDistance(edm, true) < 775 * 775 &&
                                                                 k.IsValid))
                    {
                        GnarSpells.EMini.Cast(k);
                        lastq = Environment.TickCount;
                    }
                }
                if (GnarSpells.QMini.IsReady() &&
                    Environment.TickCount - lastq > 500)
                {
                    GnarSpells.QMini.Cast(target);
                }
            }

            #endregion
        }
Пример #27
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);
                }
            }
        }
Пример #28
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);
            }
Пример #29
0
        private void Cast_E(bool combo, int mode = 0)
        {
            if (!E.IsReady())
            {
                return;
            }
            if (combo)
            {
                var target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

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

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

                if (mode == 0)
                {
                    if (Player.Mana >= Menu.Item("E_Energy", true).GetValue <Slider>().Value)
                    {
                        E.Cast();
                    }
                    else if (E.IsKillable(target) && Menu.Item("E_On_Killable", true).GetValue <bool>())
                    {
                        E.Cast();
                    }
                }
                else if (mode == 1)
                {
                    if (target.HasBuff("AkaliMota"))
                    {
                        return;
                    }
                    if (target.HasBuff("AkaliMota") && !Q.IsReady())
                    {
                        return;
                    }
                    if (Player.Mana >= Menu.Item("E_Energy", true).GetValue <Slider>().Value)
                    {
                        E.Cast();
                    }
                    if (E.IsKillable(target) && Menu.Item("E_On_Killable", true).GetValue <bool>())
                    {
                        E.Cast();
                    }
                }
            }
            else
            {
                if (MinionManager.GetMinions(Player.Position, E.Range).Count >= Menu.Item("LaneClear_useE_minHit", true).GetValue <Slider>().Value)
                {
                    E.Cast();
                }
                foreach (var minion in MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).Where(minion => Player.Distance(minion.Position) <= E.Range))
                {
                    if (E.GetDamage(minion) > minion.Health + 35)
                    {
                        E.Cast();
                    }
                }
            }
        }
Пример #30
0
	void Start() {
		MinionManager = GameObject.FindGameObjectWithTag("Player").GetComponent<MinionManager>();
		TM = GameObject.Find ("TreasureManager").GetComponent<TreasureManager> ();
	}
Пример #31
0
        private void Drawing_OnDraw(EventArgs args)
        {
            if (!ObjectManager.Player.IsDead)
            {
                if (MenuProvider.Champion.Drawings.DrawQrange.Active && _q.IsReadyPerfectly())
                {
                    Render.Circle.DrawCircle(ObjectManager.Player.Position, _q.Range,
                                             MenuProvider.Champion.Drawings.DrawQrange.Color);
                }

                if (MenuProvider.Champion.Drawings.DrawWrange.Active && _w.IsReadyPerfectly())
                {
                    Render.Circle.DrawCircle(ObjectManager.Player.Position, _w.Range,
                                             MenuProvider.Champion.Drawings.DrawWrange.Color);
                }

                if (MenuProvider.Champion.Drawings.DrawErange.Active && _e.IsReadyPerfectly())
                {
                    Render.Circle.DrawCircle(ObjectManager.Player.Position, _e.Range,
                                             MenuProvider.Champion.Drawings.DrawErange.Color);
                }

                if (MenuProvider.Champion.Drawings.DrawRrange.Active && _r.IsReadyPerfectly())
                {
                    Render.Circle.DrawCircle(ObjectManager.Player.Position, _r.Range,
                                             MenuProvider.Champion.Drawings.DrawRrange.Color);
                }

                if (MenuProvider.Champion.Drawings.GetBoolValue("Draw E Damage Percent"))
                {
                    foreach (var target in HeroManager.Enemies.Where(x => !x.IsDead && x.IsVisible))
                    {
                        if (_e.GetDamage(target) > 2)
                        {
                            var targetPos     = Drawing.WorldToScreen(target.Position);
                            var damagePercent = (_e.GetDamage(target) / target.Health + target.PhysicalShield) * 100;

                            if (damagePercent > 0)
                            {
                                Drawing.DrawText(targetPos.X, targetPos.Y - 100,
                                                 damagePercent >= 100 ? Color.Red : Color.GreenYellow, damagePercent.ToString("0.0"));
                            }
                        }
                    }

                    foreach (
                        var target in
                        MinionManager.GetMinions(float.MaxValue, MinionTypes.All, MinionTeam.Neutral)
                        .Where(x => !x.IsDead && x.IsVisible))
                    {
                        if (_e.GetDamage(target) > 2)
                        {
                            var targetPos     = Drawing.WorldToScreen(target.Position);
                            var damagePercent = (_e.GetDamage(target) / target.Health + target.PhysicalShield) * 100;

                            if (damagePercent > 0)
                            {
                                Drawing.DrawText(targetPos.X, targetPos.Y - 100,
                                                 damagePercent >= 100 ? Color.Red : Color.GreenYellow, damagePercent.ToString("0.0"));
                            }
                        }
                    }
                }
            }
        }