예제 #1
0
        internal override void Execute()
        {
            if (Settings.UseE && !Config.Auto.AutoE.KillEnemyHeros && E.IsReady() && GameObjects.EnemyHeroes.Any(x => x.IsKillableWithE(true)))
            {
                E.Cast();
            }

            if (Settings.AttackMinion && Variables.Orbwalker.CanAttack && !GameObjects.EnemyHeroes.Any(x => x.InAutoAttackRange()))
            {
                var units = new List <Obj_AI_Minion>();
                units.AddRange(GameObjects.EnemyMinions);
                units.AddRange(GameObjects.Jungle);
                var bestUnit = units.Where(x => x.IsValidTarget() && x.InAutoAttackRange()).OrderByDescending(x => x.Distance(GameObjects.Player)).FirstOrDefault();
                if (bestUnit != null)
                {
                    Variables.Orbwalker.Attack(bestUnit);
                }
            }

            if (!Variables.Orbwalker.CanMove)
            {
                return;
            }

            if (Q.IsReady() && Settings.KeepManaForE ? GameObjects.Player.Mana - Q.Instance.SData.Mana >= 30 : true)
            {
                var caststate = CastStates.NotCasted;

                if (Settings.UseQ)
                {
                    caststate = Q.CastOnBestTarget();
                }

                if (Settings.UseQPierce && caststate == CastStates.NotCasted)
                {
                    var target = Variables.TargetSelector.GetTarget(Q);
                    if (target != null)
                    {
                        var prediction = Movement.GetPrediction(new PredictionInput
                        {
                            Unit = target, Delay = Q.Delay, Radius = Q.Width, Speed = Q.Speed, Range = Q.Range
                        });
                        if (prediction.Hitchance >= HitChance.High)
                        {
                            var collision = Collision.GetCollision(new List <Vector3>
                            {
                                prediction.UnitPosition
                            }, SpellManager.QCollisionInput);
                            collision.Remove(GameObjects.Player);
                            collision.Remove(target);
                            if (collision.All(x => x.IsKillableWithQ()))
                            {
                                Q.Cast(prediction.CastPosition);
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
        internal override void Execute()
        {
            if (!Variables.Orbwalker.CanMove())
            {
                return;
            }

            if (Q.IsReady() && GameObjects.Player.ManaPercent > Settings.Mana)
            {
                var caststate = CastStates.NotCasted;

                if (Settings.UseQ)
                {
                    caststate = Q.CastOnBestTarget();
                }

                if (Settings.UseQPierce && caststate == CastStates.NotCasted)
                {
                    var target = Variables.TargetSelector.GetTarget(Q);
                    if (target != null)
                    {
                        var prediction = Movement.GetPrediction(new PredictionInput
                        {
                            Unit   = target,
                            Delay  = Q.Delay,
                            Radius = Q.Width,
                            Speed  = Q.Speed,
                            Range  = Q.Range
                        });
                        if (prediction.Hitchance >= HitChance.High)
                        {
                            var collision = Collision.GetCollision(new List <Vector3>
                            {
                                prediction.UnitPosition
                            }, SpellManager.QCollisionInput);
                            collision.Remove(GameObjects.Player);
                            collision.Remove(target);
                            if (collision.All(x => x.IsKillableWithQ()))
                            {
                                Q.Cast(prediction.CastPosition);
                            }
                        }
                    }
                }
            }
        }
예제 #3
0
        internal static List <Obj_AI_Base> GetCollision(
            this PredictionOutput pred,
            CollisionableObjects collisionable = CollisionableObjects.Minions)
        {
            var col = Collision.GetCollision(
                new List <Vector3> {
                pred.UnitPosition, pred.Input.Unit.Position
            },
                new PredictionInput
            {
                Delay = pred.Input.Delay, Radius = pred.Input.Radius, Speed = pred.Input.Speed,
                Range = pred.Input.Range, Type = pred.Input.Type, CollisionObjects = collisionable,
                From  = pred.Input.From
            });

            col.RemoveAll(i => i.Compare(pred.Input.Unit));
            return(col);
        }
예제 #4
0
        public static List <Obj_AI_Base> GetCollision(this Spell spell, Obj_AI_Base target, List <Vector3> to, CollisionableObjects collisionable = CollisionableObjects.Minions)
        {
            var col = Collision.GetCollision(
                to,
                new PredictionInput
            {
                Delay            = spell.Delay,
                Radius           = spell.Width,
                Speed            = spell.Speed,
                From             = spell.From,
                Range            = spell.Range,
                Type             = spell.Type,
                CollisionObjects = collisionable
            });

            col.RemoveAll(i => i.Compare(target));

            return(col);
        }