Пример #1
0
        public override void BuildValuesCreate(WorldPacket data, Player target)
        {
            UpdateFieldFlag flags  = GetUpdateFieldFlagsFor(target);
            WorldPacket     buffer = new WorldPacket();

            m_objectData.WriteCreate(buffer, flags, this, target);
            m_conversationData.WriteCreate(buffer, flags, this, target);

            data.WriteUInt32(buffer.GetSize());
            data.WriteUInt8((byte)flags);
            data.WriteBytes(buffer);
        }
Пример #2
0
        void BuildValuesUpdateForPlayerWithMask(UpdateData data, UpdateMask requestedObjectMask, UpdateMask requestedItemMask, UpdateMask requestedAzeriteItemMask, Player target)
        {
            UpdateFieldFlag flags      = GetUpdateFieldFlagsFor(target);
            UpdateMask      valuesMask = new UpdateMask((int)TypeId.Max);

            if (requestedObjectMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.Object);
            }

            m_itemData.FilterDisallowedFieldsMaskForFlag(requestedItemMask, flags);
            if (requestedItemMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.Item);
            }

            m_azeriteItemData.FilterDisallowedFieldsMaskForFlag(requestedAzeriteItemMask, flags);
            if (requestedAzeriteItemMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.AzeriteItem);
            }

            WorldPacket buffer = new WorldPacket();

            buffer.WriteUInt32(valuesMask.GetBlock(0));

            if (valuesMask[(int)TypeId.Object])
            {
                m_objectData.WriteUpdate(buffer, requestedObjectMask, true, this, target);
            }

            if (valuesMask[(int)TypeId.Item])
            {
                m_itemData.WriteUpdate(buffer, requestedItemMask, true, this, target);
            }

            if (valuesMask[(int)TypeId.AzeriteItem])
            {
                m_azeriteItemData.WriteUpdate(buffer, requestedAzeriteItemMask, true, this, target);
            }

            WorldPacket buffer1 = new WorldPacket();

            buffer1.WriteUInt8((byte)UpdateType.Values);
            buffer1.WritePackedGuid(GetGUID());
            buffer1.WriteUInt32(buffer.GetSize());
            buffer1.WriteBytes(buffer.GetData());

            data.AddUpdateBlock(buffer1);
        }
Пример #3
0
        public override void BuildValuesUpdate(WorldPacket data, Player target)
        {
            UpdateFieldFlag flags  = GetUpdateFieldFlagsFor(target);
            WorldPacket     buffer = new WorldPacket();

            buffer.WriteUInt32(m_values.GetChangedObjectTypeMask());
            if (m_values.HasChanged(TypeId.Object))
            {
                m_objectData.WriteUpdate(buffer, flags, this, target);
            }

            if (m_values.HasChanged(TypeId.Conversation))
            {
                m_conversationData.WriteUpdate(buffer, flags, this, target);
            }

            data.WriteUInt32(buffer.GetSize());
            data.WriteBytes(buffer);
        }
Пример #4
0
        void BuildValuesUpdateForPlayerWithMask(UpdateData data, UpdateMask requestedObjectMask, UpdateMask requestedDynamicObjectMask, Player target)
        {
            UpdateMask valuesMask = new UpdateMask((int)TypeId.Max);

            if (requestedObjectMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.Object);
            }

            if (requestedDynamicObjectMask.IsAnySet())
            {
                valuesMask.Set((int)TypeId.DynamicObject);
            }

            WorldPacket buffer = new WorldPacket();

            buffer.WriteUInt32(valuesMask.GetBlock(0));

            if (valuesMask[(int)TypeId.Object])
            {
                m_objectData.WriteUpdate(buffer, requestedObjectMask, true, this, target);
            }

            if (valuesMask[(int)TypeId.DynamicObject])
            {
                m_dynamicObjectData.WriteUpdate(buffer, requestedDynamicObjectMask, true, this, target);
            }

            WorldPacket buffer1 = new WorldPacket();

            buffer1.WriteUInt8((byte)UpdateType.Values);
            buffer1.WritePackedGuid(GetGUID());
            buffer1.WriteUInt32(buffer.GetSize());
            buffer1.WriteBytes(buffer.GetData());

            data.AddUpdateBlock(buffer1);
        }
