mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 08:28:57 +01:00
Core/Spells: Fixed WotF and PvP trinket shared cooldown
This commit is contained in:
@@ -660,22 +660,16 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
void HandleScript()
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
SpellInfo const* spellInfo = GetSpellInfo();
|
||||
caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS);
|
||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
|
||||
data << uint64(caster->GetGUID());
|
||||
data << uint8(0);
|
||||
data << uint32(spellInfo->Id);
|
||||
data << uint32(0);
|
||||
caster->GetSession()->SendPacket(&data);
|
||||
// This is only needed because spells cast from spell_linked_spell are triggered by default
|
||||
// Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
|
||||
GetCaster()->ToPlayer()->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
AfterCast += SpellCastFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user