コード例 #1
0
        private static void FindFarPoints()
        {
            for (int j = 0; j < 5; j++)
            {
                float maxDist     = 0;
                int   removeIndex = -1;

                int i = 0;
                foreach (var prediction in predictions)
                {
                    if (circleCenter.Distance(prediction) > R_radius -
                        config.SubMenu("ult").SubMenu("misc").Item("radiusDeviation").GetValue <Slider>().Value&&
                        (maxDist == 0 || circleCenter.Distance(prediction) > maxDist))
                    {
                        maxDist     = circleCenter.Distance(prediction);
                        removeIndex = i;
                    }
                    i++;
                }

                if (removeIndex != -1)
                {
                    predictions.RemoveAt(removeIndex);
                }
                else
                {
                    return;
                }

                MEC.FindMinimalBoundingCircle(predictions, out circleCenter, out circleRadius);
            }
        }
コード例 #2
0
        static void CalcUlt()
        {
            if (config.SubMenu("ult").Item("ultEnemy").GetValue <KeyBind>().Active)
            {
                predictions.Clear();
                enemiesGettingHit.Clear();
                AddPredictions();

                if (predictions.Count >= config.SubMenu("ult").Item("ultEnemyCount").GetValue <Slider>().Value)
                {
                    MEC.FindMinimalBoundingCircle(predictions, out circleCenter, out circleRadius);

                    FindFarPoints();

                    if (predictions.Count >= config.SubMenu("ult").Item("ultEnemyCount").GetValue <Slider>().Value)
                    {
                        MEC.FindMinimalBoundingCircle(predictions, out betterCircleCenter, out betterCircleRadius);

                        if (predictions.Count >= config.SubMenu("ult").Item("ultEnemyCount").GetValue <Slider>().Value&&
                            betterCircleCenter.Distance(ObjectManager.Player.Position) <= R.Range)
                        {
                            draw = true;
                            if (config.SubMenu("ult").SubMenu("misc").Item("useBetterPred").GetValue <bool>() &&
                                BetterPredition() >=
                                config.SubMenu("ult").Item("ultEnemyCount").GetValue <Slider>().Value)
                            {
                                Ult();
                            }
                            else if (!config.SubMenu("ult").SubMenu("misc").Item("useBetterPred").GetValue <bool>())
                            {
                                Ult();
                            }
                        }
                        else
                        {
                            draw = false;
                            //Console.WriteLine("Less points: " + predictions.Count.ToString());
                        }
                    }
                }
            }

            if (R.IsReady())
            {
                foreach (var ally in ObjectManager.Get <AIHeroClient>().Where(x => x.IsAlly && !x.IsDead))
                {
                    if (config.SubMenu("ult").SubMenu("allies").Item(ally.ChampionName).GetValue <bool>() &&
                        !ally.IsRecalling())
                    {
                        float flyTime          = ObjectManager.Player.Distance(ally) / R.Speed;
                        float healthPrediction = HealthPrediction.GetHealthPrediction(ally, (int)(R.Delay + flyTime));

                        if (healthPrediction >= 1 &&
                            healthPrediction <= config.SubMenu("ult").Item("ultAllyAtXHp").GetValue <Slider>().Value&&
                            ObjectManager.Get <AIHeroClient>().Where(x => x.IsEnemy && !x.IsDead).Count() > 0)
                        {
                            var allyPosPrediction =
                                Prediction.GetPrediction(ally, R.Delay + flyTime);
                            if (allyPosPrediction.CastPosition.Distance(ObjectManager.Player.Position) <= R.Range &&
                                allyPosPrediction.Hitchance >= HitChance.Medium)
                            {
                                R.Cast(allyPosPrediction.CastPosition);
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
ファイル: Orianna.cs プロジェクト: wade1990/PortAIO
        public void BeforeOrbwalk()
        {
            if (ObjectManager.Player.HealthPercent < 25 && ObjectManager.Player.CountEnemiesInRange(1200) > 0)
            {
                Spells[E].CastOnUnit(ObjectManager.Player);
            }

            if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.None)
            {
                Helpers.BallMgr.ClearWorkQueue();
                if (ConfigMenu.Item("HTOGGLE").GetValue <KeyBind>().Active)
                {
                    Harass();
                }
            }

            if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.None)
            {
                if (Spells[R].IsReady() && Helpers.BallMgr.IsBallReady && ConfigMenu.Item("MAUTOR").GetValue <bool>())
                {
                    if (CountEnemiesInRangePredicted(Spells[R].Range, 100, 0.75f) >= ConfigMenu.Item("MAUTORHIT").GetValue <Slider>().Value)
                    {
                        Helpers.BallMgr.Post(Helpers.BallMgr.Command.Shockwave, null);
                    }
                    else
                    {
                        if (Spells[Q].IsReady())
                        {
                            List <Vector2> poses = new List <Vector2>();
                            foreach (var enemy in HeroManager.Enemies)
                            {
                                if (enemy.IsValidTarget(Spells[Q].Range))
                                {
                                    var pos = LeagueSharp.Common.Prediction.GetPrediction(enemy, 0.75f).UnitPosition.To2D();
                                    if (pos.Distance(ObjectManager.Player.ServerPosition.To2D()) <= 800)
                                    {
                                        poses.Add(LeagueSharp.Common.Prediction.GetPrediction(enemy, 0.75f).UnitPosition.To2D());
                                    }
                                }
                            }

                            foreach (var list in GetCombinations(poses))
                            {
                                if (list.Count >= ConfigMenu.Item("MAUTORHIT").GetValue <Slider>().Value)
                                {
                                    Vector2 center;
                                    float   radius;
                                    MEC.FindMinimalBoundingCircle(poses, out center, out radius);
                                    if (radius < Spells[R].Width && center.Distance(ObjectManager.Player.ServerPosition) < 825f)
                                    {
                                        Helpers.BallMgr.Post(Helpers.BallMgr.Command.Attack, null, center);
                                        Helpers.BallMgr.Post(Helpers.BallMgr.Command.Shockwave, null);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }