There is an issue in SpellAvoidance that causes WoW to freeze permanently.
Spell.cs line 275 - 302 as of today:
Code:
/// <summary>
/// this behavior will move the bot StrafeRight/StrafeLeft only if enemy is casting and we needed to move!
/// Credits to BarryDurex.
/// </summary>
/// <param name="EnemyAttackRadius">EnemyAttackRadius or 0 for move Behind</param>
public static void AvoidEnemyCast(WoWUnit Unit, float EnemyAttackRadius, float SaveDistance)
{
if (!StyxWoW.Me.IsFacing(Unit))
{ Unit.Face(); }
float BehemothRotation = getPositive(Unit.RotationDegrees);
float invertEnemyRotation = getInvert(BehemothRotation);
WoWMovement.MovementDirection move = WoWMovement.MovementDirection.None;
if (getPositive(StyxWoW.Me.RotationDegrees) > invertEnemyRotation)
{ move = WoWMovement.MovementDirection.StrafeRight; }
else
{ move = WoWMovement.MovementDirection.StrafeLeft; }
while (Unit.Distance2D <= SaveDistance && Unit.IsCasting && ((EnemyAttackRadius == 0 && !StyxWoW.Me.IsSafelyBehind(Unit)) ||
(EnemyAttackRadius != 0 && Unit.IsSafelyFacing(StyxWoW.Me, EnemyAttackRadius)) || Unit.Distance2D <= 2 ))
{
WoWMovement.Move(move);
Unit.Face();
}
WoWMovement.MoveStop();
}
When run during framelock, the while loop will run infinitely because the distance will never update.
An easy fix is to enclose the while loop with a ReleaseFrame call:
Code:
/// <summary>
/// this behavior will move the bot StrafeRight/StrafeLeft only if enemy is casting and we needed to move!
/// Credits to BarryDurex.
/// </summary>
/// <param name="EnemyAttackRadius">EnemyAttackRadius or 0 for move Behind</param>
public static void AvoidEnemyCast(WoWUnit Unit, float EnemyAttackRadius, float SaveDistance)
{
if (!StyxWoW.Me.IsFacing(Unit))
{ Unit.Face(); }
float BehemothRotation = getPositive(Unit.RotationDegrees);
float invertEnemyRotation = getInvert(BehemothRotation);
WoWMovement.MovementDirection move = WoWMovement.MovementDirection.None;
if (getPositive(StyxWoW.Me.RotationDegrees) > invertEnemyRotation)
{ move = WoWMovement.MovementDirection.StrafeRight; }
else
{ move = WoWMovement.MovementDirection.StrafeLeft; }
using (StyxWoW.Memory.ReleaseFrame(true))
{
while (Unit.Distance2D <= SaveDistance && Unit.IsCasting && ((EnemyAttackRadius == 0 && !StyxWoW.Me.IsSafelyBehind(Unit)) ||
(EnemyAttackRadius != 0 && Unit.IsSafelyFacing(StyxWoW.Me, EnemyAttackRadius)) || Unit.Distance2D <= 2))
{
WoWMovement.Move(move);
Unit.Face();
}
}
WoWMovement.MoveStop();
}
However, this will still hog HB's tick time. Consider revising it to use a behavior tree (or coroutine).