Exemple #1
0
        private void CastUlt(Vector3 pos)
        {
            if (pos.IsZero)
            {
                DebugConsole.WriteLine("POSITION IS ZERO, CORE IS LIKELY BROKEN", MessageState.Warn);
                return;
            }

            var rectangle = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), pos.To2D(), _width);

            if (_menu["Collision"].Enabled &&
                GameObjects.EnemyHeroes.Count(x => x.NetworkId != _target.NetworkId && rectangle.IsInside(x.ServerPosition.To2D())) > _maxCollisionObjects ||
                pos.Distance(Global.Player) > _range ||
                pos.Distance(Global.Player) < 1200)
            {
                return;
            }

            DebugConsole.WriteLine($"Successfully Fired At: {_target.ChampionName} With The Distance: {Global.Player.Distance(pos)}", MessageState.Debug);

            _ultimate.Cast(pos);
            Reset();

            DelayAction.Queue(1500,
                              () =>
            {
                _lastSeenPosition  = Vector3.Zero;
                _predictedPosition = Vector3.Zero;
            },
                              new CancellationToken(false));
        }
Exemple #2
0
        private void Cast(Vector3 position)
        {
            if (position.IsZero)
            {
                DebugConsole.WriteLine("POSITION IS ZERO, CORE IS LIKELY BROKEN", MessageState.Warn);
                return;
            }

            if (MenuConfig.Menu["Collision"].Enabled)
            {
                var rectangle = new Geometry.Rectangle(Vector3Extensions.To2D(Global.Player.ServerPosition), Vector3Extensions.To2D(position), spell.Width);

                if (GameObjects.EnemyHeroes.Count(x => x.NetworkId != recallInformation.NetworkId && rectangle.IsInside(Vector3Extensions.To2D(x.ServerPosition))) >
                    maxCollisionObjects ||
                    position.Distance(Global.Player) > spell.Range ||
                    position.Distance(Global.Player) < 1200)
                {
                    return;
                }
            }

            spell.Cast(position);
        }