diff options
author | silver1ce <none@none> | 2010-01-10 13:52:13 +0200 |
---|---|---|
committer | silver1ce <none@none> | 2010-01-10 13:52:13 +0200 |
commit | eea50de960f0035cd54e985dc119870aa215732b (patch) | |
tree | 33a184ec8c3504f6f58ce0805b1df6ff6391f0b2 /src/game/SpellAuras.cpp | |
parent | e3ff6145eec7e72299d4223714e98048643c5c75 (diff) |
now all aura updates are placed into one packet
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r-- | src/game/SpellAuras.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index a81ab666cfd..1a3188aacb4 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -204,6 +204,38 @@ void AuraApplication::ClientUpdate(bool remove) m_target->SendMessageToSet(&data, true); } +void AuraApplication::ConstructAuraInfo(ByteBuffer &data) +{ + m_needClientUpdate = false; + + data << uint8(m_slot); + + if(!m_target->GetVisibleAura(m_slot)) + { + data << uint32(0); + sLog.outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot); + return; + } + + Aura const * aura = GetBase(); + data << uint32(aura->GetId()); + uint32 flags = m_flags; + if (aura->GetMaxDuration() > 0) + flags |= AFLAG_DURATION; + data << uint8(flags); + data << uint8(aura->GetCasterLevel()); + data << uint8(aura->GetStackAmount() > 1 ? aura->GetStackAmount() : (aura->GetCharges()) ? aura->GetCharges() : 1); + + if(!(flags & AFLAG_CASTER)) + data.appendPackGUID(aura->GetCasterGUID()); + + if(flags & AFLAG_DURATION) + { + data << uint32(aura->GetMaxDuration()); + data << uint32(aura->GetDuration()); + } +} + Aura * Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) { assert(spellproto); |