Ejemplo n.º 1
0
 protected override void Killsteal()
 {
     if (Q.IsReady() &&
         RootMenu["killsteal"]["ksq"])
     {
         var bestTarget = Extensions.GetBestKillableHero(Q, DamageType.Magical, false);
         if (bestTarget != null &&
             Player.GetSpellDamage(bestTarget, SpellSlot.Q) >= bestTarget.Health &&
             bestTarget.IsValidTarget(Q.Range))
         {
             foreach (var pixs in GameObjects.AllGameObjects)
             {
                 if (pixs.Name == "RobotBuddy" && pixs.IsValid && pixs != null && !pixs.IsDead && pixs.Team == Player.Team)
                 {
                     if (pixs.Distance(bestTarget) < Player.Distance(bestTarget))
                     {
                         Q.From = pixs.Position;
                         var pred = Q.GetPrediction(bestTarget);
                         if (pred.Hitchance >= HitChance.High)
                         {
                             Q.Cast(pred.CastPosition, true);
                         }
                     }
                     if (pixs.Distance(bestTarget) > Player.Distance(bestTarget))
                     {
                         Q.From = Player.Position;
                         var pred = Q.GetPrediction(bestTarget);
                         if (pred.Hitchance >= HitChance.High)
                         {
                             Q.Cast(pred.CastPosition, true);
                         }
                     }
                 }
             }
         }
     }
     if (E.IsReady() &&
         RootMenu["killsteal"]["kse"])
     {
         var bestTarget = Extensions.GetBestKillableHero(E, DamageType.Magical, false);
         if (bestTarget != null &&
             Player.GetSpellDamage(bestTarget, SpellSlot.E) >= bestTarget.Health &&
             bestTarget.IsValidTarget(E.Range))
         {
             E.CastOnUnit(bestTarget);
         }
     }
     if (Q.IsReady() && RootMenu["killsteal"]["kseq"])
     {
         var bestTarget = Extensions.GetBestKillableHeroEQ(DamageType.Magical, false);
         if (bestTarget != null &&
             Player.GetSpellDamage(bestTarget, SpellSlot.Q) >= bestTarget.Health &&
             bestTarget.IsValidTarget(E.Range + Q.Range) && bestTarget.Distance(Player) > Q.Range)
         {
             foreach (var ally in GameObjects.AllyHeroes
                      .Where(x => x.IsValidTarget(E.Range, true) && x != null && x.Distance(Player) < E.Range &&
                             x.Distance(bestTarget) < Q.Range)
                      .OrderBy(x => x.Distance(bestTarget)))
             {
                 E.CastOnUnit(ally);
             }
             foreach (var minion in GameObjects.Minions
                      .Where(x => x.IsValidTarget(E.Range) && x != null && x.Distance(Player) < E.Range &&
                             x.Distance(bestTarget) < Q.Range)
                      .OrderBy(x => x.Distance(bestTarget)))
             {
                 E.CastOnUnit(minion);
             }
             foreach (var enemy in GameObjects.EnemyHeroes
                      .Where(x => x.IsValidTarget(E.Range) && x != null && x.Distance(Player) < E.Range &&
                             x.Distance(bestTarget) < Q.Range)
                      .OrderBy(x => x.Distance(bestTarget)))
             {
                 E.CastOnUnit(enemy);
             }
             foreach (var pixs in GameObjects.AllGameObjects)
             {
                 if (pixs.Name == "RobotBuddy" && pixs.IsValid && pixs != null && !pixs.IsDead && pixs.Team == Player.Team)
                 {
                     foreach (var pix in GameObjects.AllyHeroes)
                     {
                         if (pix.IsValidTarget(1800, true) && pix != null && pix.Distance(Player) < 1800 &&
                             pix.HasBuff("lulufaerieattackaid") && pix.Distance(bestTarget) < Q.Range)
                         {
                             Q.From = pix.Position;
                             var pred = Q.GetPrediction(bestTarget);
                             if (pred.Hitchance >= HitChance.High)
                             {
                                 Q.Cast(pred.CastPosition, true);
                             }
                         }
                     }
                     foreach (var pix in GameObjects.EnemyHeroes)
                     {
                         if (pix.IsValidTarget(1800) && pix != null && pix.Distance(Player) < 1800 &&
                             pix.HasBuff("lulufaerieburn") && pix.Distance(bestTarget) < Q.Range)
                         {
                             Q.From = pix.Position;
                             var pred = Q.GetPrediction(bestTarget);
                             if (pred.Hitchance >= HitChance.High)
                             {
                                 Q.Cast(pred.CastPosition, true);
                             }
                         }
                     }
                     foreach (var pix in GameObjects.EnemyMinions)
                     {
                         if (pix.IsValidTarget(1800) && pix != null && pix.Distance(Player) < 1800 &&
                             (pix.HasBuff("lulufaerieburn") || pix.HasBuff("lulufaerieattackaid") ||
                              pix.HasBuff("luluevision")))
                         {
                             Q.From = pix.Position;
                             var pred = Q.GetPrediction(bestTarget);
                             if (pred.Hitchance >= HitChance.High)
                             {
                                 Q.Cast(pred.CastPosition, true);
                             }
                         }
                     }
                 }
             }
         }
     }
 }