Core/SAI: implement SMART_ACTION_ATTACK_STOP

Unlike SMART_ACTION_AUTO_ATTACK, this action is actually stopping the entire attack procedure, rather than just hack-disabling auto-attacks. Keep in mind that this action requires a passive react state to prevent a immediate AttackStart ai reaction

(cherry picked from commit 152ea6011694518017a47dc23fdbb7175bfa5481)
This commit is contained in:
Ovahlord
2022-01-06 21:39:37 +01:00
committed by Shauren
parent d1b928cca5
commit 38be5e361e
3 changed files with 9 additions and 0 deletions
@@ -1209,6 +1209,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
break;
}
case SMART_ACTION_ATTACK_STOP:
{
for (WorldObject* target : targets)
if (Unit* unitTarget = target->ToUnit())
unitTarget->AttackStop();
break;
}
case SMART_ACTION_MOVE_OFFSET:
{
for (WorldObject* target : targets)