Esempio n. 1
0
        /// <summary>
        /// Will Cleanse only on Kill
        /// </summary>
        static void KillCleansing()
        {
            if (OneReady())
            {
                QssSpell mySpell = null;
                if (
                    QssSpells.Where(
                        spell => ObjectManager.Player.HasBuff(spell.SpellBuff, true) && SpellEnabledOnKill(spell.SpellBuff) && GetChampByName(spell.ChampName).GetSpellDamage(ObjectManager.Player, spell.Slot) > ObjectManager.Player.Health + HealthBuffer)
                    .OrderBy(
                        spell => GetChampByName(spell.ChampName).GetSpellDamage(ObjectManager.Player, spell.Slot))
                    .Any())
                {
                    mySpell =
                        QssSpells.Where(
                            spell => ObjectManager.Player.HasBuff(spell.SpellBuff, true) && SpellEnabledOnKill(spell.SpellBuff))
                        .OrderBy(
                            spell => GetChampByName(spell.ChampName).GetSpellDamage(ObjectManager.Player, spell.Slot))
                        .First();
                }
                if (mySpell != null)
                {
                    UseCleanser(mySpell, ObjectManager.Player);
                }
            }
            if (!MichaelReady())
            {
                return;
            }
            //Ally Cleansing
            var      allies        = ObjectManager.Player.GetAlliesInRange(600f);
            var      highestAlly   = ObjectManager.Player;
            var      highestDamage = 0f;
            QssSpell highestSpell  = null;

            foreach (var ally in allies)
            {
                QssSpell theSpell = null;
                if (QssSpells.Where(spell => ally.HasBuff(spell.SpellBuff, true) && SpellEnabledOnKill(spell.SpellBuff) && GetChampByName(spell.ChampName).GetSpellDamage(ally, spell.Slot) > ally.Health + HealthBuffer).OrderBy(spell => GetChampByName(spell.ChampName).GetSpellDamage(ally, spell.Slot)).Any())
                {
                    theSpell = QssSpells.Where(
                        spell => ally.HasBuff(spell.SpellBuff, true) && SpellEnabledOnKill(spell.SpellBuff))
                               .OrderBy(spell => GetChampByName(spell.ChampName).GetSpellDamage(ally, spell.Slot))
                               .First();
                }
                if (theSpell != null)
                {
                    var damageDone = GetChampByName(theSpell.ChampName).GetSpellDamage(ally, theSpell.Slot);
                    if (damageDone >= highestDamage && MenuHelper.isMenuEnabled("dz191.vhr.cleanser.allies.useon." + ally.ChampionName))
                    {
                        highestSpell  = theSpell;
                        highestDamage = (float)damageDone;
                        highestAlly   = ally;
                    }
                }
            }
            if (!highestAlly.IsMe && highestSpell != null)
            {
                UseCleanser(highestSpell, highestAlly);
            }
        }
Esempio n. 2
0
 static void UseCleanser(QssSpell spell, Obj_AI_Hero target)
 {
     LeagueSharp.Common.Utility.DelayAction.Add(SpellDelay(spell.RealName), () => CastCleanseItem(target));
 }
Esempio n. 3
0
 static void UseCleanser(QssSpell spell, Obj_AI_Hero target)
 {
     LeagueSharp.Common.Utility.DelayAction.Add(SpellDelay(spell.RealName), () => CastCleanseItem(target));
 }