public override void Write() { WorldPacket attackRoundInfo = new WorldPacket(); attackRoundInfo.WriteUInt32(hitInfo); attackRoundInfo.WritePackedGuid(AttackerGUID); attackRoundInfo.WritePackedGuid(VictimGUID); attackRoundInfo.WriteInt32(Damage); attackRoundInfo.WriteInt32(OriginalDamage); attackRoundInfo.WriteInt32(OverDamage); attackRoundInfo.WriteUInt8(SubDmg.HasValue); 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.WriteInt32(AttackerState); attackRoundInfo.WriteInt32(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(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(ContentTuning.ScalesWithItemLevel ? 1 : 0); WriteLogDataBit(); FlushBits(); WriteLogData(); _worldPacket.WriteInt32(attackRoundInfo.GetSize()); _worldPacket.WriteBytes(attackRoundInfo); }
public void Write(WorldPacket data) { data.WriteUInt32(Flags); data.WriteUInt8(AnimTier); data.WriteUInt32(TierTransStartTime); data.WriteInt32(Elapsed); data.WriteUInt32(MoveTime); data.WriteUInt32(FadeObjectTime); data.WriteUInt8(Mode); data.WriteUInt8(VehicleExitVoluntary); data.WritePackedGuid(TransportGUID); data.WriteInt8(VehicleSeat); data.WriteBits((byte)Face, 2); data.WriteBits(Points.Count, 16); data.WriteBits(PackedDeltas.Count, 16); data.WriteBit(SplineFilter.HasValue); data.WriteBit(SpellEffectExtraData.HasValue); data.WriteBit(JumpExtraData.HasValue); data.FlushBits(); if (SplineFilter.HasValue) { SplineFilter.Value.Write(data); } switch (Face) { case MonsterMoveType.FacingSpot: data.WriteVector3(FaceSpot); break; case MonsterMoveType.FacingTarget: data.WriteFloat(FaceDirection); data.WritePackedGuid(FaceGUID); break; case MonsterMoveType.FacingAngle: data.WriteFloat(FaceDirection); break; } foreach (Vector3 pos in Points) { data.WriteVector3(pos); } foreach (Vector3 pos in PackedDeltas) { data.WritePackXYZ(pos); } if (SpellEffectExtraData.HasValue) { SpellEffectExtraData.Value.Write(data); } if (JumpExtraData.HasValue) { JumpExtraData.Value.Write(data); } }