Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Player::SendSpellHistory()
- {
- uint64 curTime = 0;
- ACE_OS::gettimeofday().msec(curTime);
- uint64 infTime = curTime + infinityCooldownDelayCheck;
- WorldPacket data(SMSG_SEND_SPELL_HISTORY, (1 + 2 + 4 * m_spells.size() + 2 + m_spellCooldowns.size()*(2 + 2 + 2 + 4 + 4)));
- data.WriteBits(m_spellCooldowns.size(), 19);
- for (auto itr : m_spellCooldowns)
- {
- data.WriteBit(false); // unk bit, false in sniff
- }
- for (auto itr : m_spellCooldowns)
- {
- uint32 const spellId = itr.first;
- SpellCooldown const& cooldown = itr.second;
- SpellInfo const* proto = sSpellMgr->GetSpellInfo(spellId);
- if (!proto)
- continue;
- uint64 time = cooldown.end > curTime ? (cooldown.end - curTime) : 0;
- uint64 spellCooldown = proto->Category == 0 ? time : 0;
- uint64 categoryCooldown = proto->Category != 0 ? time : 0;
- if (cooldown.end >= infTime)
- {
- spellCooldown = 1;
- categoryCooldown = 0x80000000;
- }
- data << uint32(spellId);
- data << uint32(cooldown.itemid);
- data << uint32(proto->Category);
- data << uint32(spellCooldown);
- data << uint32(categoryCooldown);
- }
- GetSession()->SendPacket(&data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement