Exemplo n.º 1
0
        public static void Execute(EventArgs args)
        {
            /// <summary>
            /// The Cleanse Logic.
            /// </summary>
            if (Bools.HasNoProtection(ObjectManager.Player) &&
                Bools.ShouldUseCleanse(ObjectManager.Player))
            {
                if (ObjectManager.Player.ChampionName == "Gangplank" &&
                    Variables.W.IsReady())
                {
                    Variables.W.Cast();
                    return;
                }
                else if (Bools.IsSpellAvailable(SpellSlots.Cleanse))
                {
                    Utility.DelayAction.Add(
                        Bools.MustRandomize() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Cleanse);
                        return;
                    }
                        );
                }
            }

            /// <summary>
            /// The Clarity logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Clarity) &&
                ObjectManager.Player.ManaPercent <= 40)
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Clarity);
            }

            /// <summary>
            /// The Ghost Logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Ghost) &&
                (ObjectManager.Player.CountEnemiesInRange(ObjectManager.Player.AttackRange + 300) < ObjectManager.Player.CountAlliesInRange(ObjectManager.Player.AttackRange + 300)) ||
                (ObjectManager.Player.CountEnemiesInRange(ObjectManager.Player.AttackRange + 300) > ObjectManager.Player.CountAlliesInRange(ObjectManager.Player.AttackRange + 300)))
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Ghost);
            }

            /*
             * /// <summary>
             * /// The Ignite Logic.
             * /// </summary>
             * if (Bools.IsSpellAvailable(SpellSlots.Ignite) &&
             *  Targets.target != null &&
             *  Targets.target.IsValidTarget(600f) &&
             *  ObjectManager.Player.GetSummonerSpellDamage(Targets.target, Damage.SpellSlot.Ignite) > Targets.target.Health)
             * {
             *  ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Ignite, Targets.target);
             * }
             */
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called when the game updates itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void Execute(EventArgs args)
        {
            if (Bools.ShouldUseCleanser() ||
                (!Bools.IsSpellAvailable(SpellSlots.Cleanse) &&
                 Bools.ShouldUseCleanse(ObjectManager.Player)))
            {
                /// <summary>
                /// The Quicksilver Sash.
                /// </summary>
                if (ItemData.Quicksilver_Sash.GetItem().IsReady())
                {
                    Utility.DelayAction.Add(
                        Variables.Menu.Item($"{Variables.MainMenuName}.randomizer").GetValue <bool>() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ItemData.Quicksilver_Sash.GetItem().Cast();
                        return;
                    }
                        );
                }

                /// <summary>
                /// The Mikaels Crucible.
                /// </summary>
                if (ItemData.Mikaels_Crucible.GetItem().IsReady())
                {
                    if (Bools.ShouldUseCleanse(Targets.Ally) &&
                        Targets.Ally.IsValidTarget(750f, false))
                    {
                        Utility.DelayAction.Add(
                            Variables.Menu.Item($"{Variables.MainMenuName}.randomizer").GetValue <bool>() ?
                            WeightedRandom.Next(100, 200) : 0,
                            () =>
                        {
                            ItemData.Mikaels_Crucible.GetItem().Cast(Targets.Ally);
                        }
                            );
                    }
                    else if (Bools.ShouldUseCleanse(ObjectManager.Player))
                    {
                        Utility.DelayAction.Add(
                            Variables.Menu.Item($"{Variables.MainMenuName}.randomizer").GetValue <bool>() ?
                            WeightedRandom.Next(100, 200) : 0,
                            () =>
                        {
                            ItemData.Mikaels_Crucible.GetItem().Cast(ObjectManager.Player);
                        }
                            );
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Called when the game updates itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void Execute(EventArgs args)
        {
            if ((Bools.ShouldUseCleanser() ||
                 (Bools.ShouldUseCleanse(ObjectManager.Player) &&
                  !Bools.IsSpellAvailable(SpellSlots.Cleanse))) ||
                ObjectManager.Player.HealthPercent <= 10 &&
                HealthPrediction.GetHealthPrediction(ObjectManager.Player, (int)(500 + Game.Ping / 2f)) <= ObjectManager.Player.MaxHealth / 6)
            {
                /// <summary>
                /// The Dervish Blade.
                /// </summary>
                if (ItemData.Dervish_Blade.GetItem().IsReady())
                {
                    Utility.DelayAction.Add(
                        Variables.Menu.Item($"{Variables.MainMenuName}.randomizer").GetValue <bool>() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ItemData.Dervish_Blade.GetItem().Cast();
                        return;
                    }
                        );
                }

                /// <summary>
                /// The Mercurial Scimitar.
                /// </summary>
                if (ItemData.Mercurial_Scimitar.GetItem().IsReady())
                {
                    Utility.DelayAction.Add(
                        Variables.Menu.Item($"{Variables.MainMenuName}.randomizer").GetValue <bool>() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ItemData.Mercurial_Scimitar.GetItem().Cast();
                    }
                        );
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Called when the game updates itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void Execute(EventArgs args)
        {
            /// <summary>
            /// The Cleanse Logic.
            /// </summary>
            if (Bools.ShouldUseCleanse(ObjectManager.Player))
            {
                if (Variables.W.IsReady() &&
                    ObjectManager.Player.ChampionName.Equals("Gangplank"))
                {
                    Variables.W.Cast();
                    return;
                }

                if (Bools.IsSpellAvailable(SpellSlots.Cleanse))
                {
                    Utility.DelayAction.Add(
                        Variables.Menu.Item($"{Variables.MainMenuName}.randomizer").GetValue <bool>() ?
                        WeightedRandom.Next(100, 200) :
                        0,
                        () =>
                    {
                        ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Cleanse);
                    }
                        );
                }
            }

            /// <summary>
            /// The Barrier Logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Barrier) &&
                HealthPrediction.GetHealthPrediction(ObjectManager.Player, (int)(250 + Game.Ping / 2f)) <= ObjectManager.Player.MaxHealth / 6)
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Barrier);
                return;
            }

            /// <summary>
            /// The Heal Logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Heal) &&
                !ItemData.Face_of_the_Mountain.GetItem().IsReady() &&
                !ItemData.Locket_of_the_Iron_Solari.GetItem().IsReady())
            {
                if ((ObjectManager.Player.CountEnemiesInRange(850f) > 0 &&
                     HealthPrediction.GetHealthPrediction(ObjectManager.Player, (int)(250 + Game.Ping / 2f)) <= ObjectManager.Player.MaxHealth / 6) ||

                    (Targets.Ally.IsValidTarget(850f) &&
                     Targets.Ally.CountEnemiesInRange(850f) > 0 &&
                     HealthPrediction.GetHealthPrediction(Targets.Ally, (int)(250 + Game.Ping / 2f)) <= Targets.Ally.MaxHealth / 6))
                {
                    ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Heal);
                    return;
                }
            }

            /// <summary>
            /// The Exhaust Logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Exhaust) &&
                Targets.Target.IsValidTarget(650f) &&
                (ObjectManager.Player.CountEnemiesInRange(850f) > 0 || Targets.Ally.CountEnemiesInRange(850f) > 0) &&
                (HealthPrediction.GetHealthPrediction(ObjectManager.Player, (int)(250 + Game.Ping / 2f)) <= ObjectManager.Player.MaxHealth / 4 ||
                 HealthPrediction.GetHealthPrediction(Targets.Ally, (int)(250 + Game.Ping / 2f)) <= Targets.Ally.MaxHealth / 4))
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Exhaust, Targets.Target);
            }

            /// <summary>
            /// The Ignite Logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Ignite) &&
                Targets.Target.IsValidTarget(600f) &&
                (ObjectManager.Player.GetSummonerSpellDamage(Targets.Target, Damage.SummonerSpell.Ignite) > Targets.Target.Health ||
                 HealthPrediction.GetHealthPrediction(Targets.Target, (int)(750 + Game.Ping / 2f)) <= 0))
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Ignite, Targets.Target);
            }

            /// <summary>
            /// The Clarity logic.
            /// </summary>
            if (Bools.IsSpellAvailable(SpellSlots.Clarity) &&
                ObjectManager.Player.ManaPercent <= 20)
            {
                ObjectManager.Player.Spellbook.CastSpell(SpellSlots.Clarity);
            }
        }
