Phelon
Well-Known Member
- Joined
- Jan 15, 2010
- Messages
- 2,591
- Reaction score
- 134
Here is just a heads up to the Devs. Stuck Handler seems to be causing strafing and movement issues. This is a cross post, but I put it here for better visibility and to let you all know what is causing it.
It looks like Swiny Ran into this back in April: http://www.thebuddyforum.com/archives/25747-wowmovement-move-issue-3.html
And it looks like the stuck code is indeed causing it: http://www.thebuddyforum.com/honorb...left-running-wild-around-mobs.html#post229158
It looks like Swiny Ran into this back in April: http://www.thebuddyforum.com/archives/25747-wowmovement-move-issue-3.html
And it looks like the stuck code is indeed causing it: http://www.thebuddyforum.com/honorb...left-running-wild-around-mobs.html#post229158
Code:
[8:59:59 AM:658] [Ultimate PVP Suite] Checks.
[8:59:59 AM:658] [Ultimate PVP Suite] MovingBackward
[8:59:59 AM:658] [Ultimate PVP Suite] Facing.
[8:59:59 AM:684] [Ultimate PVP Suite] Stop Strafing Right.
[8:59:59 AM:766] Flushing timed movement. Direction: StrafeRight
[8:59:59 AM:766] Flushing timed movement. Direction: Backwards
[8:59:59 AM:806] [Ultimate PVP Suite] Checks.
[8:59:59 AM:807] [Ultimate PVP Suite] MovingBackward
[8:59:59 AM:807] [Ultimate PVP Suite] Facing.
[8:59:59 AM:816] [Ultimate PVP Suite] Stop Strafing Right.
[8:59:59 AM:896] Flushing timed movement. Direction: StrafeRight
[8:59:59 AM:896] Flushing timed movement. Direction: Backwards
[8:59:59 AM:921] [Ultimate PVP Suite] Checks.
[8:59:59 AM:921] [Ultimate PVP Suite] MovingBackward
[8:59:59 AM:921] [Ultimate PVP Suite] Facing.
[8:59:59 AM:950] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:026] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:026] Flushing timed movement. Direction: Backwards
[9:00:00 AM:053] [Ultimate PVP Suite] Checks.
[9:00:00 AM:053] [Ultimate PVP Suite] MovingBackward
[9:00:00 AM:053] [Ultimate PVP Suite] Facing.
[9:00:00 AM:080] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:162] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:162] Flushing timed movement. Direction: Backwards
[9:00:00 AM:184] [Ultimate PVP Suite] Checks.
[9:00:00 AM:184] [Ultimate PVP Suite] MovingBackward
[9:00:00 AM:184] [Ultimate PVP Suite] Facing.
[9:00:00 AM:214] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:289] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:289] Flushing timed movement. Direction: Backwards
[9:00:00 AM:321] [Ultimate PVP Suite] Checks.
[9:00:00 AM:321] [Ultimate PVP Suite] MovingBackward
[9:00:00 AM:321] [Ultimate PVP Suite] Facing.
[9:00:00 AM:343] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:421] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:421] Flushing timed movement. Direction: Backwards
[9:00:00 AM:450] [Ultimate PVP Suite] Checks.
[9:00:00 AM:450] [Ultimate PVP Suite] MovingBackward
[9:00:00 AM:451] [Ultimate PVP Suite] Facing.
[9:00:00 AM:478] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:555] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:555] Flushing timed movement. Direction: Backwards
[9:00:00 AM:584] [Ultimate PVP Suite] Checks.
[9:00:00 AM:585] [Ultimate PVP Suite] MovingBackward
[9:00:00 AM:585] [Ultimate PVP Suite] Facing.
[9:00:00 AM:612] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:688] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:688] Flushing timed movement. Direction: Backwards
[9:00:00 AM:725] [Ultimate PVP Suite] Checks.
[9:00:00 AM:725] [Ultimate PVP Suite] MovingBackward
[9:00:00 AM:725] [Ultimate PVP Suite] Facing.
[9:00:00 AM:740] [Ultimate PVP Suite] Stop Strafing Right.
[9:00:00 AM:821] Flushing timed movement. Direction: StrafeRight
[9:00:00 AM:821] Flushing timed movement. Direction: Backwards
Code:
public static void Pulse()
{
try
{
if (StyxWoW.Me.Dead || !Battlegrounds.IsInsideBattleground ||
(StyxWoW.Me.CurrentTarget == null && !StyxWoW.Me.IsActuallyInCombat))
{
Logger.Write("Stop Movement.");
StopMovement();
}
else if (StyxWoW.Me.CurrentTarget != null && UltimatePvPSuite.CurrentTarget != null)
{
Logger.Write("Checks.");
DistanceCheck();
CheckFace();
if (!MovementCheck())
{
Logger.Write("Strafe Start.");
Strafe();
}
}
}
catch (Exception excv)
{
Logger.Write("" + excv);
}
}
#region Checks and Nav Points
private static void StopMovement()
{
if (StyxWoW.Me.MovementInfo.MovingStrafeRight && !KeyDown(Keys.D))
WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeRight);
if (StyxWoW.Me.MovementInfo.MovingStrafeLeft && !KeyDown(Keys.A))
WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeLeft);
if (StyxWoW.Me.MovementInfo.MovingForward && !KeyDown(Keys.W))
WoWMovement.MoveStop(WoWMovement.MovementDirection.Forward);
}
internal static double GetDegree
{
get
{
double d = Math.Atan2((StyxWoW.Me.CurrentTarget.Y - StyxWoW.Me.Y), (StyxWoW.Me.CurrentTarget.X - StyxWoW.Me.X));
double r = d - StyxWoW.Me.CurrentTarget.Rotation; // substracting object rotation from absolute rotation
if (r < 0)
r += (Math.PI * 2);
return WoWMathHelper.RadiansToDegrees((float)r);
}
}
private static WoWPoint CalculatePointBehindTarget()
{
return
StyxWoW.Me.CurrentTarget.Location.RayCast(
StyxWoW.Me.CurrentTarget.Rotation + WoWMathHelper.DegreesToRadians(150), 3.2f);
}
public static WoWPoint NavMe
{
get
{
if (StyxWoW.Me.CurrentTarget != null)
{
double Distance = StyxWoW.Me.CurrentTarget.Distance + 10;
return WoWMathHelper.CalculatePointFrom(StyxWoW.Me.Location, StyxWoW.Me.CurrentTarget.Location, (float)Distance);
}
return StyxWoW.Me.Location;
}
}
internal static bool KeyDown(Keys VKey)
{
if (GetAsyncKeyState(VKey) != 0) return true;
return false;
}
#endregion
#region Melee Strafe
///
/// Check to see if we are constantly facing.
///
private static void CheckFace()
{
if (!WoWMovement.IsFacing && StyxWoW.Me.CurrentTarget == StyxWoW.Me.CurrentTarget)
{
Logger.Write("Facing.");
WoWMovement.Face(StyxWoW.Me.CurrentTarget.Guid);
}
}
private static bool MovementCheck()
{
if ((StyxWoW.Me.MovementInfo.MovingStrafeRight && StyxWoW.Me.CurrentTarget.Distance >= 5.5f) || StyxWoW.Me.CurrentTarget.MeIsSafelyBehind)
{
Logger.Write("Stop Strafing Right.");
WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeRight);
return true;
}
if ((StyxWoW.Me.MovementInfo.MovingStrafeLeft && StyxWoW.Me.CurrentTarget.Distance >= 5.5f) || StyxWoW.Me.CurrentTarget.MeIsSafelyBehind)
{
Logger.Write("Stop Strafing Left.");
WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeLeft);
return true;
}
/*
// Cancel all strafes - Angle out of range
if (StyxWoW.Me.MovementInfo.MovingStrafeRight && GetDegree <= 180 && GetDegree >= Cone)
{
WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeRight);
return true;
}
if (StyxWoW.Me.MovementInfo.MovingStrafeLeft && GetDegree >= 180 && GetDegree <= (360 - Cone))
{
WoWMovement.MoveStop(WoWMovement.MovementDirection.StrafeLeft);
return true;
}
* */
return false;
}
//Makes Sure we are in Range
private static void DistanceCheck()
{
if (StyxWoW.Me.CurrentTarget.Distance >= 5.5f)
{
if (StyxWoW.Me.MovementInfo.MovingBackward)
{
Logger.Write("Stop MovingBackward");
WoWMovement.MoveStop(WoWMovement.MovementDirection.Backwards);
}
if (!StyxWoW.Me.MovementInfo.MovingForward)
{
Logger.Write("MovingForward");
WoWMovement.Move(WoWMovement.MovementDirection.Forward, new TimeSpan(99, 99, 99));
}
}
if (StyxWoW.Me.CurrentTarget.Distance < 3.2f)
{
if (StyxWoW.Me.MovementInfo.MovingForward)
{
Logger.Write("Stop MovingForward");
WoWMovement.MoveStop(WoWMovement.MovementDirection.Forward);
}
if (!StyxWoW.Me.MovementInfo.MovingBackward)
{
Logger.Write("MovingBackward");
WoWMovement.Move(WoWMovement.MovementDirection.Backwards, new TimeSpan(99, 99, 99));
}
}
}
//Makes sure we are strafing
private static void Strafe()
{
Logger.Write("Strafing.");
// 180 > strafe right
if (StyxWoW.Me.CurrentTarget.Distance < 5.5)
{
if (GetDegree >= 180 && GetDegree <= (360 - Cone) && !StyxWoW.Me.MovementInfo.MovingStrafeRight)
{
Logger.Write("Strafing Right.");
WoWMovement.Move(WoWMovement.MovementDirection.StrafeRight, new TimeSpan(99, 99, 99));
}
else if (GetDegree <= 180 && GetDegree >= Cone && !StyxWoW.Me.MovementInfo.MovingStrafeLeft)
{
Logger.Write("Strafing Left.");
WoWMovement.Move(WoWMovement.MovementDirection.StrafeLeft, new TimeSpan(99, 99, 99));
}
}
}
#endregion