Core/Spells: Implement SPELL_ATTR5_HASTE_AFFECT_DURATION. Haste rating should decrease duration of these auras
Closes #1020
This commit is contained in:
@@ -456,7 +456,7 @@ enum SpellAttr5
|
||||
SPELL_ATTR5_UNK10 = 0x00000400, // 10
|
||||
SPELL_ATTR5_UNK11 = 0x00000800, // 11
|
||||
SPELL_ATTR5_UNK12 = 0x00001000, // 12
|
||||
SPELL_ATTR5_UNK13 = 0x00002000, // 13
|
||||
SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this
|
||||
SPELL_ATTR5_UNK14 = 0x00004000, // 14
|
||||
SPELL_ATTR5_UNK15 = 0x00008000, // 15
|
||||
SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK = 0x00010000, // 16 this allows spells with EquippedItemClass to affect spells from other items if the required item is equipped
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user