Ejemplo n.º 1
0
        public static bool IsSpellShielded(this Obj_AI_Hero unit)
        {
            if (ObjectManager.Player.HasBuffOfType(BuffType.SpellShield))
            {
                return(true);
            }

            if (ObjectManager.Player.HasBuffOfType(BuffType.SpellImmunity))
            {
                return(true);
            }

            //Sivir E
            if (unit.LastCastedSpellName() == "SivirE" && (Utils.TickCount - unit.LastCastedSpellT()) < 300)
            {
                return(true);
            }

            //Morganas E
            if (unit.LastCastedSpellName() == "BlackShield" && (Utils.TickCount - unit.LastCastedSpellT()) < 300)
            {
                return(true);
            }

            //Nocturnes E
            if (unit.LastCastedSpellName() == "NocturneShit" && (Utils.TickCount - unit.LastCastedSpellT()) < 300)
            {
                return(true);
            }


            return(false);
        }
Ejemplo n.º 2
0
        static void OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender == null || !sender.Owner.IsMe)
            {
                return;
            }
            var antiswitch = Config.Item("antiswitchenabled").GetValue <bool>();
            var useforthis = Config.Item("Spells." + args.Slot).GetValue <bool>();
            var target     = args.Target as Obj_AI_Hero;
            var mindelay   = Config.Item("mindelay").GetValue <Slider>().Value;

            if (antiswitch && target != null)
            {
                if (target != Player.LastCastedSpellTarget() && Utils.TickCount - Player.LastCastedSpellT() <= mindelay)
                {
                    args.Process = false;
                    return;
                }
            }

            var humanizerenabled = Config.Item("humanizerenabled").GetValue <bool>();
            var delayforthis     = Config.Item(args.Slot + "delay").GetValue <Slider>().Value;

            if (humanizerenabled && useforthis)
            {
                if (Utils.TickCount - Player.LastCastedSpellT() <= delayforthis)
                {
                    args.Process = false;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets a value indicating whether the target has protection or not.
 /// </summary>
 /// <value>
 /// <c>true</c> if the has no protection.; otherwise, <c>false</c>.
 /// </value> 
 public static bool IsSpellShielded(Obj_AI_Hero unit)
 =>
     unit.HasBuffOfType(BuffType.SpellShield) ||
     unit.HasBuffOfType(BuffType.SpellImmunity) ||
     Utils.TickCount - unit.LastCastedSpellT() < 300 &&
     (
         unit.LastCastedSpellName().Equals("SivirE") ||
         unit.LastCastedSpellName().Equals("BlackShield") ||
         unit.LastCastedSpellName().Equals("NocturneShit")
     );
Ejemplo n.º 4
0
 /// <summary>
 /// Gets a value indicating whether the target has protection or not.
 /// </summary>
 /// <value>
 /// <c>true</c> if the has no protection.; otherwise, <c>false</c>.
 /// </value>
 public static bool IsSpellShielded(Obj_AI_Hero unit)
 =>
 unit.HasBuffOfType(BuffType.SpellShield) ||
 unit.HasBuffOfType(BuffType.SpellImmunity) ||
 Utils.TickCount - unit.LastCastedSpellT() < 300 &&
 (
     unit.LastCastedSpellName().Equals("SivirE") ||
     unit.LastCastedSpellName().Equals("BlackShield") ||
     unit.LastCastedSpellName().Equals("NocturneShit")
 );
Ejemplo n.º 5
0
 public static bool IsChannelingImportantSpell(this Obj_AI_Hero unit)
 {
     return
         (Spells.Where(spell => spell.ChampionName == unit.ChampionName)
          .Any(
              spell =>
              (unit.LastCastedspell() != null &&
               unit.LastCastedspell().Name.ToLower() == spell.SpellName.ToLower() &&
               Environment.TickCount - unit.LastCastedSpellT() < 350 + spell.ExtraDuration) ||
              (spell.BuffName != null && unit.HasBuff(spell.BuffName, true)) ||
              (ObjectManager.Player.NetworkId == unit.NetworkId &&
               LastCastedSpell.LastCastPacketSent != null &&
               LastCastedSpell.LastCastPacketSent.Slot == spell.Slot &&
               Environment.TickCount - LastCastedSpell.LastCastPacketSent.Tick < 150 + Game.Ping)));
 }
Ejemplo n.º 6
0
 public static bool IsChannelingImportantSpell(this Obj_AI_Hero unit)
 {
     return
         (Spells.Any(
              spell =>
              spell.ChampionName == unit.ChampionName &&
              ((unit.LastCastedspell() != null &&
                String.Equals(
                    unit.LastCastedspell().Name, spell.SpellName, StringComparison.CurrentCultureIgnoreCase) &&
                Environment.TickCount - unit.LastCastedSpellT() < 350 + spell.ExtraDuration) ||
               (spell.BuffName != null && unit.HasBuff(spell.BuffName, true)) ||
               (unit.IsMe &&
                LastCastedSpell.LastCastPacketSent != null &&
                LastCastedSpell.LastCastPacketSent.Slot == spell.Slot &&
                Environment.TickCount - LastCastedSpell.LastCastPacketSent.Tick < 150 + Game.Ping))));
 }
Ejemplo n.º 7
0
        private static bool IsSpellShielded(Obj_AI_Hero unit)
        {
            if (ObjectManager.Player.HasBuffOfType(BuffType.SpellShield))
            {
                return true;
            }

            if (ObjectManager.Player.HasBuffOfType(BuffType.SpellImmunity))
            {
                return true;
            }

            //Sivir E
            if (unit.LastCastedSpellName() == "SivirE" && (Environment.TickCount - unit.LastCastedSpellT()) < 300)
            {
                return true;
            }

            //Morganas E
            if (unit.LastCastedSpellName() == "BlackShield" && (Environment.TickCount - unit.LastCastedSpellT()) < 300)
            {
                return true;
            }

            //Nocturnes E
            if (unit.LastCastedSpellName() == "NocturneShit" && (Environment.TickCount - unit.LastCastedSpellT()) < 300)
            {
                return true;
            }


            return false;
        }