Ejemplo n.º 1
0
        private void DoFlee()
        {
            if (!Variables.Spells[SpellSlot.E].IsReady() || TunnelObjectNetworkID == -1)
            {
                Orbwalking.MoveTo(Game.CursorPos);
            }

            if (PositioningHelper.DoPositionsCrossWall(ObjectManager.Player.ServerPosition, Game.CursorPos) &&
                PositioningHelper.GetWallLength(ObjectManager.Player.ServerPosition, Game.CursorPos) >= 200f)
            {
                Orbwalking.MoveTo(PositioningHelper.GetFirstWallPoint(ObjectManager.Player.ServerPosition, Game.CursorPos));
            }

            //Q

            var ComboTarget = TargetSelector.GetTarget(Variables.Spells[SpellSlot.Q].Range / 1.3f, TargetSelector.DamageType.Magical);

            if (Variables.Spells[SpellSlot.Q].IsReady() && ComboTarget.IsValidTarget())
            {
                HandleQ(ComboTarget);
            }

            //E

            var dir      = ObjectManager.Player.ServerPosition.To2D() + ObjectManager.Player.Direction.To2D().Perpendicular() * (ObjectManager.Player.BoundingRadius * 2.5f);
            var Extended = Game.CursorPos;

            if (dir.IsWall() &&
                PositioningHelper.GetWallLength(ObjectManager.Player.ServerPosition, Extended) >= 200f &&
                PositioningHelper.DoPositionsCrossWall(ObjectManager.Player.ServerPosition, Extended))
            {
                Variables.Spells[SpellSlot.E].Cast(Extended);
            }
        }
Ejemplo n.º 2
0
        public void OnExecute()
        {
            if ((PositioningHelper.DoPositionsCrossWall(ObjectManager.Player.ServerPosition, Game.CursorPos) &&
                 PositioningHelper.GetWallLength(ObjectManager.Player.ServerPosition, Game.CursorPos) >= (35f)))
            {
                MoveToLimited(PositioningHelper.GetFirstWallPoint(ObjectManager.Player.ServerPosition, Game.CursorPos));
            }
            else
            {
                MoveToLimited(Game.CursorPos);
            }

            var directionExtension         = ObjectManager.Player.ServerPosition.To2D() + ObjectManager.Player.Direction.To2D().Perpendicular() * (ObjectManager.Player.BoundingRadius * 1.10f);
            var oppositeDirectionExtension = ObjectManager.Player.ServerPosition.To2D() + ObjectManager.Player.Direction.To2D().Perpendicular() * -(ObjectManager.Player.BoundingRadius * 2f);
            var ExtendedPosition           = ObjectManager.Player.ServerPosition.To2D() + ObjectManager.Player.Direction.To2D().Perpendicular() * (300 + 65f);

            if (directionExtension.IsWall() && PositioningHelper.DoPositionsCrossWall(ObjectManager.Player.ServerPosition, ExtendedPosition.To3D()) &&
                Variables.Spells[SpellSlot.Q].IsReady() &&
                PositioningHelper.DoPositionsCrossWall(ObjectManager.Player.ServerPosition, Game.CursorPos) &&
                PositioningHelper.GetWallLength(ObjectManager.Player.ServerPosition, ExtendedPosition.To3D()) <= (280f - 65f / 2f))
            {
                Variables.Spells[SpellSlot.Q].Cast(oppositeDirectionExtension);
            }
        }
Ejemplo n.º 3
0
        public void OnCombo()
        {
            var qTarget = TargetSelector.GetTarget(Variables.Spells[SpellSlot.Q].Range / 1.5f, TargetSelector.DamageType.Magical);

            if (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo) && qTarget.IsValidTarget())
            {
                var targetPrediction = LeagueSharp.Common.Prediction.GetPrediction(qTarget, 0.75f);

                if (ObjectManager.Player.HealthPercent >= 35)
                {
                    var enemyHeroesPositions = HeroManager.Enemies.Select(hero => hero.Position.To2D()).ToList();

                    var Groups = PositioningHelper.GetCombinations(enemyHeroesPositions);

                    foreach (var group in Groups)
                    {
                        if (group.Count >= 3)
                        {
                            var Circle = MEC.GetMec(group);

                            if (Circle.Center.To3D().CountEnemiesInRange(Variables.Spells[SpellSlot.Q].Range) >= 2 &&
                                Circle.Center.Distance(ObjectManager.Player) <= Variables.Spells[SpellSlot.Q].Range &&
                                Circle.Radius <= Variables.Spells[SpellSlot.Q].Width)
                            {
                                this.BallManager.ProcessCommand(new Command()
                                {
                                    SpellCommand = Commands.Q,
                                    Where        = Circle.Center.To3D()
                                });
                                return;
                            }
                        }
                    }
                }

                this.BallManager.ProcessCommand(new Command()
                {
                    SpellCommand = Commands.Q,
                    Where        = targetPrediction.UnitPosition
                });
            }

            if (Variables.Spells[SpellSlot.W].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo) &&
                qTarget.IsValidTarget(Variables.Spells[SpellSlot.W].Range))
            {
                var ballLocation = this.BallManager.BallPosition;
                var minWEnemies  = 2;

                if (ObjectManager.Player.CountEnemiesInRange(Variables.Spells[SpellSlot.Q].Range + 245f) >= 2)
                {
                    if (ballLocation.CountEnemiesInRange(Variables.Spells[SpellSlot.W].Range) >= minWEnemies)
                    {
                        this.BallManager.ProcessCommand(new Command()
                        {
                            SpellCommand = Commands.W,
                        });
                    }
                }
                else
                {
                    if (ballLocation.CountEnemiesInRange(Variables.Spells[SpellSlot.W].Range) >= 1)
                    {
                        this.BallManager.ProcessCommand(new Command()
                        {
                            SpellCommand = Commands.W,
                        });
                    }
                }
            }


            if (Variables.Spells[SpellSlot.R].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo))
            {
                if (ObjectManager.Player.CountEnemiesInRange(Variables.Spells[SpellSlot.Q].Range + 250f) > 1)
                {
                    var EnemyPositions = HeroManager.Enemies.Select(hero => hero.Position.To2D()).ToList();

                    var Combinations = PositioningHelper.GetCombinations(EnemyPositions);


                    foreach (var group in Combinations)
                    {
                        if (group.Count >= 2)
                        {
                            var Circle = MEC.GetMec(group);
                            if (Variables.Spells[SpellSlot.Q].IsReady() &&
                                Circle.Center.Distance(ObjectManager.Player) <= Variables.Spells[SpellSlot.Q].Range &&
                                Circle.Radius <= Variables.Spells[SpellSlot.R].Range &&
                                Circle.Center.To3D().CountEnemiesInRange(Variables.Spells[SpellSlot.R].Range) >= 2)
                            {
                                Variables.Spells[SpellSlot.Q].Cast(Circle.Center.To3D());

                                var arrivalDelay =
                                    (int)
                                    (BallManager.BallPosition.Distance(Circle.Center.To3D()) /
                                     Variables.Spells[SpellSlot.Q].Speed * 1000f +
                                     Variables.Spells[SpellSlot.Q].Delay * 1000f + Game.Ping / 2f + 100f);

                                Utility.DelayAction.Add(
                                    arrivalDelay, () =>
                                {
                                    //Extra check just for safety
                                    if (
                                        BallManager.BallPosition.CountEnemiesInRange(
                                            Variables.Spells[SpellSlot.R].Range) >= 2)
                                    {
                                        Variables.Spells[SpellSlot.R].Cast();
                                    }
                                });
                            }
                        }
                    }
                }
                else
                {
                    var targetForQR = TargetSelector.GetTarget(
                        Variables.Spells[SpellSlot.Q].Range / 1.2f, TargetSelector.DamageType.Magical);

                    if (targetForQR.IsValidTarget())
                    {
                        var QWDamage = ObjectManager.Player.GetComboDamage(
                            targetForQR, new[] { SpellSlot.Q, SpellSlot.W });
                        var QRDamage = ObjectManager.Player.GetComboDamage(
                            targetForQR, new[] { SpellSlot.Q, SpellSlot.W, SpellSlot.R });

                        var healthCheck = targetForQR.Health + 10f < QRDamage && !(targetForQR.Health + 10f < QWDamage);

                        if (!healthCheck)
                        {
                            return;
                        }

                        var rPosition = targetForQR.ServerPosition.Extend(
                            ObjectManager.Player.ServerPosition, Variables.Spells[SpellSlot.R].Range / 2f);

                        if (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo) &&
                            rPosition.Distance(ObjectManager.Player.ServerPosition) <=
                            Variables.Spells[SpellSlot.Q].Range)
                        {
                            Variables.Spells[SpellSlot.Q].Cast(rPosition);

                            var actionDelay =
                                (int)
                                (BallManager.BallPosition.Distance(rPosition) / Variables.Spells[SpellSlot.Q].Speed *
                                 1000f + Variables.Spells[SpellSlot.Q].Delay * 1000f + Game.Ping / 2f + 100f);

                            Utility.DelayAction.Add(
                                actionDelay, () =>
                            {
                                if (
                                    BallManager.BallPosition.CountEnemiesInRange(
                                        Variables.Spells[SpellSlot.R].Range) >= 1)
                                {
                                    Variables.Spells[SpellSlot.R].Cast();
                                }
                            });
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void OnMixed()
        {
            if (ObjectManager.Player.ManaPercent <
                Variables.AssemblyMenu.GetItemValue <Slider>("dzaio.champion.orianna.mixed.mana").Value)
            {
                return;
            }

            var qTarget = TargetSelector.GetTarget(Variables.Spells[SpellSlot.Q].Range / 1.5f, TargetSelector.DamageType.Magical);

            if (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Harrass) && qTarget.IsValidTarget())
            {
                var targetPrediction = LeagueSharp.Common.Prediction.GetPrediction(qTarget, 0.75f);

                if (ObjectManager.Player.HealthPercent >= 35)
                {
                    var enemyHeroesPositions = HeroManager.Enemies.Select(hero => hero.Position.To2D()).ToList();

                    var Groups = PositioningHelper.GetCombinations(enemyHeroesPositions);

                    foreach (var group in Groups)
                    {
                        if (group.Count >= 3)
                        {
                            var Circle = MEC.GetMec(group);

                            if (Circle.Center.To3D().CountEnemiesInRange(Variables.Spells[SpellSlot.Q].Range) >= 2 &&
                                Circle.Center.Distance(ObjectManager.Player) <= Variables.Spells[SpellSlot.Q].Range &&
                                Circle.Radius <= Variables.Spells[SpellSlot.Q].Width)
                            {
                                this.BallManager.ProcessCommand(new Command()
                                {
                                    SpellCommand = Commands.Q,
                                    Where        = Circle.Center.To3D()
                                });
                                return;
                            }
                        }
                    }
                }

                this.BallManager.ProcessCommand(new Command()
                {
                    SpellCommand = Commands.Q,
                    Where        = targetPrediction.UnitPosition
                });
            }

            if (Variables.Spells[SpellSlot.W].IsEnabledAndReady(ModesMenuExtensions.Mode.Harrass) &&
                qTarget.IsValidTarget(Variables.Spells[SpellSlot.W].Range))
            {
                var ballLocation = this.BallManager.BallPosition;
                var minWEnemies  = 2;

                if (ObjectManager.Player.CountEnemiesInRange(Variables.Spells[SpellSlot.Q].Range + 245f) >= 2)
                {
                    if (ballLocation.CountEnemiesInRange(Variables.Spells[SpellSlot.W].Range) >= minWEnemies)
                    {
                        this.BallManager.ProcessCommand(new Command()
                        {
                            SpellCommand = Commands.W,
                        });
                    }
                }
                else
                {
                    if (ballLocation.CountEnemiesInRange(Variables.Spells[SpellSlot.W].Range) >= 1)
                    {
                        this.BallManager.ProcessCommand(new Command()
                        {
                            SpellCommand = Commands.W,
                        });
                    }
                }
            }
        }