// UNUSED FOR NOW public static SMSG_UPDATE_OBJECT_VANILLA UpdateValues(PlayerEntity player) { var update = new SMSG_UPDATE_OBJECT_VANILLA(); update.Writer .WriteUInt32(1) // blocks.Count .WriteUInt8(0) // hasTransport .WriteUInt8((byte)ObjectUpdateType.UPDATETYPE_VALUES) .WriteBytes(player.Character.Id.ToPackedUInt64()); player.WriteUpdateFields(update.Writer); return(update); }
public static SMSG_UPDATE_OBJECT_VANILLA CreateUnit(Creature unit) { var update = new SMSG_UPDATE_OBJECT_VANILLA(); var entity = new UnitEntity(unit, ClientBuild.Vanilla) { ObjectGuid = new ObjectGuid(unit.ID), Guid = unit.ID }; update.Writer .WriteUInt32(1) // blocks.Count .WriteUInt8(0) // hasTransport .WriteUInt8((byte)ObjectUpdateType.UPDATETYPE_CREATE_OBJECT) .WriteBytes(unit.ID.ToPackedUInt64()) .WriteUInt8((byte)TypeId.TypeidUnit) .WriteUInt8((byte)(ObjectUpdateFlag_VANILLA.All | ObjectUpdateFlag_VANILLA.HasPosition | ObjectUpdateFlag_VANILLA.Living)) .WriteUInt32((uint)MovementFlags.None) .WriteUInt32((uint)Environment.TickCount) .WriteMap(unit.Position) .WriteFloat(0) // ?? .WriteFloat(2.5f) // WalkSpeed .WriteFloat(7f) // RunSpeed .WriteFloat(4.5f) // Backwards WalkSpeed .WriteFloat(4.72f) // SwimSpeed .WriteFloat(2.5f) // Backwards SwimSpeed .WriteFloat(3.14f) // TurnSpeed .WriteInt32(0); // ?? entity.WriteUpdateFields(update.Writer); return(update); }