mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
fix(Core/Spells): Restored special Rolling DoTs mechanic for Corruption and SW:Pain (#10206)
Fixes #9867
This commit is contained in:
@@ -940,6 +940,28 @@ void Aura::RefreshTimers(bool periodicReset /*= false*/)
|
||||
}
|
||||
}
|
||||
|
||||
// xinef: dot's rolling function
|
||||
void Aura::RefreshTimersWithMods()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
m_maxDuration = CalcMaxDuration();
|
||||
if ((caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo)) || m_spellInfo->HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC))
|
||||
{
|
||||
m_maxDuration = int32(m_maxDuration * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||
}
|
||||
|
||||
// xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration
|
||||
RefreshDuration();
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (AuraEffect* aurEff = m_effects[i])
|
||||
{
|
||||
aurEff->CalculatePeriodic(caster, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::SetCharges(uint8 charges)
|
||||
{
|
||||
if (m_procCharges == charges)
|
||||
|
||||
@@ -134,6 +134,7 @@ public:
|
||||
void SetDuration(int32 duration, bool withMods = false);
|
||||
void RefreshDuration(bool withMods = false);
|
||||
void RefreshTimers(bool periodicReset = false);
|
||||
void RefreshTimersWithMods();
|
||||
bool IsExpired() const { return !GetDuration();}
|
||||
bool IsPermanent() const { return GetMaxDuration() == -1; }
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ class spell_pri_pain_and_suffering_proc : public SpellScript
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetCaster()->GetGUID()))
|
||||
{
|
||||
aur->GetBase()->RefreshTimers();
|
||||
aur->GetBase()->RefreshTimersWithMods();
|
||||
aur->ChangeAmount(aur->CalculateAmount(aur->GetCaster()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ class spell_warl_everlasting_affliction : public SpellScript
|
||||
// Refresh corruption on target
|
||||
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID()))
|
||||
{
|
||||
aur->GetBase()->RefreshTimers();
|
||||
aur->GetBase()->RefreshTimersWithMods();
|
||||
aur->ChangeAmount(aur->CalculateAmount(aur->GetCaster()), false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user