mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/SmartAI: Delay spell cast events (SMART_ACTION_CAST) when another spell is already being casted.
Idea by ET
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user