Ejemplo n.º 1
0
        public static void OnKeyPressed()
        {
            if (Extension.CurrentMode == Mode.Dashing && SpellConfig.Q.Ready)
            {
                SpellConfig.Q.Cast();
            }

            if (!SpellConfig.E.Ready)
            {
                return;
            }

            var mob = GameObjects.Jungle.OrderBy(x => x.Distance(Game.CursorPos)).
                      FirstOrDefault(x => x.Distance(Global.Player) <= SpellConfig.E.Range + 200 && !x.HasBuff("YasuoDashWrapper"));

            if (mob != null)
            {
                var pos = mob.ServerPosition + (mob.ServerPosition - Global.Player.ServerPosition).Normalized() * mob.BoundingRadius;

                var point = WallExtension.GeneratePoint(mob.ServerPosition, Global.Player.ServerPosition.Extend(mob.ServerPosition, 475 + mob.BoundingRadius));

                if (Global.Orbwalker.CanMove())
                {
                    Global.Orbwalker.Move(pos);
                }

                if (NavMesh.WorldToCell(point).Flags == NavCellFlags.Wall)
                {
                    return;
                }

                if (pos.Distance(Global.Player) <= mob.BoundingRadius + Global.Player.BoundingRadius + 43)
                {
                    SpellConfig.E.CastOnUnit(mob);
                }
            }
            else
            {
                var minion = GameObjects.EnemyMinions.Where(MinionHelper.IsDashable).OrderBy(x => x.Distance(Game.CursorPos)).FirstOrDefault();

                if (minion != null)
                {
                    SpellConfig.E.CastOnUnit(minion);
                }
            }
        }
Ejemplo n.º 2
0
        public static void OnKeyPressed()
        {
            if (MenuConfig.Miscellaneous["Walljump"].Enabled && Global.Player.CountEnemyHeroesInRange(2000) == 0)
            {
                if (MenuConfig.Miscellaneous["Force"].Enabled && Extensions.CurrentQCount != 3)
                {
                    switch (Extensions.CurrentQCount)
                    {
                    case 2:
                        DelayAction.Queue(250, () => Global.Player.SpellBook.CastSpell(SpellSlot.Q, Game.CursorPos), new CancellationToken(false));
                        break;

                    default:
                        Global.Player.SpellBook.CastSpell(SpellSlot.Q, Game.CursorPos);
                        break;
                    }
                }

                if (Extensions.CurrentQCount != 3)
                {
                    return;
                }

                const int dashRange = 275;
                var       end       = Global.Player.Position.Extend(Game.CursorPos, dashRange);
                var       wall      = WallExtension.GeneratePoint(Global.Player.Position, end);

                if (wall.IsZero || wall.Distance(Global.Player) > SpellConfig.E.Range + 65 || !(Global.Player.Orientation.To2D().Perpendicular().AngleBetween(WallExtension.EndPoint.To2D() - Global.Player.ServerPosition.To2D()) < 160))
                {
                    return;
                }

                wall = wall.Extend(Global.Player.ServerPosition, 65);

                Extensions.FleePos = wall;

                var distance = wall.Distance(Global.Player.Position);
                Global.Orbwalker.Move(wall);

                Global.Player.SpellBook.CastSpell(SpellSlot.E, Global.Player.ServerPosition.Extend(wall, 400));
                DelayAction.Queue(190, () => Global.Player.SpellBook.CastSpell(SpellSlot.Q, wall), new CancellationToken(false));

                if (distance > 40)
                {
                    return;
                }

                Global.Player.SpellBook.CastSpell(SpellSlot.Q, wall);
            }
            else
            {
                if (SpellConfig.W.Ready)
                {
                    foreach (var enemy in GameObjects.EnemyHeroes.Where(x => x.IsValidTarget(SpellConfig.W.Range)))
                    {
                        SpellManager.CastW(enemy);
                    }
                }

                if (SpellConfig.Q.Ready)
                {
                    SpellConfig.Q.Cast(Game.CursorPos);
                }
                else if (SpellConfig.E.Ready)
                {
                    if (SpellConfig.Q.Ready && Extensions.CurrentQCount != 3)
                    {
                        return;
                    }
                    SpellConfig.E.Cast(Game.CursorPos);
                }
            }
        }