aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-04-22 21:28:04 +0200
committerTrazom62 <none@none>2010-04-22 21:28:04 +0200
commitb142ae155e88677a82669df383f3d54e651b1898 (patch)
treebe3a0d18756af07a6cf633834a9c311c072f6ed7
parent7eac04b5ad290851bbfeecbfee34310348c8c181 (diff)
Fixes GCD when 1 sec or shorter.
Support aura reducing GCD (SPELLMOD_GLOBAL_COOLDOWN) (e.g. Backdraft, Unholy presence). Fixes issue #1666. Fixes issue #1616. --HG-- branch : trunk
-rw-r--r--src/game/Player.cpp8
-rw-r--r--src/game/Player.h2
-rw-r--r--src/game/Unit.h2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index c25810a95c7..16cc48c44f4 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -22124,19 +22124,21 @@ void Player::UpdateCharmedAI()
}
}
-void Player::AddGlobalCooldown(SpellEntry const *spellInfo, Spell const *spell)
+void Player::AddGlobalCooldown(SpellEntry const *spellInfo, Spell *spell)
{
if (!spellInfo || !spellInfo->StartRecoveryTime)
return;
- uint32 cdTime = spellInfo->StartRecoveryTime;
+ float cdTime = float(spellInfo->StartRecoveryTime);
if (!(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_PASSIVE)))
cdTime *= GetFloatValue(UNIT_MOD_CAST_SPEED);
else if (IsRangedWeaponSpell(spellInfo) && !spell->IsAutoRepeat())
cdTime *= m_modAttackSpeedPct[RANGED_ATTACK];
- m_globalCooldowns[spellInfo->StartRecoveryCategory] = ((cdTime < 1000 || cdTime > 2000) ? 1000 : cdTime);
+ ApplySpellMod(spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, cdTime, spell);
+ if (cdTime > 0)
+ m_globalCooldowns[spellInfo->StartRecoveryCategory] = uint32(cdTime);
}
bool Player::HasGlobalCooldown(SpellEntry const *spellInfo) const
diff --git a/src/game/Player.h b/src/game/Player.h
index b6175b6bd8d..07334486852 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1637,7 +1637,7 @@ class Player : public Unit, public GridObject<Player>
void UpdatePotionCooldown(Spell* spell = NULL);
// global cooldown
- void AddGlobalCooldown(SpellEntry const *spellInfo, Spell const *spell);
+ void AddGlobalCooldown(SpellEntry const *spellInfo, Spell *spell);
bool HasGlobalCooldown(SpellEntry const *spellInfo) const;
void RemoveGlobalCooldown(SpellEntry const *spellInfo);
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 71ddc3bb5f0..1aef0002db8 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -109,7 +109,7 @@ enum SpellModOp
SPELLMOD_CHANCE_OF_SUCCESS = 18,
SPELLMOD_ACTIVATION_TIME = 19,
SPELLMOD_EFFECT_PAST_FIRST = 20,
- SPELLMOD_GLOBAL_COOLDOWN = 21, //TODO: GCD is not checked by server currently
+ SPELLMOD_GLOBAL_COOLDOWN = 21,
SPELLMOD_DOT = 22,
SPELLMOD_EFFECT3 = 23,
SPELLMOD_SPELL_BONUS_DAMAGE = 24,