public static bool CheckNoDamageBuffs(Obj_AI_Hero target)
        {
            foreach (var b in target.Buffs.Where(b => b.IsValidBuff()))
                switch (b.DisplayName)
                {
                    case "Chrono Shift":
                        return true;

                    case "JudicatorIntervention":
                        return true;

                    case "Undying Rage":
                        if (target.ChampionName=="Tryndamere")
                            return true;

                        continue;

                    //Spell Shields
                    case "bansheesveil":
                        return true;

                    case "SivirE":
                        return true;

                    case "NocturneW":
                        return true;

                    case "kindredrnodeathbuff":
                        return true;
                }

            return target.HasBuffOfType(BuffType.Invulnerability)||target.HasBuffOfType(BuffType.SpellImmunity);
            // || target.HasBuffOfType(BuffType.SpellShield));
        }
Example #2
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")
     );
Example #3
0
 public bool HasSpellShield(Obj_AI_Hero target)
 {
     if (target.Buffs.Any(b => b.IsValid 
     && (b.DisplayName == "bansheesveil" 
     || b.DisplayName == "SivirE"
     || b.DisplayName == "NocturneW")))
     {
         return true;
     }
  
     return target.HasBuffOfType(BuffType.SpellShield) || target.HasBuffOfType(BuffType.SpellImmunity);
 }
Example #4
0
 /// <summary>
 /// Defines whether the player should use cleanse.
 /// </summary>
 public static bool ShouldUseCleanse(Obj_AI_Hero target)
 =>
     !ObjectManager.Player.IsInvulnerable &&
     !IsSpellShielded(ObjectManager.Player) &&
     (
         Bools.IsValidStun() ||
         Bools.IsValidSnare() ||
         target.HasBuff("summonerdot") ||
         target.HasBuff("summonerexhaust") ||
         target.HasBuffOfType(BuffType.Flee) ||
         target.HasBuffOfType(BuffType.Charm) ||
         target.HasBuffOfType(BuffType.Taunt) ||
         target.HasBuffOfType(BuffType.Polymorph)
     );
Example #5
0
 public static bool CanMove(Obj_AI_Hero target)
 {
     return !(target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) || target.HasBuffOfType(BuffType.Knockup) ||
         target.HasBuffOfType(BuffType.Charm) || target.HasBuffOfType(BuffType.Fear) || target.HasBuffOfType(BuffType.Knockback) ||
         target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Suppression) ||
         target.IsStunned || target.IsChannelingImportantSpell());
 }
Example #6
0
 /// <summary>
 /// Judge Target MoveMent Status (This Part From SebbyLib)
 /// </summary>
 /// <param name="Target">Target</param>
 /// <returns></returns>
 public static bool CanMove(Obj_AI_Hero Target)
 {
     if (Target.MoveSpeed < 50 || Target.IsStunned || Target.HasBuffOfType(BuffType.Stun) ||
         Target.HasBuffOfType(BuffType.Fear) || Target.HasBuffOfType(BuffType.Snare) ||
         Target.HasBuffOfType(BuffType.Knockup) || Target.HasBuff("Recall") ||
         Target.HasBuffOfType(BuffType.Knockback) || Target.HasBuffOfType(BuffType.Charm) ||
         Target.HasBuffOfType(BuffType.Taunt) || Target.HasBuffOfType(BuffType.Suppression)
         || (Target.IsCastingInterruptableSpell() && !Target.IsMoving))
     {
         return false;
     }
     else
         return true;
 }
Example #7
0
 /// <summary>
 ///     Gets a value indicating whether BuffType is worth cleansing.
 /// </summary>
 public static bool ShouldCleanse(Obj_AI_Hero target)
     =>
         ObjectManager.Get<Obj_AI_Hero>().Any(t => t.IsEnemy && t.IsValidTarget(1500f))
         && !TargetSelector.IsInvulnerable(ObjectManager.Player, TargetSelector.DamageType.Magical, false)
         && (target.HasBuffOfType(BuffType.Flee) || target.HasBuffOfType(BuffType.Charm)
             || target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Knockup)
             || target.HasBuffOfType(BuffType.Knockback) || target.HasBuffOfType(BuffType.Polymorph)
             || target.HasBuffOfType(BuffType.Suppression) || target.HasBuffOfType(BuffType.Stun));
