Exemplo n.º 1
0
        private void QFarmLogic(List <Obj_AI_Base> minions, int min)
        {
            try
            {
                if (!Q.IsReady() || minions.Count == 0)
                {
                    return;
                }
                var totalHits = 0;
                var castPos   = Vector3.Zero;

                var positions = (from minion in minions
                                 let pred = Q.GetPrediction(minion)
                                            where pred.Hitchance >= HitChance.Medium
                                            where !Utils.IsWallBetween(Player.Position, pred.UnitPosition)
                                            select new Tuple <Obj_AI_Base, Vector3>(minion, pred.UnitPosition)).ToList();

                if (positions.Any())
                {
                    foreach (var position in positions)
                    {
                        var rect = new Geometry.Polygon.Rectangle(
                            ObjectManager.Player.Position, ObjectManager.Player.Position.Extend(position.Item2, Q.Range),
                            Q.Width);
                        var count =
                            positions.Select(
                                position2 =>
                                new Geometry.Polygon.Circle(position2.Item2, position2.Item1.BoundingRadius * 0.9f))
                            .Count(circle => circle.Points.Any(p => rect.IsInside(p)));
                        if (count > totalHits)
                        {
                            totalHits = count;
                            castPos   = position.Item2;
                        }
                        if (totalHits == minions.Count)
                        {
                            break;
                        }
                    }
                    if (!castPos.Equals(Vector3.Zero) && totalHits >= min)
                    {
                        Q.Cast(castPos);
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Exemplo n.º 2
0
 protected override void Killsteal()
 {
     if (Menu.Item(Menu.Name + ".killsteal.q").GetValue <bool>() && Q.IsReady())
     {
         var fPredEnemy =
             GameObjects.EnemyHeroes.Where(e => e.IsValidTarget(Q.Range * 1.2f) && Q.IsKillable(e))
             .Select(enemy => Q.GetPrediction(enemy, true))
             .FirstOrDefault(pred => pred.Hitchance >= HitChance.High);
         if (fPredEnemy != null && !Utils.IsWallBetween(Player.Position, fPredEnemy.CastPosition))
         {
             Q.Cast(fPredEnemy.CastPosition);
         }
     }
 }
Exemplo n.º 3
0
        private void QLogic(HitChance hitChance)
        {
            var target = TargetSelector.GetTarget(Q);

            if (target != null)
            {
                var prediction = CPrediction.Line(Q, target, hitChance, false);
                if (prediction.TotalHits >= 1)
                {
                    var firstHit = prediction.Hits.OrderBy(h => h.Distance(Player)).FirstOrDefault();
                    if (firstHit != null && !Utils.IsWallBetween(Player.Position, firstHit.Position))
                    {
                        if (!GameObjects.EnemyHeroes.Any(e => e.IsValidTarget() && Orbwalking.InAutoAttackRange(e)) ||
                            IsReloading() || Q.IsKillable(target) || prediction.TotalHits >= 2)
                        {
                            Q.Cast(prediction.CastPosition);
                        }
                    }
                }
            }
        }