Core/Spells: Implement SPELL_ATTR5_HASTE_AFFECT_DURATION. Haste rating should decrease duration of these auras

Closes #1020
This commit is contained in:
tobmaps
2011-05-12 18:59:49 +07:00
parent 88633a0be9
commit cb6fca4646
3 changed files with 6 additions and 5 deletions
@@ -840,7 +840,7 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create)
if (IsChanneledSpell(m_spellProto))
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))
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));
}
}
+4 -3
View File
@@ -1505,11 +1505,11 @@ 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))
if (IsChanneledSpell(m_spellInfo) && 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))
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())
@@ -3326,7 +3326,8 @@ void Spell::handle_immediate()
if (Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
// Apply haste mods
m_caster->ModSpellCastTime(m_spellInfo, duration, this);
if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
m_caster->ModSpellCastTime(m_spellInfo, duration, this);
m_spellState = SPELL_STATE_CASTING;
m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags);