From ce034bd544ff9c494e5a197a5d13d95cefec70db Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 23 Oct 2011 21:34:50 +0300 Subject: Core/SmartAI: Delay spell cast events (SMART_ACTION_CAST) when another spell is already being casted. Idea by ET --- src/server/game/AI/SmartScripts/SmartScript.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') 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 { -- cgit v1.2.3