diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2016-10-04 21:43:45 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2016-10-04 21:43:45 -0300 |
| commit | 016b31a1b689b1c2c2d401f4d1709d74b24279fd (patch) | |
| tree | 0878497b37d3533dacecc4c25aa06c214208880a | |
| parent | 165ddd753f0971038250cc7d838160eb3da72171 (diff) | |
Core/Spells: add proc cooldown on item equip.
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a00bd9e4d47..6f47595e4d2 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22713,6 +22713,7 @@ void Player::ApplyEquipCooldown(Item* pItem) if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) return; + std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { _Spell const& spellData = pItem->GetTemplate()->Spells[i]; @@ -22721,6 +22722,18 @@ void Player::ApplyEquipCooldown(Item* pItem) if (spellData.SpellId <= 0) continue; + // apply proc cooldown to equip auras if we have any + if (spellData.SpellTrigger == ITEM_SPELLTRIGGER_ON_EQUIP) + { + SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(spellData.SpellId); + if (!procEntry) + continue; + + if (Aura* itemAura = GetAura(spellData.SpellId, GetGUID(), pItem->GetGUID())) + itemAura->AddProcCooldown(now + procEntry->Cooldown); + continue; + } + // wrong triggering type (note: ITEM_SPELLTRIGGER_ON_NO_DELAY_USE not have cooldown) if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) continue; |
