Example #1
0
 public static bool CleanseItems(AIHeroClient ally)
 {
     if (ally == null || ally.IsDead || ally.Health <= 0 || !ally.IsValid)
     {
         return(false);
     }
     if (!Defence.Damages[ally.NetworkId].DangerousSpells.Any(a => a.Value.IsCleanseable && (a.Value.BonusDelay == 0 || a.Key - Environment.TickCount < a.Value.BonusDelay / 2)))
     {
         return(false);
     }
     if (Mercs != null && Mercs.CanUseItem())
     {
         Player.CastSpell(Mercs.SpellSlot);
         foreach (var spell in Defence.Damages[ally.NetworkId].DangerousSpells.Where(a => a.Value.IsCleanseable).ToList())
         {
             Defence.Damages[ally.NetworkId].DangerousSpells.Remove(spell.Key);
         }
         Defence.LastSpellCast = Environment.TickCount + 250;
         return(true);
     }
     if (Mikaels != null && Mikaels.CanUseItem())
     {
         Player.CastSpell(Mikaels.SpellSlot, ally);
         foreach (var spell in Defence.Damages[ally.NetworkId].DangerousSpells.Where(a => a.Value.IsCleanseable).ToList())
         {
             Defence.Damages[ally.NetworkId].DangerousSpells.Remove(spell.Key);
         }
         Defence.LastSpellCast = Environment.TickCount + 250;
         return(true);
     }
     return(false);
 }
Example #2
0
        private void Cleansers()
        {
            if (!Quicksilver.IsReady() && !Mikaels.IsReady() && !Mercurial.IsReady() && !Dervish.IsReady())
            {
                return;
            }

            if ((Player.HasBuff("zedrdeathmark") || Player.HasBuff("FizzMarinerDoom") ||
                 Player.HasBuff("MordekaiserChildrenOfTheGrave") || Player.HasBuff("PoppyDiplomaticImmunity") ||
                 Player.HasBuff("VladimirHemoplague")) && CleansersMenu["special"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }

            if (Mikaels.IsReady() && CleansersMenu["qss2"].Cast <CheckBox>().CurrentValue)
            {
                foreach (var ally in EntityManager.Heroes.Allies.Where(
                             ally =>
                             ally.IsValid && !ally.IsDead &&
                             CleansersMenu["m" + ally.ChampionName].Cast <CheckBox>().CurrentValue&&
                             Player.Distance(ally.Position) < Mikaels.Range))
                {
                    if (ally.HasBuff("zedrdeathmark") || ally.HasBuff("FizzMarinerDoom") ||
                        ally.HasBuff("MordekaiserChildrenOfTheGrave") || ally.HasBuff("PoppyDiplomaticImmunity") ||
                        ally.HasBuff("VladimirHemoplague"))
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Stun) && CleansersMenu["stun"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Snare) && CleansersMenu["snare"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Charm) && CleansersMenu["charm"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Fear) && CleansersMenu["fear"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Taunt) && CleansersMenu["taunt"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Suppression) && CleansersMenu["suppr"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                    if (ally.HasBuffOfType(BuffType.Blind) && CleansersMenu["blind"].Cast <CheckBox>().CurrentValue)
                    {
                        Mikaels.Cast(ally);
                    }
                }
            }

            if (Player.HasBuffOfType(BuffType.Stun) && CleansersMenu["stun"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
            if (Player.HasBuffOfType(BuffType.Snare) && CleansersMenu["snare"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
            if (Player.HasBuffOfType(BuffType.Charm) && CleansersMenu["charm"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
            if (Player.HasBuffOfType(BuffType.Fear) && CleansersMenu["fear"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
            if (Player.HasBuffOfType(BuffType.Taunt) && CleansersMenu["taunt"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
            if (Player.HasBuffOfType(BuffType.Suppression) && CleansersMenu["suppr"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
            if (Player.HasBuffOfType(BuffType.Blind) && CleansersMenu["blind"].Cast <CheckBox>().CurrentValue)
            {
                Clean();
            }
        }
Example #3
0
        public static bool ShieldItems(AIHeroClient ally)
        {
            if (ally == null || ally.IsDead || ally.Health <= 0 || !ally.IsValid)
            {
                return(false);
            }
            var predHp = ally.PredictedHealth();

            if (ally.IsMe && Defence.DefenceMenu["Archangels_Staff"].Cast <CheckBox>().CurrentValue&& predHp + ShieldHeals[ItemId.Archangels_Staff].Invoke() > 0) // Seraphs
            {
                if (Archangles != null && Archangles.CanUseItem())
                {
                    Player.CastSpell(Archangles.SpellSlot);
                    Defence.LastSpellCast = Environment.TickCount + 250;
                    return(true);
                }
            }
            if (Defence.DefenceMenu["Locket_of_the_Iron_Solari"].Cast <CheckBox>().CurrentValue&& (ally.IsMe && Defence.DefenceMenu["Locket_of_the_Iron_Solari_self"].Cast <CheckBox>().CurrentValue || !ally.IsMe && Defence.DefenceMenu["Locket_of_the_Iron_Solari_ally"].Cast <CheckBox>().CurrentValue) && predHp + ShieldHeals[ItemId.Locket_of_the_Iron_Solari].Invoke() > 0 && ally.Distance(Player.Instance) < 600) // Locket
            {
                if (Locket != null && Locket.CanUseItem())
                {
                    Player.CastSpell(Locket.SpellSlot);
                    Defence.LastSpellCast = Environment.TickCount + 250;
                    return(true);
                }
            }
            if (Defence.DefenceMenu["Face_of_the_Mountain"].Cast <CheckBox>().CurrentValue&& (ally.IsMe && Defence.DefenceMenu["Face_of_the_Mountain_self"].Cast <CheckBox>().CurrentValue || !ally.IsMe) && predHp + ShieldHeals[ItemId.Face_of_the_Mountain].Invoke() > 0 && ally.Distance(Player.Instance) < 700) // FOM
            {
                if (FaceOfTheMountain != null && FaceOfTheMountain.CanUseItem())
                {
                    Player.CastSpell(FaceOfTheMountain.SpellSlot, ally);
                    Defence.LastSpellCast = Environment.TickCount + 250;
                    return(true);
                }
            }
            if (Defence.DefenceMenu["Mikaels_Crucible_Heal"].Cast <CheckBox>().CurrentValue&& Mikaels != null && Mikaels.CanUseItem() && predHp + (150 + (0.1 * ally.Health)) > 0 && ally.Distance(Player.Instance) < 750) // Mikaels
            {
                Player.CastSpell(Mikaels.SpellSlot, ally);
                Defence.LastSpellCast = Environment.TickCount + 250;
                return(true);
            }
            return(false);
        }