Esempio n. 1
0
        public static void UseFleeItems()
        {
            if (_menu == null || !_menu.Item(_menu.Name + ".enabled").GetValue <bool>())
            {
                return;
            }

            try
            {
                foreach (var item in
                         Items.Where(
                             i =>
                             i.Flags.HasFlag(ItemFlags.Flee) &&
                             _menu.Item(_menu.Name + "." + i.Name + ".flee").GetValue <bool>() && i.Item.IsOwned() &&
                             i.Item.IsReady() && i.Item.IsOwned() && i.Item.IsReady() &&
                             ObjectManager.Player.CountEnemiesInRange(i.Range) >=
                             _menu.Item(_menu.Name + "." + i.Name + ".min-enemies-range").GetValue <Slider>().Value&&
                             ObjectManager.Player.HealthPercent <=
                             _menu.Item(_menu.Name + "." + i.Name + ".player-health-below").GetValue <Slider>().Value&&
                             ObjectManager.Player.HealthPercent >=
                             _menu.Item(_menu.Name + "." + i.Name + ".player-health-above").GetValue <Slider>().Value))
                {
                    if (item.CastType != CastType.Self)
                    {
                        var lItem     = item;
                        var localItem = item;
                        foreach (var enemy in
                                 GameObjects.EnemyHeroes.Where(
                                     t =>
                                     t.IsValidTarget() && !Invulnerable.Check(t) &&
                                     t.HealthPercent <=
                                     _menu.Item(_menu.Name + "." + lItem.Name + ".target-health-below")
                                     .GetValue <Slider>()
                                     .Value&&
                                     t.HealthPercent >=
                                     _menu.Item(_menu.Name + "." + lItem.Name + ".target-health-above")
                                     .GetValue <Slider>()
                                     .Value)
                                 .OrderByDescending(
                                     t =>
                                     t.Position.Distance(ObjectManager.Player.Position, true) <
                                     Math.Pow(localItem.Range, 2)))
                        {
                            if (!Utils.IsImmobile(enemy) && !Utils.IsSlowed(enemy))
                            {
                                switch (localItem.CastType)
                                {
                                case CastType.Target:
                                    localItem.Item.Cast(enemy);
                                    break;

                                case CastType.Position:
                                    var prediction = Prediction.GetPrediction(
                                        enemy, localItem.Delay, localItem.Radius, localItem.Speed);
                                    if (prediction.Hitchance >= HitChance.Medium)
                                    {
                                        localItem.Item.Cast(prediction.CastPosition);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        if (ObjectManager.Player.CountEnemiesInRange(item.Range) >
                            _menu.Item(_menu.Name + "." + item.Name + ".min-enemies-range").GetValue <Slider>().Value)
                        {
                            item.Item.Cast();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Esempio n. 2
0
        protected override void OnPostUpdate()
        {
            if (Ultimate.IsActive(UltimateModeType.Flash) && R.IsReady() && SummonerManager.Flash.IsReady())
            {
                if (Ultimate.ShouldMove(UltimateModeType.Flash))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }
                var targets =
                    Targets.Where(
                        t =>
                        t.Distance(Player) < (R.Range + R.Width + SummonerManager.Flash.Range) * 1.5f &&
                        !t.IsDashing() &&
                        (t.IsFacing(Player)
                                ? t.Distance(Player)
                                : R.GetPrediction(t).UnitPosition.Distance(Player.Position)) > R.Range);
                var backwards = Menu.Item(Menu.Name + ".ultimate.backwards").GetValue <bool>();
                foreach (var target in targets)
                {
                    var flashPos = Player.Position.Extend(target.Position, SummonerManager.Flash.Range);
                    var maxHits  = GetMaxRHits(HitChance.High, flashPos);
                    if (maxHits.Item1.Count > 0)
                    {
                        var castPos = backwards
                            ? Player.Position.Extend(maxHits.Item2, -(Player.Position.Distance(maxHits.Item2) * 2))
                            : Player.Position.Extend(maxHits.Item2, Player.Position.Distance(maxHits.Item2));
                        if (Ultimate.Check(UltimateModeType.Flash, maxHits.Item1))
                        {
                            if (R.Cast(castPos))
                            {
                                Utility.DelayAction.Add(300 + Game.Ping / 2, () => SummonerManager.Flash.Cast(flashPos));
                            }
                        }
                        else if (Ultimate.ShouldSingle(UltimateModeType.Flash))
                        {
                            if (
                                maxHits.Item1.Where(hit => Ultimate.CheckSingle(UltimateModeType.Flash, hit))
                                .Any(hit => R.Cast(castPos)))
                            {
                                Utility.DelayAction.Add(300 + Game.Ping / 2, () => SummonerManager.Flash.Cast(flashPos));
                            }
                        }
                    }
                }
            }

            if (Ultimate.IsActive(UltimateModeType.Assisted) && R.IsReady())
            {
                if (Ultimate.ShouldMove(UltimateModeType.Assisted))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }

                if (!RLogic(UltimateModeType.Assisted, R.GetHitChance("combo")))
                {
                    RLogicSingle(UltimateModeType.Assisted, R.GetHitChance("combo"), false);
                }
            }

            if (Ultimate.IsActive(UltimateModeType.Auto) && R.IsReady())
            {
                if (!RLogic(UltimateModeType.Auto, R.GetHitChance("combo")))
                {
                    RLogicSingle(UltimateModeType.Auto, R.GetHitChance("combo"));
                }
            }

            if (HeroListManager.Enabled("w-immobile") && W.IsReady())
            {
                var target =
                    Targets.FirstOrDefault(
                        t =>
                        HeroListManager.Check("w-immobile", t) && BestTargetOnlyManager.Check("w-immobile", W, t) &&
                        Utils.IsImmobile(t));
                if (target != null)
                {
                    Casting.SkillShot(target, W, HitChance.High);
                }
            }
        }
Esempio n. 3
0
        private void OnCorePostUpdate(EventArgs args)
        {
            try
            {
                if (UltimateManager.Flash() && R.IsReady() && SummonerManager.Flash.IsReady())
                {
                    if (Menu.Item(Menu.Name + ".ultimate.flash.move-cursor").GetValue <bool>())
                    {
                        Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                    }
                    var targets =
                        Targets.Where(
                            t =>
                            t.Distance(Player) < R.Range + SummonerManager.Flash.Range && !t.IsDashing() &&
                            (t.IsFacing(Player)
                                    ? (t.Distance(Player))
                                    : (Prediction.GetPrediction(t, R.Delay + 0.3f)
                                       .UnitPosition.Distance(Player.Position))) > R.Range * 1.025f);
                    foreach (var target in targets)
                    {
                        var min      = Menu.Item(Menu.Name + ".ultimate.flash.min").GetValue <Slider>().Value;
                        var flashPos = Player.Position.Extend(target.Position, SummonerManager.Flash.Range);
                        var pred     =
                            Prediction.GetPrediction(
                                new PredictionInput
                        {
                            Aoe              = true,
                            Collision        = false,
                            CollisionObjects = new[] { CollisionableObjects.YasuoWall },
                            From             = flashPos,
                            RangeCheckFrom   = flashPos,
                            Delay            = R.Delay + 0.3f,
                            Range            = R.Range,
                            Speed            = R.Speed,
                            Radius           = R.Width,
                            Type             = R.Type,
                            Unit             = target
                        });
                        if (pred.Hitchance >= R.GetHitChance("combo"))
                        {
                            R.UpdateSourcePosition(flashPos, flashPos);
                            var hits =
                                GameObjects.EnemyHeroes.Where(enemy => R.WillHit(enemy, pred.CastPosition)).ToList();
                            if (UltimateManager.Check(
                                    "combo", min, hits,
                                    hero =>
                                    CalcComboDamage(
                                        hero, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true)))
                            {
                                if (
                                    R.Cast(
                                        Player.Position.Extend(
                                            pred.CastPosition, -(Player.Position.Distance(pred.CastPosition) * 2)), true))
                                {
                                    Utility.DelayAction.Add(300, () => SummonerManager.Flash.Cast(flashPos));
                                }
                            }
                            else if (Menu.Item(Menu.Name + ".ultimate.flash.duel").GetValue <bool>())
                            {
                                if (UltimateManager.Check(
                                        "combo", 1, hits,
                                        hero =>
                                        CalcComboDamage(
                                            hero, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                            Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                            Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true)))
                                {
                                    var cDmg = CalcComboDamage(
                                        target, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true);
                                    if (cDmg - 20 >= target.Health)
                                    {
                                        if (
                                            R.Cast(
                                                Player.Position.Extend(
                                                    pred.CastPosition,
                                                    -(Player.Position.Distance(pred.CastPosition) * 2)), true))
                                        {
                                            Utility.DelayAction.Add(300, () => SummonerManager.Flash.Cast(flashPos));
                                        }
                                    }
                                }
                            }
                            R.UpdateSourcePosition();
                        }
                    }
                }

                if (UltimateManager.Assisted() && R.IsReady())
                {
                    if (Menu.Item(Menu.Name + ".ultimate.assisted.move-cursor").GetValue <bool>())
                    {
                        Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                    }

                    if (
                        !RLogic(
                            R.GetHitChance("combo"),
                            Menu.Item(Menu.Name + ".ultimate.assisted.min").GetValue <Slider>().Value,
                            Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                            Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                            Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady()))
                    {
                        if (Menu.Item(Menu.Name + ".ultimate.assisted.duel").GetValue <bool>())
                        {
                            RLogicDuel(
                                R.GetHitChance("combo"),
                                Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), false);
                        }
                    }
                }

                if (UltimateManager.Auto() && R.IsReady())
                {
                    if (
                        !RLogic(
                            R.GetHitChance("combo"),
                            Menu.Item(Menu.Name + ".ultimate.auto.min").GetValue <Slider>().Value,
                            Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                            Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                            Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), "auto"))
                    {
                        if (Menu.Item(Menu.Name + ".ultimate.auto.duel").GetValue <bool>())
                        {
                            RLogicDuel(
                                R.GetHitChance("combo"),
                                Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady());
                        }
                    }
                }

                if (HeroListManager.Enabled("w-stunned") && W.IsReady())
                {
                    var target = Targets.FirstOrDefault(
                        t => HeroListManager.Check("w-stunned", t) && Utils.IsStunned(t));
                    if (target != null)
                    {
                        Casting.SkillShot(target, W, W.GetHitChance("harass"));
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }