Core/Spells: Fixed WotF and PvP trinket shared cooldown

This commit is contained in:
Shauren
2012-06-09 13:09:49 +02:00
parent 563c70e41a
commit 7d98f2ffc7

View File

@@ -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);
}
};