mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
[8056] Move SMSG_CLEAR_COOLDOWN into function and use it. Other cleanups. Author:XTZGZoReX
[8060] Store spell_pet_auras for auraeffects instead of by whole aura Author:hunuza. --HG-- branch : trunk
This commit is contained in:
@@ -12845,33 +12845,6 @@ void Unit::SendPetTalk (uint32 pettalk)
|
||||
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Unit::SendPetSpellCooldown (uint32 spellid, time_t cooltime)
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if(!owner || owner->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4);
|
||||
data << uint64(GetGUID());
|
||||
data << uint8(0x0); // flags (0x1, 0x2)
|
||||
data << uint32(spellid);
|
||||
data << uint32(cooltime);
|
||||
|
||||
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Unit::SendPetClearCooldown (uint32 spellid)
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if(!owner || owner->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(spellid);
|
||||
data << uint64(GetGUID());
|
||||
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Unit::SendPetAIReaction(uint64 guid)
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
@@ -13368,12 +13341,6 @@ void Unit::AddPetAura(PetAura const* petSpell)
|
||||
if(GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// Aura already added - not need to add it twice
|
||||
// This check is to prevent existing pet having aura applied twice (passive auras can stack)
|
||||
// if aura has more than 1 dummy effect
|
||||
if (m_petAuras.find(petSpell)!= m_petAuras.end())
|
||||
return;
|
||||
|
||||
m_petAuras.insert(petSpell);
|
||||
if(Pet* pet = ((Player*)this)->GetPet())
|
||||
pet->CastPetAura(petSpell);
|
||||
|
||||
Reference in New Issue
Block a user