public IOrderedEnumerable <Obj_AI_Base> GetDashObjects()
 {
     try
     {
         var objects =
             GameObjects.EnemyMinions.Concat(GameObjects.Jungle)
             .Where(o => o.IsValidTarget(Orbwalking.GetRealAutoAttackRange(o)))
             .Select(o => o as Obj_AI_Base)
             .ToList();
         var apexPoint = Player.ServerPosition.To2D() +
                         (Player.ServerPosition.To2D() - Game.CursorPos.To2D()).Normalized() *
                         Orbwalking.GetRealAutoAttackRange(Player);
         return
             (objects.Where(
                  o =>
                  Utils.IsLyingInCone(
                      o.ServerPosition.To2D(), apexPoint, Player.ServerPosition.To2D(), Math.PI))
              .OrderBy(o => o.Distance(apexPoint, true)));
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(null);
 }
        public List <Obj_AI_Base> GetDashObjects(List <Obj_AI_Base> targets)
        {
            try
            {
                var apexPoint = Player.ServerPosition.To2D() +
                                (Player.ServerPosition.To2D() - Game.CursorPos.To2D()).Normalized() *
                                Orbwalking.GetRealAutoAttackRange(Player);

                return
                    (targets.Where(
                         o =>
                         Utils.IsLyingInCone(
                             o.ServerPosition.To2D(), apexPoint, Player.ServerPosition.To2D(), Math.PI))
                     .OrderBy(o => o.Distance(apexPoint, true))
                     .ToList());
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return(null);
        }
        private void OnDrawingDraw(EventArgs args)
        {
            if (!Utils.ShouldDraw() || _ePercent == null)
            {
                return;
            }
            var ePercentCircle = _ePercent.GetValue <Circle>();

            if (ePercentCircle.Active && E.IsReady())
            {
                var sharpColor = new SharpDX.Color(
                    ePercentCircle.Color.R, ePercentCircle.Color.G, ePercentCircle.Color.B);
                var maxRange = E.Range * 1.5f;
                var targets  = GameObjects.EnemyHeroes.Cast <Obj_AI_Base>().Concat(GameObjects.Jungle);

                foreach (var enemy in
                         targets.Where(
                             e =>
                             e.IsValidTarget(maxRange) && e.Position.IsOnScreen() &&
                             (e is Obj_AI_Hero || Utils.IsBigJungle(e))))
                {
                    var damage = Rend.GetDamage(enemy);
                    if (damage > 0)
                    {
                        var percent = (int)(damage / enemy.Health * 100);
                        if (percent > 0)
                        {
                            var screen   = Drawing.WorldToScreen(enemy.Position);
                            var position = enemy.Team == GameObjectTeam.Neutral
                                ? new Vector2(screen.X, screen.Y + 30)
                                : new Vector2(enemy.HPBarPosition.X + 73, enemy.HPBarPosition.Y - 28);
                            _font.DrawTextCentered(percent + " %", position, sharpColor);
                        }
                    }
                }
            }
        }
        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));
            }
        }
        protected override void OnPreUpdate()
        {
            if (E.IsReady())
            {
                if (Menu.Item(Menu.Name + ".miscellaneous.e-death").GetValue <bool>())
                {
                    if (IncomingDamageManager.GetDamage(Player) > Player.Health &&
                        GameObjects.EnemyHeroes.Any(e => e.IsValidTarget(E.Range) && Rend.HasBuff(e)))
                    {
                        CastE();
                    }
                }

                var eBig    = Menu.Item(Menu.Name + ".lasthit.e-big").GetValue <bool>();
                var eJungle = Menu.Item(Menu.Name + ".lasthit.e-jungle").GetValue <bool>();
                if (eBig || eJungle)
                {
                    if (eJungle && Player.Level >= 3 || eBig)
                    {
                        var creeps =
                            GameObjects.Jungle.Where(e => e.IsValidTarget(E.Range) && Rend.IsKillable(e, false))
                            .ToList();
                        if (eJungle && creeps.Any() ||
                            eBig &&
                            creeps.Any(
                                m =>
                                m.CharData.BaseSkinName.StartsWith("SRU_Dragon") ||
                                m.CharData.BaseSkinName.StartsWith("SRU_Baron")))
                        {
                            CastE();
                            return;
                        }
                    }
                }

                var eSiege = (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
                              Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit) &&
                             Menu.Item(Menu.Name + ".lasthit.e-siege").GetValue <bool>();
                var eTurret = (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
                               Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit) &&
                              Menu.Item(Menu.Name + ".lasthit.e-turret").GetValue <bool>();
                var eReset = Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None &&
                             Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Flee &&
                             Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo &&
                             Menu.Item(Menu.Name + ".miscellaneous.e-reset").GetValue <bool>();

                IEnumerable <Obj_AI_Minion> minions = new HashSet <Obj_AI_Minion>();
                if (eSiege || eTurret || eReset)
                {
                    minions =
                        GameObjects.EnemyMinions.Where(
                            e => e.IsValidTarget(E.Range) && Rend.IsKillable(e, e.HealthPercent < 25));
                }

                if (ResourceManager.Check("lasthit"))
                {
                    if (eSiege)
                    {
                        if (
                            minions.Any(
                                m =>
                                m.CharData.BaseSkinName.Contains("MinionSiege") ||
                                m.CharData.BaseSkinName.Contains("Super")))
                        {
                            CastE();
                            return;
                        }
                    }
                    if (eTurret)
                    {
                        if (minions.Any(m => Utils.UnderAllyTurret(m.Position)))
                        {
                            CastE();
                            return;
                        }
                    }
                }

                if (eReset && minions.Any() && ResourceManager.Check("misc") &&
                    GameObjects.EnemyHeroes.Any(e => Rend.HasBuff(e) && e.IsValidTarget(E.Range)))
                {
                    CastE();
                    return;
                }
            }

            if (ShouldSave())
            {
                R.Cast();
            }
        }
        protected override void AddToMenu()
        {
            var ultimateMenu = Menu.AddSubMenu(new Menu("Ultimate", Menu.Name + ".ultimate"));

            var blitzMenu = ultimateMenu.AddSubMenu(new Menu("Blitzcrank", ultimateMenu.Name + ".blitzcrank"));

            HeroListManager.AddToMenu(
                blitzMenu.AddSubMenu(new Menu("Blacklist", blitzMenu.Name + ".blacklist")),
                new HeroListManagerArgs("blitzcrank")
            {
                IsWhitelist   = false,
                Allies        = false,
                Enemies       = true,
                DefaultValue  = false,
                EnabledButton = false
            });
            blitzMenu.AddItem(new MenuItem(blitzMenu.Name + ".r", "Enabled").SetValue(true));

            var tahmMenu = ultimateMenu.AddSubMenu(new Menu("Tahm Kench", ultimateMenu.Name + ".tahm-kench"));

            HeroListManager.AddToMenu(
                tahmMenu.AddSubMenu(new Menu("Blacklist", tahmMenu.Name + ".blacklist")),
                new HeroListManagerArgs("tahm-kench")
            {
                IsWhitelist   = false,
                Allies        = false,
                Enemies       = true,
                DefaultValue  = false,
                EnabledButton = false
            });
            tahmMenu.AddItem(new MenuItem(tahmMenu.Name + ".r", "Enabled").SetValue(true));

            ultimateMenu.AddItem(
                new MenuItem(ultimateMenu.Name + ".save", "Save Mode").SetValue(
                    new StringList(new[] { "None", "Auto", "Min. Health %" }, 1))).ValueChanged +=
                delegate(object sender, OnValueChangeEventArgs args)
            {
                Utils.UpdateVisibleTag(ultimateMenu, 1, args.GetNewValue <StringList>().SelectedIndex == 2);
            };
            ultimateMenu.AddItem(
                new MenuItem(ultimateMenu.Name + ".save-health", "Min. Health %").SetValue(new Slider(10, 1, 50)))
            .SetTag(1);

            Utils.UpdateVisibleTag(
                ultimateMenu, 1, Menu.Item(Menu.Name + ".ultimate.save").GetValue <StringList>().SelectedIndex == 2);

            var comboMenu = Menu.AddSubMenu(new Menu("Combo", Menu.Name + ".combo"));

            HitchanceManager.AddToMenu(
                comboMenu.AddSubMenu(new Menu("Hitchance", comboMenu.Name + ".hitchance")), "combo",
                new Dictionary <string, HitChance> {
                { "Q", HitChance.VeryHigh }
            });
            ResourceManager.AddToMenu(
                comboMenu,
                new ResourceManagerArgs(
                    "combo-q", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Prefix       = "Q",
                DefaultValue = 10
            });
            comboMenu.AddItem(new MenuItem(comboMenu.Name + ".q", "Use Q").SetValue(true));
            comboMenu.AddItem(new MenuItem(comboMenu.Name + ".e", "Use E").SetValue(true));
            comboMenu.AddItem(new MenuItem(comboMenu.Name + ".e-min", "E Fleeing Min.").SetValue(new Slider(8, 1, 20)));
            comboMenu.AddItem(new MenuItem(comboMenu.Name + ".minions", "Attack Minions").SetValue(false));

            var harassMenu = Menu.AddSubMenu(new Menu("Harass", Menu.Name + ".harass"));

            HitchanceManager.AddToMenu(
                harassMenu.AddSubMenu(new Menu("Hitchance", harassMenu.Name + ".hitchance")), "harass",
                new Dictionary <string, HitChance> {
                { "Q", HitChance.High }
            });
            ResourceManager.AddToMenu(
                harassMenu,
                new ResourceManagerArgs(
                    "harass-q", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Prefix       = "Q",
                DefaultValue = 30
            });
            ResourceManager.AddToMenu(
                harassMenu,
                new ResourceManagerArgs(
                    "harass-e", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Prefix       = "E",
                DefaultValue = 30
            });
            harassMenu.AddItem(new MenuItem(harassMenu.Name + ".q", "Use Q").SetValue(true));
            harassMenu.AddItem(new MenuItem(harassMenu.Name + ".e", "Use E").SetValue(true));
            harassMenu.AddItem(new MenuItem(harassMenu.Name + ".e-min", "E Min.").SetValue(new Slider(4, 1, 20)));

            var laneClearMenu = Menu.AddSubMenu(new Menu("Lane Clear", Menu.Name + ".lane-clear"));

            ResourceManager.AddToMenu(
                laneClearMenu,
                new ResourceManagerArgs(
                    "lane-clear", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Advanced    = true,
                LevelRanges = new SortedList <int, int> {
                    { 1, 6 }, { 6, 12 }, { 12, 18 }
                },
                DefaultValues = new List <int> {
                    50, 30, 30
                }
            });
            laneClearMenu.AddItem(new MenuItem(laneClearMenu.Name + ".q", "Use Q").SetValue(true));
            laneClearMenu.AddItem(
                new MenuItem(laneClearMenu.Name + ".q-min", "Q Min. Hits").SetValue(new Slider(3, 1, 5)));
            laneClearMenu.AddItem(new MenuItem(laneClearMenu.Name + ".e", "Use E").SetValue(true));

            var jungleClearMenu = Menu.AddSubMenu(new Menu("Jungle Clear", Menu.Name + ".jungle-clear"));

            ResourceManager.AddToMenu(
                jungleClearMenu,
                new ResourceManagerArgs(
                    "jungle-clear", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Advanced    = true,
                LevelRanges = new SortedList <int, int> {
                    { 1, 6 }, { 6, 12 }, { 12, 18 }
                },
                DefaultValues = new List <int> {
                    30, 10, 10
                }
            });
            jungleClearMenu.AddItem(new MenuItem(jungleClearMenu.Name + ".q", "Use Q").SetValue(true));
            jungleClearMenu.AddItem(new MenuItem(jungleClearMenu.Name + ".e", "Use E").SetValue(true));

            var lasthitMenu = Menu.AddSubMenu(new Menu("Last Hit", Menu.Name + ".lasthit"));

            ResourceManager.AddToMenu(
                lasthitMenu,
                new ResourceManagerArgs(
                    "lasthit", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Advanced    = true,
                LevelRanges = new SortedList <int, int> {
                    { 1, 6 }, { 6, 12 }, { 12, 18 }
                },
                DefaultValues = new List <int> {
                    50, 30, 30
                }
            });
            lasthitMenu.AddItem(new MenuItem(lasthitMenu.Name + ".e-siege", "E Siege Minion").SetValue(true));
            lasthitMenu.AddItem(new MenuItem(lasthitMenu.Name + ".e-unkillable", "E Unkillable").SetValue(true));
            lasthitMenu.AddItem(new MenuItem(lasthitMenu.Name + ".e-turret", "E Under Turret").SetValue(true));
            lasthitMenu.AddItem(new MenuItem(lasthitMenu.Name + ".separator", string.Empty));
            lasthitMenu.AddItem(new MenuItem(lasthitMenu.Name + ".e-jungle", "E Jungle").SetValue(true));
            lasthitMenu.AddItem(new MenuItem(lasthitMenu.Name + ".e-big", "E Dragon/Baron").SetValue(true));

            var killstealMenu = Menu.AddSubMenu(new Menu("Killsteal", Menu.Name + ".killsteal"));

            killstealMenu.AddItem(new MenuItem(killstealMenu.Name + ".e", "Use E").SetValue(true));

            var miscMenu = Menu.AddSubMenu(new Menu("Misc", Menu.Name + ".miscellaneous"));

            ResourceManager.AddToMenu(
                miscMenu,
                new ResourceManagerArgs("misc", ResourceType.Mana, ResourceValueType.Percent, ResourceCheckType.Minimum)
            {
                Prefix       = "E",
                DefaultValue = 30
            });
            miscMenu.AddItem(new MenuItem(miscMenu.Name + ".e-reset", "E Harass Reset").SetValue(true));
            miscMenu.AddItem(new MenuItem(miscMenu.Name + ".e-death", "E Before Death").SetValue(true));
            miscMenu.AddItem(
                new MenuItem(miscMenu.Name + ".w-baron", "Hotkey W Baron").SetValue(new KeyBind('J', KeyBindType.Press)));
            miscMenu.AddItem(
                new MenuItem(miscMenu.Name + ".w-dragon", "Hotkey W Dragon").SetValue(
                    new KeyBind('K', KeyBindType.Press)));

            IndicatorManager.AddToMenu(DrawingManager.Menu, true);
            IndicatorManager.Add(Q, true, false);
            IndicatorManager.Add(W, true, false);
            IndicatorManager.Add("E", Rend.GetDamage);
            IndicatorManager.Finale();

            _ePercent = DrawingManager.Add("E Percent Damage", new Circle(false, Color.DodgerBlue));


            var lowHealthWeight = TargetSelector.Weights.GetItem("low-health");

            if (lowHealthWeight != null)
            {
                lowHealthWeight.ValueFunction = hero => hero.Health - Rend.GetDamage(hero);
                lowHealthWeight.Tooltip       = "Low Health (Health - Rend Damage) = Higher Weight";
            }

            TargetSelector.Weights.Register(
                new TargetSelector.Weights.Item(
                    "w-stack", "W Stack", 10, false, hero => hero.HasBuff("kalistacoopstrikemarkally") ? 1 : 0,
                    "Has W Debuff = Higher Weight"));
        }
