コード例 #1
0
ファイル: Lissandra.cs プロジェクト: as510446/LeagueSharp
        private static void CastE(Obj_AI_Hero target)
        {
            if (LissEMissile == null && !LissUtils.CanSecondE())
            {
                var PredManager = new List <Tuple <Vector3, int, HitChance, List <Obj_AI_Hero> > >();
                foreach (
                    var hero in
                    HeroManager.Enemies
                    .Where(
                        h =>
                        h.IsValidTarget() && !h.IsZombie &&
                        Vector3.Distance(h.ServerPosition, Player.ServerPosition) <= Spells["E"].Range))
                {
                    var pred = Spells["E"].GetPrediction(hero);
                    PredManager.Add(new Tuple <Vector3, int, HitChance, List <Obj_AI_Hero> >(pred.CastPosition,
                                                                                             pred.AoeTargetsHitCount, pred.Hitchance, pred.AoeTargetsHit));
                }

                // var OrganizedPredManager = PredManager.OrderByDescending(x => x.Item2);
                var BestLocation = PredManager.MaxOrDefault(x => x.Item4.Count);
                if (BestLocation.Item3 >= LissUtils.GetHitChance("Hitchance.E") && Spells["E"].IsReady())
                {
                    Spells["E"].Cast(BestLocation.Item1);
                }
            }
            SecondEChecker(target);
        }
コード例 #2
0
ファイル: Lissandra.cs プロジェクト: as510446/LeagueSharp
        /*
         * private static void CastQ(Obj_AI_Hero target)
         * {
         * List<Vector3> Positions = new List<Vector3>();
         * List<Vector3> GoodPositions = new List<Vector3>();
         * foreach (
         *     var hero in
         *         ObjectManager.Get<Obj_AI_Hero>()
         *             .Where(
         *                 h =>
         *                     h.IsValidTarget() && !h.IsZombie &&
         *                     Vector3.Distance(Player.ServerPosition, h.ServerPosition) < Spells["Q2"].Range))
         * {
         *     var pred = Spells["Q2"].GetPrediction(hero, true);
         *     if (pred.AoeTargetsHitCount > 1 &&
         *         pred.AoeTargetsHit.Any(
         *             h => Vector3.Distance(Player.ServerPosition, h.ServerPosition) <= Spells["Q"].Range) && pred.Hitchance > GetHitChance("Hitchance.Q"))
         *     {
         *         Positions.Add(pred.CastPosition);
         *         if (pred.AoeTargetsHit.Any(h => h.Equals(target)))
         *         {
         *             GoodPositions.Add(pred.CastPosition);
         *         }
         *
         *     }
         * }
         *
         * if (Vector3.Distance(target.ServerPosition, Player.ServerPosition) <= Spells["Q"].Range)
         * {
         *     var pred = Spells["Q"].GetPrediction(target);
         *     if (pred.Hitchance > GetHitChance("Hitchance.Q"))
         *     {
         *         Positions.Add(pred.CastPosition);
         *     }
         * }
         * if (GoodPositions.Any())
         *     {
         *         Spells["Q2"].Cast(GoodPositions.FirstOrDefault());
         *         if (LissUtils.Active("Misc.Debug"))
         *         {
         *             Game.PrintChat("Good position");
         *         }
         *         return;
         *     }
         * if (Positions.Any())
         * {
         *     Spells["Q"].Cast(Positions.FirstOrDefault());
         *     if (LissUtils.Active("Misc.Debug"))
         *     {
         *         Game.PrintChat("positions");
         *     }
         * }
         * }
         * */


        private static void CastQ(Obj_AI_Hero target)
        {
            var pred             = Spells["Q2"].GetPrediction(target);
            var collisionobjects = pred.CollisionObjects;

            if (collisionobjects.Any())
            {
                Spells["Q2"].Cast(pred.CastPosition);
                return;
            }
            var predQ = Spells["Q"].GetPrediction(target);

            if (predQ.Hitchance > LissUtils.GetHitChance("Hitchance.Q"))
            {
                Spells["Q"].Cast(pred.CastPosition);
                return;
            }
            foreach (var hero in HeroManager.Enemies.Where(h => h.IsValidTarget() && !h.IsInvulnerable && Vector3.Distance(h.ServerPosition, Player.ServerPosition) < Spells["Q2"].Range && SpellSlot.Q.IsReady()))
            {
                var prediction = Spells["Q2"].GetPrediction(hero);
                if (prediction.CollisionObjects.Any() && prediction.Hitchance > LissUtils.GetHitChance("Hitchance.Q"))
                {
                    Spells["Q2"].Cast(pred.CastPosition);
                    return;
                }
                var prediction2 = Spells["Q"].GetPrediction(hero);
                if (prediction.Hitchance > LissUtils.GetHitChance("Hitchance.Q"))
                {
                    Spells["Q"].Cast(pred.CastPosition);
                }
            }
        }
コード例 #3
0
ファイル: Lissandra.cs プロジェクト: commonsharp/PortAIO
        private static void CastQ(AIHeroClient target)
        {
            var maxhit = (from hero in
                          HeroManager.Enemies.Where(
                              h =>
                              h.IsValidTarget() && !h.IsInvulnerable &&
                              Vector3.Distance(h.ServerPosition, Player.ServerPosition) < Spells["Q2"].Range)
                          select Spells["Q2"].GetPrediction(hero)
                          into prediction
                          where
                          prediction.CollisionObjects.Count > 0 &&
                          prediction.Hitchance >= LissUtils.GetHitChance("Hitchance.Q")
                          let enemieshit = prediction.CollisionObjects.Where(x => x is AIHeroClient)
                                           select prediction).ToDictionary(prediction => prediction.CastPosition,
                                                                           prediction => prediction.CollisionObjects.Count);

            var bestpair = maxhit.MaxOrDefault(x => x.Value);

            if (bestpair.Value > 0)
            {
                var bestpos = bestpair.Key;
                Spells["Q2"].Cast(bestpos);
                return;
            }


            var distbw = Vector3.Distance(Player.ServerPosition, target.ServerPosition);

            if (distbw < Spells["Q"].Range)
            {
                var prediction2 = Spells["Q"].GetPrediction(target);
                if (prediction2.Hitchance >= LissUtils.GetHitChance("Hitchance.Q"))
                {
                    Spells["Q"].Cast(target);
                    return;
                }
            }

            if (distbw > Spells["Qtest"].Range && distbw < Spells["Q2"].Range)
            {
                var testQ    = Spells["Qtest"].GetPrediction(target);
                var collobjs = testQ.CollisionObjects;
                if ((testQ.Hitchance == HitChance.Collision || collobjs.Count > 0) && collobjs.All(x => x.IsTargetable))
                {
                    var pred = Spells["Q2"].GetPrediction(target);
                    if (pred.Hitchance >= LissUtils.GetHitChance("Hitchance.Q"))
                    {
                        Spells["Q2"].Cast(target);
                    }
                }
            }
        }
コード例 #4
0
ファイル: Lissandra.cs プロジェクト: commonsharp/PortAIO
        private static void CastE(AIHeroClient target)
        {
            if (LissEMissile == null && !LissUtils.CanSecondE())
            {
                var PredManager =
                    HeroManager.Enemies.Where(
                        h =>
                        h.IsValidTarget() && !h.IsZombie &&
                        Vector3.Distance(h.ServerPosition, Player.ServerPosition) <= Spells["E"].Range)
                    .Select(hero => Spells["E"].GetPrediction(hero))
                    .Select(
                        pred =>
                        new Tuple <Vector3, int, HitChance, List <AIHeroClient> >(pred.CastPosition,
                                                                                  pred.AoeTargetsHitCount, pred.Hitchance, pred.AoeTargetsHit));

                var BestLocation = PredManager.MaxOrDefault(x => x.Item4.Count);
                if (BestLocation.Item3 >= LissUtils.GetHitChance("Hitchance.E") && Spells["E"].IsReady())
                {
                    Spells["E"].Cast(BestLocation.Item1);
                }
            }
            SecondEChecker(target);
        }