Merge pull request #17281 from SnapperRy/delay_flee_for_assist

Core/SmartAI: delay SMART_ACTION_FLEE_FOR_ASSIST if creature is rooted or stunned
This commit is contained in:
mik1893
2016-06-09 12:01:26 +01:00

View File

@@ -3356,6 +3356,16 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
}
}
// Delay flee for assist event if stunned or rooted
if (e.GetActionType() == SMART_ACTION_FLEE_FOR_ASSIST)
{
if (me && me->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
{
e.timer = 1;
return;
}
}
e.active = true;//activate events with cooldown
switch (e.GetEventType())//process ONLY timed events
{