Core/SmartAI: delay SMART_ACTION_FLEE_FOR_ASSIST if creature is rooted/stunned.
Prevents creatures from teleporting around when fleeing while stunned/rooted.
This commit is contained in:
1 parent
d9f485273c
commit
7185ae680c
1 file changed
+10
@@ -3373,6 +3373,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
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user