public override void Serialize(LittleEndianWriter writer) { writer.WriteShort((short)1); // Number of dashes writer.WriteByte((byte)4); // Waypoints size * 2 writer.WriteUInt((uint)sourceNetId); writer.WriteFloat((float)dashSpeed); writer.WriteFloat((float)leapHeight); writer.WriteFloat((float)unitPosition.X); writer.WriteFloat((float)unitPosition.Y); writer.WriteByte((byte)(keepFacingLastDirection ? 0x01 : 0x00)); writer.WriteUInt(targetNetId); writer.WriteFloat((float)followTargetMaxDistance); writer.WriteFloat((float)backDistance); writer.WriteFloat((float)travelTime); var waypoints = new List <Vector2> { new Vector2(unitPosition.X, unitPosition.Y), new Vector2(targetPosition.X, targetPosition.Y) }; writer.WriteBytes(MovementVector.EncodeWaypoints(waypoints.ToArray(), mapSize)); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(targetNetId); writer.WriteByte((byte)extraTime); // extraTime writer.WriteUInt(futureProjectileNetId); // Basic attack projectile ID, to be spawned later writer.WriteByte((byte)slot); // attackSlot writer.WriteByte((byte)0x80); // not sure what this is, but it should be correct (or maybe attacked x z y?) - 4.18 writer.WriteByte((byte)0x01); writer.WriteShort((short)MovementVector.TargetXToNormalFormat(targetPosition.X, middleOfMap)); writer.WriteByte((byte)0x80); writer.WriteByte((byte)0x01); writer.WriteShort((short)MovementVector.TargetYToNormalFormat(targetPosition.Y, middleOfMap)); // writer.WriteFloat(targetPosition.X); // writer.WriteFloat(targetPosition.Y); writer.WriteByte((byte)0xCC); writer.WriteByte((byte)0x35); writer.WriteByte((byte)0xC4); writer.WriteByte((byte)0xD1); writer.WriteFloat(sourcePosition.X); writer.WriteFloat(sourcePosition.Y); }
public void Serialize(LittleEndianWriter writer) { writer.WriteUInt(TargetNetId); writer.WriteUInt(NetAssignedNetId); writer.WriteUInt(CasterNetId); writer.WriteUInt(BindNetId); writer.WriteUInt(KeywordNetId); writer.WriteShort(PositionX); writer.WriteFloat(PositionY); writer.WriteShort(PositionZ); writer.WriteShort(TargetPositionX); writer.WriteFloat(TargetPositionY); writer.WriteShort(TargetPositionZ); writer.WriteShort(OwnerPositionX); writer.WriteFloat(OwnerPositionY); writer.WriteShort(OwnerPositionZ); OrientationVector.Serialize(writer); writer.WriteFloat(TimeSpent); writer.WriteFloat(ScriptScale); }
public void Serialize(LittleEndianWriter writer) { writer.WriteUInt(TargetNetId); writer.WriteSByte((sbyte)(ExtraTime + 128)); writer.WriteUInt(MissileNextId); writer.WriteByte((byte)AttackSlot); // attackSlot TargetPosition.Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte((byte)damageResult); writer.WriteShort((short)((short)damageType << 8)); writer.WriteFloat((float)value); writer.WriteUInt(targetNetId); writer.WriteUInt(sourceNetId); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteFloat(position.X); writer.WriteFloat(position.Y); writer.WriteUInt(targetNetId); writer.WriteUInt(sourceNetId); writer.WriteByte((byte)pingType); writer.WriteByte(0xFB); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(buffSlot); writer.WriteByte((byte)buffType); writer.WriteByte(count); writer.WriteBool(isHidden); writer.WriteUInt(buffNameHash); writer.WriteUInt(packageHash); writer.WriteFloat(runningTime); writer.WriteFloat(duration); writer.WriteUInt(casterNetId); }
/// <summary> /// Writes this <see cref="MOBFile"/> into a <see cref="Stream"/> /// </summary> /// <param name="stream">The <see cref="Stream"/> to write to</param> public void Write(Stream stream) { using (LittleEndianWriter bw = new LittleEndianWriter(stream)) { bw.WriteBytes(Encoding.ASCII.GetBytes("OPAM")); bw.WriteUInt((uint)2); bw.WriteInt(this.Objects.Count); bw.WriteUInt((uint)0); foreach (MOBObject mobObject in this.Objects) { mobObject.Write(bw); } } }
public override void Pack(LittleEndianWriter writer) { if ((short)Cmd > byte.MaxValue) // oops, riot needs ids ! { writer.WriteByte((byte)PacketCmd.PKT_S2C_Extended); writer.WriteUInt(netId); writer.WriteShort((short)Cmd); } else { writer.WriteByte((byte)Cmd); writer.WriteUInt(netId); } Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { int waypointsSize = Waypoints.Length; if (waypointsSize > 0x7F) { throw new Exception("Too many paths > 0x7F!"); } byte bitfield = 0; if (Waypoints != null) { bitfield |= (byte)(waypointsSize << 1); } if (HasTeleportID) { bitfield |= 1; } writer.WriteByte(4);//bitfield); if (Waypoints != null) { writer.WriteUInt(TeleportNetID); if (HasTeleportID) { writer.WriteByte(TeleportID); } writer.WriteWaypointSpeedParams(SpeedParams); writer.WriteCompressedWaypoints(Waypoints); } }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(TargetNetId); writer.WriteInt((int)floatingTextType); writer.WriteInt(param); writer.WriteFixedStringLast(message, 128); }
public override void Pack(LittleEndianWriter writer) { writer.WriteByte((byte)Cmd); writer.WriteUInt(netId); writer.WriteInt(syncId); Serialize(writer); }
public void Serialize(LittleEndianWriter writer) { writer.WriteUInt(ItemId); writer.WriteByte(Slot); writer.WriteByte(ItemsInSlot); writer.WriteByte(SpellCharges); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(100); // animation flags, unknown writer.WriteFloat(scaleTime); writer.WriteFloat(startProgress); writer.WriteFloat(speedRatio); writer.WriteFixedStringLast(animationName, 64); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt((int)0); writer.WriteByte((byte)0); writer.WriteUInt(sourceNetId); writer.WriteByte((byte)0); // unk writer.WriteByte((byte)7); // unk writer.WriteInt((int)0); // Flags? }
public void Serialize(LittleEndianWriter writer) { writer.WriteUInt(PackageHash); // Ezreal writer.WriteUInt(EffectNameHash); // Particle.Name writer.WriteUShort(Flags); // 0x00000020 writer.WriteUInt(TargetBoneNameHash); // not sended writer.WriteUInt(BoneNameHash); // particle.BonesName int count = FXCreateData.Count; if (count > 0xFF) { throw new IOException("FXCreateData list too big > 255!"); } writer.WriteByte((byte)count); foreach (var fx in FXCreateData) { fx.Serialize(writer); } }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt(goldFromKill); // Gold from kill? writer.WriteByte((byte)0); writer.WriteUInt(killerNetId); writer.WriteByte((byte)0); writer.WriteByte((byte)7); writer.WriteFloat(respawnTimerMs); // Respawn timer, float }
public void Serialize(LittleEndianWriter writer) { writer.WriteSizedString(SkinName); writer.WriteUInt(SkinId); byte bitfield = 0; if (OverrideSpells) { bitfield |= 1; } if (ModelOnly) { bitfield |= 2; } if (ReplaceCharacterPackage) { bitfield |= 4; } writer.WriteByte(bitfield); writer.WriteUInt(Id); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteInt((int)teamId); writer.WriteByte((byte)0xFE); writer.WriteByte((byte)0xFF); writer.WriteByte((byte)0xFF); writer.WriteByte((byte)0xFF); writer.WriteInt((int)0); writer.WriteUInt((uint)unitNetId); // Fog Attached, when unit dies it disappears writer.WriteUInt((uint)fogNetId); //Fog NetID writer.WriteInt((int)0); writer.WriteFloat(position.X); writer.WriteFloat(position.Y); writer.WriteFloat((float)2500); writer.WriteFloat((float)88.4f); writer.WriteFloat((float)130); writer.WriteFloat((float)1.0f); writer.WriteInt((int)0); writer.WriteByte((byte)199); writer.WriteFloat(visionRadius); // vision radius }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(stackData.Id); byte bitfield = 0; if (stackData.OverrideSpells) { bitfield |= 1; } if (stackData.ModelOnly) { bitfield |= 2; } if (stackData.ReplaceCharacterPackage) { bitfield |= 4; } writer.WriteByte(bitfield); writer.WriteUInt(stackData.SkinId); writer.WriteFixedStringLast(stackData.SkinName, 64); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(netId); writer.WriteByte((byte)netNodeId); position.Serialize(writer); groupPosition.Serialize(writer); faceDirectionPosition.Serialize(writer); writer.WriteString(name, 64); writer.WriteString(skinName, 64); writer.WriteString(uniqueName, 64); writer.WriteString(spawnAnimationName, 64); writer.WriteUInt((uint)teamId); writer.WriteInt(damageBonus); writer.WriteInt(healthBonus); writer.WriteUInt((uint)roamState); writer.WriteInt(groupNumber); writer.WriteInt(buffSide); writer.WriteInt(revealEvent); writer.WriteInt(initialLevel); writer.WriteFloat(spawnDuration); writer.WriteFloat(spawnTime); writer.WriteByte(BehaviorTree); writer.WriteFixedStringLast(AIScript, 32); }
public static void WriteWaypointSpeedParams(this LittleEndianWriter writer, SpeedParams data) { if (data == null) { data = new SpeedParams(); } writer.WriteFloat(data.PathSpeedOverride); writer.WriteFloat(data.ParabolicGravity); data.ParabolicStartPoint.Serialize(writer); writer.WriteBool(data.Facing); writer.WriteUInt(data.FollowNetID); writer.WriteFloat(data.FollowDistance); writer.WriteFloat(data.FollowBackDistance); writer.WriteFloat(data.FollowTravelTime); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(turretNetId); writer.WriteByte((byte)0x40); foreach (var b in Encoding.UTF8.GetBytes(turretName)) { writer.WriteByte((byte)b); } writer.Fill(0, 64 - turretName.Length); writer.WriteByte((byte)0x0C); writer.WriteByte((byte)0x00); writer.WriteByte((byte)0x00); writer.WriteByte((byte)0x80); writer.WriteByte((byte)0x01); }
public override void Serialize(LittleEndianWriter writer) { int itemCount = Items.Length; if (itemCount > 0xFF) { throw new IOException("More than 255 items!"); } writer.WriteByte((byte)itemCount); foreach (var item in Items) { item.Serialize(writer); } if (ShieldValues != null) { writer.WriteBool(true); ShieldValues.Serialize(writer); } else { writer.WriteBool(false); } writer.WriteInt(CharacterDataStack.Length); foreach (var data in CharacterDataStack) { data.Serialize(writer); } writer.WriteUInt(LookAtNetId); writer.WriteByte((byte)LookAtType); LookAtPosition.Serialize(writer); writer.WriteInt(BuffCount.Count); foreach (var kvp in BuffCount) { writer.WriteByte(kvp.Key); writer.WriteInt(kvp.Value); } writer.WriteBool(UnknownIsHero); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte(spellSlot); byte bitfield = 0; if (isSummonerSpell) { bitfield |= 0x01; } writer.WriteByte(bitfield); writer.WriteUInt((uint)changeSpellData.ChangeSlotSpellDataType); ChangeSpellDataExtension.WriteChangeSpellData(writer, changeSpellData); changeSpellData.Serialize(writer); }
public override void Serialize(LittleEndianWriter writer) { writer.WriteByte((byte)announceEnum); if (sourceNetId != 0) { writer.WriteLong((long)sourceNetId); writer.WriteInt(assitsNetIds.Length); foreach (var a in assitsNetIds) { writer.WriteUInt((uint)a); } for (int i = 0; i < 12 - assitsNetIds.Length; i++) { writer.WriteInt((int)0); } } }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(netId); writer.WriteInt(playerId); writer.WriteByte(40); // net node id? writer.WriteByte(0); // botskilllevel if (team == TeamId.BLUE) { writer.WriteByte(1); } else { writer.WriteByte(0); } writer.WriteByte(0); // is bot writer.WriteByte(0); // spawn pos index writer.WriteInt(skinId); foreach (var b in Encoding.Default.GetBytes(name)) { writer.WriteByte((byte)b); } writer.Fill(0, 128 - name.Length); foreach (var b in Encoding.Default.GetBytes(championType)) { writer.WriteByte((byte)b); } writer.Fill(0, 40 - championType.Length); writer.WriteFloat(0.0f); writer.WriteFloat(0.0f); writer.WriteInt(0); writer.WriteByte(0); }
} //42-46 public void Serialize(LittleEndianWriter writer2) { byte[] buffer; using (var stream = new MemoryStream()) { using (var writer = new LittleEndianWriter(stream)) { writer.WriteUInt(SpellHash); writer.WriteUInt(SpellNetID); writer.WriteByte(SpellLevel); writer.WriteFloat(AttackSpeedModifier); writer.WriteUInt(CasterNetID); writer.WriteUInt(SpellChainOwnerNetID); writer.WriteUInt(PackageHash); writer.WriteUInt(MissileNetID); TargetPosition.Serialize(writer); TargetPositionEnd.Serialize(writer); int targetCount = Targets.Count; if (targetCount > 32) { throw new IOException("CastInfo targets > 32!!!"); } writer.WriteByte((byte)targetCount); foreach (var target in Targets) { writer.WriteUInt(target.Item1); writer.WriteByte((byte)target.Item2); } writer.WriteFloat(DesignerCastTime); writer.WriteFloat(ExtraCastTime); writer.WriteFloat(DesignerTotalTime); writer.WriteFloat(Cooldown); writer.WriteFloat(StartCastTime); byte bitfield = 0; if (IsAutoAttack) { bitfield |= 1; } if (IsSecondAutoAttack) { bitfield |= 2; } if (IsForceCastingOrChannel) { bitfield |= 4; } if (IsOverrideCastPosition) { bitfield |= 8; } if (IsClickCasted) { bitfield |= 16; } writer.WriteByte(bitfield); writer.WriteByte(SpellSlot); writer.WriteFloat(ManaCost); SpellCastLaunchPosition.Serialize(writer); writer.WriteInt(AmmoUsed); writer.WriteFloat(AmmoRechargeTime); } buffer = new byte[stream.Length]; var data = stream.GetBuffer(); Buffer.BlockCopy(data, 0, buffer, 0, buffer.Length); } writer2.WriteUShort((ushort)(buffer.Length + 2)); writer2.WriteBytes(buffer); }
private void Serialize2(LittleEndianWriter writer) { writer.WriteByte((byte)1); // number of particles writer.WriteUInt("Ezreal".HashString()); writer.WriteUInt("ezreal_bow.troy".HashString()); writer.WriteInt(0x00000020); // flags ? writer.WriteShort((short)0); // Unk writer.WriteUInt("L_HAND".HashString()); writer.WriteByte((byte)1); // number of targets ? writer.WriteUInt(netId); writer.WriteUInt(39439); // Particle net id ? writer.WriteUInt(netId); writer.WriteUInt(netId); writer.WriteInt(0); // unk for (var i = 0; i < 3; ++i) { var ownerHeight = 0; var particleHeight = 0; var higherValue = Math.Max(ownerHeight, particleHeight); writer.WriteShort((short)1); writer.WriteInt(higherValue); writer.WriteShort((short)1); } writer.WriteUInt((uint)0); // unk writer.WriteUInt((uint)0); // unk writer.WriteUInt((uint)0); // unk writer.WriteUInt((uint)0); // unk writer.WriteFloat(1.0f); // Particle size }
public override void Serialize(LittleEndianWriter writer) { writer.WriteUInt(targetId); }