Пример #1
0
        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));
        }
Пример #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")
     );
Пример #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);
 }
Пример #4
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());
 }
Пример #5
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)
     );
Пример #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;
 }
Пример #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));
 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;
 }
Пример #9
0
 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;
 }
Пример #10
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);
             }
         }
     }
 }
Пример #11
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);
                }
            }
        }
Пример #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));
        }
Пример #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);
 }
Пример #14
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;
 }
Пример #15
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;
 }
Пример #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);
Пример #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;
 }
Пример #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;
        }
Пример #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));
 }
Пример #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;
        }
Пример #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;
     }
         
 }
Пример #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);
            }
        }
Пример #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");
 }
Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #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);
                    }
                }
            }
        }
Пример #28
0
        static void Orbwalking_BeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                if ((Player.Mana < E.Instance.ManaCost) || (E.Instance.Level == 0) || ((E.Instance.CooldownExpires - Game.ClockTime) > 0.7) || Player.HasBuffOfType(BuffType.Silence))
                {
                    args.Process = true;
                    aastatus     = true;
                }
                else
                {
                    args.Process = false;
                    aastatus     = false;
                }
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                var LaneClearMana = Option.Item("LaneClearMana").GetValue <Slider>().Value;
                if ((Player.ManaPercentage() < LaneClearMana) || (E.Instance.Level == 0) || ((E.Instance.CooldownExpires - Game.ClockTime) > 0.7) || Nopsntarget || Player.HasBuffOfType(BuffType.Silence))
                {
                    args.Process = true;
                    aastatus     = true;
                }
                else
                {
                    args.Process = false;
                    aastatus     = false;
                }
            }
        }
Пример #29
0
        private static void UseSpell(string sdataname, string menuvar, float range = float.MaxValue, bool usemana = true)
        {
            if (!menuvar.Contains(OC.ChampionName.ToLower()))
            {
                return;
            }

            var slot = Me.GetSpellSlot(sdataname);

            if (slot != SpellSlot.Unknown && !_mainMenu.Item("use" + menuvar).GetValue <bool>())
            {
                return;
            }

            var spell  = new Spell(slot, range);
            var target = range < 5000 ? OC.Friendly() : Me;

            if (target.Distance(Me.ServerPosition, true) > range * range)
            {
                return;
            }

            if (!spell.IsReady() || !_menuConfig.Item("ason" + target.SkinName).GetValue <bool>() ||
                Me.IsRecalling() || Me.InFountain() || !target.IsValidState())
            {
                return;
            }

            var manaPercent    = (int)(Me.Mana / Me.MaxMana * 100);
            var mHealthPercent = (int)(Me.Health / Me.MaxHealth * 100);
            var aHealthPercent = (int)((target.Health / target.MaxHealth) * 100);
            var iDamagePercent = (int)((OC.IncomeDamage / target.MaxHealth) * 100);

            if (menuvar.Contains("slow") && Me.HasBuffOfType(BuffType.Slow))
            {
                spell.Cast();
                OC.Logger(Program.LogType.Action, "(Auto Spell: Slow) Im slowed, casting " + spell.Slot);
            }

            if (menuvar.Contains("slow"))
            {
                return;
            }

            if (menuvar.Contains("shield") || menuvar.Contains("ult"))
            {
                if (aHealthPercent > _mainMenu.Item("use" + menuvar + "Pct").GetValue <Slider>().Value)
                {
                    return;
                }

                if (usemana && manaPercent <= _mainMenu.Item("use" + menuvar + "Mana").GetValue <Slider>().Value)
                {
                    return;
                }

                if (iDamagePercent >= 1 || OC.IncomeDamage >= target.Health)
                {
                    if (OC.AggroTarget.NetworkId == target.NetworkId)
                    {
                        switch (menuvar)
                        {
                        case "rivenshield":
                            spell.Cast(Game.CursorPos);
                            OC.Logger(OC.LogType.Action,
                                      "(Auto Spell: Shield/Ult) Casting " + spell.Slot + " to game cursor! (Low HP)");
                            OC.Logger(OC.LogType.Action, "Target HP %: " + aHealthPercent);
                            break;

                        case "luxshield":
                            spell.Cast(target.IsMe ? Game.CursorPos : target.ServerPosition);
                            break;

                        default:
                            spell.CastOnUnit(target);
                            OC.Logger(OC.LogType.Action,
                                      "(Auto Spell: Shield/Ult) Casting " + spell.Slot + " on " + target.SkinName + " (Low HP)");
                            OC.Logger(OC.LogType.Action, "Target HP %: " + aHealthPercent);
                            break;
                        }
                    }
                }
            }

            else if (menuvar.Contains("heal"))
            {
                if (aHealthPercent > _mainMenu.Item("use" + menuvar + "Pct").GetValue <Slider>().Value)
                {
                    return;
                }

                if (menuvar.Contains("soraka"))
                {
                    if (mHealthPercent <= _mainMenu.Item("useSorakaMana").GetValue <Slider>().Value || target.IsMe)
                    {
                        return;
                    }
                }

                if (usemana && manaPercent <= _mainMenu.Item("use" + menuvar + "Mana").GetValue <Slider>().Value)
                {
                    return;
                }

                if (OC.ChampionName == "Sona")
                {
                    spell.Cast();
                }
                else
                {
                    spell.Cast(target);
                    OC.Logger(OC.LogType.Action, "(Auto Spell: Heal) Casting " + spell.Slot + " on " + target.SkinName + " (Low HP)");
                    OC.Logger(OC.LogType.Action, "Target HP %: " + aHealthPercent);
                }
            }

            if (!menuvar.Contains("zhonya"))
            {
                if (iDamagePercent >= _mainMenu.Item("use" + menuvar + "Dmg").GetValue <Slider>().Value)
                {
                    spell.Cast(target);
                    OC.Logger(OC.LogType.Action, "(SS) Casting " + spell.Slot + " on " + target.SkinName + " (Damage Chunk)");
                    OC.Logger(OC.LogType.Action, "Target HP %: " + aHealthPercent);
                }
            }
        }
Пример #30
0
 private bool IsInvulnerable(Obj_AI_Hero target)
 {
     return(target.HasBuffOfType(BuffType.SpellShield) || target.HasBuffOfType(BuffType.SpellImmunity));
 }
Пример #31
0
        private static void UseSpells(bool useQ, bool useW, bool useE, bool useR, string Source)
        {
            var         range         = Q.Range;
            var         focusSelected = menu.Item("selected").GetValue <bool>();
            Obj_AI_Hero eTarget       = SimpleTs.GetTarget(range, SimpleTs.DamageType.Magical);

            if (SimpleTs.GetSelectedTarget() != null)
            {
                if (focusSelected && SimpleTs.GetSelectedTarget().Distance(Player.ServerPosition) < range)
                {
                    eTarget = SimpleTs.GetSelectedTarget();
                }
            }

            Obj_AI_Hero rETarget = SimpleTs.GetTarget(E.Range, SimpleTs.DamageType.Magical);

            int IgniteMode = menu.Item("igniteMode").GetValue <StringList>().SelectedIndex;

            var hitC       = HitChance.High;
            int qHit       = menu.Item("qHit").GetValue <Slider>().Value;
            int harassQHit = menu.Item("qHit2").GetValue <Slider>().Value;
            var dmg        = GetComboDamage(eTarget);

            // HitChance.Low = 3, Medium , High .... etc..
            if (Source == "Combo")
            {
                switch (qHit)
                {
                case 1:
                    hitC = HitChance.Low;
                    break;

                case 2:
                    hitC = HitChance.Medium;
                    break;

                case 3:
                    hitC = HitChance.High;
                    break;

                case 4:
                    hitC = HitChance.VeryHigh;
                    break;
                }
            }
            else if (Source == "Harass")
            {
                switch (harassQHit)
                {
                case 1:
                    hitC = HitChance.Low;
                    break;

                case 2:
                    hitC = HitChance.Medium;
                    break;

                case 3:
                    hitC = HitChance.High;
                    break;

                case 4:
                    hitC = HitChance.VeryHigh;
                    break;
                }
            }

            //DFG
            if (eTarget != null && dmg > eTarget.Health - 300 && DFG.IsReady() && Source == "Combo" && Player.Distance(eTarget) <= 750 &&
                (eTarget.HasBuffOfType(BuffType.Charm) || !menu.Item("dfgCharm").GetValue <bool>()))
            {
                //Game.PrintChat("TRying!!!");
                DFG.Cast(eTarget);
            }

            //E
            if (useE && eTarget != null && E.IsReady() && Player.Distance(eTarget) < E.Range &&
                E.GetPrediction(eTarget).Hitchance >= hitC)
            {
                E.Cast(eTarget, packets());
                if (menu.Item("EQ").GetValue <bool>() && Q.IsReady())
                {
                    Q.Cast(eTarget, packets());
                }
                return;
            }

            //Ignite
            if (eTarget != null && menu.Item("ignite").GetValue <bool>() && IgniteSlot != SpellSlot.Unknown && !E.IsReady() &&
                Player.SummonerSpellbook.CanUseSpell(IgniteSlot) == SpellState.Ready && Source == "Combo")
            {
                if (IgniteMode == 0 && GetComboDamage(eTarget) > eTarget.Health)
                {
                    Player.SummonerSpellbook.CastSpell(IgniteSlot, eTarget);
                }
            }

            //W
            if (useW && eTarget != null && W.IsReady() && Player.Distance(eTarget) <= W.Range &&
                shouldW(eTarget, Source))
            {
                W.Cast();
            }
            if (Source == "Harass" && menu.Item("longQ").GetValue <bool>())
            {
                if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range && eTarget != null &&
                    shouldQ(eTarget, Source) && Player.Distance(eTarget) > 600)
                {
                    if (Q.GetPrediction(eTarget).Hitchance >= hitC)
                    {
                        Q.Cast(eTarget, packets(), true);
                        return;
                    }
                }
            }
            else if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range && eTarget != null &&
                     shouldQ(eTarget, Source))
            {
                if (Q.GetPrediction(eTarget).Hitchance >= hitC)
                {
                    Q.Cast(eTarget, packets(), true);
                    return;
                }
            }

            //R
            if (useR && eTarget != null && R.IsReady() && Player.Distance(eTarget) < R.Range)
            {
                if (E.IsReady())
                {
                    if (checkREQ(rETarget))
                    {
                        E.Cast(rETarget, packets());
                    }
                }
                if (shouldR(eTarget) && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    rTimer = Environment.TickCount - 250;
                }
                if (rTimeLeft > 9500 && rOn && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    rTimer = Environment.TickCount - 250;
                }
            }
        }
Пример #32
0
 private static void RemoveCC()
 {
     if (MenuManager.W["wEnable"].Enabled && SpellManager.W.Ready)
     {
         if (Player.HasBuffOfType(BuffType.Blind) && MenuManager.CCTypes["blind"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Charm) && MenuManager.CCTypes["charm"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Fear) && MenuManager.CCTypes["fear"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Flee) && MenuManager.CCTypes["flee"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Polymorph) && MenuManager.CCTypes["polymorph"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Silence) && MenuManager.CCTypes["silence"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Slow) && MenuManager.CCTypes["slow"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Snare) && MenuManager.CCTypes["snare"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Stun) && MenuManager.CCTypes["stun"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Suppression) && MenuManager.CCTypes["suppression"].Enabled)
         {
             SpellManager.W.Cast();
         }
         else if (Player.HasBuffOfType(BuffType.Taunt) && MenuManager.CCTypes["taunt"].Enabled)
         {
             SpellManager.W.Cast();
         }
     }
 }
Пример #33
0
 public static bool IsValidState(this Obj_AI_Hero target)
 {
     return(!target.HasBuffOfType(BuffType.SpellShield) && !target.HasBuffOfType(BuffType.SpellImmunity) &&
            !target.HasBuffOfType(BuffType.Invulnerability));
 }
Пример #34
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;
 }
Пример #35
0
        private void UseSpells(bool useQ, bool useW, bool useE, bool useR, string source)
        {
            var         range   = Q.Range;
            Obj_AI_Hero eTarget = SimpleTs.GetTarget(range, SimpleTs.DamageType.Magical);


            if (GetTargetFocus(range) != null)
            {
                eTarget = GetTargetFocus(range);
            }

            Obj_AI_Hero rETarget = SimpleTs.GetTarget(E.Range, SimpleTs.DamageType.Magical);

            int igniteMode;

            igniteMode = menu.Item("igniteMode").GetValue <StringList>().SelectedIndex;

            var hitC    = GetHitchance(source);
            var dmg     = GetComboDamage(eTarget);
            var predOff = menu.Item("Prediction_Check_Off").GetValue <bool>();

            //DFG
            if (eTarget != null && dmg > eTarget.Health - 300 && DFG.IsReady() && source == "Combo" && Player.Distance(eTarget) <= 750 &&
                (eTarget.HasBuffOfType(BuffType.Charm) || !menu.Item("dfgCharm").GetValue <bool>()))
            {
                Use_DFG(eTarget);
            }

            //E
            if (useE && eTarget != null && E.IsReady() && Player.Distance(eTarget) < E.Range)
            {
                if (E.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                {
                    E.Cast(eTarget, packets());
                    if (menu.Item("EQ").GetValue <bool>() && Q.IsReady())
                    {
                        Q.Cast(eTarget, packets());
                    }
                    return;
                }
            }

            //Ignite
            if (eTarget != null && Ignite_Ready() && !E.IsReady() && source == "Combo")
            {
                if (igniteMode == 0 && dmg > eTarget.Health)
                {
                    Use_Ignite(eTarget);
                }
            }

            //W
            if (useW && eTarget != null && W.IsReady() && Player.Distance(eTarget) <= W.Range - 100 &&
                ShouldW(eTarget, source))
            {
                W.Cast();
            }

            if (source == "Harass" && menu.Item("longQ").GetValue <bool>())
            {
                if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range && eTarget != null &&
                    ShouldQ(eTarget, source) && Player.Distance(eTarget) > 600)
                {
                    if (Q.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                    {
                        Q.Cast(eTarget, packets(), true);
                        return;
                    }
                }
            }
            else if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range && eTarget != null &&
                     ShouldQ(eTarget, source))
            {
                if (Q.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                {
                    Q.Cast(eTarget, packets(), true);
                    return;
                }
            }

            //R
            if (useR && eTarget != null && R.IsReady() && Player.Distance(eTarget) < R.Range)
            {
                if (E.IsReady())
                {
                    if (CheckReq(rETarget))
                    {
                        E.Cast(rETarget, packets());
                    }
                }
                if (ShouldR(eTarget) && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    _rTimer = Environment.TickCount - 250;
                }
                if (_rTimeLeft > 9500 && _rOn && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    _rTimer = Environment.TickCount - 250;
                }
            }
        }
Пример #36
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);
            }
        }
Пример #37
0
        public static void combo(bool useQ, bool useW, bool useE, bool useR)
        {
            var         focusSelected = menu.Item("selected").GetValue <bool>();
            Obj_AI_Hero Target        = SimpleTs.GetTarget(E.Range, SimpleTs.DamageType.Magical);

            int mode       = menu.Item("comboMode").GetValue <StringList>().SelectedIndex;
            int IgniteMode = menu.Item("igniteMode").GetValue <StringList>().SelectedIndex;

            int eDis = menu.Item("eDis").GetValue <Slider>().Value;

            if (SimpleTs.GetSelectedTarget() != null)
            {
                if (focusSelected && SimpleTs.GetSelectedTarget().Distance(Player.ServerPosition) < E.Range)
                {
                    Target = SimpleTs.GetSelectedTarget();
                }
            }

            if (!Target.HasBuffOfType(BuffType.Invulnerability) && Target.IsValidTarget(E.Range))
            {
                if (mode == 0) //qwe
                {
                    if (Target != null && DFG.IsReady() && E.IsReady() && menu.Item("dfg").GetValue <bool>())
                    {
                        DFG.Cast(Target);
                    }

                    if (useQ && Q.IsReady() && Player.Distance(Target) <= Q.Range && Target != null)
                    {
                        Q.Cast(Target, packets());
                    }

                    if (useE && Target != null && E.IsReady() && Player.Distance(Target) < E.Range &&
                        Player.Distance(Target) > eDis)
                    {
                        if (menu.Item("smartE").GetValue <bool>() &&
                            countEnemiesNearPosition(Target.ServerPosition, 500) > 2 &&
                            (!R.IsReady() || !(rSpell.State == SpellState.Surpressed && R.Level > 0)))
                        {
                            return;
                        }

                        E.Cast(Target, packets());
                    }
                }
                else if (mode == 1) //eqw
                {
                    if (Target != null && DFG.IsReady() && E.IsReady() && menu.Item("dfg").GetValue <bool>())
                    {
                        DFG.Cast(Target);
                    }

                    if (useE && Target != null && E.IsReady() && Player.Distance(Target) < E.Range &&
                        Player.Distance(Target) > eDis)
                    {
                        if (menu.Item("smartE").GetValue <bool>() &&
                            countEnemiesNearPosition(Target.ServerPosition, 500) > 2 &&
                            (!R.IsReady() || !(rSpell.State == SpellState.Surpressed && R.Level > 0)))
                        {
                            return;
                        }

                        E.Cast(Target, packets());
                    }

                    if (useQ && Q.IsReady() && Player.Distance(Target) <= Q.Range && Target != null)
                    {
                        Q.Cast(Target, packets());
                    }
                }

                //Ignite
                if (Target != null && menu.Item("ignite").GetValue <bool>() && IgniteSlot != SpellSlot.Unknown &&
                    Player.SummonerSpellbook.CanUseSpell(IgniteSlot) == SpellState.Ready)
                {
                    if (IgniteMode == 0 && GetComboDamage(Target) > Target.Health)
                    {
                        Player.SummonerSpellbook.CastSpell(IgniteSlot, Target);
                    }
                }

                if (useW && Target != null && W.IsReady() && Player.Distance(Target) <= W.Range)
                {
                    W.Cast();
                }

                if (useR && Target != null && R.IsReady() &&
                    countEnemiesNearPosition(Player.ServerPosition, R.Range) > 0)
                {
                    if (!Q.IsReady() && !E.IsReady() && !W.IsReady())
                    {
                        R.Cast();
                    }
                }
            }
        }
Пример #38
0
        private void Combo(bool useQ, bool useW, bool useE, bool useR)
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

            int mode = menu.Item("comboMode", true).GetValue <StringList>().SelectedIndex;

            int eDis = menu.Item("eDis", true).GetValue <Slider>().Value;

            if (!target.IsValidTarget(E.Range))
            {
                return;
            }

            if (!target.HasBuffOfType(BuffType.Invulnerability) && !target.IsZombie)
            {
                if (mode == 0) //qwe
                {
                    //items

                    var itemTarget = TargetSelector.GetTarget(750, TargetSelector.DamageType.Physical);
                    if (itemTarget != null && E.IsReady())
                    {
                        var dmg = GetComboDamage(itemTarget);
                        ItemManager.Target = itemTarget;

                        //see if killable
                        if (dmg > itemTarget.Health - 50)
                        {
                            ItemManager.KillableTarget = true;
                        }

                        ItemManager.UseTargetted = true;
                    }


                    if (useQ && Q.IsReady() && Player.Distance(target.Position) <= Q.Range)
                    {
                        Q.Cast(target);
                    }

                    if (useE && E.IsReady() && Player.Distance(target.Position) < E.Range && Utils.TickCount - E.LastCastAttemptT > 0 &&
                        Player.Distance(target.Position) > eDis && !Q.IsReady())
                    {
                        if (menu.Item("smartE", true).GetValue <bool>() &&
                            Player.CountEnemiesInRange(500) > 2 &&
                            (!R.IsReady() || !(RSpell.State == SpellState.Surpressed && R.Level > 0)))
                        {
                            return;
                        }

                        var delay = menu.Item("E_Delay_Slider", true).GetValue <Slider>().Value;
                        OrbwalkManager.SetAttack(false);
                        OrbwalkManager.SetMovement(false);
                        E.Cast(target);
                        E.LastCastAttemptT = Utils.TickCount + delay;
                    }
                }
                else if (mode == 1) //eqw
                {
                    //items
                    var itemTarget = TargetSelector.GetTarget(750, TargetSelector.DamageType.Physical);
                    if (itemTarget != null && E.IsReady())
                    {
                        var dmg = GetComboDamage(itemTarget);
                        ItemManager.Target = itemTarget;

                        //see if killable
                        if (dmg > itemTarget.Health - 50)
                        {
                            ItemManager.KillableTarget = true;
                        }

                        ItemManager.UseTargetted = true;
                    }

                    if (useE && E.IsReady() && Player.Distance(target.Position) < E.Range && Utils.TickCount - E.LastCastAttemptT > 0 &&
                        Player.Distance(target.Position) > eDis)
                    {
                        if (menu.Item("smartE", true).GetValue <bool>() &&
                            Player.CountEnemiesInRange(500) > 2 &&
                            (!R.IsReady() || !(RSpell.State == SpellState.Surpressed && R.Level > 0)))
                        {
                            return;
                        }

                        var delay = menu.Item("E_Delay_Slider", true).GetValue <Slider>().Value;
                        OrbwalkManager.SetAttack(false);
                        OrbwalkManager.SetMovement(false);
                        E.Cast(target);
                        E.LastCastAttemptT = Utils.TickCount + delay;
                    }

                    if (useQ && Q.IsReady() && Player.Distance(target.Position) <= Q.Range)
                    {
                        Q.Cast(target);
                    }
                }

                if (useW && W.IsReady() && Player.Distance(target.Position) <= W.Range && QSuccessfullyCasted())
                {
                    W.Cast();
                }

                if (useR && R.IsReady() &&
                    Player.CountEnemiesInRange(R.Range) > 0)
                {
                    if (!Q.IsReady() && !E.IsReady() && !W.IsReady())
                    {
                        OrbwalkManager.SetAttack(false);
                        OrbwalkManager.SetMovement(false);
                        R.Cast();
                    }
                }
            }
        }
Пример #39
0
 private bool isKnockedUp(Obj_AI_Hero x)
 {
     return(x.HasBuffOfType(BuffType.Knockup) || x.HasBuffOfType(BuffType.Knockback) || x.HasBuff("yasuoq3mis"));
 }
Пример #40
0
        private static void CastSpell(Spell QWER, Obj_AI_Hero target, int HitChanceNum)
        {
            //HitChance 0 - 2
            // example CastSpell(Q, ts, 2);
            var poutput = QWER.GetPrediction(target);
            var col     = poutput.CollisionObjects.Count(ColObj => ColObj.IsEnemy && ColObj.IsMinion && !ColObj.IsDead);

            if (QWER.Collision && col > 0)
            {
                return;
            }
            if (HitChanceNum == 0)
            {
                QWER.Cast(target, true);
            }
            else if (HitChanceNum == 1)
            {
                if ((int)poutput.Hitchance > 4)
                {
                    QWER.Cast(poutput.CastPosition);
                }
            }
            else if (HitChanceNum == 2)
            {
                if ((target.IsFacing(ObjectManager.Player) && (int)poutput.Hitchance == 5) || (target.Path.Count() == 0 && target.Position == target.ServerPosition))
                {
                    if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed) + (target.BoundingRadius * 2)))
                    {
                        QWER.Cast(poutput.CastPosition);
                    }
                }
                else if ((int)poutput.Hitchance == 5)
                {
                    QWER.Cast(poutput.CastPosition);
                }
            }
            else if (HitChanceNum == 3)
            {
                List <Vector2> waypoints   = target.GetWaypoints();
                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) + (target.BoundingRadius * 2)))
                        {
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                        }
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
            else if (HitChanceNum == 4 && (int)poutput.Hitchance > 4)
            {
                List <Vector2> waypoints   = target.GetWaypoints();
                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) + (target.BoundingRadius * 2)))
                        {
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                        }
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
        }
Пример #41
0
 private static bool Immobile(Obj_AI_Hero unit)
 {
     return(unit.HasBuffOfType(BuffType.Charm) || unit.HasBuffOfType(BuffType.Knockup) ||
            unit.HasBuffOfType(BuffType.Snare) ||
            unit.HasBuffOfType(BuffType.Taunt) || unit.HasBuffOfType(BuffType.Suppression));
 }
Пример #42
0
        private static bool Cleanse(Obj_AI_Hero hero)
        {
            bool 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);
        }
Пример #43
0
        private bool checkCC(Obj_AI_Hero hero)
        {
            bool cc = false;

            if (checkCCTick > LeagueSharp.Common.Utils.TickCount)
            {
                Console.WriteLine("tick");
                return(cc);
            }

            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("dehancer").GetValue <bool>())
            {
                if (hero.HasBuffOfType(BuffType.CombatDehancer))
                {
                    cc = true;
                }
            }

            if (Config.Item("zedultexecute").GetValue <bool>())
            {
                if (hero.HasBuff("zedultexecute"))
                {
                    cc = true;
                }
            }

            if (Config.Item("dispellExhaust").GetValue <bool>())
            {
                if (hero.HasBuff(exhaust.menuVariable))
                {
                    cc = true;
                }
            }

            if (Config.Item("dispellEsNumeroUno").GetValue <bool>())
            {
                if (hero.HasBuff("MordekaiserCOTGPet"))
                {
                    cc = true;
                }
            }

            checkCCTick = LeagueSharp.Common.Utils.TickCount + Config.Item("ccDelay").GetValue <Slider>().Value;
            return(cc);
        }
Пример #44
0
        private void Combo()
        {
            Obj_AI_Hero target = null;

            if (E.IsCharging)
            {
                target = TargetSelector.GetTarget(
                    GetTargetRange(), TargetSelector.DamageType.Magical, true,
                    HeroManager.Enemies.Where(
                        h => h.IsInvulnerable && CombatHelper.GetAngle(player, target.Position) > 50));
            }
            else
            {
                target = TargetSelector.GetTarget(
                    GetTargetRange(), TargetSelector.DamageType.Magical, true,
                    HeroManager.Enemies.Where(h => h.IsInvulnerable));
            }
            if (target == null)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config);
            }
            if (config.Item("usew", true).GetValue <bool>() && W.CanCast(target) && !E.IsCharging)
            {
                W.Cast();
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() && ignitedmg > target.Health && hasIgnite &&
                !CombatHelper.CheckCriticalBuffs(target) && !Q.CanCast(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }

            if (rActive)
            {
                orbwalker.SetAttack(false);
                Orbwalking.Attack = false;
                return;
            }

            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() && player.CanMove)
            {
                CastE(target);
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.CanCast(target) && target.IsValidTarget() &&
                !E.IsCharging)
            {
                Q.CastIfHitchanceEquals(target, HitChance.Medium);
            }

            if (R.IsReady() && config.Item("user", true).GetValue <bool>() &&
                config.Item("Rmin", true).GetValue <Slider>().Value <= player.CountEnemiesInRange(R.Range) &&
                !target.HasBuffOfType(BuffType.Knockback) && !target.HasBuffOfType(BuffType.Knockup) &&
                !target.HasBuffOfType(BuffType.Stun))
            {
                R.Cast();
            }
        }
Пример #45
0
        static int UnitBuffs(Obj_AI_Hero unit)
        {
            //Taken from 'Oracle Activator'. Thanks Kurisuu ^.^
            int cc = 0;

            if (VayneHunterRework.Menu.Item("slow").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Slow))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("blind").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Blind))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("charm").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Charm))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("fear").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Fear))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("snare").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Snare))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("taunt").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Taunt))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("supression").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Suppression))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("stun").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Stun))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("polymorph").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Polymorph))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("silence").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Silence))
                {
                    cc += 1;
                }
            }

            if (VayneHunterRework.Menu.Item("poison").GetValue <bool>())
            {
                if (unit.HasBuffOfType(BuffType.Poison))
                {
                    cc += 1;
                }
            }

            return(cc);
        }
Пример #46
0
 public static bool HasSpellShield(this Obj_AI_Hero target)
 {
     // Various spellshields
     return(target.HasBuffOfType(BuffType.SpellShield) || target.HasBuffOfType(BuffType.SpellImmunity));
 }
Пример #47
0
        private static void DoTriangleCombo(Obj_AI_Hero target)
        //I'm dumb, this triangular combo is only good for targets the Zhonyas, we can still use it for that i guess :^)
        {
            if (ShadowManager.RShadow.IsUsable && !target.HasBuffOfType(BuffType.Invulnerability))
            // Cast Ultimate m8 :S
            {
                if (MenuHelper.IsMenuEnabled("checkQWE"))
                {
                    if (_spells[SpellSlot.Q].IsReady() && _spells[SpellSlot.W].IsReady() &&
                        _spells[SpellSlot.E].IsReady())
                    {
                        if (_spells[SpellSlot.R].IsReady() && _spells[SpellSlot.R].IsInRange(target))
                        {
                            _spells[SpellSlot.R].Cast(target);
                        }
                    }
                }
                else
                {
                    if (_spells[SpellSlot.R].IsReady() && _spells[SpellSlot.R].IsInRange(target))
                    {
                        _spells[SpellSlot.R].Cast(target);
                    }
                }
            }

            if (GetMarkedTarget() != null)
            {
                target = GetMarkedTarget();
            }

            ItemManager.UseDeathmarkItems();
            ItemManager.UseSummonerSpells();

            if (ShadowManager.RShadow.Exists && ShadowManager.WShadow.IsUsable)
            {
                Vector3 bestWPosition = VectorHelper.GetBestPosition(
                    target, VectorHelper.GetVertices(target)[0], VectorHelper.GetVertices(target)[1]);
                // Maybe add a delay giving the target a chance to flash / zhonyas then it will place w at best perpendicular location m8
                if (WShadowSpell.ToggleState == 0 && Environment.TickCount - _spells[SpellSlot.W].LastCastAttemptT > 0)
                {
                    _spells[SpellSlot.W].Cast(bestWPosition);
                    //Allow half a second for the target to flash / zhonyas? :S
                    _spells[SpellSlot.W].LastCastAttemptT = Environment.TickCount + 500;
                }
            }

            if (WShadowSpell.ToggleState == 2)
            {
                _spells[SpellSlot.W].Cast();
            }

            if (ShadowManager.WShadow.Exists && ShadowManager.RShadow.Exists)
            {
                CastQ(target);
                CastE();
            }
            else if (ShadowManager.RShadow.Exists && !ShadowManager.WShadow.IsUsable && !ShadowManager.WShadow.Exists)
            {
                CastQ(target);
                CastE();
            }
        }
Пример #48
0
 public static bool IsMovementImpaired(this Obj_AI_Hero hero)
 {
     return(hero.HasBuffOfType(BuffType.Snare) || hero.HasBuffOfType(BuffType.Stun) ||
            hero.HasBuffOfType(BuffType.Taunt));
 }
Пример #49
0
        private bool IsCondemnable(Obj_AI_Hero hero)
        {
            if (!hero.IsValidTarget(550f) || hero.HasBuffOfType(BuffType.SpellShield) ||
                hero.HasBuffOfType(BuffType.SpellImmunity) || hero.IsDashing())
            {
                return(false);
            }

            //values for pred calc pP = player position; p = enemy position; pD = push distance
            var pP   = ObjectManager.Player.ServerPosition;
            var p    = hero.ServerPosition;
            var pD   = EPushDistanceSlider.Value;
            var mode = EModeStringList.SelectedValue;


            if (mode == "PRADASMART" && (IsCollisionable(p.Extend(pP, -pD)) || IsCollisionable(p.Extend(pP, -pD / 2f)) ||
                                         IsCollisionable(p.Extend(pP, -pD / 3f))))
            {
                if (!hero.CanMove ||
                    (hero.IsWindingUp))
                {
                    return(true);
                }

                var enemiesCount = ObjectManager.Player.CountEnemyHeroesInRange(1200);
                if (enemiesCount > 1 && enemiesCount <= 3)
                {
                    var prediction = E.GetPrediction(hero);
                    for (var i = 15; i < pD; i += 75)
                    {
                        if (i > pD)
                        {
                            var lastPosFlags = NavMesh.GetCollisionFlags(
                                prediction.UnitPosition.ToVector2()
                                .Extend(
                                    pP.ToVector2(),
                                    -pD)
                                .ToVector3());
                            if (lastPosFlags.HasFlag(CollisionFlags.Wall) || lastPosFlags.HasFlag(CollisionFlags.Building))
                            {
                                return(true);
                            }
                            return(false);
                        }
                        var posFlags = NavMesh.GetCollisionFlags(
                            prediction.UnitPosition.ToVector2()
                            .Extend(
                                pP.ToVector2(),
                                -i)
                            .ToVector3());
                        if (posFlags.HasFlag(CollisionFlags.Wall) || posFlags.HasFlag(CollisionFlags.Building))
                        {
                            return(true);
                        }
                    }
                    return(false);
                }
                else
                {
                    var         hitchance      = EHitchanceSlider.Value;
                    var         angle          = 0.20 * hitchance;
                    const float travelDistance = 0.5f;
                    var         alpha          = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                                                             (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                    var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                                           (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                    for (var i = 15; i < pD; i += 100)
                    {
                        if (i > pD)
                        {
                            return(false);
                        }
                        if (IsCollisionable(pP.ToVector2().Extend(alpha,
                                                                  i)
                                            .ToVector3()) && IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3()))
                        {
                            return(true);
                        }
                    }
                    return(false);
                }
            }

            if (mode == "PRADAPERFECT" &&
                (IsCollisionable(p.Extend(pP, -pD)) || IsCollisionable(p.Extend(pP, -pD / 2f)) ||
                 IsCollisionable(p.Extend(pP, -pD / 3f))))
            {
                if (!hero.CanMove ||
                    (hero.IsWindingUp))
                {
                    return(true);
                }

                var         hitchance      = EHitchanceSlider.Value;
                var         angle          = 0.20 * hitchance;
                const float travelDistance = 0.5f;
                var         alpha          = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                                                         (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                                       (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                for (var i = 15; i < pD; i += 100)
                {
                    if (i > pD)
                    {
                        return(IsCollisionable(alpha.Extend(pP.ToVector2(),
                                                            -pD)
                                               .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -pD).ToVector3()));
                    }
                    if (IsCollisionable(alpha.Extend(pP.ToVector2(),
                                                     -i)
                                        .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -i).ToVector3()))
                    {
                        return(true);
                    }
                }
                return(false);
            }

            if (mode == "OLDPRADA")
            {
                if (!hero.CanMove ||
                    (hero.IsWindingUp))
                {
                    return(true);
                }

                var         hitchance      = EHitchanceSlider.Value;
                var         angle          = 0.20 * hitchance;
                const float travelDistance = 0.5f;
                var         alpha          = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
                                                         (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
                var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
                                       (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));

                for (var i = 15; i < pD; i += 100)
                {
                    if (IsCollisionable(pP.ToVector2().Extend(alpha,
                                                              i)
                                        .ToVector3()) || IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3()))
                    {
                        return(true);
                    }
                }
                return(false);
            }

            if (mode == "MARKSMAN")
            {
                var prediction = E.GetPrediction(hero);
                return(NavMesh.GetCollisionFlags(
                           prediction.UnitPosition.ToVector2()
                           .Extend(
                               pP.ToVector2(),
                               -pD)
                           .ToVector3()).HasFlag(CollisionFlags.Wall) ||
                       NavMesh.GetCollisionFlags(
                           prediction.UnitPosition.ToVector2()
                           .Extend(
                               pP.ToVector2(),
                               -pD / 2f)
                           .ToVector3()).HasFlag(CollisionFlags.Wall));
            }

            if (mode == "SHARPSHOOTER")
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += 100)
                {
                    if (i > pD)
                    {
                        return(false);
                    }
                    var posCF = NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                        .Extend(
                            pP.ToVector2(),
                            -i)
                        .ToVector3());
                    if (posCF.HasFlag(CollisionFlags.Wall) || posCF.HasFlag(CollisionFlags.Building))
                    {
                        return(true);
                    }
                }
                return(false);
            }

            if (mode == "GOSU")
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += 75)
                {
                    var posCF = NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                        .Extend(
                            pP.ToVector2(),
                            -i)
                        .ToVector3());
                    if (posCF.HasFlag(CollisionFlags.Wall) || posCF.HasFlag(CollisionFlags.Building))
                    {
                        return(true);
                    }
                }
                return(false);
            }

            if (mode == "VHR")
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += (int)hero.BoundingRadius) //:frosty:
                {
                    var posCF = NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                        .Extend(
                            pP.ToVector2(),
                            -i)
                        .ToVector3());
                    if (posCF.HasFlag(CollisionFlags.Wall) || posCF.HasFlag(CollisionFlags.Building))
                    {
                        return(true);
                    }
                }
                return(false);
            }

            if (mode == "PRADALEGACY")
            {
                var prediction = E.GetPrediction(hero);
                for (var i = 15; i < pD; i += 75)
                {
                    var posCF = NavMesh.GetCollisionFlags(
                        prediction.UnitPosition.ToVector2()
                        .Extend(
                            pP.ToVector2(),
                            -i)
                        .ToVector3());
                    if (posCF.HasFlag(CollisionFlags.Wall) || posCF.HasFlag(CollisionFlags.Building))
                    {
                        return(true);
                    }
                }
                return(false);
            }

            if (mode == "FASTEST" &&
                (IsCollisionable(p.Extend(pP, -pD)) || IsCollisionable(p.Extend(pP, -pD / 2f)) ||
                 IsCollisionable(p.Extend(pP, -pD / 3f))))
            {
                return(true);
            }

            return(false);
        }
Пример #50
0
        public static double GetIncomingDamage(Obj_AI_Hero target, float time = 0.5f, bool skillshots = true)
        {
            double totalDamage = 0;

            foreach (var damage in IncomingDamageList.Where(damage => damage.TargetNetworkId == target.NetworkId && Game.Time - time < damage.Time))
            {
                if (skillshots)
                {
                    totalDamage += damage.Damage;
                }
                else
                {
                    if (!damage.Skillshot)
                    {
                        totalDamage += damage.Damage;
                    }
                }
            }
            double damage2 = 0;

            foreach (var missile in Cache.MissileList.Where(missile => missile.IsValid && missile.SpellCaster != null && missile.SData != null && missile.SpellCaster.Team != target.Team))
            {
                if (missile.Target != null)
                {
                    if (missile.Target.NetworkId == target.NetworkId)
                    {
                        var damageExtra = missile.SpellCaster.GetSpellDamage((Obj_AI_Base)missile.Target, missile.SData.Name);
                        if (damageExtra == 0)
                        {
                            damageExtra += target.Level * 3;
                        }
                        damage2 = damageExtra;
                    }
                }
                else if (skillshots)
                {
                    if (target.HasBuffOfType(BuffType.Slow) || target.IsWindingUp || !CanMove(target))
                    {
                        if (CanHitSkillShot(target, missile.StartPosition, missile.EndPosition, missile.SData))
                        {
                            damage2 += missile.SpellCaster.GetSpellDamage((Obj_AI_Base)missile.Target, missile.SData.Name);
                        }
                    }
                }
            }

            if (damage2 > totalDamage)
            {
                totalDamage = damage2;
            }

            if (target.HasBuffOfType(BuffType.Poison))
            {
                totalDamage += target.Level * 5;
            }
            if (target.HasBuffOfType(BuffType.Damage))
            {
                totalDamage += target.Level * 6;
            }

            return(totalDamage);
        }
Пример #51
0
        protected override void Game_OnGameUpdate(EventArgs args)
        {
            //check if player is dead
            if (Player.IsDead)
            {
                return;
            }

            SmartKs();

            if (menu.Item("escape", true).GetValue <KeyBind>().Active)
            {
                OrbwalkManager.Orbwalk(null, Game.CursorPos);
                Escape();
            }
            else if (menu.Item("ComboActive", true).GetValue <KeyBind>().Active)
            {
                Combo();
            }
            else if (menu.Item("insec", true).GetValue <KeyBind>().Active)
            {
                OrbwalkManager.Orbwalk(null, Game.CursorPos);

                _insecTarget = TargetSelector.GetSelectedTarget();

                if (_insecTarget != null)
                {
                    if (_insecTarget.HasBuffOfType(BuffType.Knockup) || _insecTarget.HasBuffOfType(BuffType.Knockback))
                    {
                        if (Player.ServerPosition.Distance(_insecTarget.ServerPosition) < 200)
                        {
                            R2.Cast(_rVec);
                        }
                    }

                    Insec();
                }
            }
            else if (menu.Item("qeCombo", true).GetValue <KeyBind>().Active)
            {
                var soldierTarget = TargetSelector.GetTarget(900, TargetSelector.DamageType.Magical);

                OrbwalkManager.Orbwalk(null, Game.CursorPos);
                CastQe(soldierTarget, "Null");
            }
            else
            {
                if (menu.Item("LaneClearActive", true).GetValue <KeyBind>().Active)
                {
                    Farm();
                }

                if (menu.Item("HarassActive", true).GetValue <KeyBind>().Active)
                {
                    Harass();
                }

                if (menu.Item("HarassActiveT", true).GetValue <KeyBind>().Active)
                {
                    Harass();
                }

                if (menu.Item("wAtk", true).GetValue <bool>())
                {
                    AutoAtk();
                }
            }
        }
Пример #52
0
        private void Combo(bool useQ, bool useW, bool useE, bool useR)
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

            int mode = menu.Item("comboMode", true).GetValue <StringList>().SelectedIndex;

            int eDis = menu.Item("eDis", true).GetValue <Slider>().Value;

            if (!target.IsValidTarget(E.Range))
            {
                return;
            }

            if (!target.HasBuffOfType(BuffType.Invulnerability) && !target.IsZombie)
            {
                if (mode == 0) //qwe
                {
                    //items

                    var itemTarget = TargetSelector.GetTarget(750, TargetSelector.DamageType.Physical);
                    if (itemTarget != null && E.IsReady())
                    {
                        var dmg = GetComboDamage(itemTarget);
                        ActiveItems.Target = itemTarget;

                        //see if killable
                        if (dmg > itemTarget.Health - 50)
                        {
                            ActiveItems.KillableTarget = true;
                        }

                        ActiveItems.UseTargetted = true;
                    }


                    if (useQ && Q.IsReady() && Player.Distance(target) <= Q.Range)
                    {
                        Q.Cast(target, packets());
                    }

                    if (useE && E.IsReady() && Player.Distance(target) < E.Range && Environment.TickCount - E.LastCastAttemptT > 0 &&
                        Player.Distance(target) > eDis)
                    {
                        if (menu.Item("smartE", true).GetValue <bool>() &&
                            countEnemiesNearPosition(target.ServerPosition, 500) > 2 &&
                            (!R.IsReady() || !(RSpell.State == SpellState.Surpressed && R.Level > 0)))
                        {
                            return;
                        }

                        var delay = menu.Item("E_Delay_Slider", true).GetValue <Slider>().Value;
                        E.Cast(target, packets());
                        E.LastCastAttemptT = Environment.TickCount + delay;
                    }
                }
                else if (mode == 1) //eqw
                {
                    //items
                    var itemTarget = TargetSelector.GetTarget(750, TargetSelector.DamageType.Physical);
                    if (itemTarget != null && E.IsReady())
                    {
                        var dmg = GetComboDamage(itemTarget);
                        ActiveItems.Target = itemTarget;

                        //see if killable
                        if (dmg > itemTarget.Health - 50)
                        {
                            ActiveItems.KillableTarget = true;
                        }

                        ActiveItems.UseTargetted = true;
                    }

                    if (useE && E.IsReady() && Player.Distance(target) < E.Range && Environment.TickCount - E.LastCastAttemptT > 0 &&
                        Player.Distance(target) > eDis)
                    {
                        if (menu.Item("smartE", true).GetValue <bool>() &&
                            countEnemiesNearPosition(target.ServerPosition, 500) > 2 &&
                            (!R.IsReady() || !(RSpell.State == SpellState.Surpressed && R.Level > 0)))
                        {
                            return;
                        }

                        var delay = menu.Item("E_Delay_Slider", true).GetValue <Slider>().Value;
                        E.Cast(target, packets());
                        E.LastCastAttemptT = Environment.TickCount + delay;
                    }

                    if (useQ && Q.IsReady() && Player.Distance(target) <= Q.Range)
                    {
                        Q.Cast(target, packets());
                    }
                }

                if (useW && W.IsReady() && Player.Distance(target) <= W.Range)
                {
                    W.Cast();
                }

                if (useR && R.IsReady() &&
                    countEnemiesNearPosition(Player.ServerPosition, R.Range) > 0)
                {
                    if (!Q.IsReady() && !E.IsReady() && !W.IsReady())
                    {
                        R.Cast();
                    }
                }
            }
        }
Пример #53
0
 /// <summary>
 /// Determines if the target is lightly impaired (slowed)
 /// </summary>
 /// <param name="enemy">The target</param>
 /// <returns>Whether the target is lightly impaired</returns>
 private static bool IsLightlyImpaired(Obj_AI_Hero enemy)
 {
     return(enemy.HasBuffOfType(BuffType.Slow));
 }
Пример #54
0
        private void UseSpells(bool useQ, bool useW, bool useE, bool useR, string source)
        {
            var         range   = Q.Range;
            Obj_AI_Hero eTarget = TargetSelector.GetTarget(range, TargetSelector.DamageType.Magical);


            if (GetTargetFocus(range) != null)
            {
                eTarget = GetTargetFocus(range);
            }

            Obj_AI_Hero rETarget = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

            var hitC    = GetHitchance(source);
            var dmg     = GetComboDamage(eTarget);
            var predOff = menu.Item("Prediction_Check_Off", true).GetValue <bool>();

            if (eTarget == null)
            {
                return;
            }

            if (source == "Combo")
            {
                //items-------
                ActiveItems.Target = eTarget;

                //see if killable
                if (dmg > eTarget.Health - 50)
                {
                    ActiveItems.KillableTarget = true;
                }

                //Items
                if (eTarget.HasBuffOfType(BuffType.Charm) || !menu.Item("dfgCharm", true).GetValue <bool>())
                {
                    ActiveItems.UseTargetted = true;
                }
            }
            //end items-------

            //E
            if (useE && E.IsReady() && Player.Distance(eTarget) < E.Range)
            {
                if (E.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                {
                    E.Cast(eTarget, packets());
                    if (menu.Item("EQ", true).GetValue <bool>() && Q.IsReady())
                    {
                        Q.Cast(eTarget, packets());
                    }
                    return;
                }
            }

            //W
            if (useW && W.IsReady() && Player.Distance(eTarget) <= W.Range - 100 &&
                ShouldW(eTarget, source))
            {
                W.Cast();
            }

            if (source == "Harass" && menu.Item("longQ", true).GetValue <bool>())
            {
                if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range &&
                    ShouldQ(eTarget, source) && Player.Distance(eTarget) > 600)
                {
                    if (Q.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                    {
                        Q.Cast(eTarget, packets(), true);
                        return;
                    }
                }
            }
            else if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range &&
                     ShouldQ(eTarget, source))
            {
                if (Q.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                {
                    Q.Cast(eTarget, packets(), true);
                    return;
                }
            }

            //R
            if (useR && R.IsReady() && Player.Distance(eTarget) < R.Range)
            {
                if (E.IsReady())
                {
                    if (CheckReq(rETarget))
                    {
                        E.Cast(rETarget, packets());
                    }
                }
                if (ShouldR(eTarget) && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    _rTimer = Environment.TickCount - 250;
                }
                if (_rTimeLeft > 9500 && _rOn && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    _rTimer = Environment.TickCount - 250;
                }
            }
        }
Пример #55
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;
        }
Пример #56
0
        private static void Combo(Boolean harass = false)
        {
            Boolean checkTarget = true;

            if (menu.Item("focusSelectedTarget").GetValue <bool>())
            {
                if (selectedTarget.IsValidTarget())
                {
                    checkTarget = false;

                    if (dontUseQW2 > Game.ClockTime)
                    {
                        if (selectedTarget.NetworkId == dontUseQW)
                        {
                            checkTarget = true;
                        }
                    }
                }
            }

            try
            {
                if (checkTarget)
                {
                    Orbwalker.ForceTarget(GetEnemyList().Where(x => x.IsValidTarget(Orbwalking.GetRealAutoAttackRange(x))).OrderBy(x => x.Health / getEDmg(x)).FirstOrDefault());
                }
                else
                {
                    Orbwalker.ForceTarget(selectedTarget);
                }
            }
            catch (Exception ex) { }

            Boolean packetCast = menu.Item("PacketCast").GetValue <bool>();

            if (R.IsReady() && !harass)
            {
                if (menu.Item("comboR").GetValue <bool>())
                {
                    Obj_AI_Hero enemyR = GetEnemyList().Where(x => x.IsValidTarget(550f) && !checkYasuoWall(x.Position)).OrderBy(x => x.Health / getRDmg(x)).FirstOrDefault();
                    if (enemyR != null)
                    {
                        PredictionOutput castPred = R.GetPrediction(enemyR, true, R.Range);

                        List <Obj_AI_Hero> enemiesHit = GetEnemyList().Where(x => R.WillHit(x.Position, castPred.CastPosition) && !checkYasuoWall(x.Position)).ToList();
                        int facingEnemies             = enemiesHit.Where(x => x.IsFacing(player)).Count();
                        int countList2 = GetEnemyList().Where(x => x.Distance(enemyR.Position) < 250 && !checkYasuoWall(x.Position)).Count();
                        int countList  = enemiesHit.Count();

                        if ((countList >= 2 && facingEnemies >= 1) || countList >= 3 || countList2 >= 3 || (countList == 1 && player.Level < 11))
                        {
                            Boolean ult = true;

                            if (countList == 1)
                            {
                                ult = false;
                                if (player.Level < 11)
                                {
                                    int    multipleE  = (facingEnemies == 1) ? 4 : 2;
                                    int    multipleQ  = (facingEnemies == 1) ? 2 : 1;
                                    double procHealth = (getEDmg(enemyR) * multipleE + getQDmg(enemyR) * multipleQ + getRDmg(enemyR)) / enemyR.Health;
                                    if (procHealth > 1 && procHealth < 1.5 && (enemyR.HasBuffOfType(BuffType.Poison) || Q.IsReady() || W.IsReady()) && (E.IsReady() || player.Spellbook.GetSpell(E.Slot).CooldownExpires < 1))
                                    {
                                        ult = true;
                                    }
                                }
                            }

                            if (ult)
                            {
                                R.Cast(castPred.CastPosition, packetCast);
                            }
                        }
                    }
                }
            }


            if (E.IsReady() && Environment.TickCount > legitEdelay && (!harass || menu.Item("eHarass").GetValue <bool>()))
            {
                Obj_AI_Hero mainTarget = null;

                if (checkTarget)
                {
                    List <Obj_AI_Hero> Eenemies = GetEnemyList();

                    Obj_AI_Hero eTarget  = null;
                    Obj_AI_Hero eTarget2 = null;

                    if (Eenemies.Count() > 0)
                    {
                        double minCast1 = -1;
                        double minCast2 = -1;

                        foreach (Obj_AI_Hero enemyto in Eenemies)
                        {
                            if (!enemyto.IsValidTarget(E.Range))
                            {
                                continue;
                            }
                            if (checkYasuoWall(enemyto.ServerPosition))
                            {
                                continue;
                            }

                            Boolean buffedEnemy = false;
                            if (enemyto.HasBuffOfType(BuffType.Poison))
                            {
                                var buffEndTime = GetPoisonBuffEndTime(enemyto);
                                if (buffEndTime > Game.Time + E.Delay)
                                {
                                    buffedEnemy = true;
                                }
                            }

                            if (buffedEnemy)
                            {
                                double casts = enemyto.Health / getEDmg(enemyto);
                                if (minCast1 == -1 || minCast1 > casts)
                                {
                                    minCast1 = casts;
                                    eTarget  = enemyto;
                                }
                            }
                            else if (getEDmg(enemyto) > enemyto.Health * 1.03)
                            {
                                float dist = player.Distance(enemyto.Position);
                                if (minCast2 == -1 || minCast2 < dist)
                                {
                                    minCast2 = dist;
                                    eTarget2 = enemyto;
                                }
                            }
                        }
                    }

                    mainTarget = (eTarget != null) ? eTarget : eTarget2;
                }
                else
                {
                    if (player.Distance(selectedTarget.Position) <= E.Range && ((selectedTarget.HasBuffOfType(BuffType.Poison) && GetPoisonBuffEndTime(selectedTarget) > Game.Time + E.Delay) || getEDmg(selectedTarget) > selectedTarget.Health * 1.03))
                    {
                        mainTarget = selectedTarget;
                    }
                }

                if (mainTarget != null)
                {
                    Orbwalker.ForceTarget(mainTarget);

                    if (E.Cast(mainTarget, packetCast) == Spell.CastStates.SuccessfullyCasted)
                    {
                        int castEdelay = menu.Item("castedalay").GetValue <Slider>().Value;
                        if (castEdelay > 0)
                        {
                            Random rand = new Random();
                            legitEdelay = Environment.TickCount + rand.Next(castEdelay);
                        }

                        if (getEDmg(mainTarget) > mainTarget.Health * 1.1)
                        {
                            dontUseQW  = mainTarget.NetworkId;
                            dontUseQW2 = Game.ClockTime + 0.6f;
                        }
                    }
                }
            }

            Obj_AI_Hero enemy = (!checkTarget) ? selectedTarget : getTarget(Q.Range);

            if (enemy != null)
            {
                if (Q.IsReady() && (!harass || menu.Item("qHarass").GetValue <bool>()))
                {
                    if (Q.CastIfHitchanceEquals(enemy, HitChance.High, packetCast))
                    {
                        castWafter = Game.Time + Q.Delay;
                        return;
                    }
                }

                if (!Q.IsReady() && castWafter < Game.Time && W.IsReady() && (!enemy.HasBuffOfType(BuffType.Poison) || !menu.Item("castWPoisoned").GetValue <bool>()) && (!harass || menu.Item("wHarass").GetValue <bool>()))
                {
                    W.CastIfHitchanceEquals(enemy, HitChance.High, packetCast);
                    return;
                }
            }
        }
Пример #57
0
 public static bool IsKnockedup(this Obj_AI_Hero unit, bool onlyyasuoq)
 {
     return(onlyyasuoq ? unit.HasBuff("yasuoq3mis") : unit.HasBuffOfType(BuffType.Knockup) ||
            unit.HasBuffOfType(BuffType.Knockback));
 }
Пример #58
0
        private bool checkCC(Obj_AI_Hero hero)
        {
            bool 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;
                }
            }

            return(cc);
        }
Пример #59
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);
                    }
                }
            }
        }
Пример #60
0
 /// <summary>
 /// Determines if the target is heavily impaired (stunned/rooted)
 /// </summary>
 /// <param name="enemy">The target</param>
 /// <returns>Whether the target is heavily impaired</returns>
 private static bool IsHeavilyImpaired(Obj_AI_Hero enemy)
 {
     return(enemy.HasBuffOfType(BuffType.Stun) || enemy.HasBuffOfType(BuffType.Snare) || enemy.HasBuffOfType(BuffType.Charm) || enemy.HasBuffOfType(BuffType.Fear) || enemy.HasBuffOfType(BuffType.Taunt));
 }