aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r--src/server/game/Spells/SpellScript.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 28d2b81a44f..c56fb6ce0ef 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -18,6 +18,7 @@
#include "Spell.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
+#include "SpellMgr.h"
#include "SpellScript.h"
#include "SpellMgr.h"
#include <string>
@@ -32,6 +33,17 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
return true;
}
+bool _SpellScript::ValidateSpellInfo(std::vector<uint32> spellIds)
+{
+ for (uint32 spellId : spellIds)
+ if (!sSpellMgr->GetSpellInfo(spellId))
+ {
+ TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId);
+ return false;
+ }
+ return true;
+}
+
void _SpellScript::_Register()
{
m_currentScriptState = SPELL_SCRIPT_STATE_REGISTRATION;