diff options
author | QAston <qaston@gmail.com> | 2011-12-31 13:10:13 +0100 |
---|---|---|
committer | QAston <qaston@gmail.com> | 2011-12-31 13:11:12 +0100 |
commit | afc18461d76b74f1e6dfaccebb3689e4ec2c2012 (patch) | |
tree | 5e6997a14ee307e31fc9721e7e44ceca7150f6de /src/server/game/Spells/SpellScript.cpp | |
parent | b65722a85959508e23c683e8d55a4bce4eeb9373 (diff) |
Core/SpellScripts: Add BeforeCast, OnCast and AfterCast hooks to SpellScripts.
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rwxr-xr-x | src/server/game/Spells/SpellScript.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 53ec7822623..fc537ce4fb1 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -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; |