mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/SpellScripts: Add BeforeCast, OnCast and AfterCast hooks to SpellScripts.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user