[0144] Enabled opcodes, most item-related. Enabled cooldown opcodes.

Signed-off-by: Yaki Khadafi <ElSolDolLo@gmail.com>
This commit is contained in:
Yaki Khadafi 2012-08-20 15:15:08 +03:00 committed by Antz
parent 1b2856f6f1
commit 1112b9f353
6 changed files with 83 additions and 69 deletions

View file

@ -3659,8 +3659,21 @@ void Player::RemoveAllSpellCooldown()
{
if (!m_spellCooldowns.empty())
{
ObjectGuid guid = GetObjectGuid();
WorldPacket data(SMSG_CLEAR_COOLDOWNS, 1 + 8 + m_spellCooldowns.size() * 4);
data.WriteGuidMask<1, 3, 6>(guid);
data.WriteBits(m_spellCooldowns.size(), 24); // cooldown count
data.WriteGuidMask<7, 5, 2, 4, 0>(guid);
data.WriteGuidBytes<7, 2, 4, 5, 1, 3>(guid);
for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr)
SendClearCooldown(itr->first, this);
data << uint32(itr->first);
data.WriteGuidBytes<0, 6>(guid);
SendDirectMessage(&data);
m_spellCooldowns.clear();
}
@ -20646,7 +20659,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30);
WorldPacket data(SMSG_ITEM_COOLDOWN, 12);
data << ObjectGuid(pItem->GetObjectGuid());
data << pItem->GetObjectGuid();
data << uint32(spellData.SpellId);
GetSession()->SendPacket(&data);
}
@ -23220,9 +23233,17 @@ void Player::RemoveAtLoginFlag(AtLoginFlags f, bool in_db_also /*= false*/)
void Player::SendClearCooldown(uint32 spell_id, Unit* target)
{
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4 + 8);
ObjectGuid guid = target->GetObjectGuid();
WorldPacket data(SMSG_CLEAR_COOLDOWNS, 1 + 8 + 4);
data.WriteGuidMask<1, 3, 6>(guid);
data.WriteBits(1, 24); // cooldown count
data.WriteGuidMask<7, 5, 2, 4, 0>(guid);
data.WriteGuidBytes<7, 2, 4, 5, 1, 3>(guid);
data << uint32(spell_id);
data << target->GetObjectGuid();
data.WriteGuidBytes<0, 6>(guid);
SendDirectMessage(&data);
}