Add hook on AuraScript called when an aura is dispelled
This commit is contained in:
@@ -2075,6 +2075,30 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Aura::CallScriptDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
|
||||
{
|
||||
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL);
|
||||
std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
|
||||
for (; hookItr != hookItrEnd ; ++hookItr)
|
||||
(*hookItr).Call(*scritr, dispelInfo);
|
||||
(*scritr)->_FinishScriptCall();
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
|
||||
{
|
||||
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL);
|
||||
std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
|
||||
for (; hookItr != hookItrEnd ; ++hookItr)
|
||||
(*hookItr).Call(*scritr, dispelInfo);
|
||||
(*scritr)->_FinishScriptCall();
|
||||
}
|
||||
}
|
||||
|
||||
bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
|
||||
{
|
||||
bool preventDefault = false;
|
||||
|
||||
@@ -198,6 +198,8 @@ class Aura
|
||||
// AuraScript
|
||||
void LoadScripts();
|
||||
bool CallScriptCheckAreaTargetHandlers(Unit* target);
|
||||
void CallScriptDispel(DispelInfo* dispelInfo);
|
||||
void CallScriptAfterDispel(DispelInfo* dispelInfo);
|
||||
bool CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
|
||||
Reference in New Issue
Block a user