示例#1
0
        /// <summary>
        /// Checks whether if I(player) have a given summoner spell on the slot provided.
        /// </summary>
        /// <param name="summSpell"></param>
        /// <param name="summSpellSlot"></param>
        /// <returns></returns>
        public static bool IHaveSpellOnSlot(SummonerSpellsEnum summSpell, SummonerSpellSlot summSpellSlot)
        {
            switch (summSpellSlot)
            {
            case SummonerSpellSlot.First:
                return(SummonerSpellsNameMappedDictionary[summSpell] == Slot1_D);

            case SummonerSpellSlot.Second:
                return(SummonerSpellsNameMappedDictionary[summSpell] == Slot2_F);
            }

            return(false);
        }
示例#2
0
        public static bool PlayerHas(SummonerSpellsEnum sumSpell)
        {
            switch (sumSpell)
            {
            case SummonerSpellsEnum.Barrier:
                return(Barrier.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Clarity:
                return(Clarity.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Cleanse:
                return(Cleanse.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Exhaust:
                return(Exhaust.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Flash:
                return(Flash.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Mark:
                return(Mark.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Ghost:
                return(Ghost.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Heal:
                return(Heal.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Ignite:
                return(Ignite.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.Smite:
                return(Smite.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.PoroToss:
                return(PoroToss.Slot != SpellSlot.Unknown);

            case SummonerSpellsEnum.ToTheKing:
                return(ToTheKing.Slot != SpellSlot.Unknown);
            }
            return(false);
        }
示例#3
0
        public static void UseSummoner(SummonerSpellsEnum summoner)
        {
            switch (summoner)
            {
            case SummonerSpellsEnum.Exhaust:
            {
                if (Exhaust == null || !Exhaust.IsReady() || !Main.SpellsMenu.VChecked("Exhaust.Enabled") || (Player.HasBuffOfType(BuffType.Invisibility) && Main.SpellsMenu.VChecked("Exhaust.Stealth")) ||
                    (Main.SpellsMenu.VChecked("Exhaust.Combo") && !Orbwalker.ActiveModes.Combo.IsOrb()))
                {
                    break;
                }
                var target = EntityManager.Heroes.Enemies.Where(x => x.IsValidTarget(Exhaust.Range) &&
                                                                (Main.SpellsMenu.VSliderValue("Exhaust.EnemyHP") <= x.HealthPercent ||
                                                                 EntityManager.Heroes.Allies.Any(ally => ally.IsValidTarget(800) && Main.SpellsMenu.VSliderValue("Exhaust.AllyHP") <= ally.HealthPercent)));
                switch (Main.SpellsMenu.VComboValue("Exhaust.Target"))
                {
                case 0:
                {
                    target.OrderByDescending(x => TargetSelector.GetPriority(x));
                }
                break;

                case 1:
                {
                    target.OrderBy(x => x.Health);
                }
                break;

                case 2:
                {
                    target.OrderByDescending(x => x.TotalAttackDamage);
                }
                break;

                case 3:
                {
                    target.OrderByDescending(x => x.TotalMagicalDamage);
                }
                break;

                case 4:
                {
                    target.OrderByDescending(x => x.MoveSpeed);
                }
                break;

                case 5:
                {
                    target.OrderByDescending(x => x.PercentAttackSpeedMod);
                }
                break;
                }
                if (target.Any())
                {
                    Exhaust.Cast(target.First());
                }
            }
            break;

            case SummonerSpellsEnum.Heal:
            {
                if (Heal == null || !Heal.IsReady() || !Main.SpellsMenu.VChecked("Heal.Enabled") || (Player.HasBuffOfType(BuffType.Invisibility) && Main.SpellsMenu.VChecked("Heal.Stealth")) ||
                    (Main.SpellsMenu.VChecked("Heal.Combo") && !Orbwalker.ActiveModes.Combo.IsOrb()))
                {
                    break;
                }
                var allies = EntityManager.Heroes.Allies.Where(x => x.IsValidTarget(Heal.Range) && x.HealthPercent <= (x.IsMe ? Main.SpellsMenu.VSliderValue("Heal.MyHP") : Main.SpellsMenu.VSliderValue("Heal.AllyHP")));
                if (!allies.Any())
                {
                    break;
                }
                var dic = new Dictionary <Obj_AI_Base, int>();
                foreach (var ally in allies)
                {
                    dic.Add(ally, 500);
                }
                if (!Main.SpellsMenu.VChecked("Heal.Smart") || Prediction.Health.GetPrediction(dic).Any(x => x.Value <= 0))
                {
                    Heal.Cast();
                }
            }
            break;

            case SummonerSpellsEnum.Ignite:
            {
                if (Ignite == null || !Ignite.IsReady() || !Main.SpellsMenu.VChecked("Ignite.Enabled") ||
                    (Main.SpellsMenu.VChecked("Ignite.Combo") && !Orbwalker.ActiveModes.Combo.IsOrb()))
                {
                    break;
                }
                var target = EntityManager.Heroes.Enemies.Where(t =>
                                                                t.IsValidTarget(Ignite.Range) &&
                                                                t.Health <= Player.Instance.GetSummonerSpellDamage(t, DamageLibrary.SummonerSpells.Ignite)).FirstOrDefault();

                if (target == null)
                {
                    break;
                }
                Ignite.Cast(target);
            }
            break;

            case SummonerSpellsEnum.Mark:
            {
                if (Mark == null || !Mark.IsReady() || !Main.SpellsMenu.VChecked("Mark.Enabled") ||
                    !Orbwalker.ActiveModes.Combo.IsOrb())
                {
                    break;
                }
                var target = Mark.GetTarget();
                if (target == null)
                {
                    break;
                }
                var pred = Mark.GetPrediction(target);
                if (pred.CanNext(Mark, Main.SpellsMenu.VSliderValue("Mark.Percent"), true))
                {
                    Mark.Cast(pred.CastPosition);
                }
            }
            break;

            case SummonerSpellsEnum.Smite:
            {
                if (Smite == null || !Smite.IsReady() || !Main.SpellsMenu.VChecked("Smite.Enabled"))
                {
                    break;
                }
                var target = EntityManager.Heroes.Enemies.Where(t =>
                                                                t.IsValidTarget(Smite.Range) &&
                                                                t.Health <= Player.Instance.GetSummonerSpellDamage(t, DamageLibrary.SummonerSpells.Smite)).FirstOrDefault();
                var minion = ObjectManager.Get <Obj_AI_Minion>()
                             .FirstOrDefault(m => m.Health < Player.Instance.GetSummonerSpellDamage(m, DamageLibrary.SummonerSpells.Smite) &&
                                             m != null && m.IsMonster && m.IsImportant() && Smite.IsInRange(m));
                if (minion != null)
                {
                    Smite.Cast(minion);
                }
                if (target != null)
                {
                    Smite.Cast(target);
                }
            }
            break;

            case SummonerSpellsEnum.Barrier:
            {
                if (Barrier == null || !Barrier.IsReady() || !Main.SpellsMenu.VChecked("Barrier.Enabled") || (Player.HasBuffOfType(BuffType.Invisibility) && Main.SpellsMenu.VChecked("Barrier.Stealth")) ||
                    (Main.SpellsMenu.VChecked("Barrier.Combo") && !Orbwalker.ActiveModes.Combo.IsOrb()) || Player.Instance.HealthPercent > Main.SpellsMenu.VSliderValue("Barrier.MyHP"))
                {
                    break;
                }
                if (!Main.SpellsMenu.VChecked("Barrier.Smart") || Prediction.Health.GetPrediction(Player.Instance, 800) <= 0)
                {
                    Barrier.Cast();
                }
            }
            break;

            default:
            {
                break;
            }
            }
        }