mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user