|
|
|
@@ -400,7 +400,7 @@ void AuraEffect::GetTargetList(std::list<Unit *> & targetList) const
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AuraEffect::GetApplicationList(std::list<AuraApplication* const> & applicationList) const
|
|
|
|
|
void AuraEffect::GetApplicationList(std::list<AuraApplication*> & applicationList) const
|
|
|
|
|
{
|
|
|
|
|
Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
|
|
|
|
|
// remove all targets which were not added to new list - they no longer deserve area aura
|
|
|
|
@@ -951,10 +951,10 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
|
|
|
|
|
if (!handleMask)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
std::list<AuraApplication* const> effectApplications;
|
|
|
|
|
std::list<AuraApplication*> effectApplications;
|
|
|
|
|
GetApplicationList(effectApplications);
|
|
|
|
|
|
|
|
|
|
for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
|
|
|
|
for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
|
|
|
|
if ((*apptItr)->HasEffect(GetEffIndex()))
|
|
|
|
|
HandleEffect(*apptItr, handleMask, false);
|
|
|
|
|
|
|
|
|
@@ -967,12 +967,12 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
|
|
|
|
|
CalculateSpellMod();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
|
|
|
|
for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
|
|
|
|
if ((*apptItr)->HasEffect(GetEffIndex()))
|
|
|
|
|
HandleEffect(*apptItr, handleMask, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply)
|
|
|
|
|
void AuraEffect::HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply)
|
|
|
|
|
{
|
|
|
|
|
// check if call is correct, we really don't want using bitmasks here (with 1 exception)
|
|
|
|
|
ASSERT(!mode
|
|
|
|
@@ -995,15 +995,15 @@ void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool a
|
|
|
|
|
// call scripts helping/replacing effect handlers
|
|
|
|
|
bool prevented = false;
|
|
|
|
|
if (apply)
|
|
|
|
|
prevented = GetBase()->CallScriptEffectApplyHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
|
|
|
|
prevented = GetBase()->CallScriptEffectApplyHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
|
|
|
|
else
|
|
|
|
|
prevented = GetBase()->CallScriptEffectRemoveHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
|
|
|
|
prevented = GetBase()->CallScriptEffectRemoveHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
|
|
|
|
|
|
|
|
|
// check if script events have removed the aura or if default effect prevention was requested
|
|
|
|
|
if ((apply && aurApp->GetRemoveMode()) || prevented)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
(*this.*AuraEffectHandler [GetAuraType()])(aurApp, mode, apply);
|
|
|
|
|
(*this.*AuraEffectHandler [GetAuraType()])(const_cast<AuraApplication const *>(aurApp), mode, apply);
|
|
|
|
|
|
|
|
|
|
// check if script events have removed the aura or if default effect prevention was requested
|
|
|
|
|
if (apply && aurApp->GetRemoveMode())
|
|
|
|
@@ -1011,14 +1011,14 @@ void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool a
|
|
|
|
|
|
|
|
|
|
// call scripts triggering additional events after apply/remove
|
|
|
|
|
if (apply)
|
|
|
|
|
GetBase()->CallScriptAfterEffectApplyHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
|
|
|
|
GetBase()->CallScriptAfterEffectApplyHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
|
|
|
|
else
|
|
|
|
|
GetBase()->CallScriptAfterEffectRemoveHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
|
|
|
|
GetBase()->CallScriptAfterEffectRemoveHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AuraEffect::HandleEffect(Unit * target, uint8 mode, bool apply)
|
|
|
|
|
{
|
|
|
|
|
AuraApplication const * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
|
|
|
|
|
AuraApplication * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
|
|
|
|
|
ASSERT(aurApp);
|
|
|
|
|
HandleEffect(aurApp, mode, apply);
|
|
|
|
|
}
|
|
|
|
@@ -1096,10 +1096,10 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
|
|
|
|
|
m_periodicTimer += m_amplitude - diff;
|
|
|
|
|
UpdatePeriodic(caster);
|
|
|
|
|
|
|
|
|
|
std::list<AuraApplication* const> effectApplications;
|
|
|
|
|
std::list<AuraApplication*> effectApplications;
|
|
|
|
|
GetApplicationList(effectApplications);
|
|
|
|
|
// tick on targets of effects
|
|
|
|
|
for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
|
|
|
|
for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
|
|
|
|
if ((*apptItr)->HasEffect(GetEffIndex()))
|
|
|
|
|
PeriodicTick(*apptItr, caster);
|
|
|
|
|
}
|
|
|
|
|