mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8056] Move SMSG_CLEAR_COOLDOWN into function and use it. Other cleanups.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
d97f2bb92f
commit
9b9fe55981
6 changed files with 28 additions and 77 deletions
|
|
@ -3256,12 +3256,7 @@ void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
|
|||
m_spellCooldowns.erase(spell_id);
|
||||
|
||||
if(update)
|
||||
{
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(spell_id);
|
||||
data << uint64(GetGUID());
|
||||
SendDirectMessage(&data);
|
||||
}
|
||||
SendClearCooldown(spell_id, this);
|
||||
}
|
||||
|
||||
void Player::RemoveArenaSpellCooldowns()
|
||||
|
|
@ -3279,13 +3274,8 @@ void Player::RemoveArenaSpellCooldowns()
|
|||
entry->RecoveryTime <= 15 * MINUTE * IN_MILISECONDS &&
|
||||
entry->CategoryRecoveryTime <= 15 * MINUTE * IN_MILISECONDS )
|
||||
{
|
||||
// notify player
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(itr->first);
|
||||
data << uint64(GetGUID());
|
||||
GetSession()->SendPacket(&data);
|
||||
// remove cooldown
|
||||
m_spellCooldowns.erase(itr);
|
||||
// remove & notify
|
||||
RemoveSpellCooldown(itr->first, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3295,12 +3285,8 @@ void Player::RemoveAllSpellCooldown()
|
|||
if(!m_spellCooldowns.empty())
|
||||
{
|
||||
for(SpellCooldowns::const_iterator itr = m_spellCooldowns.begin();itr != m_spellCooldowns.end(); ++itr)
|
||||
{
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(itr->first);
|
||||
data << uint64(GetGUID());
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
SendClearCooldown(itr->first, this);
|
||||
|
||||
m_spellCooldowns.clear();
|
||||
}
|
||||
}
|
||||
|
|
@ -6289,22 +6275,6 @@ void Player::DuelComplete(DuelCompleteType type)
|
|||
duel->opponent->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1);
|
||||
}
|
||||
|
||||
// cool-down duel spell
|
||||
/*data.Initialize(SMSG_SPELL_COOLDOWN, 17);
|
||||
|
||||
data<<GetGUID();
|
||||
data<<uint8(0x0);
|
||||
|
||||
data<<(uint32)7266;
|
||||
data<<uint32(0x0);
|
||||
GetSession()->SendPacket(&data);
|
||||
data.Initialize(SMSG_SPELL_COOLDOWN, 17);
|
||||
data<<duel->opponent->GetGUID();
|
||||
data<<uint8(0x0);
|
||||
data<<(uint32)7266;
|
||||
data<<uint32(0x0);
|
||||
duel->opponent->GetSession()->SendPacket(&data);*/
|
||||
|
||||
//Remove Duel Flag object
|
||||
GameObject* obj = GetMap()->GetGameObject(GetUInt64Value(PLAYER_DUEL_ARBITER));
|
||||
if(obj)
|
||||
|
|
@ -20299,4 +20269,12 @@ void Player::RemoveAtLoginFlag( AtLoginFlags f, bool in_db_also /*= false*/ )
|
|||
|
||||
if(in_db_also)
|
||||
CharacterDatabase.PExecute("UPDATE characters set at_login = at_login & ~ %u WHERE guid ='%u'", uint32(f), GetGUIDLow());
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SendClearCooldown( uint32 spell_id, Unit* target )
|
||||
{
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(spell_id);
|
||||
data << uint64(target->GetGUID());
|
||||
SendDirectMessage(&data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue