Example #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);
             * }
             */
        }
Example #2
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;
                        }
                            );
                    }
                }
            }
        }