Beispiel #1
0
        public static void CoPulse()
        {
            if (Me.CurrentTarget.Distance < 3 && SpellManager.CanCast("Blink"))
            {
                WoWMovement.Move(WoWMovement.MovementDirection.Backwards);
                SpellManager.Cast("Blink");
                return;
            }

            _target = Me.CurrentTarget;

            // Strafe Left
            if (GetDegree <= 180 && GetDegree >= Cone)
            {
                var vectorA = Calculators._obj1ToObj2(Me, Me.CurrentTarget);
                var B       = Calculators._B(vectorA, System.Math.PI / 2);

                if (!Me.IsFacing(new WoWPoint(B.X, B.Y, B.Z)) && Me.CurrentTarget.Distance < 10)
                {
                    WoWMovement.Move(WoWMovement.MovementDirection.TurnLeft);
                }

                if (Me.IsFacing(new WoWPoint(B.X, B.Y, B.Z)))
                {
                    WoWMovement.MoveStop(WoWMovement.MovementDirection.TurnLeft);
                }

                if (Me.CurrentTarget.Distance < 10)
                {
                    WoWMovement.Move(WoWMovement.MovementDirection.StrafeLeft);
                }

                if (Me.CurrentTarget.Distance >= 20)
                {
                    WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeLeft);
                }
            }

            // Strafe right
            if (GetDegree >= 180 && GetDegree <= (360 - Cone))
            {
                var vectorA = Calculators._obj1ToObj2(Me, Me.CurrentTarget);
                var B       = Calculators._B(vectorA, -(System.Math.PI / 2));

                if (!Me.IsFacing(new WoWPoint(B.X, B.Y, B.Z)) && Me.CurrentTarget.Distance < 10)
                {
                    WoWMovement.Move(WoWMovement.MovementDirection.TurnRight);
                }

                if (Me.IsFacing(new WoWPoint(B.X, B.Y, B.Z)))
                {
                    WoWMovement.MoveStop(WoWMovement.MovementDirection.TurnRight);
                }

                if (Me.CurrentTarget.Distance < 10)
                {
                    WoWMovement.Move(WoWMovement.MovementDirection.StrafeRight);
                }

                if (Me.CurrentTarget.Distance >= 20)
                {
                    WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeRight);
                }
            }

            return;
        }