Example #1
0
        public static void OnCombo()
        {
            if (spells[Spells.Q].IsReady() && Utilities.IsEnabled("q.combo"))
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spells[Spells.Q].Range)))
                {
                    spells[Spells.Q].Cast(enemy);
                }
            }

            if (spells[Spells.W].IsReady() && Utilities.IsEnabled("w.combo"))
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spells[Spells.W].Range)))
                {
                    spells[Spells.W].PredictionCast(enemy, Utilities.TheHitChance("sel.hitchance.w"), "sel.predict.w", Menus.menuCfg);
                }
            }

            if (spells[Spells.E].IsReady() && Utilities.IsEnabled("e.combo"))
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(ERange + spells[Spells.E].Range)))
                {
                    HitEnemy_E(enemy, Utilities.TheHitChance("sel.hitchance.e"));
                }
            }

            if (spells[Spells.R].IsReady() && Utilities.IsEnabled("r.combo"))
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spells[Spells.R].Range) &&
                                                                spells[Spells.R].GetPrediction(x, true).Hitchance >= Utilities.TheHitChance("sel.hitchance.r")))
                {
                    if (enemy.Health < CalculateDamage(enemy) && enemy.HealthPercent > 10)
                    {
                        if (Utilities.IsEnabled("r.champ.whitelist" + enemy.ChampionName))
                        {
                            spells[Spells.R].Cast(enemy);
                        }
                    }
                    if (Utilities.Player.CountEnemiesInRange(spells[Spells.R].Range) >= Utilities.SliderValue("r.min.hit"))
                    {
                        if (Utilities.IsEnabled("r.champ.whitelist" + enemy.ChampionName))
                        {
                            spells[Spells.R].CastIfWillHit(enemy, Utilities.SliderValue("r.min.hit"));
                        }
                    }
                }
            }
        }
Example #2
0
        public static FarmLocation GetBestLaserFarmLocation(bool jungle)
        {
            var bestEndPos   = new Vector2();
            var bestStartPos = new Vector2();
            var mMinionCount = 0;
            List <Obj_AI_Base> AllMinions;

            if (!jungle)
            {
                AllMinions = MinionManager.GetMinions(EMaxRange);
            }
            else
            {
                AllMinions = MinionManager.GetMinions(EMaxRange, MinionTypes.All, MinionTeam.Neutral);
            }

            var mMinionsList     = (from minions in AllMinions select minions.Position.To2D()).ToList <Vector2>();
            var possiblePosition = new List <Vector2>();

            possiblePosition.AddRange(mMinionsList);
            var Max = possiblePosition.Count;

            for (var i = 0; i < Max; i++)
            {
                for (var j = 0; j < Max; j++)
                {
                    if (possiblePosition[j] != possiblePosition[i])
                    {
                        possiblePosition.Add((possiblePosition[j] + possiblePosition[i]) / 2);
                    }
                }
            }

            foreach (var StartPositionMinion in AllMinions.Where(m => Utilities.Player.Distance(m) < ERange))
            {
                var StartPos = StartPositionMinion.Position.To2D();

                foreach (var Pos in possiblePosition)
                {
                    if (Pos.Distance(StartPos, true) <= LenghtE * LenghtE)
                    {
                        var EndPos = StartPos + LenghtE * (Pos - StartPos).Normalized();
                        var count  =
                            mMinionsList.Count(Pos2 => Pos2.Distance(StartPos, EndPos, true, true) <= 140 * 140);

                        if (count >= mMinionCount)
                        {
                            bestEndPos   = EndPos;
                            mMinionCount = count;
                            bestStartPos = StartPos;
                        }
                    }
                }
            }

            if ((!jungle && Utilities.SliderValue("e.clear.minhit") < mMinionCount) || (jungle && mMinionCount > 0))
            {
                return(new FarmLocation(bestStartPos, bestEndPos, mMinionCount));
            }
            else
            {
                return(new FarmLocation(bestStartPos, bestEndPos, 0));
            }
        } // Algorithm by Trus. Congratz bro