Core/SpellScripts: Add BeforeCast, OnCast and AfterCast hooks to SpellScripts.

This commit is contained in:
QAston
2011-12-31 13:10:13 +01:00
parent b65722a859
commit afc18461d7
6 changed files with 138 additions and 13 deletions

View File

@@ -52,6 +52,11 @@ void _SpellScript::_Init(std::string const* scriptname, uint32 spellId)
m_scriptSpellId = spellId;
}
std::string const* _SpellScript::_GetScriptName() const
{
return m_scriptName;
}
_SpellScript::EffectHook::EffectHook(uint8 _effIndex)
{
// effect index must be in range <0;2>, allow use of special effindexes
@@ -147,6 +152,16 @@ std::string _SpellScript::EffectAuraNameCheck::ToString()
}
}
SpellScript::CastHandler::CastHandler(SpellCastFnType _pCastHandlerScript)
{
pCastHandlerScript = _pCastHandlerScript;
}
void SpellScript::CastHandler::Call(SpellScript* spellScript)
{
(spellScript->*pCastHandlerScript)();
}
SpellScript::CheckCastHandler::CheckCastHandler(SpellCheckCastFnType checkCastHandlerScript)
{
_checkCastHandlerScript = checkCastHandlerScript;