diff options
| author | Snapper <snapperryen@gmail.com> | 2016-06-04 21:17:15 +0200 |
|---|---|---|
| committer | Snapper <snapperryen@gmail.com> | 2016-06-04 21:17:15 +0200 |
| commit | aaf10dccb09935e8618389df99b2f8616458cf6b (patch) | |
| tree | 36c0c6a5ca3489b2912c16127d2c58ebcfb24c0a | |
| parent | 24ac2bb9be5099b67edfd3239ab2ec8c12362a7a (diff) | |
Core/SmartAI: delay SMART_ACTION_FLEE_FOR_ASSIST if creature is rooted/stunned.
Prevents creatures from teleporting around when fleeing while stunned/rooted.
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 10 |
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 7c258e09b09..554adfc08ed 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 { |
