/// <summary> /// Will Cleanse only on Kill /// </summary> static void KillCleansing() { if (OneReady()) { QssSpell mySpell = null; if ( QssSpells.Where( spell => DZAIO.Player.HasBuff(spell.SpellBuff, true) && SpellEnabledOnKill(spell.SpellBuff) && GetChampByName(spell.ChampName).GetSpellDamage(ObjectManager.Player, spell.Slot) > DZAIO.Player.Health + HealthBuffer) .OrderBy( spell => GetChampByName(spell.ChampName).GetSpellDamage(ObjectManager.Player, spell.Slot)) .Any()) { mySpell = QssSpells.Where( spell => DZAIO.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 = DZAIO.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("dzaio.cleanser.allies.useon." + ally.ChampionName)) { highestSpell = theSpell; highestDamage = (float)damageDone; highestAlly = ally; } } } if (!highestAlly.IsMe && highestSpell != null) { UseCleanser(highestSpell, highestAlly); } }
static void UseCleanser(QssSpell spell, Obj_AI_Hero target) { LeagueSharp.Common.Utility.DelayAction.Add(SpellDelay(spell.RealName), () => CastCleanseItem(target)); }
static void UseCleanser(QssSpell spell,Obj_AI_Hero target) { LeagueSharp.Common.Utility.DelayAction.Add(SpellDelay(spell.RealName), () => CastCleanseItem(target)); }