@@ -378,10 +378,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
378378 &AuraEffect::HandleNoImmediateEffect, // 316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic
379379};
380380
381- AuraEffect::AuraEffect (Aura* base, SpellEffectInfo const & spellEfffectInfo, int32 const * baseAmount, Unit* caster):
382- m_base(base), m_spellInfo(base->GetSpellInfo ()), m_spellEffectInfo (spellEfffectInfo),
381+ AuraEffect::AuraEffect (Aura* base, SpellEffectInfo const & spellEfffectInfo, int32 const * baseAmount, Unit* caster) :
382+ m_base(base), m_spellInfo(base->GetSpellInfo ()), m_effectInfo (spellEfffectInfo), m_spellmod( nullptr ),
383383m_baseAmount(baseAmount ? *baseAmount : spellEfffectInfo.BasePoints),
384- _amount(), m_spellmod( nullptr ), _periodicTimer(0 ), _amplitude (0 ), _ticksDone(0 ),
384+ _amount(), _periodicTimer(0 ), _period (0 ), _ticksDone(0 ),
385385m_canBeRecalculated(true ), m_isPeriodic(false )
386386{
387387 CalculatePeriodic (caster, true , false );
@@ -538,9 +538,9 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
538538uint32 AuraEffect::GetTotalTicks () const
539539{
540540 uint32 totalTicks = 0 ;
541- if (_amplitude && !GetBase ()->IsPermanent ())
541+ if (_period && !GetBase ()->IsPermanent ())
542542 {
543- totalTicks = static_cast <uint32>(GetBase ()->GetMaxDuration () / _amplitude );
543+ totalTicks = static_cast <uint32>(GetBase ()->GetMaxDuration () / _period );
544544 if (m_spellInfo->HasAttribute (SPELL_ATTR5_START_PERIODIC_AT_APPLY))
545545 ++totalTicks;
546546 }
@@ -556,13 +556,13 @@ void AuraEffect::ResetPeriodic(bool resetPeriodicTimer /*= false*/)
556556 _periodicTimer = 0 ;
557557 // Start periodic on next tick or at aura apply
558558 if (m_spellInfo->HasAttribute (SPELL_ATTR5_START_PERIODIC_AT_APPLY))
559- _periodicTimer = _amplitude ;
559+ _periodicTimer = _period ;
560560 }
561561}
562562
563563void AuraEffect::CalculatePeriodic (Unit* caster, bool resetPeriodicTimer /* = true*/ , bool load /* = false*/ )
564564{
565- _amplitude = GetSpellEffectInfo ().Amplitude ;
565+ _period = GetSpellEffectInfo ().ApplyAuraPeriod ;
566566
567567 // prepare periodics
568568 switch (GetAuraType ())
@@ -588,39 +588,39 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru
588588 break ;
589589 }
590590
591- GetBase ()->CallScriptEffectCalcPeriodicHandlers (this , m_isPeriodic, _amplitude );
591+ GetBase ()->CallScriptEffectCalcPeriodicHandlers (this , m_isPeriodic, _period );
592592
593593 if (!m_isPeriodic)
594594 return ;
595595
596596 Player* modOwner = caster ? caster->GetSpellModOwner () : nullptr ;
597597 // Apply casting time mods
598- if (_amplitude )
598+ if (_period )
599599 {
600600 // Apply periodic time mod
601601 if (modOwner)
602- modOwner->ApplySpellMod (GetId (), SPELLMOD_ACTIVATION_TIME, _amplitude );
602+ modOwner->ApplySpellMod (GetId (), SPELLMOD_ACTIVATION_TIME, _period );
603603
604604 if (caster)
605605 {
606606 // Haste modifies periodic time of channeled spells
607607 if (m_spellInfo->IsChanneled ())
608- caster->ModSpellDurationTime (m_spellInfo, _amplitude );
608+ caster->ModSpellDurationTime (m_spellInfo, _period );
609609 // and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE
610610 else if (caster->HasAuraTypeWithAffectMask (SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute (SPELL_ATTR5_HASTE_AFFECT_DURATION))
611- _amplitude = int32 (_amplitude * caster->GetFloatValue (UNIT_MOD_CAST_SPEED));
611+ _period = int32 (_period * caster->GetFloatValue (UNIT_MOD_CAST_SPEED));
612612 }
613613 }
614614 else // prevent infinite loop on Update
615615 m_isPeriodic = false ;
616616
617617 if (load) // aura loaded from db
618618 {
619- if (_amplitude && !GetBase ()->IsPermanent ())
619+ if (_period && !GetBase ()->IsPermanent ())
620620 {
621621 uint32 elapsedTime = GetBase ()->GetMaxDuration () - GetBase ()->GetDuration ();
622- _ticksDone = elapsedTime / uint32 (_amplitude );
623- _periodicTimer = elapsedTime % uint32 (_amplitude );
622+ _ticksDone = elapsedTime / uint32 (_period );
623+ _periodicTimer = elapsedTime % uint32 (_period );
624624 }
625625
626626 if (m_spellInfo->HasAttribute (SPELL_ATTR5_START_PERIODIC_AT_APPLY))
@@ -818,9 +818,9 @@ void AuraEffect::Update(uint32 diff, Unit* caster)
818818 uint32 totalTicks = GetTotalTicks ();
819819
820820 _periodicTimer += diff;
821- while (_periodicTimer >= _amplitude )
821+ while (_periodicTimer >= _period )
822822 {
823- _periodicTimer -= _amplitude ;
823+ _periodicTimer -= _period ;
824824
825825 if (!GetBase ()->IsPermanent () && (_ticksDone + 1 ) > totalTicks)
826826 break ;
@@ -1075,7 +1075,7 @@ void AuraEffect::CleanupTriggeredSpells(Unit* target)
10751075 // needed for spell 43680, maybe others
10761076 // / @todo is there a spell flag, which can solve this in a more sophisticated way?
10771077 if (GetSpellEffectInfo ().ApplyAuraName == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
1078- uint32 (m_spellInfo->GetDuration ()) == GetSpellEffectInfo ().Amplitude )
1078+ uint32 (m_spellInfo->GetDuration ()) == GetSpellEffectInfo ().ApplyAuraPeriod )
10791079 return ;
10801080
10811081 target->RemoveAurasDueToSpell (tSpellId, GetCasterGUID ());
0 commit comments