Example #8
0
 private void OnInterruptableTarget(Obj_AI_Hero target, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (E.CanCast(target) && config.Item("useEint", true).GetValue<bool>())
     {
         if (E.CastIfHitchanceEquals(target, HitChance.High, config.Item("packets").GetValue<bool>()))
         {
             return;
         }
     }
     if (R.CanCast(target) && config.Item("useRint", true).GetValue<bool>())
     {
         if (savedQ != null && !SimpleQ && !target.IsMoving && target.Distance(qPos) > QExplosionRange &&
             target.Distance(player) < R.Range - 100 &&
             target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2 &&
             !target.HasBuffOfType(BuffType.Knockback))
         {
             var cast = Prediction.GetPrediction(target, 1000f).UnitPosition.Extend(savedQ.position, -100);
             R.Cast(cast);
         }
         else if (target.Distance(player) < R.Range - 100)
         {
             if (player.CountEnemiesInRange(2000) <= player.CountAlliesInRange(2000))
             {
                 var cast = target.Position.Extend(player.Position, -100);
                 R.Cast(cast);
             }
             else
             {
                 var cast = target.Position.Extend(player.Position, 100);
                 R.Cast(cast);
             }
         }
     }
 }
Example #9
0
        public void CastSkillshot(Obj_AI_Hero t, Spell s, HitChance hc = HitChance.High)
        {
            if (!s.IsSkillshot)
                return;

            PredictionOutput p = s.GetPrediction(t);

            if (s.Collision)
            {
                for (int i = 0; i < p.CollisionObjects.Count; i++)
                    if (!p.CollisionObjects[i].IsDead && (p.CollisionObjects[i].IsEnemy || p.CollisionObjects[i].IsMinion))
                        return;
            }

            if ((t.HasBuffOfType(BuffType.Slow) && p.Hitchance >= HitChance.High) || p.Hitchance == HitChance.Immobile)
                s.Cast(p.CastPosition);
            else if (t.IsRecalling())
                s.Cast(t.ServerPosition);
            else
            {
                if (s.IsReady())
                {
                    s.SPredictionCast(t, hc);
                }
            }
        }
 public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
 {
     try
     {
         if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
         {
             return true;
         }
         foreach (var invulnerable in Items)
         {
             if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
             {
                 if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
                 {
                     if (!ignoreShields && invulnerable.IsShield && target.HasBuff(invulnerable.BuffName))
                     {
                         return true;
                     }
                     if (invulnerable.CustomCheck != null && CustomCheck(invulnerable, target, damageType))
                     {
                         return true;
                     }
                 }
             }
         }
         return false;
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return false;
 }
 public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
 {
     if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
     {
         return true;
     }
     foreach (var invulnerable in Items)
     {
         if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
         {
             if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
             {
                 if (!ignoreShields && invulnerable.IsShield && target.HasBuff(invulnerable.BuffName))
                 {
                     return true;
                 }
                 if (invulnerable.CustomCheck != null)
                 {
                     return CustomCheck(invulnerable, target, damageType);
                 }
             }
         }
     }
     return false;
 }
Example #12
0
        // From Asuna
        public static bool CheckNoDamageBuffs(Obj_AI_Hero target)
        {
            foreach (var b in target.Buffs.Where(b => b.IsValidBuff()))
            {
                switch (b.DisplayName)
                {
                    case "Chrono Shift":
                        return true;

                    case "JudicatorIntervention":
                        return true;

                    case "Undying Rage":
                        if (target.ChampionName == "Tryndamere")
                            return true;
                        continue;

                    //Spell Shields
                    case "bansheesveil":
                        return true;

                    case "SivirE":
                        return true;

                    case "NocturneW":
                        return true;
                }
            }
            if (target.ChampionName == "Poppy" && HeroManager.Allies.Any(
                o =>
                {
                    return !o.IsMe
                           && o.Buffs.Any(
                               b =>
                                   b.Caster.NetworkId == target.NetworkId && b.IsValidBuff()
                                   && b.DisplayName == "PoppyDITarget");
                }))
            {
                return true;
            }

            return (target.HasBuffOfType(BuffType.Invulnerability)
                    || target.HasBuffOfType(BuffType.SpellImmunity));
            // || target.HasBuffOfType(BuffType.SpellShield));
        }
Example #13
0
 public bool Immobilized(Obj_AI_Hero target)
 {
     return target.HasBuffOfType(BuffType.Stun)
            || target.HasBuffOfType(BuffType.Snare)
            || target.HasBuffOfType(BuffType.Knockup)
            || target.HasBuffOfType(BuffType.Knockback)
            || target.HasBuffOfType(BuffType.Charm)
            || target.HasBuffOfType(BuffType.Fear)
            || target.HasBuffOfType(BuffType.Taunt)
            || target.HasBuffOfType(BuffType.Suppression);
 }
Example #14
0
 public static bool immobileTarget(Obj_AI_Hero target)
 {
     if (target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) || target.HasBuffOfType(BuffType.Knockup) ||
         target.HasBuffOfType(BuffType.Charm) || target.HasBuffOfType(BuffType.Fear) || target.HasBuffOfType(BuffType.Knockback) ||
         target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Suppression) ||
         target.IsStunned)
     {
         return true;
     }
     else
         return false;
 }
