Esempio n. 1
0
        /// <summary>
        ///     On Clear
        /// </summary>
        private void Clear()
        {
            var basename = BaseName + "Clear.";

            if (StaticObjects.ProjectMenu.Item($"{basename}.UseE").GetValue <bool>())
            {
                if (_manaManager.CheckClearE())
                {
                    if (StaticObjects.ProjectMenu.Item($"{basename}.UseE.OnTurrets").GetValue <bool>())
                    {
                        var turrets = ObjectManager.Get <Obj_AI_Turret>().OrderBy(dis => dis.ServerPosition.Distance(StaticObjects.Player.ServerPosition));

                        foreach (var turret in
                                 turrets.Where(turret => turret.IsEnemy).Where(turret => !turret.IsDead && turret.IsValidTarget(E.Range)))
                        {
                            E.Cast(turret);

                            if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ").GetValue <bool>())
                            {
                                if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ.OnTurrets").GetValue <bool>())
                                {
                                    Q.Cast();
                                }
                            }

                            Orbwalker.ForceTarget(turret);
                            return;
                        }
                    }

                    if (StaticObjects.ProjectMenu.Item($"{basename}.UseE.OnJungle").GetValue <bool>())
                    {
                        var bigmonsters = MinionManager.GetMinions(E.Range, MinionTypes.All, MinionTeam.Neutral).Where(name => !name.Name.ToLower().Contains("mini") && !name.BaseSkinName.ToLower().Contains("mini")).OrderBy(hp => hp.Health);

                        foreach (var monster in bigmonsters.Where(target => target.IsValidTarget(E.Range)))
                        {
                            E.Cast(monster);

                            if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ").GetValue <bool>())
                            {
                                if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ.OnJungle").GetValue <bool>())
                                {
                                    Q.Cast();
                                }
                            }

                            Orbwalker.ForceTarget(monster);
                            return;
                        }
                    }

                    if (StaticObjects.ProjectMenu.Item($"{basename}.UseE.OnMinions").GetValue <bool>())
                    {
                        var validMinons = MinionManager.GetMinions(StaticObjects.Player.Position, E.Range - 50, MinionTypes.All, MinionTeam.NotAlly);
                        if (validMinons.Count >= StaticObjects.ProjectMenu.Item($"{basename}.MinionsInRange").GetValue <Slider>().Value)
                        {
                            Obj_AI_Base target      = null;
                            var         bestInRange = 0;
                            foreach (var minon in validMinons.Where(minon => minon.IsValidTarget(E.Range)))
                            {
                                var inRange = 1 + validMinons.Count(minon2 => minon.Distance(minon) < 125);
                                if (inRange <= bestInRange)
                                {
                                    continue;
                                }

                                bestInRange = inRange;
                                target      = minon;
                            }

                            if ((target != null) && (bestInRange >= StaticObjects.ProjectMenu.Item($"{basename}.MinionsInRange").GetValue <Slider>().Value))
                            {
                                E.Cast(target);
                                if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ").GetValue <bool>())
                                {
                                    if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ.OnMinions").GetValue <bool>())
                                    {
                                        Q.Cast();
                                    }
                                }

                                Orbwalker.ForceTarget(target);
                            }
                        }
                    }
                }
            }
        }