Пример #5
0
        public override void BuildValuesUpdateWithFlag(WorldPacket data, UpdateFieldFlag flags, Player target)
        {
            UpdateMask valuesMask = new UpdateMask(14);

            valuesMask.Set((int)TypeId.Item);
            valuesMask.Set((int)TypeId.AzeriteItem);

            WorldPacket buffer = new WorldPacket();

            buffer.WriteUInt32(valuesMask.GetBlock(0));

            UpdateMask mask = new UpdateMask(40);

            m_itemData.AppendAllowedFieldsMaskForFlag(mask, flags);
            m_itemData.WriteUpdate(buffer, mask, true, this, target);

            UpdateMask mask2 = new UpdateMask(9);

            m_azeriteItemData.AppendAllowedFieldsMaskForFlag(mask2, flags);
            m_azeriteItemData.WriteUpdate(buffer, mask2, true, this, target);

            data.WriteUInt32(buffer.GetSize());
            data.WriteBytes(buffer);
        }
Пример #6
0
        public override void Write()
        {
            WorldPacket attackRoundInfo = new WorldPacket();

            attackRoundInfo.WriteUInt32((uint)hitInfo);
            attackRoundInfo.WritePackedGuid(AttackerGUID);
            attackRoundInfo.WritePackedGuid(VictimGUID);
            attackRoundInfo.WriteInt32(Damage);
            attackRoundInfo.WriteInt32(OriginalDamage);
            attackRoundInfo.WriteInt32(OverDamage);
            attackRoundInfo.WriteUInt8((byte)(SubDmg.HasValue ? 1 : 0));

            if (SubDmg.HasValue)
            {
                attackRoundInfo.WriteInt32(SubDmg.Value.SchoolMask);
                attackRoundInfo.WriteFloat(SubDmg.Value.FDamage);
                attackRoundInfo.WriteInt32(SubDmg.Value.Damage);
                if (hitInfo.HasAnyFlag(HitInfo.FullAbsorb | HitInfo.PartialAbsorb))
                {
                    attackRoundInfo.WriteInt32(SubDmg.Value.Absorbed);
                }
                if (hitInfo.HasAnyFlag(HitInfo.FullResist | HitInfo.PartialResist))
                {
                    attackRoundInfo.WriteInt32(SubDmg.Value.Resisted);
                }
            }

            attackRoundInfo.WriteUInt8(VictimState);
            attackRoundInfo.WriteUInt32(AttackerState);
            attackRoundInfo.WriteUInt32(MeleeSpellID);

            if (hitInfo.HasAnyFlag(HitInfo.Block))
            {
                attackRoundInfo.WriteInt32(BlockAmount);
            }

            if (hitInfo.HasAnyFlag(HitInfo.RageGain))
            {
                attackRoundInfo.WriteInt32(RageGained);
            }

            if (hitInfo.HasAnyFlag(HitInfo.Unk1))
            {
                attackRoundInfo.WriteUInt32(UnkState.State1);
                attackRoundInfo.WriteFloat(UnkState.State2);
                attackRoundInfo.WriteFloat(UnkState.State3);
                attackRoundInfo.WriteFloat(UnkState.State4);
                attackRoundInfo.WriteFloat(UnkState.State5);
                attackRoundInfo.WriteFloat(UnkState.State6);
                attackRoundInfo.WriteFloat(UnkState.State7);
                attackRoundInfo.WriteFloat(UnkState.State8);
                attackRoundInfo.WriteFloat(UnkState.State9);
                attackRoundInfo.WriteFloat(UnkState.State10);
                attackRoundInfo.WriteFloat(UnkState.State11);
                attackRoundInfo.WriteUInt32(UnkState.State12);
            }

            if (hitInfo.HasAnyFlag(HitInfo.Block | HitInfo.Unk12))
            {
                attackRoundInfo.WriteFloat(Unk);
            }

            attackRoundInfo.WriteUInt8((byte)ContentTuning.TuningType);
            attackRoundInfo.WriteUInt8(ContentTuning.TargetLevel);
            attackRoundInfo.WriteUInt8(ContentTuning.Expansion);
            attackRoundInfo.WriteUInt8(ContentTuning.TargetMinScalingLevel);
            attackRoundInfo.WriteUInt8(ContentTuning.TargetMaxScalingLevel);
            attackRoundInfo.WriteInt16(ContentTuning.PlayerLevelDelta);
            attackRoundInfo.WriteInt8(ContentTuning.TargetScalingLevelDelta);
            attackRoundInfo.WriteUInt16(ContentTuning.PlayerItemLevel);
            attackRoundInfo.WriteUInt16(ContentTuning.ScalingHealthItemLevelCurveID);
            attackRoundInfo.WriteUInt8((byte)(ContentTuning.ScalesWithItemLevel ? 1 : 0));

            WriteLogDataBit();
            FlushBits();
            WriteLogData();

            _worldPacket.WriteUInt32(attackRoundInfo.GetSize());
            _worldPacket.WriteBytes(attackRoundInfo);
        }