aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp14
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp1
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h10
3 files changed, 24 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 8a65266846a..e8610ff94b5 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1245,6 +1245,20 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
(*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.delunitByte.byte1);
break;
}
+ case SMART_ACTION_INTERRUPT_SPELL:
+ {
+ ObjectList* targets = GetTargets(e, unit);
+ if (!targets)
+ return;
+
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
+ {
+ if (IsUnit((*itr)))
+ (*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed,e.action.interruptSpellCasting.spell_id,e.action.interruptSpellCasting.withInstant);
+ }
+
+ break;
+ }
default:
sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType());
break;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 7662071fd04..1f4185ac01a 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -768,6 +768,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
case SMART_ACTION_RANDOM_MOVE:
case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1:
+ case SMART_ACTION_INTERRUPT_SPELL:
break;
default:
sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 392e0320be1..0dcb166070f 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -448,7 +448,9 @@ enum SMART_ACTION
SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1 = 91, // bytes, target
- SMART_ACTION_END = 92,
+ SMART_ACTION_INTERRUPT_SPELL = 92,
+
+ SMART_ACTION_END = 93,
};
struct SmartAction
@@ -823,6 +825,12 @@ struct SmartAction
struct
{
+ bool withDelayed;
+ uint32 spell_id;
+ bool withInstant;
+ } interruptSpellCasting;
+ struct
+ {
uint32 param1;
uint32 param2;
uint32 param3;