Exemplo n.º 5
0
        public static void Execute(EventArgs args)
        {
            if (Bools.ShouldUseCleanser() ||
                (Bools.ShouldUseCleanse(ObjectManager.Player) && !Bools.IsSpellAvailable(SpellSlots.Cleanse)))
            {
                /// <summary>
                /// The Dervish Blade.
                /// </summary>
                if (ItemData.Dervish_Blade.GetItem().IsReady())
                {
                    Utility.DelayAction.Add(
                        Bools.HasZedMark(ObjectManager.Player) ?
                        1500 : Bools.MustRandomize() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ItemData.Dervish_Blade.GetItem().Cast();
                        return;
                    }
                        );
                }

                /// <summary>
                /// The Mercurial Scimitar.
                /// </summary>
                if (ItemData.Mercurial_Scimitar.GetItem().IsReady())
                {
                    Utility.DelayAction.Add(
                        Bools.HasZedMark(ObjectManager.Player) ?
                        1500 : Bools.MustRandomize() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ItemData.Mercurial_Scimitar.GetItem().Cast();
                        return;
                    }
                        );
                }

                /// <summary>
                /// The Quicksilver Sash.
                /// </summary>
                if (ItemData.Quicksilver_Sash.GetItem().IsReady())
                {
                    Utility.DelayAction.Add(
                        Bools.HasZedMark(ObjectManager.Player) ?
                        1500 : Bools.MustRandomize() ?
                        WeightedRandom.Next(100, 200) : 0,
                        () =>
                    {
                        ItemData.Quicksilver_Sash.GetItem().Cast();
                        return;
                    }
                        );
                }

                /// <summary>
                /// The Mikaels Crucible.
                /// </summary>
                if (ItemData.Mikaels_Crucible.GetItem().IsReady())
                {
                    foreach (var Ally in HeroManager.Allies
                             .Where(
                                 h =>
                                 h.IsValidTarget(750f, false) &&
                                 Bools.ShouldUseCleanse(h) &&
                                 Bools.HasNoProtection(h)))
                    {
                        Utility.DelayAction.Add(
                            Bools.MustRandomize() ?
                            WeightedRandom.Next(100, 200) : 0,
                            () =>
                        {
                            ItemData.Mikaels_Crucible.GetItem().Cast(Ally);
                            return;
                        }
                            );
                    }
                }
            }
        }