aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-12-16 18:52:45 +0100
committerShauren <shauren.trinity@gmail.com>2018-12-16 18:52:45 +0100
commitb09390e575a81772bfb156ac35275e22a85fca9f (patch)
treef00b4bb7ebb6d27410198c048639fb766c7ac8c1 /src
parenteee1f2cadf8174caca4849c22ba1fb8f12fc9e08 (diff)
Core/Spells: Corrected haste affecting GCDs to match 3.3.5 client logic
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 8c19863a5db..6150dbb4228 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -7954,8 +7954,7 @@ void Spell::TriggerGlobalCooldown()
if (!CanHaveGlobalCooldown(m_caster))
return;
- int32 gcd = m_spellInfo->StartRecoveryTime;
- if (!gcd)
+ if (!m_spellInfo->StartRecoveryCategory)
return;
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -7963,20 +7962,23 @@ void Spell::TriggerGlobalCooldown()
return;
// Global cooldown can't leave range 1..1.5 secs
- // There are some spells (mostly not cast directly by player) that have < 1 sec and > 1.5 sec global cooldowns
- // but as tests show are not affected by any spell mods.
- if (m_spellInfo->StartRecoveryTime >= MIN_GCD && m_spellInfo->StartRecoveryTime <= MAX_GCD)
- {
- // gcd modifier auras are applied only to own spells and only players have such mods
- if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd, this);
+ int32 gcd = m_spellInfo->StartRecoveryTime;
- // Apply haste rating
+ // gcd modifier auras are applied only to own spells and only players have such mods
+ if (Player* modOwner = m_caster->GetSpellModOwner())
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd, this);
+
+ // Apply haste rating
+ if (m_spellInfo->StartRecoveryCategory == 133 && m_spellInfo->StartRecoveryTime == 1500 &&
+ m_spellInfo->DmgClass != SPELL_DAMAGE_CLASS_MELEE && m_spellInfo->DmgClass != SPELL_DAMAGE_CLASS_RANGED &&
+ !m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) && !m_spellInfo->HasAttribute(SPELL_ATTR0_ABILITY))
+ {
gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
RoundToInterval<int32>(gcd, MIN_GCD, MAX_GCD);
}
- m_caster->ToUnit()->GetSpellHistory()->AddGlobalCooldown(m_spellInfo, gcd);
+ if (gcd)
+ m_caster->ToUnit()->GetSpellHistory()->AddGlobalCooldown(m_spellInfo, gcd);
}
void Spell::CancelGlobalCooldown()