SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Player::AddGlobalCooldown(SpellEntry const *spellInfo, Spell *spell)
  2. {
  3.     if (!spellInfo || !spellInfo->StartRecoveryTime)
  4.         return;
  5.  
  6.     float cdTime = float(spellInfo->StartRecoveryTime);
  7.  
  8.     if (!(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_PASSIVE)))
  9.         cdTime *= GetFloatValue(UNIT_MOD_CAST_SPEED);
  10.     else if (IsRangedWeaponSpell(spellInfo) && !spell->IsAutoRepeat())
  11.         cdTime *= m_modAttackSpeedPct[RANGED_ATTACK];
  12.  
  13.     if (cdTime > 1500.0f)
  14.         cdTime = 1500.0f;
  15.  
  16.     if ((m_owner->getClass() == CLASS_WARLOCK)
  17.        || (m_owner->getClass() == CLASS_SHAMAN)        
  18.        || (m_owner->getClass() == CLASS_DEATH_KNIGHT)
  19.        || (m_owner->getClass() == CLASS_WARRIOR)
  20.        || (m_owner->getClass() == CLASS_HUNTER)
  21.        || (m_owner->getClass() == CLASS_PRIEST))
  22.         cdTime = 1500.0f;
  23.  
  24.     ApplySpellMod(spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, cdTime, spell);
  25.     if (cdTime > 0)
  26.         m_globalCooldowns[spellInfo->StartRecoveryCategory] = uint32(cdTime);
  27. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top