Example #15
0
 public static bool CanMove(Obj_AI_Hero target)
 {
     if (target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) || target.HasBuffOfType(BuffType.Knockup) ||
         target.HasBuffOfType(BuffType.Charm) || target.HasBuffOfType(BuffType.Fear) || target.HasBuffOfType(BuffType.Knockback) ||
         target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Suppression) ||
         target.IsStunned || (target.IsChannelingImportantSpell() && !target.IsMoving) || target.MoveSpeed < 50 || Prediction.GetPrediction(target,0.5f).Hitchance > HitChance.Dashing)
     {
         return false;
     }
     else
         return true;
 }
Example #16
0
 /// <summary>
 /// Gets a value indicating whether a determined champion can move or not.
 /// </summary>
 /// <value>
 /// <c>true</c> if the target can't move.; otherwise, <c>false</c>.
 /// </value>
 public static bool IsImmobile(Obj_AI_Hero target)
 => 
     target.HasBuffOfType(BuffType.Stun) ||
     target.HasBuffOfType(BuffType.Flee) ||
     target.HasBuffOfType(BuffType.Snare) ||
     target.HasBuffOfType(BuffType.Taunt) ||
     target.HasBuffOfType(BuffType.Charm) ||
     target.HasBuffOfType(BuffType.Knockup) ||
     target.HasBuffOfType(BuffType.Suppression);
Example #17
0
 public static bool CanMove(Obj_AI_Hero target)
 {
     if (target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) || target.HasBuffOfType(BuffType.Knockup) ||
         target.HasBuffOfType(BuffType.Charm) || target.HasBuffOfType(BuffType.Fear) || target.HasBuffOfType(BuffType.Knockback) ||
         target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Suppression) ||
         target.IsStunned || target.IsChannelingImportantSpell())
     {
         Program.debug("!canMov" + target.ChampionName);
         return false;
     }
     else
         return true;
 }
Example #18
0
        public static bool Condemn360(Obj_AI_Hero unit, int push, Vector2 pos = new Vector2())
        {
            if (unit.HasBuffOfType(BuffType.SpellImmunity) || unit.HasBuffOfType(BuffType.SpellShield) ||
                _lastCheck + 50 > Environment.TickCount || ObjectManager.Player.IsDashing())
            {
                return false;
            }

            var prediction = E.GetPrediction(unit);
            var predictionsList = pos.IsValid() ? new List<Vector3>() { pos.ToVector3() } : new List<Vector3>
                        {
                            unit.ServerPosition,
                            unit.Position,
                            prediction.CastPosition,
                            prediction.UnitPosition
                        };

            var wallsFound = 0;
            _points = new List<Vector2>();
            foreach (var position in predictionsList)
            {
                for (var i = 0; i < push; i += (int)unit.BoundingRadius) // 420 = push distance
                {
                    var cPos = ObjectManager.Player.Position.Extend(position, ObjectManager.Player.Distance(position) + i).ToVector2();
                    _points.Add(cPos);
                    if (NavMesh.GetCollisionFlags(cPos.ToVector3()).HasFlag(CollisionFlags.Wall) || NavMesh.GetCollisionFlags(cPos.ToVector3()).HasFlag(CollisionFlags.Building))
                    {
                        wallsFound++;
                        break;
                    }
                }
            }

            // ReSharper disable once PossibleLossOfFraction
            if ((wallsFound / predictionsList.Count) >= 33 / 100f)
            {
                return true;
            }

            return false;
        }
Example #19
0
 public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
 {
     return target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable ||
            (from invulnerable in Items
                where invulnerable.Champion == null || invulnerable.Champion == target.ChampionName
                where invulnerable.DamageType == null || invulnerable.DamageType == damageType
                where target.HasBuff(invulnerable.BuffName)
                where !ignoreShields || !invulnerable.IsShield
                select invulnerable).Any(
                    invulnerable =>
                        invulnerable.CheckFunction == null || CheckFunction(invulnerable, target, damageType));
 }
Example #20
0
        public bool Unkillable(Obj_AI_Hero target)
        {
            if (target.Buffs.Any(b => b.IsValid 
            && (b.DisplayName == "UndyingRage" 
            || b.DisplayName == "ChronoShift"
            || b.DisplayName == "JudicatorIntervention" 
            || b.DisplayName == "kindredrnodeathbuff")))
            {
                return true;
            }

            return target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable;
        }
Example #21
0
 /// <summary>
 /// Enemy Immobile
 /// </summary>
 /// <param name="target"></param>
 /// <returns></returns>
 public static bool IsEnemyImmobile(Obj_AI_Hero target)
 {
     if (target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) ||
         target.HasBuffOfType(BuffType.Knockup) ||
         target.HasBuffOfType(BuffType.Charm) || target.HasBuffOfType(BuffType.Fear) ||
         target.HasBuffOfType(BuffType.Knockback) ||
         target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Suppression) ||
         target.IsStunned || target.IsChannelingImportantSpell())
     {
         return true;
     }
     else
     {
         return false;
     }
         
 }
Example #22
0
        public static void Condemn360(Obj_AI_Hero hero, Vector2 pos = new Vector2())
        {
            if (hero.HasBuffOfType(BuffType.SpellImmunity) || hero.HasBuffOfType(BuffType.SpellShield) ||
                LastCheck + 50 > Environment.TickCount || ObjectManager.Player.IsDashing())
            {
                return;
            }
            var prediction = VayneSpells.E.GetPrediction(hero);
            var predictionsList = pos.IsValid() ? new List<Vector3>() { pos.To3D() } : new List<Vector3>
                        {
                            hero.ServerPosition,
                            hero.Position,
                            prediction.CastPosition,
                            prediction.UnitPosition
                        };

            var wallsFound = 0;
            Points = new List<Vector2>();
            foreach (var position in predictionsList)
            {
                for (var i = 0; i < PushDistance; i += (int)hero.BoundingRadius) // 420 = push distance
                {
                    var cPos = ObjectManager.Player.Position.Extend(position, ObjectManager.Player.Distance(position) + i).To2D();
                    Points.Add(cPos);
                    if (NavMesh.GetCollisionFlags(cPos.To3D()).HasFlag(CollisionFlags.Wall) || NavMesh.GetCollisionFlags(cPos.To3D()).HasFlag(CollisionFlags.Building))
                    {
                        wallsFound++;
                        break;
                    }
                }
            }
            if ((wallsFound / predictionsList.Count) >= 33 / 100f)
            {
                VayneSpells.E.Cast(hero);
            }
        }
Example #23
0
 public static bool ShouldUseCleanse(Obj_AI_Hero target)
 {
     return target.HasBuffOfType(BuffType.Charm)
         || target.HasBuffOfType(BuffType.Flee)
         || target.HasBuffOfType(BuffType.Polymorph)
         || target.HasBuffOfType(BuffType.Snare)
         || target.HasBuffOfType(BuffType.Stun)
         || target.HasBuffOfType(BuffType.Taunt)
         || target.HasBuff("summonerexhaust")
         || target.HasBuff("summonerdot");
 }
Example #24
0
 public static bool CanMove(Obj_AI_Hero target)
 {
     if(target.MoveSpeed < 50)
         return false;
     else if (!Player.CanMove || target.IsStunned || target.HasBuffOfType(BuffType.Stun) || target.HasBuffOfType(BuffType.Snare) || target.HasBuffOfType(BuffType.Knockup) ||
         target.HasBuffOfType(BuffType.Knockback) || target.HasBuffOfType(BuffType.Taunt) || target.HasBuffOfType(BuffType.Suppression) || target.IsChannelingImportantSpell())
     {
         return false;
     }
     else
         return true;
 }
Example #25
0
 public static bool HasBuffsofCC(Obj_AI_Hero Hero)
 {
     if (Hero.HasBuffOfType(BuffType.Flee))
         return true;
     if (Hero.HasBuffOfType(BuffType.Charm))
         return true;
     if (Hero.HasBuffOfType(BuffType.Polymorph))
         return true;
     if (Hero.HasBuffOfType(BuffType.Snare))
         return true;
     if (Hero.HasBuffOfType(BuffType.Stun))
         return true;
     if (Hero.HasBuffOfType(BuffType.Taunt))
         return true;
     if (Hero.HasBuffOfType(BuffType.Suppression))
         return true;            
     return false;
 }
