コード例 #1
0
 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);
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: IncomingDamage.cs プロジェクト: CONANLXF/AIO
 private void CheckSkillShots()
 {
     if (!skillShotChecked)
     {
         skillShotChecked = true;
         LeagueSharp.Common.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 &&
                         ((AIHeroClient)SkillshotDetector.ActiveSkillshots[i].Caster).ChampionName ==
                         b.ChampionName))
             {
                 SkillshotDetector.ActiveSkillshots.RemoveAt(i);
                 break;
             }
             foreach (var Hero in
                 HeroManager.AllHeroes.Where(
                     h =>
                         h.LSDistance(SkillshotDetector.ActiveSkillshots[i].Caster) <
                         SkillshotDetector.ActiveSkillshots[i].SkillshotData.Range)
                     .OrderBy(h => h.LSDistance(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.LSIsValidTarget(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).LSDistance(Hero) /
                          SkillshotDetector.ActiveSkillshots[i].SkillshotData.MissileSpeed);
                     missileSpeed = missileSpeed > 5f ? 5f : missileSpeed;
                     var newData = new Dmg(
                         Hero,
                         (float)
                             Damage.LSGetSpellDamage(
                                 (AIHeroClient)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);
                         }
                     }
                 }
             }
         }
     }
 }