mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Spells: add proc cooldown on item equip.
(cherry picked from commit 016b31a1b6)
# Conflicts:
# src/server/game/Entities/Player/Player.cpp
This commit is contained in:
@@ -23636,10 +23636,23 @@ void Player::ApplyEquipCooldown(Item* pItem)
|
||||
if (proto->GetFlags() & ITEM_FLAG_NO_EQUIP_COOLDOWN)
|
||||
return;
|
||||
|
||||
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
||||
for (uint8 i = 0; i < proto->Effects.size(); ++i)
|
||||
{
|
||||
ItemEffectEntry const* effectData = proto->Effects[i];
|
||||
|
||||
// apply proc cooldown to equip auras if we have any
|
||||
if (effectData->Trigger == ITEM_SPELLTRIGGER_ON_EQUIP)
|
||||
{
|
||||
SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(effectData->SpellID);
|
||||
if (!procEntry)
|
||||
continue;
|
||||
|
||||
if (Aura* itemAura = GetAura(effectData->SpellID, GetGUID(), pItem->GetGUID()))
|
||||
itemAura->AddProcCooldown(now + procEntry->Cooldown);
|
||||
continue;
|
||||
}
|
||||
|
||||
// wrong triggering type
|
||||
if (effectData->Trigger != ITEM_SPELLTRIGGER_ON_USE)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user