Core/Spells: Fix bug with double haste rating for channeled spells

This commit is contained in:
tobmaps
2011-05-15 04:24:49 +07:00
parent d10ca63240
commit df3ee186ec
2 changed files with 11 additions and 6 deletions

View File

@@ -830,9 +830,12 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create)
{
// Haste modifies periodic time of channeled spells
if (IsChanneledSpell(m_spellProto))
caster->ModSpellCastTime(m_spellProto, m_amplitude);
{
if (m_spellProto->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
caster->ModSpellCastTime(m_spellProto, m_amplitude);
}
// and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE
if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellProto) || m_spellProto->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
else if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellProto) || m_spellProto->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
}
}

View File

@@ -1505,11 +1505,13 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
duration = m_originalCaster->ModSpellDuration(aurSpellInfo, unit, duration, positive);
// Haste modifies duration of channeled spells
if (IsChanneledSpell(m_spellInfo) && m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this);
if (IsChanneledSpell(m_spellInfo))
{
if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this);
}
// and duration of auras affected by SPELL_AURA_PERIODIC_HASTE
if (m_originalCaster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, aurSpellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
else if (m_originalCaster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, aurSpellInfo) || (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
duration = int32(duration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED));
if (duration != m_spellAura->GetMaxDuration())