Exemple #7
0
        protected override void OnPreUpdate()
        {
            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
                Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
            {
                var eBig    = Menu.Item(Menu.Name + ".lasthit.e-big").GetValue <bool>();
                var eJungle = Menu.Item(Menu.Name + ".lasthit.e-jungle").GetValue <bool>();
                var eSiege  = Menu.Item(Menu.Name + ".lasthit.e-siege").GetValue <bool>();
                var eTurret = Menu.Item(Menu.Name + ".lasthit.e-turret").GetValue <bool>();
                var eReset  = Menu.Item(Menu.Name + ".miscellaneous.e-reset").GetValue <bool>();

                IEnumerable <Obj_AI_Minion> minions = new HashSet <Obj_AI_Minion>();
                if (eSiege || eTurret || eReset)
                {
                    minions = GameObjects.EnemyMinions.Where(e => e.IsValidTarget(E.Range) && Rend.IsKillable(e, true));
                }

                if (E.IsReady())
                {
                    if (ResourceManager.Check("lasthit"))
                    {
                        if (eSiege)
                        {
                            if (
                                minions.Any(
                                    m =>
                                    (m.CharData.BaseSkinName.Contains("MinionSiege") ||
                                     m.CharData.BaseSkinName.Contains("Super"))))
                            {
                                E.Cast();
                                return;
                            }
                        }
                        if (eTurret)
                        {
                            if (minions.Any(m => Utils.UnderAllyTurret(m.Position)))
                            {
                                E.Cast();
                                return;
                            }
                        }
                    }
                    if (eBig || eJungle)
                    {
                        var enemySmites =
                            GameObjects.EnemyHeroes.Where(
                                e =>
                                !e.IsDead && e.Distance(Player) < SummonerManager.Smite.Range * 1.5f &&
                                SummonerManager.IsSmiteReady(e));
                        var allySmites =
                            (from ally in
                             GameObjects.AllyHeroes.Where(
                                 e => !e.IsDead && e.Distance(Player) < SummonerManager.Smite.Range)
                             let spell = SummonerManager.GetSmiteSpell(ally)
                                         where
                                         spell != null &&
                                         (spell.IsReady() || spell.Cooldown - spell.CooldownExpires - Game.Time <= 3)
                                         select ally).ToList();

                        if (eJungle && Player.Level > 3 ||
                            eBig && (enemySmites.Any() || !allySmites.Any() || Player.CountEnemiesInRange(1000) > 1))
                        {
                            var creeps =
                                GameObjects.Jungle.Where(e => e.IsValidTarget(E.Range) && Rend.IsKillable(e, false))
                                .ToList();
                            if (eJungle && creeps.Any() ||
                                eBig &&
                                creeps.Any(
                                    m =>
                                    (m.CharData.BaseSkinName.StartsWith("SRU_Dragon") ||
                                     m.CharData.BaseSkinName.StartsWith("SRU_Baron"))))
                            {
                                E.Cast();
                                return;
                            }
                        }
                    }
                }

                if (eReset && E.IsReady() && ResourceManager.Check("misc") &&
                    GameObjects.EnemyHeroes.Any(e => Rend.HasBuff(e) && e.IsValidTarget(E.Range)))
                {
                    if (minions.Any())
                    {
                        E.Cast();
                        return;
                    }
                }
            }
            if (Menu.Item(Menu.Name + ".ultimate.save").GetValue <bool>() && SoulBound.Unit != null && R.IsReady() &&
                !SoulBound.Unit.InFountain())
            {
                SoulBound.Clean();
                var enemies = SoulBound.Unit.CountEnemiesInRange(500);
                if ((SoulBound.Unit.HealthPercent <= 10 && SoulBound.Unit.CountEnemiesInRange(500) > 0) ||
                    (SoulBound.Unit.HealthPercent <= 5 && SoulBound.TotalDamage > SoulBound.Unit.Health && enemies == 0) ||
                    (SoulBound.Unit.HealthPercent <= 50 && SoulBound.TotalDamage > SoulBound.Unit.Health && enemies > 0))
                {
                    R.Cast();
                }
            }

            if (Menu.Item(Menu.Name + ".miscellaneous.w-baron").GetValue <KeyBind>().Active&& W.IsReady() &&
                !Player.IsWindingUp && Player.Distance(SummonersRift.River.Baron) <= W.Range)
            {
                W.Cast(SummonersRift.River.Baron);
            }
            if (Menu.Item(Menu.Name + ".miscellaneous.w-dragon").GetValue <KeyBind>().Active&& W.IsReady() &&
                !Player.IsWindingUp && Player.Distance(SummonersRift.River.Dragon) <= W.Range)
            {
                W.Cast(SummonersRift.River.Dragon);
            }

            if (SoulBound.Unit == null)
            {
                SoulBound.Unit =
                    GameObjects.AllyHeroes.FirstOrDefault(
                        a =>
                        a.Buffs.Any(
                            b =>
                            b.Caster.IsMe &&
                            b.Name.Equals("kalistacoopstrikeally", StringComparison.OrdinalIgnoreCase)));
            }
            if (SoulBound.Unit != null && SoulBound.Unit.Distance(Player) < R.Range && R.IsReady())
            {
                var blitz = Menu.Item(Menu.Name + ".ultimate.blitzcrank.r").GetValue <bool>();
                var tahm  = Menu.Item(Menu.Name + ".ultimate.tahm-kench.r").GetValue <bool>();
                foreach (var enemy in
                         GameObjects.EnemyHeroes.Where(e => (blitz || tahm) && !e.IsDead && e.Distance(Player) < 3000))
                {
                    if (blitz)
                    {
                        var blitzBuff =
                            enemy.Buffs.FirstOrDefault(
                                b =>
                                b.IsActive && b.Caster.NetworkId.Equals(SoulBound.Unit.NetworkId) &&
                                b.Name.Equals("rocketgrab2", StringComparison.OrdinalIgnoreCase));
                        if (blitzBuff != null)
                        {
                            if (!HeroListManager.Check("blitzcrank", enemy))
                            {
                                if (!SoulBound.Unit.UnderTurret(false) && SoulBound.Unit.Distance(enemy) > 750f &&
                                    SoulBound.Unit.Distance(Player) > R.Range / 3f)
                                {
                                    R.Cast();
                                }
                            }
                            return;
                        }
                    }
                    if (tahm)
                    {
                        var tahmBuff =
                            enemy.Buffs.FirstOrDefault(
                                b =>
                                b.IsActive && b.Caster.NetworkId.Equals(SoulBound.Unit.NetworkId) &&
                                b.Name.Equals("tahmkenchwdevoured", StringComparison.OrdinalIgnoreCase));
                        if (tahmBuff != null)
                        {
                            if (!HeroListManager.Check("tahm-kench", enemy))
                            {
                                if (!SoulBound.Unit.UnderTurret(false) &&
                                    (SoulBound.Unit.Distance(enemy) > Player.AttackRange ||
                                     GameObjects.AllyHeroes.Where(
                                         a => a.NetworkId != SoulBound.Unit.NetworkId && a.NetworkId != Player.NetworkId)
                                     .Any(t => t.Distance(Player) > 600) ||
                                     GameObjects.AllyTurrets.Any(t => t.Distance(Player) < 600)))
                                {
                                    R.Cast();
                                }
                            }
                            return;
                        }
                    }
                }
            }
        }
Exemple #8
0
        private void OnCorePreUpdate(EventArgs args)
        {
            try
            {
                if (Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo &&
                    Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Flee)
                {
                    var eBig    = Menu.Item(Menu.Name + ".lasthit.e-big").GetValue <bool>();
                    var eTurret = Menu.Item(Menu.Name + ".lasthit.e-turret").GetValue <bool>();
                    var eReset  = Menu.Item(Menu.Name + ".miscellaneous.e-reset").GetValue <bool>();

                    IEnumerable <Obj_AI_Minion> minions = new HashSet <Obj_AI_Minion>();
                    if (eBig || eTurret || eReset)
                    {
                        minions =
                            GameObjects.EnemyMinions.Where(e => e.IsValidTarget(E.Range) && Rend.IsKillable(e, true));
                    }

                    if (E.IsReady())
                    {
                        if (eBig)
                        {
                            var creeps =
                                GameObjects.Jungle.Where(e => e.IsValidTarget(E.Range) && Rend.IsKillable(e, false))
                                .Concat(minions)
                                .ToList();
                            if (
                                creeps.Any(
                                    m =>
                                    (m.CharData.BaseSkinName.Contains("MinionSiege") ||
                                     m.CharData.BaseSkinName.Contains("Super") ||
                                     m.CharData.BaseSkinName.StartsWith("SRU_Dragon") ||
                                     m.CharData.BaseSkinName.StartsWith("SRU_Baron"))))
                            {
                                E.Cast();
                                return;
                            }
                        }

                        if (eTurret && ManaManager.Check("lasthit"))
                        {
                            var minion =
                                minions.FirstOrDefault(
                                    m => Utils.UnderAllyTurret(m.Position) && Rend.IsKillable(m, false));
                            if (minion != null)
                            {
                                E.Cast();
                                return;
                            }
                        }
                    }

                    if (eReset && E.IsReady() && ManaManager.Check("misc") &&
                        GameObjects.EnemyHeroes.Any(e => Rend.HasBuff(e) && e.IsValidTarget(E.Range)))
                    {
                        if (minions.Any())
                        {
                            E.Cast();
                            return;
                        }
                    }
                }
                if (Menu.Item(Menu.Name + ".ultimate.save").GetValue <bool>() && SoulBound.Unit != null && R.IsReady() &&
                    !SoulBound.Unit.InFountain())
                {
                    SoulBound.Clean();
                    var enemies = SoulBound.Unit.CountEnemiesInRange(500);
                    if ((SoulBound.Unit.HealthPercent <= 10 && SoulBound.Unit.CountEnemiesInRange(500) > 0) ||
                        (SoulBound.Unit.HealthPercent <= 5 && SoulBound.TotalDamage > SoulBound.Unit.Health &&
                         enemies == 0) ||
                        (SoulBound.Unit.HealthPercent <= 50 && SoulBound.TotalDamage > SoulBound.Unit.Health &&
                         enemies > 0))
                    {
                        R.Cast();
                    }
                }
                if (Menu.Item(Menu.Name + ".miscellaneous.w-baron").GetValue <KeyBind>().Active&& W.IsReady() &&
                    Player.Distance(SummonersRift.River.Baron) <= W.Range)
                {
                    W.Cast(SummonersRift.River.Baron);
                }
                if (Menu.Item(Menu.Name + ".miscellaneous.w-dragon").GetValue <KeyBind>().Active&& W.IsReady() &&
                    Player.Distance(SummonersRift.River.Dragon) <= W.Range)
                {
                    W.Cast(SummonersRift.River.Dragon);
                }

                if (SoulBound.Unit == null)
                {
                    SoulBound.Unit =
                        GameObjects.AllyHeroes.FirstOrDefault(
                            a =>
                            a.Buffs.Any(
                                b =>
                                b.Caster.IsMe &&
                                b.Name.Equals("kalistacoopstrikeally", StringComparison.OrdinalIgnoreCase)));
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }