예제 #1
0
        private static void KillSteal()
        {
            if (getCheckBoxItem(ksMenu, "Q") && Q.IsReady())
            {
                if (IsDashing)
                {
                    if (CanCastQCir)
                    {
                        var targets = GetQCirTarget.Where(i => i.Health + i.AttackShield <= GetQDmg(i)).ToList();
                        if (CastQCir(targets))
                        {
                            return;
                        }
                    }
                }
                else
                {
                    var target = !haveQ3?Q.GetTarget(Q.Width / 2) : Q2.GetTarget(Q2.Width / 2);

                    if (target != null && target.Health + target.AttackShield <= GetQDmg(target))
                    {
                        if (!haveQ3)
                        {
                            if (Q.Casting(target).IsCasted())
                            {
                                return;
                            }
                        }
                        else if (Q2.Casting(target, false, LeagueSharp.SDK.CollisionableObjects.YasuoWall).IsCasted())
                        {
                            return;
                        }
                    }
                }
            }
            if (getCheckBoxItem(ksMenu, "E") && E.IsReady())
            {
                var targets = EntityManager.Heroes.Enemies.Where(i => !HaveE(i) && E.IsInRange(i)).ToList();
                if (targets.Count > 0)
                {
                    var target = targets.FirstOrDefault(i => i.Health + i.MagicShield <= GetEDmg(i));
                    if (target != null)
                    {
                        if (E.CastOnUnit(target))
                        {
                            lastE = Variables.TickCount;
                            return;
                        }
                    }
                    else if (getCheckBoxItem(ksMenu, "Q") && Q.IsReady(50))
                    {
                        target = targets.Where(i => i.Distance(GetPosAfterDash(i)) < Q3.Range).FirstOrDefault(
                            i =>
                        {
                            var dmgE = GetEDmg(i) - i.MagicShield;
                            return(i.Health - (dmgE > 0 ? dmgE : 0) + i.AttackShield <= GetQDmg(i));
                        });
                        if (target != null && E.CastOnUnit(target))
                        {
                            lastE = Variables.TickCount;
                            return;
                        }
                    }
                }
            }
            if (getCheckBoxItem(ksMenu, "R") && R.IsReady())
            {
                var targets = GetRTarget;
                if (targets.Count > 0)
                {
                    var target =
                        targets.Where(
                            i =>
                            getCheckBoxItem(ksMenu, "RCast" + i.NetworkId) &&
                            (i.Health + i.AttackShield <= R.GetDamage(i) ||
                             (Q.IsReady(1000) && i.Health + i.AttackShield <= R.GetDamage(i) + GetQDmg(i))) &&
                            !Invulnerable.Check(i, R.DamageType))
                        .MaxOrDefault(i => new Priority().GetDefaultPriority(i));
                    if (target != null)
                    {
                        R.CastOnUnit(target);
                    }
                }
            }
        }
예제 #2
0
 private static void KillSteal()
 {
     if (getCheckBoxItem(ksMenu, "Q") && Q.IsReady())
     {
         if (IsDashing)
         {
             if (CanCastQCir)
             {
                 var targets = GetQCirTarget.Where(i => i.Health + i.AttackShield <= GetQDmg(i)).ToList();
                 if (CastQCir(targets))
                 {
                     return;
                 }
             }
         }
         else
         {
             var target = SpellQ.GetTarget(SpellQ.Width / 2);
             if (target != null && target.Health + target.AttackShield <= GetQDmg(target))
             {
                 if (!haveQ3)
                 {
                     if (Q.Casting(target).IsCasted())
                     {
                         return;
                     }
                 }
                 else if (Q2.Casting(target, false, CollisionableObjects.YasuoWall).IsCasted())
                 {
                     return;
                 }
             }
         }
     }
     if (getCheckBoxItem(ksMenu, "E") && E.IsReady())
     {
         var canQ   = getCheckBoxItem(ksMenu, "Q") && Q.IsReady(50);
         var target =
             EntityManager.Heroes.Enemies.FirstOrDefault(
                 i =>
                 !HaveE(i) && E.IsInRange(i) &&
                 (canQ && Q3.WillHit(Q3.GetPredPosition(i), GetPosAfterDash(i))
                             ? i.Health - Math.Max(GetEDmg(i) - i.MagicShield, 0) + i.AttackShield
                  <= GetQDmg(i)
                             : i.Health + i.MagicShield <= GetEDmg(i)));
         if (target != null && E.CastOnUnit(target))
         {
             return;
         }
     }
     if (getCheckBoxItem(ksMenu, "R") && R.IsReady())
     {
         var target =
             EntityManager.Heroes.Enemies.Where(
                 i =>
                 getCheckBoxItem(ksMenu, "RCast" + i.NetworkId) &&
                 i.Health + i.AttackShield <= R.GetDamage(i) + (Q.IsReady(1000) ? GetQDmg(i) : 0))
             .MaxOrDefault(i => new Priority().GetDefaultPriority(i));
         if (target != null)
         {
             R.CastOnUnit(target);
         }
     }
 }