Пример #1
0
        private static void CastQ(Obj_AI_Base target)
        {
            var myPosition = Game.CursorPos;

            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.smartq") && _spells[SpellSlot.E].IsReady())
            {
                const int currentStep = 30;
                var       direction   = ObjectManager.Player.Direction.To2D().Perpendicular();
                for (var i = 0f; i < 360f; i += currentStep)
                {
                    var         angleRad        = Geometry.DegreeToRadian(i);
                    var         rotatedPosition = ObjectManager.Player.Position.To2D() + (300 * direction.Rotated(angleRad));
                    Obj_AI_Hero myTarget;
                    if (CondemnCheck(rotatedPosition.To3D(), out myTarget) && Helpers.OkToQ(rotatedPosition.To3D()))
                    {
                        myPosition = rotatedPosition.To3D();
                        break;
                    }
                }
            }
            if (_spells[SpellSlot.R].IsEnabledAndReady(Mode.Combo) && (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo) && ObjectManager.Player.CountEnemiesInRange(Orbwalking.GetRealAutoAttackRange(null)) >= MenuHelper.getSliderValue("dz191.vhr.combo.r.minenemies"))
            {
                _spells[SpellSlot.R].Cast();
            }
            CastTumble(myPosition, target);
        }
Пример #2
0
        /// <summary>
        ///     Gets the QE position for the Tumble-Condemn combo.
        /// </summary>
        /// <returns></returns>
        public static Vector3 GetQEPosition()
        {
            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || !Program.E.IsReady())
            {
                return(Vector3.Zero);
            }

            var direction = ObjectManager.Player.Direction.To2D().LSPerpendicular();

            for (var i = 0f; i < 360f; i += 45)
            {
                var angleRad        = Geometry.DegreeToRadian(i);
                var rotatedPosition = ObjectManager.Player.Position.To2D() + 300f * direction.LSRotated(angleRad);
                if (Provider.GetTarget(rotatedPosition.To3D()).IsValidTarget() && rotatedPosition.To3D().IsSafe())
                {
                    return(rotatedPosition.To3D());
                }
            }

            return(Vector3.Zero);
        }
Пример #3
0
        public static Vector3 FindTumblePosition(AIHeroClient target)
        {
            if (Program.Only2W && target.GetBuffCount("vaynesilvereddebuff") == 1)
            {
                // == 1 cuz calling this after attack which is aa missile still flying
                return(Vector3.Zero);
            }

            if (Program.Wall)
            {
                var outRadius = ObjectManager.Player.BoundingRadius / (float)Math.Cos(2 * Math.PI / 8);

                for (var i = 1; i <= 8; i++)
                {
                    var angle    = i * 2 * Math.PI / 8;
                    var x        = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                    var y        = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                    var colFlags = NavMesh.GetCollisionFlags(x, y);
                    if (colFlags.HasFlag(CollisionFlags.Wall) || colFlags.HasFlag(CollisionFlags.Building))
                    {
                        return(new Vector3(x, y, 0));
                    }
                }
            }

            if (Program.sacMode == 0)
            {
                var vec = target.ServerPosition;

                if (target.Path.Length > 0)
                {
                    if (ObjectManager.Player.LSDistance(vec) < ObjectManager.Player.LSDistance(target.Path.Last()))
                    {
                        return(IsSafe(target, Game.CursorPos));
                    }
                    return(IsSafe(target,
                                  Game.CursorPos.LSTo2D()
                                  .LSRotated(
                                      Geometry.DegreeToRadian(
                                          (vec - ObjectManager.Player.ServerPosition).LSTo2D()
                                          .LSAngleBetween((Game.CursorPos - ObjectManager.Player.ServerPosition).LSTo2D()) %
                                          90))
                                  .To3D()));
                }
                if (target.IsMelee)
                {
                    return(IsSafe(target, Game.CursorPos));
                }

                return(IsSafe(target,
                              ObjectManager.Player.ServerPosition +
                              (target.ServerPosition - ObjectManager.Player.ServerPosition).LSNormalized()
                              .LSTo2D()
                              .LSRotated(
                                  Geometry.DegreeToRadian(90 -
                                                          (vec - ObjectManager.Player.ServerPosition).LSTo2D()
                                                          .LSAngleBetween(
                                                              (Game.CursorPos - ObjectManager.Player.ServerPosition).LSTo2D())))
                              .To3D() * 300f));
            }
            if (Program.sacMode == 1)
            {
                return(Game.CursorPos);
            }

            return(Game.CursorPos);
        }