Exemple #1
0
 public static Menu AddMisc(Menu main)
 {
     main = Events(main);
     main.AddSubMenu(Program.SPredictionMenu);
     main = Jungle.addJungleOptions(main);
     main = AutoLeveler.AddToMenu(main);
     main = FpsBalancer.AddToMenu(main);
     if (HeroesWithPet.Any(a => a == ObjectManager.Player.ChampionName))
     {
         main = PetHandler.addItemOptons(main);
     }
     return(main);
 }
 private void CheckSkillShots()
 {
     if (FpsBalancer.CheckCounter())
     {
         return;
     }
     if (!skillShotChecked)
     {
         skillShotChecked = true;
         Utility.DelayAction.Add(70, () => skillShotChecked = false);
         for (int i = 0; i < SkillshotDetector.ActiveSkillshots.Count; i++)
         {
             if (
                 CombatHelper.BuffsList.Any(
                     b =>
                     SkillshotDetector.ActiveSkillshots[i].SkillshotData.Slot == b.Slot &&
                     ((Obj_AI_Hero)SkillshotDetector.ActiveSkillshots[i].Caster).ChampionName ==
                     b.ChampionName))
             {
                 SkillshotDetector.ActiveSkillshots.RemoveAt(i);
                 break;
             }
             foreach (var Hero in
                      HeroManager.AllHeroes.Where(
                          h =>
                          h.Distance(SkillshotDetector.ActiveSkillshots[i].Caster) <
                          SkillshotDetector.ActiveSkillshots[i].SkillshotData.Range)
                      .OrderBy(h => h.Distance(SkillshotDetector.ActiveSkillshots[i].Caster)))
             {
                 SkillshotDetector.ActiveSkillshots[i].Game_OnGameUpdate();
                 if (SkillshotDetector.ActiveSkillshots[i].Caster.NetworkId != Hero.NetworkId &&
                     SkillshotDetector.ActiveSkillshots[i].Caster.Team != Hero.Team &&
                     !SkillshotDetector.ActiveSkillshots[i].IsSafePath(
                         0, -1, SkillshotDetector.ActiveSkillshots[i].SkillshotData.Delay, Hero).IsSafe&&
                     Hero.IsValidTarget(1500, false, Hero.Position) &&
                     SkillshotDetector.ActiveSkillshots[i].IsAboutToHit(
                         510, Hero, SkillshotDetector.ActiveSkillshots[i].Caster))
                 {
                     var data =
                         IncomingDamagesAlly.Concat(IncomingDamagesEnemy)
                         .FirstOrDefault(h => h.Hero.NetworkId == Hero.NetworkId);
                     var missileSpeed =
                         (SkillshotDetector.ActiveSkillshots[i].GetMissilePosition(0).Distance(Hero) /
                          SkillshotDetector.ActiveSkillshots[i].SkillshotData.MissileSpeed);
                     missileSpeed = missileSpeed > 5f ? 5f : missileSpeed;
                     var newData = new Dmg(
                         Hero,
                         (float)
                         Damage.GetSpellDamage(
                             (Obj_AI_Hero)SkillshotDetector.ActiveSkillshots[i].Caster, Hero,
                             SkillshotDetector.ActiveSkillshots[i].SkillshotData.Slot), missileSpeed, false,
                         false, SkillshotDetector.ActiveSkillshots[i]);
                     if (data == null ||
                         data.Damages.Any(
                             d =>
                             d.SkillShot != null &&
                             d.SkillShot.Caster.NetworkId ==
                             SkillshotDetector.ActiveSkillshots[i].Caster.NetworkId &&
                             d.SkillShot.SkillshotData.SpellName ==
                             SkillshotDetector.ActiveSkillshots[i].SkillshotData.SpellName &&
                             SkillshotDetector.ActiveSkillshots[i].SkillshotData.PossibleTargets.Any(
                                 h => h == Hero.NetworkId)))
                     {
                         continue;
                     }
                     if (data != null && data.Hero != Hero)
                     {
                         if (
                             SkillshotDetector.ActiveSkillshots[i].SkillshotData.CollisionObjects.Count(
                                 c => c != CollisionObjectTypes.YasuoWall) > 0)
                         {
                             /* Console.WriteLine(
                              *  SkillshotDetector.ActiveSkillshots[i].SkillshotData.SpellName + " -> " +
                              *  Hero.Name + " - " +
                              *  SkillshotDetector.ActiveSkillshots[i].SkillshotData.IsDangerous);*/
                             data.Damages.Add(newData);
                             SkillshotDetector.ActiveSkillshots[i].SkillshotData.PossibleTargets.Add(
                                 Hero.NetworkId);
                             SkillshotDetector.ActiveSkillshots.RemoveAt(i);
                             break;
                         }
                         else
                         {
                             /*Console.WriteLine(
                              *  SkillshotDetector.ActiveSkillshots[i].SkillshotData.SpellName + " --> " +
                              *  Hero.Name + " - " +
                              *  SkillshotDetector.ActiveSkillshots[i].SkillshotData.IsDangerous);*/
                             data.Damages.Add(newData);
                             SkillshotDetector.ActiveSkillshots[i].SkillshotData.PossibleTargets.Add(
                                 Hero.NetworkId);
                         }
                     }
                 }
             }
         }
     }
 }