aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormik1893 <michele.roscelli@gmail.com>2016-06-09 12:01:26 +0100
committermik1893 <michele.roscelli@gmail.com>2016-06-09 12:01:26 +0100
commitb0e7b458408b85e44734b0e876e83fc4473cc3ec (patch)
tree427ed2f02b83889b93a90d7606346f77448a4eec /src
parent164d269fc5a84e4afc8dbe4c04953542c066e6a2 (diff)
parentaaf10dccb09935e8618389df99b2f8616458cf6b (diff)
Merge pull request #17281 from SnapperRy/delay_flee_for_assist
Core/SmartAI: delay SMART_ACTION_FLEE_FOR_ASSIST if creature is rooted or stunned
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index a0a7651df13..c631874f18d 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -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
{