Example #26
0
 // ReSharper restore StringLiteralTypo
 public static bool HasBuff(Obj_AI_Hero target,
     LeagueSharp.Common.TargetSelector.DamageType damageType = LeagueSharp.Common.TargetSelector.DamageType.True,
     bool ignoreShields = true)
 {
     try
     {
         return target.HasBuffOfType(BuffType.Invulnerability) ||
                Invulnerables.Any(
                    i =>
                        (i.Champion == null || i.Champion == target.ChampionName) &&
                        (!ignoreShields || !i.IsShield) && (i.DamageType == null || i.DamageType == damageType) &&
                        target.HasBuff(i.BuffName) &&
                        (i.CustomCheck == null || i.CustomCheck(target, damageType)));
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return false;
 }
Example #27
0
        private static void CastSpell(Spell QWER, Obj_AI_Hero target, int HitChanceNum)
        {
            //HitChance 0 - 2
            // example CastSpell(Q, ts, 2);
            if (HitChanceNum == 0)
                QWER.Cast(target, true);
            else if (HitChanceNum == 1)
                QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh, true);
            else if (HitChanceNum == 2)
            {
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);
                if (target.Path.Count() < 2)
                    QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh, true);
            }
            else if (HitChanceNum == 3)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                //debug("" + target.Path.Count() + " " + (target.Position == target.ServerPosition) + (waypoints.Last<Vector2>().To3D() == target.ServerPosition));
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);

                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
            else if (HitChanceNum == 4 && (int)QWER.GetPrediction(target).Hitchance > 4)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                //debug("" + target.Path.Count() + " " + (target.Position == target.ServerPosition) + (waypoints.Last<Vector2>().To3D() == target.ServerPosition));
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);

                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
        }
Example #28
0
        private void handleWEnemyHero(Obj_AI_Hero target)
        {
            if (target.GetBuffCount("TahmKenchPDebuffCounter") == 3 && !CombatHelper.CheckCriticalBuffs(target) &&
                !target.HasBuffOfType(BuffType.Stun) && !target.HasBuffOfType(BuffType.Snare) && !Q.CanCast(target) &&
                !justQ)
            {
                orbwalker.SetMovement(false);
                if (Orbwalking.CanMove(100) && Game.CursorPos.Distance(target.Position) < 300)
                {
                    player.IssueOrder(GameObjectOrder.MoveTo, target.Position.Extend(player.Position, 100));
                }

                lastWtarget = Team.Enemy;
                W.CastOnUnit(target, true);
            }
        }
Example #29
0
        private static bool Cleanse(Obj_AI_Hero hero)
        {
            var cc = false;
            if (_config.Item("blind").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Blind))
                {
                    cc = true;
                }
            }

            if (_config.Item("charm").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Charm))
                {
                    cc = true;
                }
            }

            if (_config.Item("fear").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Fear))
                {
                    cc = true;
                }
            }

            if (_config.Item("flee").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Flee))
                {
                    cc = true;
                }
            }

            if (_config.Item("snare").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Snare))
                {
                    cc = true;
                }
            }

            if (_config.Item("taunt").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Taunt))
                {
                    cc = true;
                }
            }

            if (_config.Item("suppression").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Suppression))
                {
                    cc = true;
                }
            }

            if (_config.Item("stun").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Stun))
                {
                    cc = true;
                }
            }

            if (_config.Item("polymorph").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Polymorph))
                {
                    cc = true;
                }
            }

            if (_config.Item("silence").GetValue<bool>())
            {
                if (hero.HasBuffOfType(BuffType.Silence))
                {
                    cc = true;
                }
            }

            if (_config.Item("zedultexecute").GetValue<bool>())
            {
                if (_player.HasBuff("zedulttargetmark"))
                {
                    cc = true;
                }
            }

            return cc;
        }
Example #30
0
 public static bool Check(Obj_AI_Hero target,
     float damage,
     DamageType damageType = DamageType.True,
     bool ignoreShields = true)
 {
     if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
     {
         return true;
     }
     foreach (var invulnerable in Items)
     {
         if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
         {
             if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
             {
                 if (target.HasBuff(invulnerable.BuffName))
                 {
                     if (!ignoreShields || !invulnerable.IsShield)
                     {
                         if (invulnerable.CheckFunction == null ||
                             CheckFunction(invulnerable, target, damageType))
                         {
                             if (invulnerable.MinHealthPercent > 0 &&
                                 (target.Health - damage) / target.MaxHealth * 100 <
                                 invulnerable.MinHealthPercent)
                             {
                                 return true;
                             }
                             return true;
                         }
                     }
                 }
             }
         }
     }
     return false;
 }