diff options
author | Shocker <shocker@freakz.ro> | 2011-10-23 21:34:50 +0300 |
---|---|---|
committer | Shocker <shocker@freakz.ro> | 2011-10-23 21:34:50 +0300 |
commit | ce034bd544ff9c494e5a197a5d13d95cefec70db (patch) | |
tree | 20d5860bd435678f1220ca601623b26d165885e8 /src | |
parent | 0acc5b526c2410488bd4b880b8fd910426daaee0 (diff) |
Core/SmartAI: Delay spell cast events (SMART_ACTION_CAST) when another spell is already being casted.
Idea by ET
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index cbbf83bca25..de263fafdea 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2632,6 +2632,19 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) if (e.timer < diff) { + // delay spell cast event if another spell is being casted + if (e.GetActionType() == SMART_ACTION_CAST) + { + if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)) + { + if (me && me->HasUnitState(UNIT_STAT_CASTING)) + { + e.timer = 1; + return; + } + } + } + e.active = true;//activate events with cooldown switch (e.GetEventType())//process ONLY timed events { |