diff --git a/src/DiIiS-NA/Core/Extensions/DateTimeExtensions.cs b/src/DiIiS-NA/Core/Extensions/DateTimeExtensions.cs index f8c5d4b..d77794b 100644 --- a/src/DiIiS-NA/Core/Extensions/DateTimeExtensions.cs +++ b/src/DiIiS-NA/Core/Extensions/DateTimeExtensions.cs @@ -1,5 +1,6 @@ //Blizzless Project 2022 using System; +using System.Collections.Generic; namespace DiIiS_NA.Core.Extensions { @@ -20,5 +21,89 @@ namespace DiIiS_NA.Core.Extensions TimeSpan diff = time.ToUniversalTime() - DateTime.UnixEpoch; return (ulong)((diff.TotalSeconds - 946695547L) * 1000000000L); } + + + /// + /// Transforms a timespan to a readable text. + /// E.g.: + /// 1 day, 2 hours, 3 minutes and 4 seconds + /// 5 hours, 6 minutes and 7 seconds + /// + /// If over certain threshold (millennium or more) it will only return the number of days. + /// + /// The timespan to be converted + /// The readable text + public static string ToText(this TimeSpan span) + { + List parts = new(); + + // if days are divided by 365, we have years, otherwise we have months or days + if (span.Days / 365 > 0) + { + // if days are divided by 365, we have years + parts.Add($"{((double)span.Days / 365):F} year{(span.Days / 365 > 1 ? "s" : "")}"); + // get months from the remaining days + int months = span.Days % 365 / 30; + if (months > 0) + parts.Add($"{months} month{(months > 1 ? "s" : "")}"); + + // get remaining days + int days = span.Days % 365 % 30; + if (days > 0) + parts.Add($"{days} day{(days > 1 ? "s" : "")}"); + } + else if (span.Days / 30 > 0) + { + // if days are divided by 30, we have months + parts.Add($"{((double)span.Days / 30):F} month{(span.Days / 30 > 1 ? "s" : "")}"); + // get remaining days + int days = span.Days % 30; + if (days > 0) + parts.Add($"{days} day{(days > 1 ? "s" : "")}"); + } + else if (span.Days > 0) + // if days are not divided by 365 or 30, we have days + parts.Add( $"{span.Days} day{(span.Days > 1 ? "s" : "")}"); + if (span.Hours > 0) + parts.Add($"{span.Hours} hour{(span.Hours > 1 ? "s" : "")}"); + if (span.Minutes > 0) + parts.Add($"{span.Minutes} minute{(span.Minutes > 1 ? "s" : "")}"); + if (span.Seconds > 0) + parts.Add($"{span.Seconds} second{(span.Seconds > 1 ? "s" : "")}"); + + var result = parts.ToArray(); + return string.Join(", ", result[..^1]) + (result.Length > 1 ? " and " : "") + parts[^1]; + } + + public static string ToSmallText(this TimeSpan span) + { + List parts = new(); + if (span.Days / 365 > 0) + { + parts.Add($"{((double)span.Days / 365):F}y"); + int months = span.Days % 365 / 30; + if (months > 0) + parts.Add($"{months}m"); + int days = span.Days % 365 % 30; + if (days > 0) + parts.Add($"{days}d"); + } + else if (span.Days / 30 > 0) + { + parts.Add($"{((double)span.Days / 30):F}m"); + int days = span.Days % 30; + if (days > 0) + parts.Add($"{days}d"); + } + else if (span.Days > 0) + parts.Add($"{span.Days}d"); + if (span.Hours > 0) + parts.Add($"{span.Hours}h"); + if (span.Minutes > 0) + parts.Add($"{span.Minutes}m"); + if (span.Seconds > 0) + parts.Add($"{span.Seconds}s"); + return string.Join(" ", parts); + } } } diff --git a/src/DiIiS-NA/Core/Extensions/EnumerableExtensions.cs b/src/DiIiS-NA/Core/Extensions/EnumerableExtensions.cs index db22845..23f76dd 100644 --- a/src/DiIiS-NA/Core/Extensions/EnumerableExtensions.cs +++ b/src/DiIiS-NA/Core/Extensions/EnumerableExtensions.cs @@ -8,21 +8,29 @@ namespace DiIiS_NA.Core.Extensions; public static class EnumerableExtensions { - public static string HexDump(this IEnumerable collection) + public static string ToHex(this byte b) => b.ToString("X2"); + public static string HexDump(this byte[] collection, bool skipSpace = false) { var sb = new StringBuilder(); foreach (byte value in collection) { - sb.Append(value.ToString("X2")); - sb.Append(' '); + sb.Append(value.ToHex()); + if (!skipSpace) + sb.Append(' '); } - if (sb.Length > 0) + if (!skipSpace && sb.Length > 0) sb.Remove(sb.Length - 1, 1); return sb.ToString(); } - - public static string ToEncodedString(this IEnumerable collection, Encoding encoding) + + public static string HexDump(this IEnumerable collection, bool skipSpace = false) { + return collection.ToArray().HexDump(skipSpace); + } + + public static string ToEncodedString(this IEnumerable collection, Encoding encoding = null) + { + encoding ??= Encoding.UTF8; return encoding.GetString(collection.ToArray()); } @@ -34,7 +42,7 @@ public static class EnumerableExtensions int i = 0; foreach (byte value in collection) { - if (i > 0 && ((i % 16) == 0)) + if (i > 0 && i % 16 == 0) { output.Append(hex); output.Append(' '); @@ -44,27 +52,21 @@ public static class EnumerableExtensions } hex.Append(value.ToString("X2")); hex.Append(' '); - text.Append($"{((char.IsWhiteSpace((char)value) && (char)value != ' ') ? '.' : (char)value)}"); // prettify text + text.Append($"{(char.IsWhiteSpace((char)value) && (char)value != ' ' ? '.' : (char)value)}"); // prettify text ++i; } - var hexstring = hex.ToString(); + var hexRepresentation = hex.ToString(); if (text.Length < 16) { - hexstring = hexstring.PadRight(48); // pad the hex representation in-case it's smaller than a regular 16 value line. + hexRepresentation = hexRepresentation.PadRight(48); // pad the hex representation in-case it's smaller than a regular 16 value line. } - output.Append(hexstring); + output.Append(hexRepresentation); output.Append(' '); output.Append(text); return output.ToString(); } - public static TItem PickRandom(this IEnumerable source) - { - return RandomHelper.RandomItem(source); - } - - public static bool TryPickRandom(this IEnumerable source, out TItem randomItem) - { - return RandomHelper.TryGetRandomItem(source, out randomItem); - } + public static TItem PickRandom(this IEnumerable source) => RandomHelper.RandomItem(source); + + public static bool TryPickRandom(this IEnumerable source, out TItem randomItem) => RandomHelper.TryGetRandomItem(source, out randomItem); } \ No newline at end of file diff --git a/src/DiIiS-NA/Core/Extensions/StringExtensions.cs b/src/DiIiS-NA/Core/Extensions/StringExtensions.cs index 0e1887c..b4e980d 100644 --- a/src/DiIiS-NA/Core/Extensions/StringExtensions.cs +++ b/src/DiIiS-NA/Core/Extensions/StringExtensions.cs @@ -1,4 +1,9 @@ //Blizzless Project 2022 + +using System; +using System.Collections.Generic; +using System.Text; + namespace DiIiS_NA.Core.Extensions { public static class StringExtensions @@ -25,6 +30,7 @@ namespace DiIiS_NA.Core.Extensions { sB.Append((char)item); } + ms.Close(); sw.Dispose(); ms.Dispose(); @@ -53,11 +59,14 @@ namespace DiIiS_NA.Core.Extensions { sB.Append((char)byteArray[i]); } + sr.Close(); ms.Close(); sr.Dispose(); ms.Dispose(); return sB.ToString(); } + public static byte[] ToBytes(this string bytes, Encoding encoding) => encoding.GetBytes(bytes); + public static byte[] ToBytes(this string bytes) => bytes.ToBytes(Encoding.UTF8); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Accolade.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Accolade.cs index d97cd3a..8a9bbf5 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Accolade.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Accolade.cs @@ -17,8 +17,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); stream.Close(); } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Act.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Act.cs index b2ed7ad..a7ad0bf 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Act.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Act.cs @@ -20,20 +20,20 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Act(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); - this.ActQuestInfo = stream.ReadSerializedData(); //12 + ActQuestInfo = stream.ReadSerializedData(); //12 stream.Position += 12; - this.WayPointInfo = new WaypointInfo[100]; //32 + WayPointInfo = new WaypointInfo[100]; //32 for (int i = 0; i < WayPointInfo.Length; i++) - this.WayPointInfo[i] = new WaypointInfo(stream); + WayPointInfo[i] = new WaypointInfo(stream); - this.ResolvedPortalDestination = new ResolvedPortalDestination(stream); + ResolvedPortalDestination = new ResolvedPortalDestination(stream); - this.ActStartLocOverrides = new ActStartLocOverride[6]; + ActStartLocOverrides = new ActStartLocOverride[6]; for (int i = 0; i < ActStartLocOverrides.Length; i++) - this.ActStartLocOverrides[i] = new ActStartLocOverride(stream); + ActStartLocOverrides[i] = new ActStartLocOverride(stream); stream.Close(); } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Actor.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Actor.cs index d812da8..7b75311 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Actor.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Actor.cs @@ -47,52 +47,52 @@ namespace DiIiS_NA.Core.MPQ.FileFormats var stream = file.Open(); Header = new Header(stream); //+16 - this.Flags = stream.ReadValueS32(); - this.Type = (ActorType)stream.ReadValueS32(); - this.ApperanceSNO = stream.ReadValueS32(); - this.PhysMeshSNO = stream.ReadValueS32(); - this.Cylinder = new AxialCylinder(stream); - this.Sphere = new Sphere(stream); - this.AABBBounds = new AABB(stream); + Flags = stream.ReadValueS32(); + Type = (ActorType)stream.ReadValueS32(); + ApperanceSNO = stream.ReadValueS32(); + PhysMeshSNO = stream.ReadValueS32(); + Cylinder = new AxialCylinder(stream); + Sphere = new Sphere(stream); + AABBBounds = new AABB(stream); - this.TagMap = stream.ReadSerializedItem(); + TagMap = stream.ReadSerializedItem(); stream.Position += (2 * 4); - this.AnimSetSNO = stream.ReadValueS32(); - this.MonsterSNO = stream.ReadValueS32(); + AnimSetSNO = stream.ReadValueS32(); + MonsterSNO = stream.ReadValueS32(); //stream.Position += 8; MsgTriggeredEvents = stream.ReadSerializedData(); - this.AniimTreeSno = stream.ReadValueS32(); + AniimTreeSno = stream.ReadValueS32(); //stream.Position += 4; //this.IntNew = stream.ReadValueS32(); //stream.Position += 8; - this.MsgTriggeredEventCount = MsgTriggeredEvents.Count; + MsgTriggeredEventCount = MsgTriggeredEvents.Count; stream.Position += 12; - this.LocationPowerSrc = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + LocationPowerSrc = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); - this.Looks = new WeightedLook[8]; + Looks = new WeightedLook[8]; for (int i = 0; i < 8; i++) { - this.Looks[i] = new WeightedLook(stream); + Looks[i] = new WeightedLook(stream); } - this.PhysicsSNO = stream.ReadValueS32(); - this.PhysicsFlags = stream.ReadValueS32(); - this.Material = stream.ReadValueS32(); - this.ExplosiionFactor = stream.ReadValueF32(); - this.WindFactor = stream.ReadValueF32(); - this.PartialRagdollResponsiveness = stream.ReadValueF32(); + PhysicsSNO = stream.ReadValueS32(); + PhysicsFlags = stream.ReadValueS32(); + Material = stream.ReadValueS32(); + ExplosiionFactor = stream.ReadValueF32(); + WindFactor = stream.ReadValueF32(); + PartialRagdollResponsiveness = stream.ReadValueF32(); - this.ActorCollisionData = new ActorCollisionData(stream); + ActorCollisionData = new ActorCollisionData(stream); - this.InventoryImages = new int[7]; //Was 5*8/4 - Darklotus + InventoryImages = new int[7]; //Was 5*8/4 - Darklotus for (int i = 0; i < InventoryImages.Length; i++) { - this.InventoryImages[i] = stream.ReadValueS32(); + InventoryImages[i] = stream.ReadValueS32(); } stream.Position += (4 * 7); - this.SocketedImage = stream.ReadValueS32(); + SocketedImage = stream.ReadValueS32(); stream.Position += (4 * 5); CastingNotes = stream.ReadSerializedString(); VoiceOverRole = stream.ReadSerializedString(); @@ -129,10 +129,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public ActorCollisionFlags(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); } } @@ -144,7 +144,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public AxialCylinder(MpqFileStream stream) { - this.Position = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + Position = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); Ax1 = stream.ReadValueF32(); Ax2 = stream.ReadValueF32(); } @@ -169,7 +169,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public WeightedLook(MpqFileStream stream) { - this.LookLink = stream.ReadString(64, true); + LookLink = stream.ReadString(64, true); Int0 = stream.ReadValueS32(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Adventure.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Adventure.cs index 4120f3d..62e32b6 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Adventure.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Adventure.cs @@ -20,13 +20,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Adventure(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.ActorSNO = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.Angle0 = stream.ReadValueF32(); - this.Angle1 = stream.ReadValueF32(); - this.Angle2 = stream.ReadValueF32(); - this.MarkerSetSNO = stream.ReadValueS32(); + Header = new Header(stream); + ActorSNO = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + Angle0 = stream.ReadValueF32(); + Angle1 = stream.ReadValueF32(); + Angle2 = stream.ReadValueF32(); + MarkerSetSNO = stream.ReadValueS32(); stream.Close(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/AmbientSound.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/AmbientSound.cs index d027759..5f7f184 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/AmbientSound.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/AmbientSound.cs @@ -26,15 +26,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public AmbientSound(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.SoundSNO00 = stream.ReadValueS32(); - this.RandomAmbientSoundParams = new RandomAmbientSoundParams(stream); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + SoundSNO00 = stream.ReadValueS32(); + RandomAmbientSoundParams = new RandomAmbientSoundParams(stream); //stream.Position = 76; - this.SoundSNO01 = stream.ReadValueS32(); + SoundSNO01 = stream.ReadValueS32(); Time01 = stream.ReadValueF32(); Time02 = stream.ReadValueF32(); - this.Text = stream.ReadString(64); + Text = stream.ReadString(64); F0 = stream.ReadValueF32(); F1 = stream.ReadValueF32(); F2 = stream.ReadValueF32(); diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Anim.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Anim.cs index 0f32c1e..a287364 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Anim.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Anim.cs @@ -22,14 +22,14 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Anim(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.Flags = stream.ReadValueS32(); - this.PlaybackMode = stream.ReadValueS32(); - this.SNOAppearance = stream.ReadValueS32(); - this.Permutations = stream.ReadSerializedData(); - this.PermutationCount = stream.ReadValueS32(); + Header = new Header(stream); + Flags = stream.ReadValueS32(); + PlaybackMode = stream.ReadValueS32(); + SNOAppearance = stream.ReadValueS32(); + Permutations = stream.ReadSerializedData(); + PermutationCount = stream.ReadValueS32(); stream.Position += 12; - this.MachineTime = stream.ReadValueS32(); + MachineTime = stream.ReadValueS32(); stream.Close(); } } @@ -74,49 +74,49 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Flags = stream.ReadValueS32(); - this.PermutationName = stream.ReadString(65, true); + Flags = stream.ReadValueS32(); + PermutationName = stream.ReadString(65, true); stream.Position += 3; - this.FrameRate = stream.ReadValueF32(); - this.Compression = stream.ReadValueF32(); - this.TramslationCompressionRatio = stream.ReadValueF32(); - this.RotationComressionRatio = stream.ReadValueF32(); - this.ScaleCompressionRatio = stream.ReadValueF32(); - this.BlendTime = stream.ReadValueS32(); - this.FromPermBlendTime = stream.ReadValueS32(); - this.Weight = stream.ReadValueS32(); - this.SpeedMultMin = stream.ReadValueF32(); - this.SpeedMultDelta = stream.ReadValueF32(); - this.RagdollVelocityFactor = stream.ReadValueF32(); - this.RagdollMomentumFactor = stream.ReadValueF32(); - this.BoneNameCount = stream.ReadValueS32(); - this.BoneNames = stream.ReadSerializedData(); + FrameRate = stream.ReadValueF32(); + Compression = stream.ReadValueF32(); + TramslationCompressionRatio = stream.ReadValueF32(); + RotationComressionRatio = stream.ReadValueF32(); + ScaleCompressionRatio = stream.ReadValueF32(); + BlendTime = stream.ReadValueS32(); + FromPermBlendTime = stream.ReadValueS32(); + Weight = stream.ReadValueS32(); + SpeedMultMin = stream.ReadValueF32(); + SpeedMultDelta = stream.ReadValueF32(); + RagdollVelocityFactor = stream.ReadValueF32(); + RagdollMomentumFactor = stream.ReadValueF32(); + BoneNameCount = stream.ReadValueS32(); + BoneNames = stream.ReadSerializedData(); stream.Position += 12; - this.KeyframePosCount = stream.ReadValueS32(); - this.TranslationCurves = stream.ReadSerializedData(); + KeyframePosCount = stream.ReadValueS32(); + TranslationCurves = stream.ReadSerializedData(); stream.Position += 12; - this.RotationCurves = stream.ReadSerializedData(); + RotationCurves = stream.ReadSerializedData(); stream.Position += 8; - this.ScaleCurves = stream.ReadSerializedData(); + ScaleCurves = stream.ReadSerializedData(); stream.Position += 8; - this.ContactKeyframe0 = stream.ReadValueF32(); - this.ContactKeyframe1 = stream.ReadValueF32(); - this.ContactKeyframe2 = stream.ReadValueF32(); - this.ContactKeyframe3 = stream.ReadValueF32(); - this.ContactOffset0 = new Vector3D(stream); - this.ContactOffset1 = new Vector3D(stream); - this.ContactOffset2 = new Vector3D(stream); - this.ContactOffset3 = new Vector3D(stream); - this.EarliestInterruptKeyFrame = stream.ReadValueF32(); - this.KeyedAttachments = stream.ReadSerializedData(); - this.KeyedAttachmentsCount = stream.ReadValueS32(); + ContactKeyframe0 = stream.ReadValueF32(); + ContactKeyframe1 = stream.ReadValueF32(); + ContactKeyframe2 = stream.ReadValueF32(); + ContactKeyframe3 = stream.ReadValueF32(); + ContactOffset0 = new Vector3D(stream); + ContactOffset1 = new Vector3D(stream); + ContactOffset2 = new Vector3D(stream); + ContactOffset3 = new Vector3D(stream); + EarliestInterruptKeyFrame = stream.ReadValueF32(); + KeyedAttachments = stream.ReadSerializedData(); + KeyedAttachmentsCount = stream.ReadValueS32(); stream.Position += 8; - this.KeyframePosList = stream.ReadSerializedData(); + KeyframePosList = stream.ReadSerializedData(); stream.Position += 8; - this.NonlinearOffset = stream.ReadSerializedData(); + NonlinearOffset = stream.ReadSerializedData(); stream.Position += 8; - this.AvgVelocity = new VelocityVector3D(stream); - this.HardPointLink = new HardPointLink(stream); + AvgVelocity = new VelocityVector3D(stream); + HardPointLink = new HardPointLink(stream); //this.S0 = stream.ReadString(256, true); //this.S1 = stream.ReadString(256, true); stream.Position += 8; @@ -129,7 +129,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(64, true); + Name = stream.ReadString(64, true); } } @@ -140,8 +140,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Keys = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); + Keys = stream.ReadSerializedData(); } } @@ -152,8 +152,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Keys = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); + Keys = stream.ReadSerializedData(); } } @@ -164,8 +164,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Keys = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); + Keys = stream.ReadSerializedData(); } } @@ -176,8 +176,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Location = new Vector3D(stream); + I0 = stream.ReadValueS32(); + Location = new Vector3D(stream); } } @@ -188,8 +188,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Q0 = new Quaternion16(stream); + I0 = stream.ReadValueS32(); + Q0 = new Quaternion16(stream); } } @@ -200,8 +200,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Scale = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + Scale = stream.ReadValueF32(); } } @@ -212,8 +212,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.KeyframeIndex = stream.ReadValueF32(); - this.Event = new TriggerEvent(stream); + KeyframeIndex = stream.ReadValueF32(); + Event = new TriggerEvent(stream); } } @@ -225,9 +225,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public VelocityVector3D(MpqFileStream stream) { - this.VelocityX = stream.ReadValueF32(); - this.VelocityY = stream.ReadValueF32(); - this.VelocityZ = stream.ReadValueF32(); + VelocityX = stream.ReadValueF32(); + VelocityY = stream.ReadValueF32(); + VelocityZ = stream.ReadValueF32(); } } @@ -246,10 +246,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats /// The MPQFileStream to read from. public Quaternion16(MpqFileStream stream) { - this.Short0 = stream.ReadValueS16(); - this.Short1 = stream.ReadValueS16(); - this.Short2 = stream.ReadValueS16(); - this.Short3 = stream.ReadValueS16(); + Short0 = stream.ReadValueS16(); + Short1 = stream.ReadValueS16(); + Short2 = stream.ReadValueS16(); + Short3 = stream.ReadValueS16(); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/AnimSet.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/AnimSet.cs index 1927476..2b229f5 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/AnimSet.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/AnimSet.cs @@ -63,8 +63,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public AnimSet(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.SNOParentAnimSet = stream.ReadValueS32(); + Header = new Header(stream); + SNOParentAnimSet = stream.ReadValueS32(); TagMapAnimDefault = stream.ReadSerializedItem(); stream.Position += 8; AnimSetTagMaps = new TagMap[28]; diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Animation2D.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Animation2D.cs index 2cac985..53beffd 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Animation2D.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Animation2D.cs @@ -20,13 +20,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Animation2D(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.FrameAnim = new FrameAnim(stream); - this.SNOSound = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.Anim2DFrame = new Anim2DFrame(stream); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + FrameAnim = new FrameAnim(stream); + SNOSound = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + Anim2DFrame = new Anim2DFrame(stream); stream.Close(); } @@ -42,11 +42,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public FrameAnim(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.Velocity0 = stream.ReadValueF32(); - this.Velocity1 = stream.ReadValueF32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + Velocity0 = stream.ReadValueF32(); + Velocity1 = stream.ReadValueF32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); } } public class Anim2DFrame @@ -56,7 +56,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Anim2DFrame(MpqFileStream stream) { - this.Text = stream.ReadString(64); + Text = stream.ReadString(64); DT_RGBACOLOR = new DT_RGBACOLOR(stream); } } @@ -69,10 +69,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public DT_RGBACOLOR(MpqFileStream stream) { - this.B0 = stream.ReadValueU8(); - this.B1 = stream.ReadValueU8(); - this.B2 = stream.ReadValueU8(); - this.B3 = stream.ReadValueU8(); + B0 = stream.ReadValueU8(); + B1 = stream.ReadValueU8(); + B2 = stream.ReadValueU8(); + B3 = stream.ReadValueU8(); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/BossEncounter.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/BossEncounter.cs index 45bd0df..41506ff 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/BossEncounter.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/BossEncounter.cs @@ -32,29 +32,29 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public BossEncounter(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.I6 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); - this.I9 = stream.ReadValueS32(); - this.I10 = stream.ReadValueS32(); - this.I11 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.SNOQuestRange = stream.ReadValueS32(); - this.Worlds = new int[4]; + Header = new Header(stream); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); + I10 = stream.ReadValueS32(); + I11 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + SNOQuestRange = stream.ReadValueS32(); + Worlds = new int[4]; for (int i = 0; i < 4; i++) - this.Worlds[i] = stream.ReadValueS32(); - this.Scripts = new int[3]; + Worlds[i] = stream.ReadValueS32(); + Scripts = new int[3]; for (int i = 0; i < 3; i++) - this.Scripts[i] = stream.ReadValueS32(); - this.LevelAreaSNO = stream.ReadValueS32(); - this.ActorSNO = stream.ReadValueS32(); + Scripts[i] = stream.ReadValueS32(); + LevelAreaSNO = stream.ReadValueS32(); + ActorSNO = stream.ReadValueS32(); stream.Close(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Condition.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Condition.cs index 4eda348..abe2144 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Condition.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Condition.cs @@ -70,94 +70,94 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Condition(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); //0 + Header = new Header(stream); //0 //+16 - this.I0 = stream.ReadValueS32(); //12 + 16 = 28 - this.I1 = stream.ReadValueS32(); //32 - this.Class = new int[7]; //36 + I0 = stream.ReadValueS32(); //12 + 16 = 28 + I1 = stream.ReadValueS32(); //32 + Class = new int[7]; //36 for (int i = 0; i < 7; i++) - this.Class[i] = stream.ReadValueS32(); + Class[i] = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); //48 + 16 = 64 - this.I3 = stream.ReadValueS32(); //68 - this.I4 = stream.ReadValueS32(); //72 - this.I5 = stream.ReadValueS32(); //76 + I2 = stream.ReadValueS32(); //48 + 16 = 64 + I3 = stream.ReadValueS32(); //68 + I4 = stream.ReadValueS32(); //72 + I5 = stream.ReadValueS32(); //76 - this.LoreCondition = new LoreSubcondition[3]; //80 + LoreCondition = new LoreSubcondition[3]; //80 for (int i = 0; i < 3; i++) - this.LoreCondition[i] = new LoreSubcondition(stream); + LoreCondition[i] = new LoreSubcondition(stream); - this.QuestCondition = new QuestSubcondition[3]; //104 + QuestCondition = new QuestSubcondition[3]; //104 for (int i = 0; i < 3; i++) - this.QuestCondition[i] = new QuestSubcondition(stream); + QuestCondition[i] = new QuestSubcondition(stream); - this.I6 = stream.ReadValueS32(); //152 - this.I7 = stream.ReadValueS32(); //156 - this.I8 = stream.ReadValueS32(); //160 - this.ItemCondition = new ItemSubcondition[3]; //164 + I6 = stream.ReadValueS32(); //152 + I7 = stream.ReadValueS32(); //156 + I8 = stream.ReadValueS32(); //160 + ItemCondition = new ItemSubcondition[3]; //164 for (int i = 0; i < 3; i++) - this.ItemCondition[i] = new ItemSubcondition(stream); + ItemCondition[i] = new ItemSubcondition(stream); - this.I9 = stream.ReadValueS32(); //212 - this.I10 = stream.ReadValueS32(); //216 - this.I11 = stream.ReadValueS32(); //220 - this.I12 = stream.ReadValueS32(); //224 - this.I13 = stream.ReadValueS32(); //228 + I9 = stream.ReadValueS32(); //212 + I10 = stream.ReadValueS32(); //216 + I11 = stream.ReadValueS32(); //220 + I12 = stream.ReadValueS32(); //224 + I13 = stream.ReadValueS32(); //228 - this.I14 = stream.ReadValueS32(); //232 - this.I15 = stream.ReadValueS32(); //236 - this.I16 = stream.ReadValueS32(); //240 + I14 = stream.ReadValueS32(); //232 + I15 = stream.ReadValueS32(); //236 + I16 = stream.ReadValueS32(); //240 stream.Position += 4; - this.I17 = stream.ReadValueS32(); //248 - this.I18 = stream.ReadValueS32(); //252 + I17 = stream.ReadValueS32(); //248 + I18 = stream.ReadValueS32(); //252 - this.I19 = stream.ReadValueS32(); //256 - this.I20 = stream.ReadValueS32(); //260 + I19 = stream.ReadValueS32(); //256 + I20 = stream.ReadValueS32(); //260 - this.SNOCurrentWorld = stream.ReadValueS32(); //264 - this.SNOCurrentLevelArea = stream.ReadValueS32(); //268 - this.SNOQuestRange = stream.ReadValueS32(); //272 - this.FollowerCondition = new FollowerSubcondition(stream); //276 + SNOCurrentWorld = stream.ReadValueS32(); //264 + SNOCurrentLevelArea = stream.ReadValueS32(); //268 + SNOQuestRange = stream.ReadValueS32(); //272 + FollowerCondition = new FollowerSubcondition(stream); //276 - this.LabelCondition = new LabelSubcondition[3]; //284 + LabelCondition = new LabelSubcondition[3]; //284 for (int i = 0; i < 3; i++) - this.LabelCondition[i] = new LabelSubcondition(stream); + LabelCondition[i] = new LabelSubcondition(stream); - this.SkillCondition = new SkillSubcondition[3]; //308 + SkillCondition = new SkillSubcondition[3]; //308 for (int i = 0; i < 3; i++) - this.SkillCondition[i] = new SkillSubcondition(stream); + SkillCondition[i] = new SkillSubcondition(stream); - this.I21 = stream.ReadValueS32(); //344 - this.I22 = stream.ReadValueS32(); //348 - this.I23 = stream.ReadValueS32(); //352 - this.I24 = stream.ReadValueS32(); //356 - this.I25 = stream.ReadValueS32(); //360 + I21 = stream.ReadValueS32(); //344 + I22 = stream.ReadValueS32(); //348 + I23 = stream.ReadValueS32(); //352 + I24 = stream.ReadValueS32(); //356 + I25 = stream.ReadValueS32(); //360 - this.I26 = stream.ReadValueS32(); //364 - this.I27 = stream.ReadValueS32(); //368 - this.I28 = stream.ReadValueS32(); //372 - this.I29 = stream.ReadValueS32(); //376 + I26 = stream.ReadValueS32(); //364 + I27 = stream.ReadValueS32(); //368 + I28 = stream.ReadValueS32(); //372 + I29 = stream.ReadValueS32(); //376 - this.MonsterCondition = new MonsterSubcondition[15]; //380 + MonsterCondition = new MonsterSubcondition[15]; //380 for (int i = 0; i < 15; i++) - this.MonsterCondition[i] = new MonsterSubcondition(stream); + MonsterCondition[i] = new MonsterSubcondition(stream); - this.GameFlagCondition = new GameFlagSubcondition[3]; //440 + GameFlagCondition = new GameFlagSubcondition[3]; //440 for (int i = 0; i < 3; i++) - this.GameFlagCondition[i] = new GameFlagSubcondition(stream); + GameFlagCondition[i] = new GameFlagSubcondition(stream); - this.PlayerFlagCondition = new PlayerFlagSubcondition[3]; //824 + PlayerFlagCondition = new PlayerFlagSubcondition[3]; //824 for (int i = 0; i < 3; i++) - this.PlayerFlagCondition[i] = new PlayerFlagSubcondition(stream); + PlayerFlagCondition[i] = new PlayerFlagSubcondition(stream); - this.BuffSubCondition = new BuffSubcondition[3]; //1208 + BuffSubCondition = new BuffSubcondition[3]; //1208 for (int i = 0; i < 3; i++) - this.BuffSubCondition[i] = new BuffSubcondition(stream); + BuffSubCondition[i] = new BuffSubcondition(stream); - this.I30 = stream.ReadValueS32(); //1244 - this.I31 = stream.ReadValueS32(); //1248 - this.I32 = stream.ReadValueS32(); //1252 + I30 = stream.ReadValueS32(); //1244 + I31 = stream.ReadValueS32(); //1248 + I32 = stream.ReadValueS32(); //1252 stream.Close(); } @@ -170,8 +170,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public LoreSubcondition(MpqFileStream stream) { - this.SNOLore = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); + SNOLore = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); } } @@ -184,10 +184,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public QuestSubcondition(MpqFileStream stream) { - this.SNOQuest = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); + SNOQuest = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); } } @@ -200,10 +200,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public ItemSubcondition(MpqFileStream stream) { - this.ItemGBId = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); + ItemGBId = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); } } @@ -214,8 +214,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public FollowerSubcondition(MpqFileStream stream) { - this.Type = (FollowerType)stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); + Type = (FollowerType)stream.ReadValueS32(); + I0 = stream.ReadValueS32(); } } @@ -226,8 +226,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public LabelSubcondition(MpqFileStream stream) { - this.LabelGBId = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); + LabelGBId = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); } } @@ -239,9 +239,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public SkillSubcondition(MpqFileStream stream) { - this.SNOSkillPower = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); + SNOSkillPower = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); } } @@ -251,7 +251,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public MonsterSubcondition(MpqFileStream stream) { - this.SNOMonsterActor = stream.ReadValueS32(); + SNOMonsterActor = stream.ReadValueS32(); } } @@ -261,7 +261,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public GameFlagSubcondition(MpqFileStream stream) { - this.S0 = stream.ReadString(128, true); + S0 = stream.ReadString(128, true); } } @@ -271,7 +271,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public PlayerFlagSubcondition(MpqFileStream stream) { - this.S0 = stream.ReadString(128, true); + S0 = stream.ReadString(128, true); } } @@ -283,9 +283,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public BuffSubcondition(MpqFileStream stream) { - this.SNOPower = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); + SNOPower = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Conversation.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Conversation.cs index 48da94c..59fc4b1 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Conversation.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Conversation.cs @@ -5,6 +5,7 @@ using CrystalMpq; using Gibbed.IO; using DiIiS_NA.GameServer.Core.Types.SNO; using DiIiS_NA.Core.MPQ.FileFormats.Types; +using Newtonsoft.Json; namespace DiIiS_NA.Core.MPQ.FileFormats { @@ -33,31 +34,31 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { MpqFileStream stream = file.Open(); - this.Header = new Header(stream); //0 + Header = new Header(stream); //0 //+16 - this.ConversationType = (ConversationTypes)stream.ReadValueS32(); //12 - this.ConversationIcon = stream.ReadValueS32(); //16 - this.snoConvPiggyback = stream.ReadValueS32(); //20 + ConversationType = (ConversationTypes)stream.ReadValueS32(); //12 + ConversationIcon = stream.ReadValueS32(); //16 + snoConvPiggyback = stream.ReadValueS32(); //20 - this.snoConvUnlocks = new int[3]; + snoConvUnlocks = new int[3]; for (int i = 0; i < snoConvUnlocks.Length; i++) //24 - this.snoConvUnlocks[i] = stream.ReadValueS32(); + snoConvUnlocks[i] = stream.ReadValueS32(); - this.Flags = stream.ReadValueS32(); //36 - this.SetPlayerFlags = stream.ReadString(128, true); //40 - this.SNOPrimaryNpc = stream.ReadValueS32(); //168 - this.SNOAltNpc1 = stream.ReadValueS32(); //172 - this.SNOAltNpc2 = stream.ReadValueS32(); //176 - this.SNOAltNpc3 = stream.ReadValueS32(); //180 - this.SNOAltNpc4 = stream.ReadValueS32(); //184 - this.LineUID = stream.ReadValueS32(); //188-192 + Flags = stream.ReadValueS32(); //36 + SetPlayerFlags = stream.ReadString(128, true); //40 + SNOPrimaryNpc = stream.ReadValueS32(); //168 + SNOAltNpc1 = stream.ReadValueS32(); //172 + SNOAltNpc2 = stream.ReadValueS32(); //176 + SNOAltNpc3 = stream.ReadValueS32(); //180 + SNOAltNpc4 = stream.ReadValueS32(); //184 + LineUID = stream.ReadValueS32(); //188-192 stream.Position += 8; RootTreeNodes = stream.ReadSerializedData(); // 200 stream.Position = stream.Position; CompiiledScript = stream.ReadSerializedByteArray(); //216 stream.Position = stream.Position; - this.SNOBossEncounter = stream.ReadValueS32(); //264 - this.Pad = stream.ReadValueS32(); //268 + SNOBossEncounter = stream.ReadValueS32(); //264 + Pad = stream.ReadValueS32(); //268 stream.Close(); } @@ -129,15 +130,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats ClassFilter = stream.ReadValueS32(); for (int i = 0; i < CompressedDisplayTimes.Length; i++) //40 //328 CompressedDisplayTimes[i] = new ConvLocalDisplayTimes(stream); - this.GBIDConvVarCheck = stream.ReadValueS32(); //1104 + GBIDConvVarCheck = stream.ReadValueS32(); //1104 ConvVarCheckOp = (TypeConv)stream.ReadValueS32(); - this.ConvVarCheckVal = stream.ReadValueS32(); - this.GBIDConvVarSet = stream.ReadValueS32(); + ConvVarCheckVal = stream.ReadValueS32(); + GBIDConvVarSet = stream.ReadValueS32(); ConvVarSetOp = (Ref)stream.ReadValueS32(); //1408 - this.ConvVarSetVal = stream.ReadValueS32(); - this.BranchIndex = stream.ReadValueS32(); - this.Weight = stream.ReadValueS32(); + ConvVarSetVal = stream.ReadValueS32(); + BranchIndex = stream.ReadValueS32(); + Weight = stream.ReadValueS32(); //strea3.Position += 4; // these are unaccounted for...xml offsets just skips ahead stream.Position += (2 * 4); TrueNodes = stream.ReadSerializedData(); @@ -190,14 +191,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats s.Append(' ', pad); s.AppendLine("}"); } } - } public class ConvLocalDisplayTimes { public int[] Languages = new int[14]; - public ConvLocalDisplayTimes(CrystalMpq.MpqFileStream stream) + public ConvLocalDisplayTimes(MpqFileStream stream) { for (int i = 0; i < Languages.Length; i++) Languages[i] = stream.ReadValueS32(); diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/ConversationList.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/ConversationList.cs index 7d30c3a..7d71f7b 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/ConversationList.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/ConversationList.cs @@ -17,8 +17,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public ConversationList() { - if (this.ConversationListEntries == null) this.ConversationListEntries = new List(); - if (this.AmbientConversationListEntries == null) this.AmbientConversationListEntries = new List(); + if (ConversationListEntries == null) ConversationListEntries = new List(); + if (AmbientConversationListEntries == null) AmbientConversationListEntries = new List(); } } @@ -29,11 +29,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { get { - return (ConversationTypes)this.Flags; + return (ConversationTypes)Flags; } set { - this.Flags = (int)value; + Flags = (int)value; } } @@ -86,22 +86,22 @@ namespace DiIiS_NA.Core.MPQ.FileFormats //* public ConversationListEntry(ConversationTypes type, int i0, int questId, int convId, int questStep, int act) { - this.SNOConversation = convId; - this.SpecialEventFlag = act; - this.Type = type; - this.SNOQuestCurrent = -1; - this.SNOQuestAssigned = -1; - this.SNOQuestComplete = -1; - this.SNOQuestRange = -1; - this.SNOLevelArea = -1; - this.SNOQuestActive = questId; - this.ConditionReqs = i0; + SNOConversation = convId; + SpecialEventFlag = act; + Type = type; + SNOQuestCurrent = -1; + SNOQuestAssigned = -1; + SNOQuestComplete = -1; + SNOQuestRange = -1; + SNOLevelArea = -1; + SNOQuestActive = questId; + ConditionReqs = i0; //this.I1 = -1; - this.CrafterType = -1; - this.StepUIDCurrent = questStep; - this.GbidItem = -1; - this.Label = ""; - this.PlayerFlag = ""; + CrafterType = -1; + StepUIDCurrent = questStep; + GbidItem = -1; + Label = ""; + PlayerFlag = ""; } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/EffectGroup.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/EffectGroup.cs index 30dbe30..a672e19 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/EffectGroup.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/EffectGroup.cs @@ -24,15 +24,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public EffectGroup(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.EffectItems = stream.ReadSerializedData(); - this.EffectItemsCount = stream.ReadValueS32(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + EffectItems = stream.ReadSerializedData(); + EffectItemsCount = stream.ReadValueS32(); stream.Position += 12; // pad 1 - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.SnoPower = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + SnoPower = stream.ReadValueS32(); I5 = new int[16]; for (int i = 0; i < I5.Length; i++) @@ -49,9 +49,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Weight = stream.ReadValueS32(); - this.Hash = stream.ReadString(64, true); - this.TriggeredEvent.Read(stream); + Weight = stream.ReadValueS32(); + Hash = stream.ReadString(64, true); + TriggeredEvent.Read(stream); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Encounter.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Encounter.cs index 95fcc8a..735a981 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Encounter.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Encounter.cs @@ -17,10 +17,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Encounter(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.SNOSpawn = stream.ReadValueS32(); + Header = new Header(stream); + SNOSpawn = stream.ReadValueS32(); stream.Position += (2 * 4);// pad 2 int - this.Spawnoptions = stream.ReadSerializedData(); + Spawnoptions = stream.ReadSerializedData(); stream.Close(); } } @@ -34,10 +34,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOSpawn = stream.ReadValueS32(); - this.Probability = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.SNOCondition = stream.ReadValueS32(); + SNOSpawn = stream.ReadValueS32(); + Probability = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + SNOCondition = stream.ReadValueS32(); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/GameBalance.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/GameBalance.cs index 76dd09c..fb107f7 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/GameBalance.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/GameBalance.cs @@ -77,77 +77,77 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public GameBalance(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.Type = (BalanceType)stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.ItemType = stream.ReadSerializedData(); + Header = new Header(stream); + Type = (BalanceType)stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + ItemType = stream.ReadSerializedData(); stream.Position += 8; - this.Item = stream.ReadSerializedData(); + Item = stream.ReadSerializedData(); stream.Position += 8; - this.Experience = stream.ReadSerializedData(); + Experience = stream.ReadSerializedData(); stream.Position += 8; - this.ExperienceAlt = stream.ReadSerializedData(); + ExperienceAlt = stream.ReadSerializedData(); stream.Position += 8; - this.HelpCodes = stream.ReadSerializedData(); + HelpCodes = stream.ReadSerializedData(); stream.Position += 8; - this.MonsterLevel = stream.ReadSerializedData(); + MonsterLevel = stream.ReadSerializedData(); stream.Position += 8; - this.Affixes = stream.ReadSerializedData(); + Affixes = stream.ReadSerializedData(); stream.Position += 8; - this.Heros = stream.ReadSerializedData(); + Heros = stream.ReadSerializedData(); stream.Position += 8; - this.MovementStyles = stream.ReadSerializedData(); + MovementStyles = stream.ReadSerializedData(); stream.Position += 8; - this.Labels = stream.ReadSerializedData(); + Labels = stream.ReadSerializedData(); stream.Position += 8; - this.LootDistribution = stream.ReadSerializedData(); + LootDistribution = stream.ReadSerializedData(); stream.Position += 8; - this.RareItemNames = stream.ReadSerializedData(); + RareItemNames = stream.ReadSerializedData(); stream.Position += 8; - this.MonsterAffixes = stream.ReadSerializedData(); + MonsterAffixes = stream.ReadSerializedData(); stream.Position += 8; - this.RareMonsterNames = stream.ReadSerializedData(); + RareMonsterNames = stream.ReadSerializedData(); stream.Position += 8; - this.SocketedEffects = stream.ReadSerializedData(); + SocketedEffects = stream.ReadSerializedData(); stream.Position += 8; - this.ItemDropTable = stream.ReadSerializedData(); + ItemDropTable = stream.ReadSerializedData(); stream.Position += 8; - this.ItemLevelModifiers = stream.ReadSerializedData(); + ItemLevelModifiers = stream.ReadSerializedData(); stream.Position += 8; - this.QualityClasses = stream.ReadSerializedData(); + QualityClasses = stream.ReadSerializedData(); stream.Position += 8; - this.HandicapLevelTables = stream.ReadSerializedData(); + HandicapLevelTables = stream.ReadSerializedData(); stream.Position += 8; - this.ItemSalvageLevelTables = stream.ReadSerializedData(); + ItemSalvageLevelTables = stream.ReadSerializedData(); stream.Position += 8; - this.Hirelings = stream.ReadSerializedData(); + Hirelings = stream.ReadSerializedData(); stream.Position += 8; - this.SetItemBonus = stream.ReadSerializedData(); + SetItemBonus = stream.ReadSerializedData(); stream.Position += 8; - this.EliteModifiers = stream.ReadSerializedData(); + EliteModifiers = stream.ReadSerializedData(); stream.Position += 8; - this.ItemTiers = stream.ReadSerializedData(); + ItemTiers = stream.ReadSerializedData(); stream.Position += 8; - this.PowerFormula = stream.ReadSerializedData(); + PowerFormula = stream.ReadSerializedData(); stream.Position += 8; - this.Recipes = stream.ReadSerializedData(); + Recipes = stream.ReadSerializedData(); stream.Position += 8; - this.ScriptedAchievementEvents = stream.ReadSerializedData(); + ScriptedAchievementEvents = stream.ReadSerializedData(); stream.Position += 8; - this.LootRunQuestTierTables = stream.ReadSerializedData(); + LootRunQuestTierTables = stream.ReadSerializedData(); stream.Position += 8; - this.ParagonBonusesTables = stream.ReadSerializedData(); + ParagonBonusesTables = stream.ReadSerializedData(); stream.Position += 8; - this.LegacyItemConversionTables = stream.ReadSerializedData(); + LegacyItemConversionTables = stream.ReadSerializedData(); stream.Position += 8; - this.EnchantItemAffixUseCountCostScalarsTables = stream.ReadSerializedData(); + EnchantItemAffixUseCountCostScalarsTables = stream.ReadSerializedData(); stream.Position += 8; - this.TieredLootRunLevelTables = stream.ReadSerializedData(); + TieredLootRunLevelTables = stream.ReadSerializedData(); stream.Position += 8; - this.TransmuteRecipesTables = stream.ReadSerializedData(); + TransmuteRecipesTables = stream.ReadSerializedData(); stream.Position += 8; - this.CurrencyConversionTables = stream.ReadSerializedData(); + CurrencyConversionTables = stream.ReadSerializedData(); stream.Position += 8; #region Запись дампа вещей @@ -293,26 +293,26 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.Hash = StringHashHelper.HashItemName(this.Name); - this.ParentType = stream.ReadValueS32(); - this.GBID = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.LootLevelRange = stream.ReadValueS32(); - this.ReqCrafterLevelForEnchant = stream.ReadValueS32(); - this.MaxSockets = stream.ReadValueS32(); - this.Usable = (ItemFlags)stream.ReadValueS32(); - this.BodySlot1 = (eItemType)stream.ReadValueS32(); - this.BodySlot2 = (eItemType)stream.ReadValueS32(); - this.BodySlot3 = (eItemType)stream.ReadValueS32(); - this.BodySlot4 = (eItemType)stream.ReadValueS32(); - this.InheritedAffix0 = stream.ReadValueS32(); - this.InheritedAffix1 = stream.ReadValueS32(); - this.InheritedAffix2 = stream.ReadValueS32(); - this.InheritedAffixFamily0 = stream.ReadValueS32(); - this.Labels = new int[5]; + Name = stream.ReadString(256, true); + Hash = StringHashHelper.HashItemName(Name); + ParentType = stream.ReadValueS32(); + GBID = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + LootLevelRange = stream.ReadValueS32(); + ReqCrafterLevelForEnchant = stream.ReadValueS32(); + MaxSockets = stream.ReadValueS32(); + Usable = (ItemFlags)stream.ReadValueS32(); + BodySlot1 = (eItemType)stream.ReadValueS32(); + BodySlot2 = (eItemType)stream.ReadValueS32(); + BodySlot3 = (eItemType)stream.ReadValueS32(); + BodySlot4 = (eItemType)stream.ReadValueS32(); + InheritedAffix0 = stream.ReadValueS32(); + InheritedAffix1 = stream.ReadValueS32(); + InheritedAffix2 = stream.ReadValueS32(); + InheritedAffixFamily0 = stream.ReadValueS32(); + Labels = new int[5]; for (int i = 0; i < 5; i++) - this.Labels[i] = stream.ReadValueS32(); + Labels[i] = stream.ReadValueS32(); } } public class ItemTable : ISerializableData @@ -423,139 +423,139 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); //000 - this.Hash = StringHashHelper.HashItemName(this.Name); //256 + Name = stream.ReadString(256, true); //000 + Hash = StringHashHelper.HashItemName(Name); //256 - this.GBID = stream.ReadValueS32(); //256 - this.PAD = stream.ReadValueS32(); //260 + GBID = stream.ReadValueS32(); //256 + PAD = stream.ReadValueS32(); //260 - this.SNOActor = stream.ReadValueS32(); //264 - this.ItemTypesGBID = stream.ReadValueS32(); //268 + SNOActor = stream.ReadValueS32(); //264 + ItemTypesGBID = stream.ReadValueS32(); //268 - this.Flags = stream.ReadValueS32(); //272 - 8 + 16 = 24 - this.DyeType = stream.ReadValueS32(); //276 + Flags = stream.ReadValueS32(); //272 - 8 + 16 = 24 + DyeType = stream.ReadValueS32(); //276 //this.NewI0 = stream.ReadValueS32(); - this.ItemLevel = stream.ReadValueS32(); //280 - this.ItemAct = (eItemAct)stream.ReadValueS32(); //284 - 28 + 16 = 44 + ItemLevel = stream.ReadValueS32(); //280 + ItemAct = (eItemAct)stream.ReadValueS32(); //284 - 28 + 16 = 44 - this.AffixLevel = stream.ReadValueS32(); //288 - 48 - this.BonusAffixes = stream.ReadValueS32(); //292 - 52 - this.BonusMajorAffixes = stream.ReadValueS32(); //296 - 56 - this.BonusMinorAffixes = stream.ReadValueS32(); //300 - 60 - this.MaxSockets = stream.ReadValueS32(); //304 - 64 - this.MaxStackSize = stream.ReadValueS32(); //308 - 68 - this.Cost = stream.ReadValueS32(); //312 - 72 - this.CostAlt = stream.ReadValueS32(); //316 - 76 - this.IdentifyCost = stream.ReadValueS32(); //320 - 80 - this.SellOverrideCost = stream.ReadValueS32(); //324 - 84 - this.RemoveGemCost = stream.ReadValueS32(); //328 - 88 - this.RequiredLevel = stream.ReadValueS32(); //332 - 92 - this.CrafterRequiredLevel = stream.ReadValueS32(); //336 - 96 - this.BaseDurability = stream.ReadValueS32(); //340 - 100 - this.DurabilityVariance = stream.ReadValueS32(); //344 - 104 - this.EnchantAffixCost = stream.ReadValueS32(); //348 - 108 - this.EnchantAffixCostX1 = stream.ReadValueS32(); //352 - 112 - this.TransmogUnlockCrafterLevel = stream.ReadValueS32(); //356 - 116 - this.TransmogCost = stream.ReadValueS32(); //360 - 120 - this.SNOBaseItem = stream.ReadValueS32(); //364 - 124 - this.SNOSet = stream.ReadValueS32(); //368 - 128 - this.SNOComponentTreasureClass = stream.ReadValueS32(); //372 - this.SNOComponentTreasureClassMagic = stream.ReadValueS32(); //376 - this.SNOComponentTreasureClassRare = stream.ReadValueS32(); //380 - this.SNOComponentTreasureClassLegend = stream.ReadValueS32(); //384 - this.SNORareNamePrefixStringList = stream.ReadValueS32(); //388 - this.SNORareNameSuffixStringList = stream.ReadValueS32(); //392 - 152 - this.StartEffect = stream.ReadValueS32(); //396 - this.EndEffect = stream.ReadValueS32(); //400 - this.PortraitBkgrnd = stream.ReadValueS32(); //404 - this.PortraitHPBar = stream.ReadValueS32(); //408 - this.PortraitBanner = stream.ReadValueS32(); //412 - this.PortraitFrame = stream.ReadValueS32(); //416 - this.Labels = new int[5]; //420 + AffixLevel = stream.ReadValueS32(); //288 - 48 + BonusAffixes = stream.ReadValueS32(); //292 - 52 + BonusMajorAffixes = stream.ReadValueS32(); //296 - 56 + BonusMinorAffixes = stream.ReadValueS32(); //300 - 60 + MaxSockets = stream.ReadValueS32(); //304 - 64 + MaxStackSize = stream.ReadValueS32(); //308 - 68 + Cost = stream.ReadValueS32(); //312 - 72 + CostAlt = stream.ReadValueS32(); //316 - 76 + IdentifyCost = stream.ReadValueS32(); //320 - 80 + SellOverrideCost = stream.ReadValueS32(); //324 - 84 + RemoveGemCost = stream.ReadValueS32(); //328 - 88 + RequiredLevel = stream.ReadValueS32(); //332 - 92 + CrafterRequiredLevel = stream.ReadValueS32(); //336 - 96 + BaseDurability = stream.ReadValueS32(); //340 - 100 + DurabilityVariance = stream.ReadValueS32(); //344 - 104 + EnchantAffixCost = stream.ReadValueS32(); //348 - 108 + EnchantAffixCostX1 = stream.ReadValueS32(); //352 - 112 + TransmogUnlockCrafterLevel = stream.ReadValueS32(); //356 - 116 + TransmogCost = stream.ReadValueS32(); //360 - 120 + SNOBaseItem = stream.ReadValueS32(); //364 - 124 + SNOSet = stream.ReadValueS32(); //368 - 128 + SNOComponentTreasureClass = stream.ReadValueS32(); //372 + SNOComponentTreasureClassMagic = stream.ReadValueS32(); //376 + SNOComponentTreasureClassRare = stream.ReadValueS32(); //380 + SNOComponentTreasureClassLegend = stream.ReadValueS32(); //384 + SNORareNamePrefixStringList = stream.ReadValueS32(); //388 + SNORareNameSuffixStringList = stream.ReadValueS32(); //392 - 152 + StartEffect = stream.ReadValueS32(); //396 + EndEffect = stream.ReadValueS32(); //400 + PortraitBkgrnd = stream.ReadValueS32(); //404 + PortraitHPBar = stream.ReadValueS32(); //408 + PortraitBanner = stream.ReadValueS32(); //412 + PortraitFrame = stream.ReadValueS32(); //416 + Labels = new int[5]; //420 for (int i = 0; i < 5; i++) - this.Labels[i] = stream.ReadValueS32(); + Labels[i] = stream.ReadValueS32(); //stream.Position += 16; - this.Pad = stream.ReadValueS32(); //440 - 200 - this.WeaponDamageMin = stream.ReadValueF32(); //444 - 204 - this.WeaponDamageDelta = stream.ReadValueF32(); //448 - 208 - this.DamageMinVariance = stream.ReadValueF32(); //452 - 212 - this.DamageDeltaVariance = stream.ReadValueF32(); //456 - 216 - this.AttacksPerSecond = stream.ReadValueF32(); //460 - 220 - this.Armor = stream.ReadValueF32(); //464 - 224 - this.ArmorDelta = stream.ReadValueF32(); //468 - 228 + Pad = stream.ReadValueS32(); //440 - 200 + WeaponDamageMin = stream.ReadValueF32(); //444 - 204 + WeaponDamageDelta = stream.ReadValueF32(); //448 - 208 + DamageMinVariance = stream.ReadValueF32(); //452 - 212 + DamageDeltaVariance = stream.ReadValueF32(); //456 - 216 + AttacksPerSecond = stream.ReadValueF32(); //460 - 220 + Armor = stream.ReadValueF32(); //464 - 224 + ArmorDelta = stream.ReadValueF32(); //468 - 228 - this.SNOSkill0 = stream.ReadValueS32(); //472 - 232 - this.SkillI0 = stream.ReadValueS32(); //476 - this.SNOSkill1 = stream.ReadValueS32(); //480 - this.SkillI1 = stream.ReadValueS32(); //484 - this.SNOSkill2 = stream.ReadValueS32(); //488 - this.SkillI2 = stream.ReadValueS32(); //492 - this.SNOSkill3 = stream.ReadValueS32(); //496 - this.SkillI3 = stream.ReadValueS32(); //500 + SNOSkill0 = stream.ReadValueS32(); //472 - 232 + SkillI0 = stream.ReadValueS32(); //476 + SNOSkill1 = stream.ReadValueS32(); //480 + SkillI1 = stream.ReadValueS32(); //484 + SNOSkill2 = stream.ReadValueS32(); //488 + SkillI2 = stream.ReadValueS32(); //492 + SNOSkill3 = stream.ReadValueS32(); //496 + SkillI3 = stream.ReadValueS32(); //500 - this.Attribute = new AttributeSpecifier[16]; //504 + Attribute = new AttributeSpecifier[16]; //504 for (int i = 0; i < 16; i++) - this.Attribute[i] = new AttributeSpecifier(stream); - this.Quality = (ItemQuality)stream.ReadValueS32(); // 888 -- 888-608 = 284 + Attribute[i] = new AttributeSpecifier(stream); + Quality = (ItemQuality)stream.ReadValueS32(); // 888 -- 888-608 = 284 - this.RecipeToGrant = new int[10]; //892 + RecipeToGrant = new int[10]; //892 for (int i = 0; i < 10; i++) - this.RecipeToGrant[i] = stream.ReadValueS32(); + RecipeToGrant[i] = stream.ReadValueS32(); - this.TransmogsToGrant = new int[8]; //932 + TransmogsToGrant = new int[8]; //932 for (int i = 0; i < 8; i++) - this.TransmogsToGrant[i] = stream.ReadValueS32(); + TransmogsToGrant[i] = stream.ReadValueS32(); - this.Massive0 = new int[9]; // 964 + Massive0 = new int[9]; // 964 for (int i = 0; i < 9; i++) - this.Massive0[i] = stream.ReadValueS32(); + Massive0[i] = stream.ReadValueS32(); - this.LegendaryAffixFamily = new int[6]; //1000 + LegendaryAffixFamily = new int[6]; //1000 for (int i = 0; i < 6; i++) - this.LegendaryAffixFamily[i] = stream.ReadValueS32(); - this.MaxAffixLevel = new int[6]; + LegendaryAffixFamily[i] = stream.ReadValueS32(); + MaxAffixLevel = new int[6]; for (int i = 0; i < 6; i++) - this.MaxAffixLevel[i] = stream.ReadValueS32(); //1456 - this.I38 = new int[6]; //1024 + MaxAffixLevel[i] = stream.ReadValueS32(); //1456 + I38 = new int[6]; //1024 for (int i = 0; i < 6; i++) - this.I38[i] = stream.ReadValueS32(); + I38[i] = stream.ReadValueS32(); - this.LegendaryFamily = stream.ReadValueS32(); //1072 - this.GemT = (GemType)stream.ReadValueS32(); //1076 - this.CraftingTier = stream.ReadValueS32(); //1080 - this.CraftingQuality = (Alpha)stream.ReadValueS32(); //1084 - this.snoActorPageOfFatePortal = stream.ReadValueS32(); //1088 - this.snoWorldPageOfFate1 = stream.ReadValueS32(); //1092 - this.snoWorldPageOfFate2 = stream.ReadValueS32(); //1096 - this.snoLevelAreaPageOfFatePortal = stream.ReadValueS32(); //1100 - this.EnchantAffixIngredientsCount = stream.ReadValueS32(); //1104 - this.EnchantAffixIngredients = new RecipeIngredient[6]; //1108 + LegendaryFamily = stream.ReadValueS32(); //1072 + GemT = (GemType)stream.ReadValueS32(); //1076 + CraftingTier = stream.ReadValueS32(); //1080 + CraftingQuality = (Alpha)stream.ReadValueS32(); //1084 + snoActorPageOfFatePortal = stream.ReadValueS32(); //1088 + snoWorldPageOfFate1 = stream.ReadValueS32(); //1092 + snoWorldPageOfFate2 = stream.ReadValueS32(); //1096 + snoLevelAreaPageOfFatePortal = stream.ReadValueS32(); //1100 + EnchantAffixIngredientsCount = stream.ReadValueS32(); //1104 + EnchantAffixIngredients = new RecipeIngredient[6]; //1108 for (int i = 0; i < 6; i++) - this.EnchantAffixIngredients[i] = new RecipeIngredient(stream); - this.EnchantAffixIngredientsCountX1 = stream.ReadValueS32(); //1156 - this.EnchantAffixIngredientsX1 = new RecipeIngredient[6]; //1160 + EnchantAffixIngredients[i] = new RecipeIngredient(stream); + EnchantAffixIngredientsCountX1 = stream.ReadValueS32(); //1156 + EnchantAffixIngredientsX1 = new RecipeIngredient[6]; //1160 for (int i = 0; i < 6; i++) - this.EnchantAffixIngredientsX1[i] = new RecipeIngredient(stream); - this.LegendaryPowerItemReplacement = stream.ReadValueS32(); //1208 - this.SeasonRequiredToDrop = stream.ReadValueS32(); //1212 + EnchantAffixIngredientsX1[i] = new RecipeIngredient(stream); + LegendaryPowerItemReplacement = stream.ReadValueS32(); //1208 + SeasonRequiredToDrop = stream.ReadValueS32(); //1212 - this.Attribute1 = new AttributeSpecifier[2]; //1216 + Attribute1 = new AttributeSpecifier[2]; //1216 for (int i = 0; i < 2; i++) - this.Attribute1[i] = new AttributeSpecifier(stream); + Attribute1[i] = new AttributeSpecifier(stream); - this.JewelSecondaryEffectUnlockRank = stream.ReadValueS32(); //1264 - this.JewelMaxRank = stream.ReadValueS32(); //1268 - this.MainEffect = stream.ReadValueS32(); //1272 - this.DateReleased = stream.ReadValueS32(); //1276 - this.VacuumPickup = stream.ReadValueS32(); //1280 + JewelSecondaryEffectUnlockRank = stream.ReadValueS32(); //1264 + JewelMaxRank = stream.ReadValueS32(); //1268 + MainEffect = stream.ReadValueS32(); //1272 + DateReleased = stream.ReadValueS32(); //1276 + VacuumPickup = stream.ReadValueS32(); //1280 - this.CostAlt2 = stream.ReadValueS32(); //1284 - this.DynamicCraftCostMagic = stream.ReadValueS32(); //1288 - this.DynamicCraftCostRare = stream.ReadValueS32(); //1292 - this.DynamicCraftAffixCount = stream.ReadValueS32(); //1296 - this.SeasonCacheTreasureClass = stream.ReadValueS32(); //1300 + CostAlt2 = stream.ReadValueS32(); //1284 + DynamicCraftCostMagic = stream.ReadValueS32(); //1288 + DynamicCraftCostRare = stream.ReadValueS32(); //1292 + DynamicCraftAffixCount = stream.ReadValueS32(); //1296 + SeasonCacheTreasureClass = stream.ReadValueS32(); //1300 if (SNOSet != -1)// & Name.Contains("Unique")) { } @@ -736,132 +736,132 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.DeltaXP = stream.ReadValueS64(); - this.DeltaXPClassic = stream.ReadValueS32(); - this.PlayerXPValue = stream.ReadValueS32(); + DeltaXP = stream.ReadValueS64(); + DeltaXPClassic = stream.ReadValueS32(); + PlayerXPValue = stream.ReadValueS32(); - this.DurabilityLossPct = stream.ReadValueF32(); - this.LifePerVitality = stream.ReadValueF32(); + DurabilityLossPct = stream.ReadValueF32(); + LifePerVitality = stream.ReadValueF32(); - this.QuestRewardTier1 = stream.ReadValueS32(); - this.QuestRewardTier2 = stream.ReadValueS32(); - this.QuestRewardTier3 = stream.ReadValueS32(); - this.QuestRewardTier4 = stream.ReadValueS32(); - this.QuestRewardTier5 = stream.ReadValueS32(); - this.QuestRewardTier6 = stream.ReadValueS32(); - this.QuestRewardTier7 = stream.ReadValueS32(); - this.QuestRewardGoldTier1 = stream.ReadValueS32(); - this.QuestRewardGoldTier2 = stream.ReadValueS32(); - this.QuestRewardGoldTier3 = stream.ReadValueS32(); - this.QuestRewardGoldTier4 = stream.ReadValueS32(); - this.QuestRewardGoldTier5 = stream.ReadValueS32(); - this.QuestRewardGoldTier6 = stream.ReadValueS32(); - this.LoreRewardTier1 = stream.ReadValueS32(); - this.LoreRewardTier2 = stream.ReadValueS32(); - this.LoreRewardTier3 = stream.ReadValueS32(); //76 - this.TimedDungeonBonusXP = stream.ReadValueS32(); //92 - this.WaveFightBonusXP = stream.ReadValueS32(); //96 - this.HordeBonusXP = stream.ReadValueS32(); //100 - this.ZapperBonusXP = stream.ReadValueS32(); //104 - this.GoblinHuntBonusXP = stream.ReadValueS32(); //108 - this.TimedDungeonBonusGold = stream.ReadValueS32(); //112 - this.WaveFightBonusGold = stream.ReadValueS32(); //116 - this.HordeBonusGold = stream.ReadValueS32(); //120 - this.ZapperBonusGold = stream.ReadValueS32(); //124 - this.GoblinHuntBonusGold = stream.ReadValueS32(); //128 - this.BountyKillUniqueXP = stream.ReadValueS32(); //132 - this.BountyKillUniqueGold = stream.ReadValueS32(); //136 - this.BountyKillBossXP = stream.ReadValueS32(); //140 - this.BountyKillBossGold = stream.ReadValueS32(); //144 - this.BountyCompleteEventXP = stream.ReadValueS32(); //148 - this.BountyCompleteEventGold = stream.ReadValueS32(); //152 - this.BountyClearDungeonXP = stream.ReadValueS32(); - this.BountyClearDungeonGold = stream.ReadValueS32(); - this.BountyCampsXP = stream.ReadValueS32(); - this.BountyCampsGold = stream.ReadValueS32(); - this.KillCounterReward = stream.ReadValueS32(); - this.GenericSkillPoints = stream.ReadValueS32(); + QuestRewardTier1 = stream.ReadValueS32(); + QuestRewardTier2 = stream.ReadValueS32(); + QuestRewardTier3 = stream.ReadValueS32(); + QuestRewardTier4 = stream.ReadValueS32(); + QuestRewardTier5 = stream.ReadValueS32(); + QuestRewardTier6 = stream.ReadValueS32(); + QuestRewardTier7 = stream.ReadValueS32(); + QuestRewardGoldTier1 = stream.ReadValueS32(); + QuestRewardGoldTier2 = stream.ReadValueS32(); + QuestRewardGoldTier3 = stream.ReadValueS32(); + QuestRewardGoldTier4 = stream.ReadValueS32(); + QuestRewardGoldTier5 = stream.ReadValueS32(); + QuestRewardGoldTier6 = stream.ReadValueS32(); + LoreRewardTier1 = stream.ReadValueS32(); + LoreRewardTier2 = stream.ReadValueS32(); + LoreRewardTier3 = stream.ReadValueS32(); //76 + TimedDungeonBonusXP = stream.ReadValueS32(); //92 + WaveFightBonusXP = stream.ReadValueS32(); //96 + HordeBonusXP = stream.ReadValueS32(); //100 + ZapperBonusXP = stream.ReadValueS32(); //104 + GoblinHuntBonusXP = stream.ReadValueS32(); //108 + TimedDungeonBonusGold = stream.ReadValueS32(); //112 + WaveFightBonusGold = stream.ReadValueS32(); //116 + HordeBonusGold = stream.ReadValueS32(); //120 + ZapperBonusGold = stream.ReadValueS32(); //124 + GoblinHuntBonusGold = stream.ReadValueS32(); //128 + BountyKillUniqueXP = stream.ReadValueS32(); //132 + BountyKillUniqueGold = stream.ReadValueS32(); //136 + BountyKillBossXP = stream.ReadValueS32(); //140 + BountyKillBossGold = stream.ReadValueS32(); //144 + BountyCompleteEventXP = stream.ReadValueS32(); //148 + BountyCompleteEventGold = stream.ReadValueS32(); //152 + BountyClearDungeonXP = stream.ReadValueS32(); + BountyClearDungeonGold = stream.ReadValueS32(); + BountyCampsXP = stream.ReadValueS32(); + BountyCampsGold = stream.ReadValueS32(); + KillCounterReward = stream.ReadValueS32(); + GenericSkillPoints = stream.ReadValueS32(); - this.CritMultiplier = stream.ReadValueF32(); - this.DodgeMultiplier = stream.ReadValueF32(); - this.LifeStealMultiplier = stream.ReadValueF32(); + CritMultiplier = stream.ReadValueF32(); + DodgeMultiplier = stream.ReadValueF32(); + LifeStealMultiplier = stream.ReadValueF32(); - this.DemonHunterStrength = stream.ReadValueS32(); - this.DemonHunterDexterity = stream.ReadValueS32(); - this.DemonHunterIntelligence = stream.ReadValueS32(); - this.DemonHunterVitality = stream.ReadValueS32(); - this.BarbarianStrength = stream.ReadValueS32(); - this.BarbarianDexterity = stream.ReadValueS32(); - this.BarbarianIntelligence = stream.ReadValueS32(); - this.BarbarianVitality = stream.ReadValueS32(); - this.WizardStrength = stream.ReadValueS32(); - this.WizardDexterity = stream.ReadValueS32(); - this.WizardIntelligence = stream.ReadValueS32(); - this.WizardVitality = stream.ReadValueS32(); - this.WitchDoctorStrength = stream.ReadValueS32(); - this.WitchDoctorDexterity = stream.ReadValueS32(); - this.WitchDoctorIntelligence = stream.ReadValueS32(); - this.WitchDoctorVitality = stream.ReadValueS32(); - this.MonkStrength = stream.ReadValueS32(); - this.MonkDexterity = stream.ReadValueS32(); - this.MonkIntelligence = stream.ReadValueS32(); - this.MonkVitality = stream.ReadValueS32(); - this.CrusaderStrength = stream.ReadValueS32(); - this.CrusaderDexterity = stream.ReadValueS32(); - this.CrusaderIntelligence = stream.ReadValueS32(); - this.CrusaderVitality = stream.ReadValueS32(); - this.NecromancerStrength = stream.ReadValueS32(); - this.NecromancerDexterity = stream.ReadValueS32(); - this.NecromancerIntelligence = stream.ReadValueS32(); - this.NecromancerVitality = stream.ReadValueS32(); + DemonHunterStrength = stream.ReadValueS32(); + DemonHunterDexterity = stream.ReadValueS32(); + DemonHunterIntelligence = stream.ReadValueS32(); + DemonHunterVitality = stream.ReadValueS32(); + BarbarianStrength = stream.ReadValueS32(); + BarbarianDexterity = stream.ReadValueS32(); + BarbarianIntelligence = stream.ReadValueS32(); + BarbarianVitality = stream.ReadValueS32(); + WizardStrength = stream.ReadValueS32(); + WizardDexterity = stream.ReadValueS32(); + WizardIntelligence = stream.ReadValueS32(); + WizardVitality = stream.ReadValueS32(); + WitchDoctorStrength = stream.ReadValueS32(); + WitchDoctorDexterity = stream.ReadValueS32(); + WitchDoctorIntelligence = stream.ReadValueS32(); + WitchDoctorVitality = stream.ReadValueS32(); + MonkStrength = stream.ReadValueS32(); + MonkDexterity = stream.ReadValueS32(); + MonkIntelligence = stream.ReadValueS32(); + MonkVitality = stream.ReadValueS32(); + CrusaderStrength = stream.ReadValueS32(); + CrusaderDexterity = stream.ReadValueS32(); + CrusaderIntelligence = stream.ReadValueS32(); + CrusaderVitality = stream.ReadValueS32(); + NecromancerStrength = stream.ReadValueS32(); + NecromancerDexterity = stream.ReadValueS32(); + NecromancerIntelligence = stream.ReadValueS32(); + NecromancerVitality = stream.ReadValueS32(); - this.TemplarStrength = stream.ReadValueS32(); - this.TemplarDexterity = stream.ReadValueS32(); - this.TemplarIntelligence = stream.ReadValueS32(); - this.TemplarVitality = stream.ReadValueS32(); - this.ScoundrelStrength = stream.ReadValueS32(); - this.ScoundrelDexterity = stream.ReadValueS32(); - this.ScoundrelIntelligence = stream.ReadValueS32(); - this.ScoundrelVitality = stream.ReadValueS32(); - this.EnchantressStrength = stream.ReadValueS32(); - this.EnchantressDexterity = stream.ReadValueS32(); - this.EnchantressIntelligence = stream.ReadValueS32(); - this.EnchantressVitality = stream.ReadValueS32(); + TemplarStrength = stream.ReadValueS32(); + TemplarDexterity = stream.ReadValueS32(); + TemplarIntelligence = stream.ReadValueS32(); + TemplarVitality = stream.ReadValueS32(); + ScoundrelStrength = stream.ReadValueS32(); + ScoundrelDexterity = stream.ReadValueS32(); + ScoundrelIntelligence = stream.ReadValueS32(); + ScoundrelVitality = stream.ReadValueS32(); + EnchantressStrength = stream.ReadValueS32(); + EnchantressDexterity = stream.ReadValueS32(); + EnchantressIntelligence = stream.ReadValueS32(); + EnchantressVitality = stream.ReadValueS32(); - this.TemplarDamageAbsorbPercent = stream.ReadValueF32(); - this.ScoundrelDamageAbsorbPercent = stream.ReadValueF32(); - this.EnchantressDamageAbsorbPercent = stream.ReadValueF32(); - this.PVPXPToLevel = stream.ReadValueS64(); + TemplarDamageAbsorbPercent = stream.ReadValueF32(); + ScoundrelDamageAbsorbPercent = stream.ReadValueF32(); + EnchantressDamageAbsorbPercent = stream.ReadValueF32(); + PVPXPToLevel = stream.ReadValueS64(); - this.PVPGoldWin = stream.ReadValueS32(); - this.PVPGoldWinByRank = stream.ReadValueS32(); - this.PVPXPWin = stream.ReadValueS32(); - this.PVPNormalXPWin = stream.ReadValueS32(); - this.PVPTokensWin = stream.ReadValueS32(); - this.PVPAltXPWin = stream.ReadValueS32(); - this.PVPGoldLoss = stream.ReadValueS32(); - this.PVPGoldLossByRank = stream.ReadValueS32(); - this.PVPXPLoss = stream.ReadValueS32(); - this.PVPNormalXPLoss = stream.ReadValueS32(); + PVPGoldWin = stream.ReadValueS32(); + PVPGoldWinByRank = stream.ReadValueS32(); + PVPXPWin = stream.ReadValueS32(); + PVPNormalXPWin = stream.ReadValueS32(); + PVPTokensWin = stream.ReadValueS32(); + PVPAltXPWin = stream.ReadValueS32(); + PVPGoldLoss = stream.ReadValueS32(); + PVPGoldLossByRank = stream.ReadValueS32(); + PVPXPLoss = stream.ReadValueS32(); + PVPNormalXPLoss = stream.ReadValueS32(); - this.PVPTokensLoss = stream.ReadValueS32(); - this.PVPAltXPLoss = stream.ReadValueS32(); - this.PVPGoldTie = stream.ReadValueS32(); - this.PVPGoldTieByRank = stream.ReadValueS32(); - this.PVPXPTie = stream.ReadValueS32(); - this.PVPNormalXPTie = stream.ReadValueS32(); - this.PVPTokensTie = stream.ReadValueS32(); - this.PVPAltXPTie = stream.ReadValueS32(); - this.GoldCostLevelScalar = stream.ReadValueF32(); + PVPTokensLoss = stream.ReadValueS32(); + PVPAltXPLoss = stream.ReadValueS32(); + PVPGoldTie = stream.ReadValueS32(); + PVPGoldTieByRank = stream.ReadValueS32(); + PVPXPTie = stream.ReadValueS32(); + PVPNormalXPTie = stream.ReadValueS32(); + PVPTokensTie = stream.ReadValueS32(); + PVPAltXPTie = stream.ReadValueS32(); + GoldCostLevelScalar = stream.ReadValueF32(); - this.SidekickPrimaryStatIdeal = stream.ReadValueS32(); - this.SidekickVitalityIdeal = stream.ReadValueS32(); - this.SidekickTotalArmorIdeal = stream.ReadValueS32(); - this.SidekickTotalResistIdeal = stream.ReadValueS32(); - this.SidekickTargetLifeOnHitIdeal = stream.ReadValueS32(); - this.SidekickTargetDPSIdeal = stream.ReadValueS32(); + SidekickPrimaryStatIdeal = stream.ReadValueS32(); + SidekickVitalityIdeal = stream.ReadValueS32(); + SidekickTotalArmorIdeal = stream.ReadValueS32(); + SidekickTotalResistIdeal = stream.ReadValueS32(); + SidekickTargetLifeOnHitIdeal = stream.ReadValueS32(); + SidekickTargetDPSIdeal = stream.ReadValueS32(); - this.GearXPScalar = stream.ReadValueF32(); + GearXPScalar = stream.ReadValueF32(); } } @@ -905,40 +905,40 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.L0 = stream.ReadValueS64(); //584 + L0 = stream.ReadValueS64(); //584 - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.I6 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); - this.I9 = stream.ReadValueS32(); - this.I10 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); + I10 = stream.ReadValueS32(); - this.I11 = stream.ReadValueS32(); - this.I12 = stream.ReadValueS32(); - this.I13 = stream.ReadValueS32(); - this.I14 = stream.ReadValueS32(); - this.I15 = stream.ReadValueS32(); - this.I16 = stream.ReadValueS32(); - this.I17 = stream.ReadValueS32(); - this.I18 = stream.ReadValueS32(); - this.I19 = stream.ReadValueS32(); - this.I20 = stream.ReadValueS32(); + I11 = stream.ReadValueS32(); + I12 = stream.ReadValueS32(); + I13 = stream.ReadValueS32(); + I14 = stream.ReadValueS32(); + I15 = stream.ReadValueS32(); + I16 = stream.ReadValueS32(); + I17 = stream.ReadValueS32(); + I18 = stream.ReadValueS32(); + I19 = stream.ReadValueS32(); + I20 = stream.ReadValueS32(); - this.I21 = stream.ReadValueS32(); - this.I22 = stream.ReadValueS32(); - this.I23 = stream.ReadValueS32(); - this.I24 = stream.ReadValueS32(); - this.I25 = stream.ReadValueS32(); - this.I26 = stream.ReadValueS32(); - this.I27 = stream.ReadValueS32(); - this.I28 = stream.ReadValueS32(); - this.I29 = stream.ReadValueS32(); - this.I30 = stream.ReadValueS32(); + I21 = stream.ReadValueS32(); + I22 = stream.ReadValueS32(); + I23 = stream.ReadValueS32(); + I24 = stream.ReadValueS32(); + I25 = stream.ReadValueS32(); + I26 = stream.ReadValueS32(); + I27 = stream.ReadValueS32(); + I28 = stream.ReadValueS32(); + I29 = stream.ReadValueS32(); + I30 = stream.ReadValueS32(); } } public class HelpCodesTable : ISerializableData //unused @@ -950,9 +950,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.S0 = stream.ReadValueS32(); - this.S1 = stream.ReadValueS32(); - this.S2 = stream.ReadValueS64(); + S0 = stream.ReadValueS32(); + S1 = stream.ReadValueS32(); + S2 = stream.ReadValueS64(); // this.S0 = stream.ReadString(256, true); // this.S1 = stream.ReadString(256, true); // this.S2 = stream.ReadString(128, true); @@ -1023,66 +1023,66 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int Pad { get; private set; } public void Read(MpqFileStream stream) { - this.LvlMin = stream.ReadValueS32(); - this.Str = stream.ReadValueF32(); - this.Dex = stream.ReadValueF32(); - this.Int = stream.ReadValueF32(); - this.Vit = stream.ReadValueF32(); - this.HPMin = stream.ReadValueF32(); - this.HPDelta = stream.ReadValueF32(); - this.HPRegen = stream.ReadValueF32(); - this.ResourceBase = stream.ReadValueF32(); - this.ResourceRegen = stream.ReadValueF32(); - this.Armor = stream.ReadValueF32(); - this.Dmg = stream.ReadValueF32(); - this.DmgDelta = stream.ReadValueF32(); - this.DmgFire = stream.ReadValueF32(); - this.DmgDeltaFire = stream.ReadValueF32(); - this.DmgLightning = stream.ReadValueF32(); - this.DmgDeltaLightning = stream.ReadValueF32(); - this.DmgCold = stream.ReadValueF32(); - this.DmgDeltaCold = stream.ReadValueF32(); - this.DmgPoison = stream.ReadValueF32(); - this.DmgDeltaPoison = stream.ReadValueF32(); - this.DmgArcane = stream.ReadValueF32(); - this.DmgDeltaArcane = stream.ReadValueF32(); - this.DmgHoly = stream.ReadValueF32(); - this.DmgDeltaHoly = stream.ReadValueF32(); - this.DmgSiege = stream.ReadValueF32(); - this.DmgDeltaSiege = stream.ReadValueF32(); - this.HirelingHPMin = stream.ReadValueF32(); - this.HirelingHPDelta = stream.ReadValueF32(); - this.HirelingHPRegen = stream.ReadValueF32(); - this.HirelingDmg = stream.ReadValueF32(); - this.HirelingDmgRange = stream.ReadValueF32(); - this.HirelingRetrainCost = stream.ReadValueF32(); - this.GetHitDamage = stream.ReadValueF32(); - this.GetHitScalar = stream.ReadValueF32(); - this.GetHitMax = stream.ReadValueF32(); - this.GetHitRecovery = stream.ReadValueF32(); - this.WalkSpd = stream.ReadValueF32(); - this.RunSpd = stream.ReadValueF32(); - this.SprintSpd = stream.ReadValueF32(); - this.StrafeSpd = stream.ReadValueF32(); - this.AttSpd = stream.ReadValueF32(); - this.ProjSpd = stream.ReadValueF32(); - this.Exp = stream.ReadValueF32(); - this.ResistPhysical = stream.ReadValueF32(); - this.ResistFire = stream.ReadValueF32(); - this.ResistLightning = stream.ReadValueF32(); - this.ResistCold = stream.ReadValueF32(); - this.ResistPoison = stream.ReadValueF32(); - this.ResistArcane = stream.ReadValueF32(); - this.ResistSiege = stream.ReadValueF32(); - this.ResistChill = stream.ReadValueF32(); - this.ResistStun = stream.ReadValueF32(); - this.ConsoleHealthScalar = stream.ReadValueF32(); - this.ConsoleDamageScalar = stream.ReadValueF32(); - this.Monster1AffixWeight = stream.ReadValueF32(); - this.Monster2AffixWeight = stream.ReadValueF32(); - this.Monster3AffixWeight = stream.ReadValueF32(); - this.Monster4AffixWeight = stream.ReadValueF32(); - this.Pad = stream.ReadValueS32(); + LvlMin = stream.ReadValueS32(); + Str = stream.ReadValueF32(); + Dex = stream.ReadValueF32(); + Int = stream.ReadValueF32(); + Vit = stream.ReadValueF32(); + HPMin = stream.ReadValueF32(); + HPDelta = stream.ReadValueF32(); + HPRegen = stream.ReadValueF32(); + ResourceBase = stream.ReadValueF32(); + ResourceRegen = stream.ReadValueF32(); + Armor = stream.ReadValueF32(); + Dmg = stream.ReadValueF32(); + DmgDelta = stream.ReadValueF32(); + DmgFire = stream.ReadValueF32(); + DmgDeltaFire = stream.ReadValueF32(); + DmgLightning = stream.ReadValueF32(); + DmgDeltaLightning = stream.ReadValueF32(); + DmgCold = stream.ReadValueF32(); + DmgDeltaCold = stream.ReadValueF32(); + DmgPoison = stream.ReadValueF32(); + DmgDeltaPoison = stream.ReadValueF32(); + DmgArcane = stream.ReadValueF32(); + DmgDeltaArcane = stream.ReadValueF32(); + DmgHoly = stream.ReadValueF32(); + DmgDeltaHoly = stream.ReadValueF32(); + DmgSiege = stream.ReadValueF32(); + DmgDeltaSiege = stream.ReadValueF32(); + HirelingHPMin = stream.ReadValueF32(); + HirelingHPDelta = stream.ReadValueF32(); + HirelingHPRegen = stream.ReadValueF32(); + HirelingDmg = stream.ReadValueF32(); + HirelingDmgRange = stream.ReadValueF32(); + HirelingRetrainCost = stream.ReadValueF32(); + GetHitDamage = stream.ReadValueF32(); + GetHitScalar = stream.ReadValueF32(); + GetHitMax = stream.ReadValueF32(); + GetHitRecovery = stream.ReadValueF32(); + WalkSpd = stream.ReadValueF32(); + RunSpd = stream.ReadValueF32(); + SprintSpd = stream.ReadValueF32(); + StrafeSpd = stream.ReadValueF32(); + AttSpd = stream.ReadValueF32(); + ProjSpd = stream.ReadValueF32(); + Exp = stream.ReadValueF32(); + ResistPhysical = stream.ReadValueF32(); + ResistFire = stream.ReadValueF32(); + ResistLightning = stream.ReadValueF32(); + ResistCold = stream.ReadValueF32(); + ResistPoison = stream.ReadValueF32(); + ResistArcane = stream.ReadValueF32(); + ResistSiege = stream.ReadValueF32(); + ResistChill = stream.ReadValueF32(); + ResistStun = stream.ReadValueF32(); + ConsoleHealthScalar = stream.ReadValueF32(); + ConsoleDamageScalar = stream.ReadValueF32(); + Monster1AffixWeight = stream.ReadValueF32(); + Monster2AffixWeight = stream.ReadValueF32(); + Monster3AffixWeight = stream.ReadValueF32(); + Monster4AffixWeight = stream.ReadValueF32(); + Pad = stream.ReadValueS32(); } } public class AffixTable : ISerializableData @@ -1131,60 +1131,60 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int AffixGroup { get; private set; } public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.Hash = StringHashHelper.HashItemName(this.Name); - this.I0 = stream.ReadValueS32(); - this.AffixLevel = stream.ReadValueS32(); - this.SupMask = stream.ReadValueS32(); - this.Frequency = stream.ReadValueS32(); - this.DemonHunterFrequency = stream.ReadValueS32(); - this.BarbarianFrequency = stream.ReadValueS32(); - this.WizardFrequency = stream.ReadValueS32(); - this.WitchDoctorFrequency = stream.ReadValueS32(); - this.MonkFrequency = stream.ReadValueS32(); - this.CrafterRequiredLevel = stream.ReadValueS32(); - this.NecromancerFrequency = stream.ReadValueS32(); - this.HirelingNoneFrequency = stream.ReadValueS32(); - this.TemplarFrequency = stream.ReadValueS32(); - this.ScoundrelFrequency = stream.ReadValueS32(); - this.EnchantressFrequency = stream.ReadValueS32(); - this.AffixLevelMin = stream.ReadValueS32(); - this.AffixLevelMax = stream.ReadValueS32(); - this.Cost = stream.ReadValueS32(); - this.IdentifyCost = stream.ReadValueS32(); - this.OverrideLevelReq = stream.ReadValueS32(); - this.CrafterRequiredLevel = stream.ReadValueS32(); - this.ItemEffectType = (DamageAffixType)stream.ReadValueS32(); //340 - this.ItemEffectLevel = stream.ReadValueS32(); - this.ConvertsTo = stream.ReadValueS32(); - this.LegendaryUprankAffix = stream.ReadValueS32(); - this.SNORareNamePrefixStringList = stream.ReadValueS32(); - this.SNORareNameSuffixStringList = stream.ReadValueS32(); - this.AffixFamily0 = stream.ReadValueS32(); - this.AffixFamily1 = stream.ReadValueS32(); - this.PlayerClass = (Class)stream.ReadValueS32(); //372 - this.ExclusionCategory = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + Hash = StringHashHelper.HashItemName(Name); + I0 = stream.ReadValueS32(); + AffixLevel = stream.ReadValueS32(); + SupMask = stream.ReadValueS32(); + Frequency = stream.ReadValueS32(); + DemonHunterFrequency = stream.ReadValueS32(); + BarbarianFrequency = stream.ReadValueS32(); + WizardFrequency = stream.ReadValueS32(); + WitchDoctorFrequency = stream.ReadValueS32(); + MonkFrequency = stream.ReadValueS32(); + CrafterRequiredLevel = stream.ReadValueS32(); + NecromancerFrequency = stream.ReadValueS32(); + HirelingNoneFrequency = stream.ReadValueS32(); + TemplarFrequency = stream.ReadValueS32(); + ScoundrelFrequency = stream.ReadValueS32(); + EnchantressFrequency = stream.ReadValueS32(); + AffixLevelMin = stream.ReadValueS32(); + AffixLevelMax = stream.ReadValueS32(); + Cost = stream.ReadValueS32(); + IdentifyCost = stream.ReadValueS32(); + OverrideLevelReq = stream.ReadValueS32(); + CrafterRequiredLevel = stream.ReadValueS32(); + ItemEffectType = (DamageAffixType)stream.ReadValueS32(); //340 + ItemEffectLevel = stream.ReadValueS32(); + ConvertsTo = stream.ReadValueS32(); + LegendaryUprankAffix = stream.ReadValueS32(); + SNORareNamePrefixStringList = stream.ReadValueS32(); + SNORareNameSuffixStringList = stream.ReadValueS32(); + AffixFamily0 = stream.ReadValueS32(); + AffixFamily1 = stream.ReadValueS32(); + PlayerClass = (Class)stream.ReadValueS32(); //372 + ExclusionCategory = stream.ReadValueS32(); - this.ExcludedCategories = new int[6]; + ExcludedCategories = new int[6]; for (int i = 0; i < 6; i++) - this.ExcludedCategories[i] = stream.ReadValueS32(); - this.ItemGroup = new int[24]; + ExcludedCategories[i] = stream.ReadValueS32(); + ItemGroup = new int[24]; for (int i = 0; i < 24; i++) - this.ItemGroup[i] = stream.ReadValueS32(); - this.LegendaryAllowedTypes = new int[24]; + ItemGroup[i] = stream.ReadValueS32(); + LegendaryAllowedTypes = new int[24]; for (int i = 0; i < 24; i++) - this.LegendaryAllowedTypes[i] = stream.ReadValueS32(); + LegendaryAllowedTypes[i] = stream.ReadValueS32(); - this.AllowedQualityLevels = stream.ReadValueS32(); - this.AffixType = (AffixType)stream.ReadValueS32(); //600 - this.AssociatedAffix = stream.ReadValueS32(); + AllowedQualityLevels = stream.ReadValueS32(); + AffixType = (AffixType)stream.ReadValueS32(); //600 + AssociatedAffix = stream.ReadValueS32(); - this.AttributeSpecifier = new AttributeSpecifier[4]; + AttributeSpecifier = new AttributeSpecifier[4]; for (int i = 0; i < 4; i++) - this.AttributeSpecifier[i] = new AttributeSpecifier(stream); + AttributeSpecifier[i] = new AttributeSpecifier(stream); //704 stream.Position += 72; - this.AffixGroup = stream.ReadValueS32(); + AffixGroup = stream.ReadValueS32(); stream.Position += 4; } } @@ -1264,70 +1264,70 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { //stream.Position += 4; - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.SNOMaleActor = stream.ReadValueS32(); - this.SNOFemaleActor = stream.ReadValueS32(); - this.SNOInventory = stream.ReadValueS32(); - this.MaxTrainableSkills = stream.ReadValueS32(); - this.SNOStartingLMBSkill = stream.ReadValueS32(); - this.SNOStartingRMBSkill = stream.ReadValueS32(); - this.SNOSKillKit0 = stream.ReadValueS32(); - this.SNOSKillKit1 = stream.ReadValueS32(); - this.SNOSKillKit2 = stream.ReadValueS32(); - this.SNOSKillKit3 = stream.ReadValueS32(); - this.PrimaryResource = (Resource)stream.ReadValueS32(); - this.SecondaryResource = (Resource)stream.ReadValueS32(); - this.CoreAttribute = (PrimaryAttribute)stream.ReadValueS32(); - this.PlayerAwarenessRadius = stream.ReadValueF32(); - this.IsRanged = stream.ReadValueS32(); //320 + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + SNOMaleActor = stream.ReadValueS32(); + SNOFemaleActor = stream.ReadValueS32(); + SNOInventory = stream.ReadValueS32(); + MaxTrainableSkills = stream.ReadValueS32(); + SNOStartingLMBSkill = stream.ReadValueS32(); + SNOStartingRMBSkill = stream.ReadValueS32(); + SNOSKillKit0 = stream.ReadValueS32(); + SNOSKillKit1 = stream.ReadValueS32(); + SNOSKillKit2 = stream.ReadValueS32(); + SNOSKillKit3 = stream.ReadValueS32(); + PrimaryResource = (Resource)stream.ReadValueS32(); + SecondaryResource = (Resource)stream.ReadValueS32(); + CoreAttribute = (PrimaryAttribute)stream.ReadValueS32(); + PlayerAwarenessRadius = stream.ReadValueF32(); + IsRanged = stream.ReadValueS32(); //320 //HitpointsMax HitpointsFactorLevel - this.Strength = stream.ReadValueF32(); //336 - this.Dexterity = stream.ReadValueF32(); //340 - this.Intelligence = stream.ReadValueF32(); //352 - this.Vitality = stream.ReadValueF32(); //356 - this.HitpointsMax = stream.ReadValueF32(); //360 - this.HitpointsFactorLevel = stream.ReadValueF32(); //364 - this.HPRegen = stream.ReadValueF32(); //372 - this.ClassDamageReductionPercent = stream.ReadValueF32(); //376 - this.ClassDamageReductionPercentPVP = stream.ReadValueF32(); //380 - this.PrimaryResourceBase = stream.ReadValueF32(); //408 - this.PrimaryResourceFactorLevel = stream.ReadValueF32(); //484 - this.PrimaryResourceRegen = stream.ReadValueF32(); //488 - this.SecondaryResourceBase = stream.ReadValueF32(); //492 - this.SecondaryResourceFactorLevel = stream.ReadValueF32(); //500 - this.SecondaryResourceRegen = stream.ReadValueF32(); //536 - this.Armor = stream.ReadValueF32(); //540 - this.Dmg = stream.ReadValueF32(); //548 - this.WalkingRate = stream.ReadValueF32(); //584 - this.RunningRate = stream.ReadValueF32(); //588 - this.SprintRate = stream.ReadValueF32(); //592 - this.ProjRate = stream.ReadValueF32(); //596 - this.CritDamageCap = stream.ReadValueF32(); //600 - this.CritPercentBase = stream.ReadValueF32(); //604 - this.CritPercentCap = stream.ReadValueF32(); //612 - this.DodgeRatingBase = stream.ReadValueF32(); //616 - this.GetHitMaxBase = stream.ReadValueF32(); //680 - this.GetHitMaxPerLevel = stream.ReadValueF32(); //692 - this.GetHitRecoveryBase = stream.ReadValueF32(); //696 - this.GetHitRecoveryPerLevel = stream.ReadValueF32(); //700 - this.ResistPhysical = stream.ReadValueF32(); //704 - this.ResistFire = stream.ReadValueF32(); //720 - this.ResistLightning = stream.ReadValueF32(); //724 - this.ResistCold = stream.ReadValueF32(); //728 - this.ResistPoison = stream.ReadValueF32(); //772 - this.ResistArcane = stream.ReadValueF32(); - this.ResistChill = stream.ReadValueF32(); - this.ResistStun = stream.ReadValueF32(); - this.KnockbackWeight = stream.ReadValueF32(); - this.OOCHealthRegen = stream.ReadValueF32(); - this.OOCManaRegen = stream.ReadValueF32(); - this.PotionDilutionDuration = stream.ReadValueF32(); - this.PotionDilutionScalar = stream.ReadValueF32(); - this.DualWieldBothAttackChance = stream.ReadValueF32(); - this.Freeze_Capacity = stream.ReadValueF32(); - this.Thaw_Rate = stream.ReadValueF32(); + Strength = stream.ReadValueF32(); //336 + Dexterity = stream.ReadValueF32(); //340 + Intelligence = stream.ReadValueF32(); //352 + Vitality = stream.ReadValueF32(); //356 + HitpointsMax = stream.ReadValueF32(); //360 + HitpointsFactorLevel = stream.ReadValueF32(); //364 + HPRegen = stream.ReadValueF32(); //372 + ClassDamageReductionPercent = stream.ReadValueF32(); //376 + ClassDamageReductionPercentPVP = stream.ReadValueF32(); //380 + PrimaryResourceBase = stream.ReadValueF32(); //408 + PrimaryResourceFactorLevel = stream.ReadValueF32(); //484 + PrimaryResourceRegen = stream.ReadValueF32(); //488 + SecondaryResourceBase = stream.ReadValueF32(); //492 + SecondaryResourceFactorLevel = stream.ReadValueF32(); //500 + SecondaryResourceRegen = stream.ReadValueF32(); //536 + Armor = stream.ReadValueF32(); //540 + Dmg = stream.ReadValueF32(); //548 + WalkingRate = stream.ReadValueF32(); //584 + RunningRate = stream.ReadValueF32(); //588 + SprintRate = stream.ReadValueF32(); //592 + ProjRate = stream.ReadValueF32(); //596 + CritDamageCap = stream.ReadValueF32(); //600 + CritPercentBase = stream.ReadValueF32(); //604 + CritPercentCap = stream.ReadValueF32(); //612 + DodgeRatingBase = stream.ReadValueF32(); //616 + GetHitMaxBase = stream.ReadValueF32(); //680 + GetHitMaxPerLevel = stream.ReadValueF32(); //692 + GetHitRecoveryBase = stream.ReadValueF32(); //696 + GetHitRecoveryPerLevel = stream.ReadValueF32(); //700 + ResistPhysical = stream.ReadValueF32(); //704 + ResistFire = stream.ReadValueF32(); //720 + ResistLightning = stream.ReadValueF32(); //724 + ResistCold = stream.ReadValueF32(); //728 + ResistPoison = stream.ReadValueF32(); //772 + ResistArcane = stream.ReadValueF32(); + ResistChill = stream.ReadValueF32(); + ResistStun = stream.ReadValueF32(); + KnockbackWeight = stream.ReadValueF32(); + OOCHealthRegen = stream.ReadValueF32(); + OOCManaRegen = stream.ReadValueF32(); + PotionDilutionDuration = stream.ReadValueF32(); + PotionDilutionScalar = stream.ReadValueF32(); + DualWieldBothAttackChance = stream.ReadValueF32(); + Freeze_Capacity = stream.ReadValueF32(); + Thaw_Rate = stream.ReadValueF32(); } public enum Resource : int @@ -1454,40 +1454,40 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { stream.Position += 4; - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.I6 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); - this.I9 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); - this.F11 = stream.ReadValueF32(); - this.F12 = stream.ReadValueF32(); - this.F13 = stream.ReadValueF32(); - this.F14 = stream.ReadValueF32(); - this.F15 = stream.ReadValueF32(); - this.F16 = stream.ReadValueF32(); - this.F17 = stream.ReadValueF32(); - this.F18 = stream.ReadValueF32(); - this.F19 = stream.ReadValueF32(); - this.F20 = stream.ReadValueF32(); - this.F21 = stream.ReadValueF32(); - this.SNOPowerToBreakObjects = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); + F11 = stream.ReadValueF32(); + F12 = stream.ReadValueF32(); + F13 = stream.ReadValueF32(); + F14 = stream.ReadValueF32(); + F15 = stream.ReadValueF32(); + F16 = stream.ReadValueF32(); + F17 = stream.ReadValueF32(); + F18 = stream.ReadValueF32(); + F19 = stream.ReadValueF32(); + F20 = stream.ReadValueF32(); + F21 = stream.ReadValueF32(); + SNOPowerToBreakObjects = stream.ReadValueS32(); } } public class LabelGBIDTable : ISerializableData @@ -1502,11 +1502,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { //stream.Position += 4; - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); } } public class LootDistributionTableEntry : ISerializableData //0 byte file @@ -1583,29 +1583,29 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.I6 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); - this.I9 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); - this.I10 = stream.ReadValueS32(); - this.I11 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); + I10 = stream.ReadValueS32(); + I11 = stream.ReadValueS32(); } } public class RareItemNamesTable : ISerializableData @@ -1621,13 +1621,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.Type = (BalanceType)stream.ReadValueS32(); - this.RelatedAffixOrItemType = stream.ReadValueS32(); - this.AffixType = (AffixType)stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + Type = (BalanceType)stream.ReadValueS32(); + RelatedAffixOrItemType = stream.ReadValueS32(); + AffixType = (AffixType)stream.ReadValueS32(); + I2 = stream.ReadValueS32(); } } public class MonsterAffixesTable : ISerializableData @@ -1661,32 +1661,32 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { //584 - this.Name = stream.ReadString(256, true); - this.Hash = StringHashHelper.HashItemName(this.Name); - this.I0 = stream.ReadValueS32(); // - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.MonsterAffix = (MonsterAffix)stream.ReadValueS32(); // - this.Resistance = (Resistance)stream.ReadValueS32(); - this.AffixType = (AffixType)stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.I6 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + Hash = StringHashHelper.HashItemName(Name); + I0 = stream.ReadValueS32(); // + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + MonsterAffix = (MonsterAffix)stream.ReadValueS32(); // + Resistance = (Resistance)stream.ReadValueS32(); + AffixType = (AffixType)stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); - this.Attributes = new AttributeSpecifier[10]; //888 + Attributes = new AttributeSpecifier[10]; //888 for (int i = 0; i < 10; i++) - this.Attributes[i] = new AttributeSpecifier(stream); + Attributes[i] = new AttributeSpecifier(stream); - this.MinionAttributes = new AttributeSpecifier[10]; + MinionAttributes = new AttributeSpecifier[10]; for (int i = 0; i < 10; i++) - this.MinionAttributes[i] = new AttributeSpecifier(stream); + MinionAttributes[i] = new AttributeSpecifier(stream); stream.Position += 4; - this.SNOOnSpawnPowerMinion = stream.ReadValueS32(); //804 - 1372 - this.SNOOnSpawnPowerChampion = stream.ReadValueS32(); - this.SNOOnSpawnPowerRare = stream.ReadValueS32(); + SNOOnSpawnPowerMinion = stream.ReadValueS32(); //804 - 1372 + SNOOnSpawnPowerChampion = stream.ReadValueS32(); + SNOOnSpawnPowerRare = stream.ReadValueS32(); BS = new byte[99]; for (int i = 0; i < BS.Length; i++) @@ -1710,13 +1710,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.Hash = StringHashHelper.HashItemName(this.Name); - this.I0 = stream.ReadValueS32(); // - this.I1 = stream.ReadValueS32(); - this.AffixType = (AffixType)stream.ReadValueS32(); - this.S0 = stream.ReadString(128, true); - this.I2 = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + Hash = StringHashHelper.HashItemName(Name); + I0 = stream.ReadValueS32(); // + I1 = stream.ReadValueS32(); + AffixType = (AffixType)stream.ReadValueS32(); + S0 = stream.ReadString(128, true); + I2 = stream.ReadValueS32(); } } @@ -1734,18 +1734,18 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.Item = stream.ReadValueS32(); - this.ItemType = stream.ReadValueS32(); - this.Attribute = new AttributeSpecifier[3]; + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + Item = stream.ReadValueS32(); + ItemType = stream.ReadValueS32(); + Attribute = new AttributeSpecifier[3]; for (int i = 0; i < 3; i++) - this.Attribute[i] = new AttributeSpecifier(stream); - this.ReqAttribute = new AttributeSpecifier[2]; + Attribute[i] = new AttributeSpecifier(stream); + ReqAttribute = new AttributeSpecifier[2]; for (int i = 0; i < 2; i++) - this.ReqAttribute[i] = new AttributeSpecifier(stream); - this.S0 = stream.ReadString(1024, true); + ReqAttribute[i] = new AttributeSpecifier(stream); + S0 = stream.ReadString(1024, true); } } public class ItemDropTableEntry : ISerializableData //0 byte file @@ -1759,10 +1759,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.I0 = new int[221]; + Name = stream.ReadString(256, true); + I0 = new int[221]; for (int i = 0; i < 221; i++) - this.I0[i] = stream.ReadValueS32(); + I0[i] = stream.ReadValueS32(); } } public class ItemLevelModifier : ISerializableData //0 byte file @@ -1839,34 +1839,34 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.I6 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); - this.I9 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); - this.I10 = stream.ReadValueS32(); - this.I11 = stream.ReadValueS32(); + I10 = stream.ReadValueS32(); + I11 = stream.ReadValueS32(); } } public class QualityClass : ISerializableData //0 byte file @@ -1881,13 +1881,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int I2 { get; private set; } public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.F0 = new float[22]; + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + F0 = new float[22]; for (int i = 0; i < 22; i++) - this.F0[i] = stream.ReadValueF32(); - this.I2 = stream.ReadValueS32(); + F0[i] = stream.ReadValueF32(); + I2 = stream.ReadValueS32(); } } public class HandicapLevelTable : ISerializableData @@ -1903,14 +1903,14 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int I1 { get; private set; } public void Read(MpqFileStream stream) { - this.HPMod = stream.ReadValueF32(); - this.DmgMod = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.XPMod = stream.ReadValueF32(); - this.GoldMod = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); + HPMod = stream.ReadValueF32(); + DmgMod = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + XPMod = stream.ReadValueF32(); + GoldMod = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); } } public class ItemSalvageLevelTable : ISerializableData @@ -1921,10 +1921,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int TreasureClassSNO3 { get; private set; } public void Read(MpqFileStream stream) { - this.TreasureClassSNO0 = stream.ReadValueS32(); - this.TreasureClassSNO1 = stream.ReadValueS32(); - this.TreasureClassSNO2 = stream.ReadValueS32(); - this.TreasureClassSNO3 = stream.ReadValueS32(); + TreasureClassSNO0 = stream.ReadValueS32(); + TreasureClassSNO1 = stream.ReadValueS32(); + TreasureClassSNO2 = stream.ReadValueS32(); + TreasureClassSNO3 = stream.ReadValueS32(); } } public class HirelingTable : ISerializableData @@ -1955,25 +1955,25 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { // - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.SNOActor = stream.ReadValueS32(); - this.SNOProxy = stream.ReadValueS32(); - this.SNOInventory = stream.ReadValueS32(); - this.TreasureClassSNO = stream.ReadValueS32(); - this.Attribute = (PrimaryAttribute)stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + SNOActor = stream.ReadValueS32(); + SNOProxy = stream.ReadValueS32(); + SNOInventory = stream.ReadValueS32(); + TreasureClassSNO = stream.ReadValueS32(); + Attribute = (PrimaryAttribute)stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); } } @@ -1989,11 +1989,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.Set = stream.ReadValueS32(); - this.Count = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + Set = stream.ReadValueS32(); + Count = stream.ReadValueS32(); Attribute = new AttributeSpecifier[8]; for (int i = 0; i < 8; i++) Attribute[i] = new AttributeSpecifier(stream); @@ -2078,33 +2078,33 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); + Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.Time0 = stream.ReadValueS32(); - this.F1 = stream.ReadValueF32(); - this.Time1 = stream.ReadValueS32(); - this.F2 = stream.ReadValueF32(); - this.Time2 = stream.ReadValueS32(); - this.F3 = stream.ReadValueF32(); - this.Time3 = stream.ReadValueS32(); - this.F4 = stream.ReadValueF32(); - this.Time4 = stream.ReadValueS32(); - this.F5 = stream.ReadValueF32(); - this.Time5 = stream.ReadValueS32(); - this.F6 = stream.ReadValueF32(); - this.Time6 = stream.ReadValueS32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.Time7 = stream.ReadValueS32(); - this.F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); - this.F11 = stream.ReadValueF32(); - this.F12 = stream.ReadValueF32(); - this.I2 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + Time0 = stream.ReadValueS32(); + F1 = stream.ReadValueF32(); + Time1 = stream.ReadValueS32(); + F2 = stream.ReadValueF32(); + Time2 = stream.ReadValueS32(); + F3 = stream.ReadValueF32(); + Time3 = stream.ReadValueS32(); + F4 = stream.ReadValueF32(); + Time4 = stream.ReadValueS32(); + F5 = stream.ReadValueF32(); + Time5 = stream.ReadValueS32(); + F6 = stream.ReadValueF32(); + Time6 = stream.ReadValueS32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + Time7 = stream.ReadValueS32(); + F9 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); + F11 = stream.ReadValueF32(); + F12 = stream.ReadValueF32(); + I2 = stream.ReadValueS32(); } } public class ItemTier : ISerializableData //0 byte file @@ -2137,15 +2137,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Head = stream.ReadValueS32(); - this.Torso = stream.ReadValueS32(); - this.Feet = stream.ReadValueS32(); - this.Hands = stream.ReadValueS32(); + Head = stream.ReadValueS32(); + Torso = stream.ReadValueS32(); + Feet = stream.ReadValueS32(); + Hands = stream.ReadValueS32(); - this.Shoulders = stream.ReadValueS32(); - this.Bracers = stream.ReadValueS32(); - this.Belt = stream.ReadValueS32(); - this.Necesssary = stream.ReadValueS32(); + Shoulders = stream.ReadValueS32(); + Bracers = stream.ReadValueS32(); + Belt = stream.ReadValueS32(); + Necesssary = stream.ReadValueS32(); } } public class PowerFormulaTable : ISerializableData @@ -2156,10 +2156,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.S0 = stream.ReadString(1024, true); - this.F0 = new float[76]; + S0 = stream.ReadString(1024, true); + F0 = new float[76]; for (int i = 0; i < 76; i++) - this.F0[i] = stream.ReadValueF32(); + F0[i] = stream.ReadValueF32(); } } public class RecipeTable : ISerializableData @@ -2179,19 +2179,19 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.Hash = StringHashHelper.HashItemName(this.Name); - this.GBID = stream.ReadValueS32(); - this.PAD = stream.ReadValueS32(); - this.SNORecipe = stream.ReadValueS32(); - this.CrafterType = (RecipeType)stream.ReadValueS32(); - this.Flags = stream.ReadValueS32(); - this.Level = stream.ReadValueS32(); - this.Gold = stream.ReadValueS32(); - this.NumIngredients = stream.ReadValueS32(); - this.Ingredients = new RecipeIngredient[6]; + Name = stream.ReadString(256, true); + Hash = StringHashHelper.HashItemName(Name); + GBID = stream.ReadValueS32(); + PAD = stream.ReadValueS32(); + SNORecipe = stream.ReadValueS32(); + CrafterType = (RecipeType)stream.ReadValueS32(); + Flags = stream.ReadValueS32(); + Level = stream.ReadValueS32(); + Gold = stream.ReadValueS32(); + NumIngredients = stream.ReadValueS32(); + Ingredients = new RecipeIngredient[6]; for (int i = 0; i < 6; i++) - this.Ingredients[i] = new RecipeIngredient(stream); + Ingredients[i] = new RecipeIngredient(stream); } } public class ScriptedAchievementEventsTable : ISerializableData @@ -2204,9 +2204,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.GBID = stream.ReadValueS32(); - this.PAD = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + GBID = stream.ReadValueS32(); + PAD = stream.ReadValueS32(); } } public class LootRunQuestTierTable : ISerializableData @@ -2217,12 +2217,12 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public LootRunQuestTierEntry[] LootRunQuestTierEntrys { get; private set; } public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.LootRunQuestTierEntrys = new LootRunQuestTierEntry[16]; + Name = stream.ReadString(256, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + LootRunQuestTierEntrys = new LootRunQuestTierEntry[16]; for (int i = 0; i < 16; i++) - this.LootRunQuestTierEntrys[i] = new LootRunQuestTierEntry(stream); + LootRunQuestTierEntrys[i] = new LootRunQuestTierEntry(stream); } } public class ParagonBonusesTable : ISerializableData @@ -2238,22 +2238,22 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public string IconName { get; private set; } public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.Hash = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + Hash = stream.ReadValueS32(); if (Hash == 0) { - Hash = StringHashHelper.HashItemName(this.Name); + Hash = StringHashHelper.HashItemName(Name); } - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); stream.Position += 4; AttributeSpecifiers = new AttributeSpecifier[4]; //856 for (int i = 0; i < 4; i++) - this.AttributeSpecifiers[i] = new AttributeSpecifier(stream); - this.Category = stream.ReadValueS32(); //368 + 584 = 952 - this.Index = stream.ReadValueS32(); - this.HeroClass = (Class)stream.ReadValueS32(); - this.IconName = stream.ReadString(256, true); + AttributeSpecifiers[i] = new AttributeSpecifier(stream); + Category = stream.ReadValueS32(); //368 + 584 = 952 + Index = stream.ReadValueS32(); + HeroClass = (Class)stream.ReadValueS32(); + IconName = stream.ReadString(256, true); stream.Position += 4; //640 + 584 = 1224 } @@ -2270,13 +2270,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.GBID = stream.ReadValueS32(); - this.PAD = stream.ReadValueS32(); - this.OldItemGBID = stream.ReadValueS32(); - this.NewItemGBID = stream.ReadValueS32(); - this.ConsoleIgnore = stream.ReadValueS32(); - this.Pad = stream.ReadValueS32(); + Name = stream.ReadString(256, true); + GBID = stream.ReadValueS32(); + PAD = stream.ReadValueS32(); + OldItemGBID = stream.ReadValueS32(); + NewItemGBID = stream.ReadValueS32(); + ConsoleIgnore = stream.ReadValueS32(); + Pad = stream.ReadValueS32(); } } public class EnchantItemAffixUseCountCostScalarsTable : ISerializableData @@ -2286,8 +2286,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.UseCount = stream.ReadValueS32(); - this.CostMultiplier = stream.ReadValueF32(); + UseCount = stream.ReadValueS32(); + CostMultiplier = stream.ReadValueF32(); } } public class TieredLootRunLevelTable : ISerializableData @@ -2308,19 +2308,19 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.L0 = stream.ReadValueS64(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + L0 = stream.ReadValueS64(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); } } public class TransmuteRecipesTable : ISerializableData @@ -2336,16 +2336,16 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.GBID = stream.ReadValueS32(); - this.PAD = stream.ReadValueS32(); - this.TransmuteType = (TransmuteType)stream.ReadValueS32(); + Name = stream.ReadString(256, true); + GBID = stream.ReadValueS32(); + PAD = stream.ReadValueS32(); + TransmuteType = (TransmuteType)stream.ReadValueS32(); TransmuteRecipeIngredients = new TransmuteRecipeIngredient[8]; for (int i = 0; i < TransmuteRecipeIngredients.Length; i++) TransmuteRecipeIngredients[i] = new TransmuteRecipeIngredient(stream); - this.IngredientsCount = stream.ReadValueS32(); - this.Page = stream.ReadValueS32(); - this.Hidden = stream.ReadValueS32(); + IngredientsCount = stream.ReadValueS32(); + Page = stream.ReadValueS32(); + Hidden = stream.ReadValueS32(); //stream.Position += 8; } } @@ -2363,16 +2363,16 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(256, true); - this.GBID = stream.ReadValueS32(); - this.PAD = stream.ReadValueS32(); - this.CurrencyType = (CurrencyType)stream.ReadValueS32(); + Name = stream.ReadString(256, true); + GBID = stream.ReadValueS32(); + PAD = stream.ReadValueS32(); + CurrencyType = (CurrencyType)stream.ReadValueS32(); LinkedItemsGBIDs = new int[5]; for (int i = 0; i < LinkedItemsGBIDs.Length; i++) LinkedItemsGBIDs[i] = stream.ReadValueS32(); - this.SortOrder = stream.ReadValueS32(); //872 - this.Hidden = stream.ReadValueS32(); - this.AutoPickup = stream.ReadValueS32(); + SortOrder = stream.ReadValueS32(); //872 + Hidden = stream.ReadValueS32(); + AutoPickup = stream.ReadValueS32(); stream.Position += 4; } } @@ -2549,8 +2549,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public RecipeIngredient(MpqFileStream stream) { - this.ItemsGBID = stream.ReadValueS32(); - this.Count = stream.ReadValueS32(); + ItemsGBID = stream.ReadValueS32(); + Count = stream.ReadValueS32(); } } public class TransmuteRecipeIngredient @@ -2561,9 +2561,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public TransmuteRecipeIngredient(MpqFileStream stream) { - this.Type = stream.ReadValueS32(); - this.TypeValue = stream.ReadValueS32(); - this.Quantity = stream.ReadValueS32(); + Type = stream.ReadValueS32(); + TypeValue = stream.ReadValueS32(); + Quantity = stream.ReadValueS32(); } } public class LootRunQuestTierEntry @@ -2575,10 +2575,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public LootRunQuestTierEntry(MpqFileStream stream) { - this.QuestSNO = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.GBID = stream.ReadValueS32(); - this.ItemsGBID = stream.ReadValueS32(); + QuestSNO = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + GBID = stream.ReadValueS32(); + ItemsGBID = stream.ReadValueS32(); } } public class AttributeSpecifier @@ -2590,10 +2590,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public AttributeSpecifier(MpqFileStream stream) { - this.AttributeId = stream.ReadValueS32(); - this.SNOParam = stream.ReadValueS32(); + AttributeId = stream.ReadValueS32(); + SNOParam = stream.ReadValueS32(); stream.Position += 8; - this.Formula = stream.ReadSerializedInts(); + Formula = stream.ReadSerializedInts(); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Globals.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Globals.cs index 4e490a9..d327ced 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Globals.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Globals.cs @@ -127,50 +127,50 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Globals(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); stream.Position += (3 * 4); - this.ServerData = stream.ReadSerializedData(); + ServerData = stream.ReadSerializedData(); stream.Position += 4; - this.I0 = stream.ReadValueS32(); //32 + I0 = stream.ReadValueS32(); //32 stream.Position += 12; - this.StartLocationNames = new Dictionary(); + StartLocationNames = new Dictionary(); foreach (var startLocation in stream.ReadSerializedData()) StartLocationNames.Add(startLocation.I0, startLocation); - this.F0 = stream.ReadValueF32(); //56 - this.F1 = stream.ReadValueF32(); //60 - this.F2 = stream.ReadValueF32(); //64 - this.F3 = stream.ReadValueF32(); //68 + F0 = stream.ReadValueF32(); //56 + F1 = stream.ReadValueF32(); //60 + F2 = stream.ReadValueF32(); //64 + F3 = stream.ReadValueF32(); //68 - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.I3 = stream.ReadValueS32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); - this.I4 = stream.ReadValueS32(); - this.I6 = new int[4]; + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + I3 = stream.ReadValueS32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); + I4 = stream.ReadValueS32(); + I6 = new int[4]; for (int i = 0; i < 4; i++) - this.I6[i] = stream.ReadValueS32(); + I6[i] = stream.ReadValueS32(); stream.Position += 4; - this.BannerParams = new BannerParams(stream); - this.I5 = stream.ReadValueS32(); - this.I7 = stream.ReadValueS32(); - this.I8 = stream.ReadValueS32(); - this.I9 = stream.ReadValueS32(); - this.F11 = stream.ReadValueF32(); - this.F12 = stream.ReadValueF32(); - this.F13 = stream.ReadValueF32(); - this.F14 = stream.ReadValueF32(); - this.F15 = stream.ReadValueF32(); - this.F16 = stream.ReadValueF32(); - this.F17 = stream.ReadValueF32(); - this.F18 = stream.ReadValueF32(); + BannerParams = new BannerParams(stream); + I5 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); + F11 = stream.ReadValueF32(); + F12 = stream.ReadValueF32(); + F13 = stream.ReadValueF32(); + F14 = stream.ReadValueF32(); + F15 = stream.ReadValueF32(); + F16 = stream.ReadValueF32(); + F17 = stream.ReadValueF32(); + F18 = stream.ReadValueF32(); stream.Close(); } } @@ -190,16 +190,16 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public DifficultyTuningParams(MpqFileStream stream) { - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F9 = stream.ReadValueF32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F9 = stream.ReadValueF32(); } } @@ -210,8 +210,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.UHash = stream.ReadValueS32(); - this.S0 = stream.ReadString(64, true); + UHash = stream.ReadValueS32(); + S0 = stream.ReadString(64, true); } } @@ -222,8 +222,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.S0 = stream.ReadString(64, true); + I0 = stream.ReadValueS32(); + S0 = stream.ReadString(64, true); } } @@ -235,9 +235,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.UHash = stream.ReadValueS32(); - this.S0 = stream.ReadString(32, true); - this.F0 = stream.ReadValueF32(); + UHash = stream.ReadValueS32(); + S0 = stream.ReadString(32, true); + F0 = stream.ReadValueF32(); } } @@ -389,48 +389,48 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public float F65 { get; private set; } public void Read(MpqFileStream stream) { - this.ActorGroups = new Dictionary(); + ActorGroups = new Dictionary(); foreach (var group in stream.ReadSerializedData()) //166 - this.ActorGroups.Add(group.UHash, group); + ActorGroups.Add(group.UHash, group); stream.Position += 8; - this.ScriptGlobalVars = stream.ReadSerializedData(); + ScriptGlobalVars = stream.ReadSerializedData(); stream.Position += 8; - this.TuningParams = new DifficultyTuningParams[4]; + TuningParams = new DifficultyTuningParams[4]; for (int i = 0; i < 4; i++) - this.TuningParams[i] = new DifficultyTuningParams(stream); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.F20 = stream.ReadValueF32(); - this.F21 = stream.ReadValueF32(); - this.F22 = stream.ReadValueF32(); - this.I5 = stream.ReadValueS32(); - this.F23 = stream.ReadValueF32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.F9 = stream.ReadValueF32(); - this.F10 = stream.ReadValueF32(); - this.F11 = stream.ReadValueF32(); - this.F12 = stream.ReadValueF32(); - this.F13 = stream.ReadValueF32(); - this.F14 = stream.ReadValueF32(); - this.F15 = stream.ReadValueF32(); - this.F16 = stream.ReadValueF32(); - this.F17 = stream.ReadValueF32(); - this.F18 = stream.ReadValueF32(); - this.F28 = new float[17]; + TuningParams[i] = new DifficultyTuningParams(stream); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + F20 = stream.ReadValueF32(); + F21 = stream.ReadValueF32(); + F22 = stream.ReadValueF32(); + I5 = stream.ReadValueS32(); + F23 = stream.ReadValueF32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + F9 = stream.ReadValueF32(); + F10 = stream.ReadValueF32(); + F11 = stream.ReadValueF32(); + F12 = stream.ReadValueF32(); + F13 = stream.ReadValueF32(); + F14 = stream.ReadValueF32(); + F15 = stream.ReadValueF32(); + F16 = stream.ReadValueF32(); + F17 = stream.ReadValueF32(); + F18 = stream.ReadValueF32(); + F28 = new float[17]; for (var i = 0; i < 17; i++) - this.F28[i] = stream.ReadValueF32(); + F28[i] = stream.ReadValueF32(); } } @@ -454,33 +454,33 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public BannerParams(MpqFileStream stream) { stream.Position += 8; - this.TexBackgrounds = stream.ReadSerializedData(); - this.I0 = stream.ReadValueS32(); //16 + TexBackgrounds = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); //16 stream.Position += 12; - this.TexPatterns = stream.ReadSerializedData(); - this.I0 = stream.ReadValueS32(); //40 + TexPatterns = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); //40 stream.Position += 12; - this.TexMainSigils = stream.ReadSerializedData(); + TexMainSigils = stream.ReadSerializedData(); stream.Position += 8; - this.TexVariantSigils = stream.ReadSerializedData(); - this.I0 = stream.ReadValueS32(); //80 + TexVariantSigils = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); //80 stream.Position += 12; - this.TexSigilAccents = stream.ReadSerializedData(); - this.I0 = stream.ReadValueS32(); //104 + TexSigilAccents = stream.ReadSerializedData(); + I0 = stream.ReadValueS32(); //104 stream.Position += 12; - this.ColorSets = stream.ReadSerializedData(); + ColorSets = stream.ReadSerializedData(); stream.Position += 8; - this.SigilPlacements = stream.ReadSerializedData(); + SigilPlacements = stream.ReadSerializedData(); stream.Position += 8; - this.SNOActorBases = stream.ReadSerializedInts(); + SNOActorBases = stream.ReadSerializedInts(); stream.Position += 8; - this.SNOActorCaps = stream.ReadSerializedInts(); + SNOActorCaps = stream.ReadSerializedInts(); stream.Position += 8; - this.SNOActorPoles = stream.ReadSerializedInts(); + SNOActorPoles = stream.ReadSerializedInts(); stream.Position += 8; - this.SNOActorRibbons = stream.ReadSerializedInts(); + SNOActorRibbons = stream.ReadSerializedInts(); stream.Position += 8; - this.EpicBannerDescriptions = stream.ReadSerializedData(); + EpicBannerDescriptions = stream.ReadSerializedData(); stream.Position += 8; } } @@ -492,8 +492,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOTexture = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); + SNOTexture = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); stream.Position += 4; } } @@ -507,12 +507,12 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Color = new RGBAColor[2]; + Color = new RGBAColor[2]; for (int i = 0; i < 2; i++) - this.Color[i] = new RGBAColor(stream); - this.String1 = stream.ReadString(64, true); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); + Color[i] = new RGBAColor(stream); + String1 = stream.ReadString(64, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); stream.Position += 4; } } @@ -524,8 +524,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.S0 = stream.ReadString(64, true); - this.I0 = stream.ReadValueS32(); + S0 = stream.ReadString(64, true); + I0 = stream.ReadValueS32(); } } @@ -539,11 +539,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOBannerShape = stream.ReadValueS32(); - this.SNOBannerBase = stream.ReadValueS32(); - this.SNOBannerPole = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.S0 = stream.ReadString(128, true); + SNOBannerShape = stream.ReadValueS32(); + SNOBannerBase = stream.ReadValueS32(); + SNOBannerPole = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + S0 = stream.ReadString(128, true); } } @@ -554,8 +554,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/LevelArea.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/LevelArea.cs index ec64537..fff0464 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/LevelArea.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/LevelArea.cs @@ -22,13 +22,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.SNOLevelArea0 = stream.ReadValueS32(); - this.SNOLevelArea1 = stream.ReadValueS32(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + SNOLevelArea0 = stream.ReadValueS32(); + SNOLevelArea1 = stream.ReadValueS32(); stream.Position += 8; if (stream.Position + 8 != stream.Length) - this.LevelAreaServerData = stream.ReadSerializedData(); //32 - 48 + LevelAreaServerData = stream.ReadSerializedData(); //32 - 48 stream.Close(); } @@ -45,11 +45,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOLevelArea0 = stream.ReadValueS32(); - this.LocSet = new GizmoLocSet(stream); - this.SNOLevelArea1 = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.SpawnPopulation = stream.ReadSerializedData(); + SNOLevelArea0 = stream.ReadValueS32(); + LocSet = new GizmoLocSet(stream); + SNOLevelArea1 = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + SpawnPopulation = stream.ReadSerializedData(); } } @@ -60,9 +60,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public GizmoLocSet(MpqFileStream stream) { //stream.Position = 0; - this.SpawnType = new GizmoLocSpawnType[52]; + SpawnType = new GizmoLocSpawnType[52]; for (int i = 0; i < 52; i++) - this.SpawnType[i] = new GizmoLocSpawnType(stream); + SpawnType[i] = new GizmoLocSpawnType(stream); } } @@ -75,7 +75,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public GizmoLocSpawnType(MpqFileStream stream) { stream.Position += 8; - this.SpawnEntry = stream.ReadSerializedData(); + SpawnEntry = stream.ReadSerializedData(); //this.Description = stream.ReadString(80, true); //this.Comment = stream.ReadString(256, true); } @@ -91,10 +91,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOHandle = new SNOHandle(stream); - this.ForceRandomFacing = stream.ReadValueS32(); - this.Weight = stream.ReadValueF32(); - this.MaxTimesPicked = stream.ReadValueS32(); + SNOHandle = new SNOHandle(stream); + ForceRandomFacing = stream.ReadValueS32(); + Weight = stream.ReadValueF32(); + MaxTimesPicked = stream.ReadValueS32(); } } @@ -112,16 +112,16 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Min = stream.ReadValueS32(); - this.Max = stream.ReadValueS32(); + Min = stream.ReadValueS32(); + Max = stream.ReadValueS32(); //this.SNOHandle = new SNOHandle(stream); - this.SnoRequiredQuest = stream.ReadValueS32(); - this.SnoCondition = stream.ReadValueS32(); - this.Flags = stream.ReadValueS32(); - this.HighPrecisionPercent = stream.ReadValueF32(); - this.ConditionSNO = stream.ReadValueS32(); + SnoRequiredQuest = stream.ReadValueS32(); + SnoCondition = stream.ReadValueS32(); + Flags = stream.ReadValueS32(); + HighPrecisionPercent = stream.ReadValueF32(); + ConditionSNO = stream.ReadValueS32(); stream.Position += 8; - this.GizmoLocSpawnChoices = stream.ReadSerializedData(); + GizmoLocSpawnChoices = stream.ReadSerializedData(); } } @@ -145,25 +145,25 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int SNO { get; private set; } public void Read(MpqFileStream stream) { - this.Description = stream.ReadString(64, true); - this.I0 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); + Description = stream.ReadString(64, true); + I0 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); - this.I1 = new int[4]; + I1 = new int[4]; for (int i = 0; i < 4; i++) - this.I1[i] = stream.ReadValueS32(); - this.I2 = new int[4]; + I1[i] = stream.ReadValueS32(); + I2 = new int[4]; for (int i = 0; i < 4; i++) - this.I2[i] = stream.ReadValueS32(); - this.SpawnGroupsCount = stream.ReadValueS32(); + I2[i] = stream.ReadValueS32(); + SpawnGroupsCount = stream.ReadValueS32(); stream.Position += 8; - this.SpawnGroup = stream.ReadSerializedData(); + SpawnGroup = stream.ReadSerializedData(); stream.Position += 8; SNOs = stream.ReadSerializedInts(); - this.SNO = stream.ReadValueS32(); + SNO = stream.ReadValueS32(); } } @@ -188,16 +188,16 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int SNO { get; private set; } public void Read(MpqFileStream stream) { - this.GroupType = (SpawnGroupType)stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.I0 = stream.ReadValueS32(); - this.SpawnItemsCount = stream.ReadValueS32(); + GroupType = (SpawnGroupType)stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + SpawnItemsCount = stream.ReadValueS32(); stream.Position += 12; - this.SpawnItems = stream.ReadSerializedData(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.SNO = stream.ReadValueS32(); + SpawnItems = stream.ReadSerializedData(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + SNO = stream.ReadValueS32(); } } @@ -225,13 +225,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOHandle = new SNOHandle(stream); - this.SpawnType = (SpawnType)stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); + SNOHandle = new SNOHandle(stream); + SpawnType = (SpawnType)stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Lore.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Lore.cs index fac9843..e71445b 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Lore.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Lore.cs @@ -20,13 +20,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Lore(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.Category = (LoreCategory)stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.SNOConversation = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + Category = (LoreCategory)stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + SNOConversation = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); stream.Close(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/MarkerSet.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/MarkerSet.cs index d2cff2b..acb8996 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/MarkerSet.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/MarkerSet.cs @@ -25,12 +25,12 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public MarkerSet(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream);//0 - this.Markers = stream.ReadSerializedData(); //28 + Header = new Header(stream);//0 + Markers = stream.ReadSerializedData(); //28 stream.Position += 4; NoSpawns = stream.ReadSerializedData(); //96 stream.Position += (15 * 4); - this.AABB = new AABB(stream); //160 + AABB = new AABB(stream); //160 //stream.Position += (14 * 4); int i0 = stream.ReadValueS32(); //184 @@ -38,11 +38,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats //this.ContainsActorLocations = false; throw new System.Exception("Farmy thought this field is a bool, but apparently its not"); else - this.ContainsActorLocations = i0 == 1; + ContainsActorLocations = i0 == 1; - this.NLabel = stream.ReadValueS32(); //200 - this.SpecialIndexCount = stream.ReadValueS32(); //204 - this.SpecialIndexList = stream.ReadSerializedShorts(); //208 + NLabel = stream.ReadValueS32(); //200 + SpecialIndexCount = stream.ReadValueS32(); //204 + SpecialIndexList = stream.ReadSerializedShorts(); //208 stream.Close(); } } @@ -59,14 +59,14 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(128, true); - this.Type = (MarkerType)stream.ReadValueS32(); - this.PRTransform = new PRTransform(stream); - this.SNOHandle = new SNOHandle(stream); - this.TagMap = stream.ReadSerializedItem(); + Name = stream.ReadString(128, true); + Type = (MarkerType)stream.ReadValueS32(); + PRTransform = new PRTransform(stream); + SNOHandle = new SNOHandle(stream); + TagMap = stream.ReadSerializedItem(); stream.Position += 8; - this.MarkerLinksCount = stream.ReadValueS32(); - this.MarkerLinks = stream.ReadSerializedData(); + MarkerLinksCount = stream.ReadValueS32(); + MarkerLinks = stream.ReadSerializedData(); stream.Position += (3 * 4); } @@ -95,8 +95,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.String1 = stream.ReadString(128, true); - this.String2 = stream.ReadString(128, true); + String1 = stream.ReadString(128, true); + String2 = stream.ReadString(128, true); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Monster.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Monster.cs index 6eab9bf..4d89ef8 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Monster.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Monster.cs @@ -76,17 +76,17 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Monster(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.Flags = stream.ReadValueS32(); //12 - this.ActorSNO = stream.ReadValueS32(); //16 - this.LookIndex = stream.ReadValueS32(); //20 - this.Type = (MonsterType)stream.ReadValueS32(); //40 - 24 - this.Race = (MonsterRace)stream.ReadValueS32(); //44 - 28 - this.Size = (MonsterSize)stream.ReadValueS32(); //48 - 32 - this.Monsterdef = new MonsterDef(stream); //52 - 36 - this.Resists = (Resistance)stream.ReadValueS32(); //56 - this.DefaultCountMin = stream.ReadValueS32(); //60 - this.DefaultCountDelta = stream.ReadValueS32(); //64 + Header = new Header(stream); + Flags = stream.ReadValueS32(); //12 + ActorSNO = stream.ReadValueS32(); //16 + LookIndex = stream.ReadValueS32(); //20 + Type = (MonsterType)stream.ReadValueS32(); //40 - 24 + Race = (MonsterRace)stream.ReadValueS32(); //44 - 28 + Size = (MonsterSize)stream.ReadValueS32(); //48 - 32 + Monsterdef = new MonsterDef(stream); //52 - 36 + Resists = (Resistance)stream.ReadValueS32(); //56 + DefaultCountMin = stream.ReadValueS32(); //60 + DefaultCountDelta = stream.ReadValueS32(); //64 AttributeModifiers = new float[146]; //68 for (int i = 0; i < 146; i++) { @@ -99,90 +99,90 @@ namespace DiIiS_NA.Core.MPQ.FileFormats HPMinion = stream.ReadValueF32(); HPDeltaMinion = stream.ReadValueF32(); //672 - this.GoldGranted = stream.ReadValueS32(); - this.HealthDropNormal = new HealthDropInfo(stream); - this.HealthDropChampion = new HealthDropInfo(stream); - this.HealthDropRare = new HealthDropInfo(stream); - this.HealthDropMinion = new HealthDropInfo(stream); + GoldGranted = stream.ReadValueS32(); + HealthDropNormal = new HealthDropInfo(stream); + HealthDropChampion = new HealthDropInfo(stream); + HealthDropRare = new HealthDropInfo(stream); + HealthDropMinion = new HealthDropInfo(stream); // 716 - this.SNOSkillKit = stream.ReadValueS32(); - this.SkillDeclarations = new SkillDeclaration[8]; + SNOSkillKit = stream.ReadValueS32(); + SkillDeclarations = new SkillDeclaration[8]; for (int i = 0; i < 8; i++) { - this.SkillDeclarations[i] = new SkillDeclaration(stream); + SkillDeclarations[i] = new SkillDeclaration(stream); } - this.MonsterSkillDeclarations = new MonsterSkillDeclaration[8]; + MonsterSkillDeclarations = new MonsterSkillDeclaration[8]; for (int i = 0; i < 8; i++) { - this.MonsterSkillDeclarations[i] = new MonsterSkillDeclaration(stream); + MonsterSkillDeclarations[i] = new MonsterSkillDeclaration(stream); } // 912 - this.SNOTreasureClassFirstKill = stream.ReadValueS32(); - this.SNOTreasureClass = stream.ReadValueS32(); - this.SNOTreasureClassRare = stream.ReadValueS32(); - this.SNOTreasureClassChampion = stream.ReadValueS32(); - this.SNOTreasureClassChampionLight = stream.ReadValueS32(); + SNOTreasureClassFirstKill = stream.ReadValueS32(); + SNOTreasureClass = stream.ReadValueS32(); + SNOTreasureClassRare = stream.ReadValueS32(); + SNOTreasureClassChampion = stream.ReadValueS32(); + SNOTreasureClassChampionLight = stream.ReadValueS32(); // 932 - this.NoDropScalar = stream.ReadValueF32(); - this.FleeChance = stream.ReadValueF32(); - this.FleeCooldownMin = stream.ReadValueF32(); - this.FleeCooldownDelta = stream.ReadValueF32(); - this.SummonCountPer = stream.ReadValueS32(); - this.SummonLifetime = stream.ReadValueF32(); - this.SummonMaxConcurrent = stream.ReadValueS32(); - this.SummonMaxTotal = stream.ReadValueS32(); - this.SNOInventory = stream.ReadValueS32(); //3D0 - 976 + 28 =1004 - this.SNOSecondaryInventory = stream.ReadValueS32(); - this.SNOLore = stream.ReadValueS32(); - this.AIBehavior = new int[6]; + NoDropScalar = stream.ReadValueF32(); + FleeChance = stream.ReadValueF32(); + FleeCooldownMin = stream.ReadValueF32(); + FleeCooldownDelta = stream.ReadValueF32(); + SummonCountPer = stream.ReadValueS32(); + SummonLifetime = stream.ReadValueF32(); + SummonMaxConcurrent = stream.ReadValueS32(); + SummonMaxTotal = stream.ReadValueS32(); + SNOInventory = stream.ReadValueS32(); //3D0 - 976 + 28 =1004 + SNOSecondaryInventory = stream.ReadValueS32(); + SNOLore = stream.ReadValueS32(); + AIBehavior = new int[6]; for (int i = 0; i < 6; i++) { - this.AIBehavior[i] = stream.ReadValueS32(); + AIBehavior[i] = stream.ReadValueS32(); } - this.GBIdMovementStyles = new int[8]; + GBIdMovementStyles = new int[8]; for (int i = 0; i < 8; i++) { - this.GBIdMovementStyles[i] = stream.ReadValueS32(); + GBIdMovementStyles[i] = stream.ReadValueS32(); } - this.SNOSummonActor = new int[6]; + SNOSummonActor = new int[6]; for (int i = 0; i < 6; i++) { - this.SNOSummonActor[i] = stream.ReadValueS32(); + SNOSummonActor[i] = stream.ReadValueS32(); } - this.RandomAffixes = stream.ReadValueS32(); + RandomAffixes = stream.ReadValueS32(); GBIdAffixes = new int[4]; for (int i = 0; i < 4; i++) { - this.GBIdAffixes[i] = stream.ReadValueS32(); + GBIdAffixes[i] = stream.ReadValueS32(); } GBIdDisallowedAffixes = new int[6]; for (int i = 0; i < 6; i++) { - this.GBIdDisallowedAffixes[i] = stream.ReadValueS32(); + GBIdDisallowedAffixes[i] = stream.ReadValueS32(); } // 1096 - this.AITargetStyleNormal = stream.ReadValueS32(); - this.AITargetStyleChampion = stream.ReadValueS32(); - this.AITargetStyleRare = stream.ReadValueS32(); - this.PowerType = (MonsterPowerType)stream.ReadValueS32(); //1152 + AITargetStyleNormal = stream.ReadValueS32(); + AITargetStyleChampion = stream.ReadValueS32(); + AITargetStyleRare = stream.ReadValueS32(); + PowerType = (MonsterPowerType)stream.ReadValueS32(); //1152 //0x468 stream.Position += (3 * 4); - this.TagMap = stream.ReadSerializedItem(); //1180 + TagMap = stream.ReadSerializedItem(); //1180 stream.Position = 1196; - this.MinionSpawnGroupCount = stream.ReadValueS32(); //1196 + MinionSpawnGroupCount = stream.ReadValueS32(); //1196 stream.Position += (3 * 4); - this.MonsterMinionSpawngroup = stream.ReadSerializedData(); //1212 - this.ChampionSpawnGroupCount = stream.ReadValueS32(); //1220 - this.MonsterChampionSpawngroup = stream.ReadSerializedData(); //1236 - this.Name = stream.ReadString(128, true); //1244 - this.DoesNotDropNecroCorpse = stream.ReadValueS32(); //1344 - this.Pad = stream.ReadValueS32(); //1344 - this.snoAIStateAttackerCapReached = stream.ReadValueS32(); + MonsterMinionSpawngroup = stream.ReadSerializedData(); //1212 + ChampionSpawnGroupCount = stream.ReadValueS32(); //1220 + MonsterChampionSpawngroup = stream.ReadSerializedData(); //1236 + Name = stream.ReadString(128, true); //1244 + DoesNotDropNecroCorpse = stream.ReadValueS32(); //1344 + Pad = stream.ReadValueS32(); //1344 + snoAIStateAttackerCapReached = stream.ReadValueS32(); stream.Close(); @@ -195,8 +195,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public List SpawnItems = new List(); public void Read(MpqFileStream stream) { - this.Weight = stream.ReadValueF32(); - this.SpawnItemCount = stream.ReadValueS32(); + Weight = stream.ReadValueF32(); + SpawnItemCount = stream.ReadValueS32(); stream.Position += 8; SpawnItems = stream.ReadSerializedData(); } @@ -209,8 +209,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public List SpawnItems = new List(); public void Read(MpqFileStream stream) { - this.Weight = stream.ReadValueF32(); - this.SpawnItemCount = stream.ReadValueS32(); + Weight = stream.ReadValueF32(); + SpawnItemCount = stream.ReadValueS32(); stream.Position += 8; SpawnItems = stream.ReadSerializedData(); } @@ -226,11 +226,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOSpawn = stream.ReadValueS32(); - this.SpawnCountMin = stream.ReadValueS32(); - this.SpawnCountMax = stream.ReadValueS32(); - this.SpawnSpreadMin = stream.ReadValueS32(); - this.SpawnSpreadMax = stream.ReadValueS32(); + SNOSpawn = stream.ReadValueS32(); + SpawnCountMin = stream.ReadValueS32(); + SpawnCountMax = stream.ReadValueS32(); + SpawnSpreadMin = stream.ReadValueS32(); + SpawnSpreadMax = stream.ReadValueS32(); } } @@ -241,8 +241,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SnoActor = stream.ReadValueS32(); - this.SpawnCount = stream.ReadValueS32(); + SnoActor = stream.ReadValueS32(); + SpawnCount = stream.ReadValueS32(); } } @@ -311,9 +311,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public HealthDropInfo(MpqFileStream stream) { - this.DropChance = stream.ReadValueF32(); - this.GBID = stream.ReadValueS32(); - this.HealthDropStyle = stream.ReadValueS32(); + DropChance = stream.ReadValueF32(); + GBID = stream.ReadValueS32(); + HealthDropStyle = stream.ReadValueS32(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Music.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Music.cs index 2c4c2eb..ca0b597 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Music.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Music.cs @@ -18,7 +18,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); stream.Close(); diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Observer.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Observer.cs index 1b9275a..124160f 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Observer.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Observer.cs @@ -38,23 +38,23 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Observer(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); - this.Angle0 = stream.ReadValueF32(); - this.F1 = stream.ReadValueF32(); - this.Velocity = stream.ReadValueF32(); - this.F8 = stream.ReadValueF32(); - this.Angle1 = stream.ReadValueF32(); - this.Angle2 = stream.ReadValueF32(); - this.F2 = stream.ReadValueF32(); - this.V0 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); - this.V1 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); - this.F3 = stream.ReadValueF32(); - this.F4 = stream.ReadValueF32(); - this.F5 = stream.ReadValueF32(); - this.F6 = stream.ReadValueF32(); - this.F7 = stream.ReadValueF32(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + Angle0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + Velocity = stream.ReadValueF32(); + F8 = stream.ReadValueF32(); + Angle1 = stream.ReadValueF32(); + Angle2 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + V0 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + V1 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + F6 = stream.ReadValueF32(); + F7 = stream.ReadValueF32(); stream.Close(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/PhysMesh.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/PhysMesh.cs index faec841..5cca11b 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/PhysMesh.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/PhysMesh.cs @@ -21,13 +21,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public PhysMesh(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); //0 + Header = new Header(stream); //0 //+16 - this.I0 = stream.ReadValueS32(); //28 - this.CollisionMeshCount = stream.ReadValueS32(); //32 - this.CollisionMeshes = stream.ReadSerializedData(); //36 + I0 = stream.ReadValueS32(); //28 + CollisionMeshCount = stream.ReadValueS32(); //32 + CollisionMeshes = stream.ReadSerializedData(); //36 stream.Position += 12; - this.I1 = stream.ReadValueS32(); //26 + I1 = stream.ReadValueS32(); //26 stream.Close(); } } @@ -53,21 +53,21 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { //64 stream.Position += (4 * 6); - this.F0 = new Float3(stream); //88 - this.F1 = new Float3(stream); //100 - this.F2 = new Float3(stream); //112 - this.DominoNodeCount = stream.ReadValueS32(); //124 - this.VerticeCount = stream.ReadValueS32(); //128 - this.DominoTriangleCount = stream.ReadValueS32(); //132 - this.DominoEdgeCount = stream.ReadValueS32(); //136 + F0 = new Float3(stream); //88 + F1 = new Float3(stream); //100 + F2 = new Float3(stream); //112 + DominoNodeCount = stream.ReadValueS32(); //124 + VerticeCount = stream.ReadValueS32(); //128 + DominoTriangleCount = stream.ReadValueS32(); //132 + DominoEdgeCount = stream.ReadValueS32(); //136 stream.Position += 4; - this.Vertices = stream.ReadSerializedData(); //96 - 160 - this.DominoTriangles = stream.ReadSerializedData(); //104 - 168 - this.DominoNodes = stream.ReadSerializedData(); //112 - 176 + Vertices = stream.ReadSerializedData(); //96 - 160 + DominoTriangles = stream.ReadSerializedData(); //104 - 168 + DominoNodes = stream.ReadSerializedData(); //112 - 176 //stream.Position += 4 * 2; - this.I6 = stream.ReadValueS32(); //120 - 184 - this.I7 = stream.ReadValueS32(); //124 - 188 + I6 = stream.ReadValueS32(); //120 - 184 + I7 = stream.ReadValueS32(); //124 - 188 //176 } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Power.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Power.cs index cdce359..2e2367b 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Power.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Power.cs @@ -27,7 +27,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Power(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); LuaName = stream.ReadString(64, true); //28 stream.Position += 4; // Powerdef = new PowerDef(stream); //108 diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/QuestRange.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/QuestRange.cs index ce32f4b..63ee85f 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/QuestRange.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/QuestRange.cs @@ -25,12 +25,12 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public QuestRange(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); //0 - this.Pull = stream.ReadValueS32(); //12 + 16 = 28 - this.I1 = stream.ReadValueS32(); //12 + 16 = 28 - this.I2 = stream.ReadValueS32(); //12 + 16 = 28 - this.I3 = stream.ReadValueS32(); //12 + 16 = 28 - this.I4 = stream.ReadValueS32(); //12 + 16 = 28 + Header = new Header(stream); //0 + Pull = stream.ReadValueS32(); //12 + 16 = 28 + I1 = stream.ReadValueS32(); //12 + 16 = 28 + I2 = stream.ReadValueS32(); //12 + 16 = 28 + I3 = stream.ReadValueS32(); //12 + 16 = 28 + I4 = stream.ReadValueS32(); //12 + 16 = 28 Enitys = new QuestTimeEntity[20]; for (int i = 0; stream.Position < stream.Length; i++) { @@ -59,8 +59,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public QuestTime(MpqFileStream stream) { - this.SNOQuest = stream.ReadValueS32(); - this.StepID = stream.ReadValueS32(); + SNOQuest = stream.ReadValueS32(); + StepID = stream.ReadValueS32(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Recipe.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Recipe.cs index 72eaf35..f0f5a84 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Recipe.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Recipe.cs @@ -14,7 +14,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Recipe(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); ItemSpecifierData = new ItemSpecifierData(stream); stream.Close(); } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Rope.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Rope.cs index ac7a0ec..560a993 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Rope.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Rope.cs @@ -58,9 +58,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Rope(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.F0 = stream.ReadValueF32(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); stream.Close(); } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Scene.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Scene.cs index 5152164..712352e 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Scene.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Scene.cs @@ -34,41 +34,41 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Scene(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); ///+16 Int0 = stream.ReadValueS32(); //12 - 28 - this.AABBBounds = new AABB(stream); //16 - 32 - this.AABBMarketSetBounds = new AABB(stream); //40 - 56 - this.NavMesh = new NavMeshDef(stream); //64 - 80 - this.Exclusions = stream.ReadSerializedInts(); //104 - 120 + AABBBounds = new AABB(stream); //16 - 32 + AABBMarketSetBounds = new AABB(stream); //40 - 56 + NavMesh = new NavMeshDef(stream); //64 - 80 + Exclusions = stream.ReadSerializedInts(); //104 - 120 stream.Position += (14 * 4); - this.Inclusions = stream.ReadSerializedInts(); //168 - 184 + Inclusions = stream.ReadSerializedInts(); //168 - 184 stream.Position += (14 * 4); - this.MarkerSets = stream.ReadSerializedInts(); //232 - 248 + MarkerSets = stream.ReadSerializedInts(); //232 - 248 stream.Position += (14 * 4); - this.LookLink = stream.ReadString(64, true); //296 - 312 + LookLink = stream.ReadString(64, true); //296 - 312 //stream.Position += (14 * 4; - this.MsgTriggeredEvent = stream.ReadSerializedData(); //360 - 376 - this.Int1 = stream.ReadValueS32(); //368 - 384 + MsgTriggeredEvent = stream.ReadSerializedData(); //360 - 376 + Int1 = stream.ReadValueS32(); //368 - 384 stream.Position += (3 * 4); - this.NavZone = new NavZoneDef(stream); //384 - 400 - this.SNOAppearance = stream.ReadValueS32(); //520 - 536 + NavZone = new NavZoneDef(stream); //384 - 400 + SNOAppearance = stream.ReadValueS32(); //520 - 536 stream.Position += 4; - this.SNOPhysMesh = stream.ReadValueS32(); //528 - 544 + SNOPhysMesh = stream.ReadValueS32(); //528 - 544 stream.Close(); - this.NoSpawn = false; + NoSpawn = false; int NoSpawnSquares = 0; - foreach (var zone in this.NavMesh.Squares) + foreach (var zone in NavMesh.Squares) { - if (!((zone.Flags & DiIiS_NA.Core.MPQ.FileFormats.Scene.NavCellFlags.NoSpawn) == 0)) + if (!((zone.Flags & NavCellFlags.NoSpawn) == 0)) { NoSpawnSquares++; } } - if ((this.NavMesh.Squares.Count - NoSpawnSquares) < (this.NavMesh.Squares.Count / 10)) this.NoSpawn = true; + if ((NavMesh.Squares.Count - NoSpawnSquares) < (NavMesh.Squares.Count / 10)) NoSpawn = true; } public class NavMeshDef @@ -85,12 +85,12 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public NavMeshDef(MpqFileStream stream) { - this.SquaresCountX = stream.ReadValueS32(); - this.SquaresCountY = stream.ReadValueS32(); - this.Int0 = stream.ReadValueS32(); - this.NavMeshSquareCount = stream.ReadValueS32(); - this.Float0 = stream.ReadValueF32(); - this.Squares = stream.ReadSerializedData(); + SquaresCountX = stream.ReadValueS32(); + SquaresCountY = stream.ReadValueS32(); + Int0 = stream.ReadValueS32(); + NavMeshSquareCount = stream.ReadValueS32(); + Float0 = stream.ReadValueF32(); + Squares = stream.ReadSerializedData(); if (SquaresCountX <= 64 && SquaresCountY <= 64) @@ -118,7 +118,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats // Loop thru each NavmeshSquare in the array, and fills the grid for (int i = 0; i < NavMeshSquareCount; i++) { - WalkGrid[i % SquaresCountX, i / SquaresCountY] = (byte)(Squares[i].Flags & Scene.NavCellFlags.AllowWalk); + WalkGrid[i % SquaresCountX, i / SquaresCountY] = (byte)(Squares[i].Flags & NavCellFlags.AllowWalk); // Set the grid to 0x1 if its walkable, left as 0 if not. - DarkLotus } @@ -145,29 +145,29 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public NavZoneDef(MpqFileStream stream) { - this.NavCellCount = stream.ReadValueS32(); + NavCellCount = stream.ReadValueS32(); stream.Position += (3 * 4); - this.NavCells = stream.ReadSerializedData(); + NavCells = stream.ReadSerializedData(); - this.NeighbourCount = stream.ReadValueS32(); + NeighbourCount = stream.ReadValueS32(); stream.Position += (3 * 4); - this.NavCellNeighbours = stream.ReadSerializedData(); + NavCellNeighbours = stream.ReadSerializedData(); - this.Float0 = stream.ReadValueF32(); - this.Float1 = stream.ReadValueF32(); - this.Int2 = stream.ReadValueS32(); - this.V0 = new Vector2D(stream); + Float0 = stream.ReadValueF32(); + Float1 = stream.ReadValueF32(); + Int2 = stream.ReadValueS32(); + V0 = new Vector2D(stream); stream.Position += (3 * 4); - this.GridSquares = stream.ReadSerializedData(); + GridSquares = stream.ReadSerializedData(); - this.Int3 = stream.ReadValueS32(); + Int3 = stream.ReadValueS32(); stream.Position += (3 * 4); - this.CellLookups = stream.ReadSerializedData(); + CellLookups = stream.ReadSerializedData(); - this.BorderDataCount = stream.ReadValueS32(); + BorderDataCount = stream.ReadValueS32(); stream.Position += (3 * 4); - this.BorderData = stream.ReadSerializedData(); + BorderData = stream.ReadSerializedData(); } } @@ -178,8 +178,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Z = stream.ReadValueF32(); - this.Flags = (NavCellFlags)stream.ReadValueS32(); + Z = stream.ReadValueF32(); + Flags = (NavCellFlags)stream.ReadValueS32(); } } @@ -193,11 +193,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public RectangleF Bounds { get { return new RectangleF(Min.X, Min.Y, Max.X - Min.X, Max.Y - Min.Y); } } public void Read(MpqFileStream stream) { - this.Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); - this.Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); - this.Flags = (NavCellFlags)stream.ReadValueS16(); - this.NeighbourCount = stream.ReadValueS16(); - this.NeighborsIndex = stream.ReadValueS32(); + Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + Flags = (NavCellFlags)stream.ReadValueS16(); + NeighbourCount = stream.ReadValueS16(); + NeighborsIndex = stream.ReadValueS32(); } } @@ -232,8 +232,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Flags = stream.ReadValueS16(); - this.WCell = stream.ReadValueS16(); + Flags = stream.ReadValueS16(); + WCell = stream.ReadValueS16(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/SceneGroup.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/SceneGroup.cs index 0e2fc72..9755fbe 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/SceneGroup.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/SceneGroup.cs @@ -18,11 +18,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public SceneGroup(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.I0 = stream.ReadValueS32(); - this.Items = stream.ReadSerializedData(); + Header = new Header(stream); + I0 = stream.ReadValueS32(); + Items = stream.ReadSerializedData(); stream.Position += 8; - this.I1 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); stream.Close(); } } @@ -35,9 +35,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOScene = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.LabelGBId = stream.ReadValueS32(); + SNOScene = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + LabelGBId = stream.ReadValueS32(); } } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/SkillKit.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/SkillKit.cs index 73572ab..13c2ceb 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/SkillKit.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/SkillKit.cs @@ -17,11 +17,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public SkillKit(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); stream.Position += 12; - this.TraitEntries = stream.ReadSerializedData(); + TraitEntries = stream.ReadSerializedData(); stream.Position += 8; - this.ActiveSkillEntries = stream.ReadSerializedData(); + ActiveSkillEntries = stream.ReadSerializedData(); stream.Close(); } @@ -35,10 +35,10 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public int I0 { get; private set; } public void Read(MpqFileStream stream) { - this.SNOPower = stream.ReadValueS32(); - this.Category = stream.ReadValueS32(); - this.ReqLevel = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); + SNOPower = stream.ReadValueS32(); + Category = stream.ReadValueS32(); + ReqLevel = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); } } @@ -59,18 +59,18 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOPower = stream.ReadValueS32(); - this.Category = (ActiveSkillCategory)stream.ReadValueS32(); - this.SkillGroup = stream.ReadValueS32(); - this.ReqLevel = stream.ReadValueS32(); - this.RuneNone_ReqLevel = stream.ReadValueS32(); - this.RuneA_ReqLevel = stream.ReadValueS32(); - this.RuneB_ReqLevel = stream.ReadValueS32(); - this.RuneC_ReqLevel = stream.ReadValueS32(); - this.RuneD_ReqLevel = stream.ReadValueS32(); - this.RuneE_ReqLevel = stream.ReadValueS32(); - this.I0 = stream.ReadValueS32(); - this.I1 = new int[5]; + SNOPower = stream.ReadValueS32(); + Category = (ActiveSkillCategory)stream.ReadValueS32(); + SkillGroup = stream.ReadValueS32(); + ReqLevel = stream.ReadValueS32(); + RuneNone_ReqLevel = stream.ReadValueS32(); + RuneA_ReqLevel = stream.ReadValueS32(); + RuneB_ReqLevel = stream.ReadValueS32(); + RuneC_ReqLevel = stream.ReadValueS32(); + RuneD_ReqLevel = stream.ReadValueS32(); + RuneE_ReqLevel = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = new int[5]; for (int i = 0; i < I1.Length; i++) I1[i] = stream.ReadValueS32(); } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Tutorial.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Tutorial.cs index aaa78cf..de81edd 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Tutorial.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Tutorial.cs @@ -24,15 +24,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public Tutorial(MpqFile file) { var stream = file.Open(); - this.Header = new Header(stream); - this.Flags = stream.ReadValueS32(); - this.Label = stream.ReadValueS32(); - this.TimeBeforeFading = stream.ReadValueS32(); - this.RecurTime = stream.ReadValueS32(); - this.OccurrencesUntilLearned = stream.ReadValueS32(); - this.ArrowPosition = stream.ReadValueS32(); - this.Offset = new Vector2D(stream); - this.Pad = stream.ReadValueS32(); + Header = new Header(stream); + Flags = stream.ReadValueS32(); + Label = stream.ReadValueS32(); + TimeBeforeFading = stream.ReadValueS32(); + RecurTime = stream.ReadValueS32(); + OccurrencesUntilLearned = stream.ReadValueS32(); + ArrowPosition = stream.ReadValueS32(); + Offset = new Vector2D(stream); + Pad = stream.ReadValueS32(); stream.Close(); } } diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Types/Common.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Types/Common.cs index 75f798d..3c3cb42 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Types/Common.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Types/Common.cs @@ -20,13 +20,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats.Types public Header(MpqFileStream stream) { - this.DeadBeef = stream.ReadValueS32(); - this.SnoType = stream.ReadValueS32(); - this.Unknown1 = stream.ReadValueS32(); - this.Unknown2 = stream.ReadValueS32(); - this.SNOId = stream.ReadValueS32(); - this.Unknown3 = stream.ReadValueS32(); - this.Unknown4 = stream.ReadValueS32(); + DeadBeef = stream.ReadValueS32(); + SnoType = stream.ReadValueS32(); + Unknown1 = stream.ReadValueS32(); + Unknown2 = stream.ReadValueS32(); + SNOId = stream.ReadValueS32(); + Unknown3 = stream.ReadValueS32(); + Unknown4 = stream.ReadValueS32(); } } @@ -66,15 +66,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats.Types public ScriptFormula(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.I1 = stream.ReadValueS32(); - this.I2 = stream.ReadValueS32(); - this.I3 = stream.ReadValueS32(); - this.I4 = stream.ReadValueS32(); - this.NameSize = stream.ReadValueS32(); - this.I5 = stream.ReadValueS32(); - this.OpcodeSize = stream.ReadValueS32(); - this.OpCodeName = stream.ReadStringZ(Encoding.ASCII); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + NameSize = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + OpcodeSize = stream.ReadValueS32(); + OpCodeName = stream.ReadStringZ(Encoding.ASCII); switch (NameSize % 4) { @@ -91,7 +91,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats.Types break; } - this.OpCodeArray = new byte[OpcodeSize]; + OpCodeArray = new byte[OpcodeSize]; stream.Read(OpCodeArray, 0, OpcodeSize); } @@ -125,7 +125,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats.Types public HardPointLink(MpqFileStream stream) { - this.Name = stream.ReadString(64, true); + Name = stream.ReadString(64, true); I0 = stream.ReadValueS32(); } } @@ -271,8 +271,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats.Types HardPointLinks = new HardPointLink[2]; HardPointLinks[0] = new HardPointLink(stream); HardPointLinks[1] = new HardPointLink(stream); - this.LookLink = stream.ReadString(64, true); - this.ConstraintLink = stream.ReadString(64, true); + LookLink = stream.ReadString(64, true); + ConstraintLink = stream.ReadString(64, true); AnimTag = stream.ReadValueS32(); Alpha = stream.ReadValueF32(); MsgPassMethod = stream.ReadValueS32(); diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/Weather.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/Weather.cs index 68c3025..4c23abe 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/Weather.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/Weather.cs @@ -45,7 +45,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); stream.Close(); diff --git a/src/DiIiS-NA/Core/MPQ/FileFormats/World.cs b/src/DiIiS-NA/Core/MPQ/FileFormats/World.cs index b51f0c9..9d88943 100644 --- a/src/DiIiS-NA/Core/MPQ/FileFormats/World.cs +++ b/src/DiIiS-NA/Core/MPQ/FileFormats/World.cs @@ -43,14 +43,14 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { var stream = file.Open(); - this.Header = new Header(stream); + Header = new Header(stream); - this.DynamicWorld = (stream.ReadValueS32() != 0); + DynamicWorld = (stream.ReadValueS32() != 0); stream.Position += 8; - this.ServerData = stream.ReadSerializedData(); //16 - this.MarkerSets = stream.ReadSerializedInts(); //40 + ServerData = stream.ReadSerializedData(); //16 + MarkerSets = stream.ReadSerializedInts(); //40 - this.Environment = new Environment(stream); //96 - 56 + Environment = new Environment(stream); //96 - 56 // - 56 DeformationScale = stream.ReadValueF32(); //172 Flags = stream.ReadValueS32(); //176 @@ -78,8 +78,8 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SceneChunks = stream.ReadSerializedData(); - this.ChunkCount = stream.ReadValueS32(); + SceneChunks = stream.ReadSerializedData(); + ChunkCount = stream.ReadValueS32(); stream.Position += (3 * 4); } @@ -103,9 +103,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOHandle = new SNOHandle(stream); - this.PRTransform = new PRTransform(stream); - this.SceneSpecification = new SceneSpecification(stream); + SNOHandle = new SNOHandle(stream); + PRTransform = new PRTransform(stream); + SceneSpecification = new SceneSpecification(stream); } } @@ -162,14 +162,14 @@ namespace DiIiS_NA.Core.MPQ.FileFormats Tiles = stream.ReadSerializedData(); stream.Position += (14 * 4); - this.CommandCount = stream.ReadValueS32(); - this.Commands = stream.ReadSerializedData(); + CommandCount = stream.ReadValueS32(); + Commands = stream.ReadSerializedData(); stream.Position += (3 * 4); - this.ParentIndices = stream.ReadSerializedInts(); + ParentIndices = stream.ReadSerializedInts(); stream.Position += (2 * 4); - this.TagMap = stream.ReadSerializedItem(); + TagMap = stream.ReadSerializedItem(); stream.Position += (2 * 4); } } @@ -219,7 +219,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats TileType = stream.ReadValueS32(); SNOScene = stream.ReadValueS32(); Probability = stream.ReadValueS32(); - this.TagMap = stream.ReadSerializedItem(); + TagMap = stream.ReadSerializedItem(); stream.Position += (2 * 4); CustomTileInfo = new CustomTileInfo(stream); @@ -249,9 +249,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(128, true); + Name = stream.ReadString(128, true); CommandType = stream.ReadValueS32(); - this.TagMap = stream.ReadSerializedItem(); + TagMap = stream.ReadSerializedItem(); stream.Position += (3 * 4); } } @@ -338,9 +338,9 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public SceneClusterSet(MpqFileStream stream) { - this.ClusterCount = stream.ReadValueS32(); + ClusterCount = stream.ReadValueS32(); stream.Position += (4 * 3); - this.SceneClusters = stream.ReadSerializedData(); + SceneClusters = stream.ReadSerializedData(); } } @@ -371,13 +371,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(128, true); - this.ClusterId = stream.ReadValueS32(); - this.GroupCount = stream.ReadValueS32(); + Name = stream.ReadString(128, true); + ClusterId = stream.ReadValueS32(); + GroupCount = stream.ReadValueS32(); stream.Position += (2 * 4); - this.SubSceneGroups = stream.ReadSerializedData(); + SubSceneGroups = stream.ReadSerializedData(); - this.Default = new SubSceneGroup(stream); + Default = new SubSceneGroup(stream); } } @@ -394,15 +394,15 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public SubSceneGroup(MpqFileStream stream) { - this.Read(stream); + Read(stream); } public void Read(MpqFileStream stream) { - this.I0 = stream.ReadValueS32(); - this.SubSceneCount = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + SubSceneCount = stream.ReadValueS32(); stream.Position += (2 * 4); - this.Entries = stream.ReadSerializedData(); + Entries = stream.ReadSerializedData(); } } @@ -429,11 +429,11 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.SNOScene = stream.ReadValueS32(); - this.Probability = stream.ReadValueS32(); + SNOScene = stream.ReadValueS32(); + Probability = stream.ReadValueS32(); stream.Position += (3 * 4); - this.LabelCount = stream.ReadValueS32(); - this.Labels = stream.ReadSerializedData(); + LabelCount = stream.ReadValueS32(); + Labels = stream.ReadSerializedData(); } } @@ -468,7 +468,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats { Rulecount = stream.ReadValueS32(); stream.Position += (3 * 4); - this.LabelRules = stream.ReadSerializedData(); + LabelRules = stream.ReadSerializedData(); } } @@ -489,12 +489,12 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.Name = stream.ReadString(128, true); + Name = stream.ReadString(128, true); LabelCondition = new LabelCondition(stream); NumToChoose = stream.ReadValueS32(); LabelCount = stream.ReadValueS32(); stream.Position += (2 * 4); - this.Entries = stream.ReadSerializedData(); + Entries = stream.ReadSerializedData(); } } @@ -515,7 +515,7 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { - this.GBIdLabel = stream.ReadValueS32(); + GBIdLabel = stream.ReadValueS32(); Int0 = stream.ReadValueS32(); Weight = stream.ReadValueF32(); ApplyCountMin = stream.ReadValueS32(); @@ -633,13 +633,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats public void Read(MpqFileStream stream) { //stream.Position += 8; - this.DRLGParams = stream.ReadSerializedData(); + DRLGParams = stream.ReadSerializedData(); stream.Position += 8; - this.SceneParams = stream.ReadSerializedItem(); + SceneParams = stream.ReadSerializedItem(); //stream.Position += 8; LabelRuleSet = new LabelRuleSet(stream); - this.Int1 = stream.ReadValueS32(); - this.SceneClusterSet = new SceneClusterSet(stream); + Int1 = stream.ReadValueS32(); + SceneClusterSet = new SceneClusterSet(stream); for (int i = 0; i < SNONavMeshFunctions.Length; i++) { SNONavMeshFunctions[i] = stream.ReadValueS32(); diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/QuestManager.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/QuestManager.cs index 189686e..e74c778 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/QuestManager.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/GameSystem/QuestManager.cs @@ -908,13 +908,13 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem AdditionalTargetCounter++; foreach (var player in QuestManager.Game.Players.Values) { - List Scenes = new List(); + List scenes = new List(); int monsterCount = 0; foreach (var scene in QuestManager.Game.GetWorld(world).Scenes.Values) if (!scene.SceneSNO.Name.ToLower().Contains("filler")) if (scene.Specification.SNOLevelAreas[0] == LevelArea) { - Scenes.Add(scene); + scenes.Add(scene); foreach (var act in scene.Actors) if (act is Monster) monsterCount++; @@ -934,7 +934,7 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem { while (monsterCount < AdditionalTargetCounter + 20) { - GameServer.Core.Types.Math.Vector3D scenePoint = Scenes.PickRandom().Position; + GameServer.Core.Types.Math.Vector3D scenePoint = scenes.PickRandom().Position; GameServer.Core.Types.Math.Vector3D point = null; while (true) { diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/ActI.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/ActI.cs index f373dc6..e2e57bc 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/ActI.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/ActI.cs @@ -226,7 +226,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Rescue Cain - Game.QuestManager.Quests.Add(72095, new Quest { RewardXp = 3630, RewardGold = 190, Completed = false, Saveable = true, NextQuest = 72221, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(72095, new Quest { RewardXp = 3630, RewardGold = 190, Completed = false, Saveable = true, NextQuest = 72221}); Game.QuestManager.Quests[72095].Steps.Add(-1, new QuestStep { @@ -543,7 +543,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Shattered Crown - Game.QuestManager.Quests.Add(72221, new Quest { RewardXp = 900, RewardGold = 195, Completed = false, Saveable = true, NextQuest = 72061, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(72221, new Quest { RewardXp = 900, RewardGold = 195, Completed = false, Saveable = true, NextQuest = 72061}); Game.QuestManager.Quests[72221].Steps.Add(-1, new QuestStep { @@ -770,7 +770,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Reign of Black King - Game.QuestManager.Quests.Add(72061, new Quest { RewardXp = 5625, RewardGold = 810, Completed = false, Saveable = true, NextQuest = 117779, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(72061, new Quest { RewardXp = 5625, RewardGold = 810, Completed = false, Saveable = true, NextQuest = 117779}); Game.QuestManager.Quests[72061].Steps.Add(-1, new QuestStep { @@ -1137,7 +1137,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Tyrael Sword - Game.QuestManager.Quests.Add(117779, new Quest { RewardXp = 4125, RewardGold = 630, Completed = false, Saveable = true, NextQuest = 72738, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(117779, new Quest { RewardXp = 4125, RewardGold = 630, Completed = false, Saveable = true, NextQuest = 72738}); Game.QuestManager.Quests[117779].Steps.Add(-1, new QuestStep { @@ -1253,7 +1253,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Broken Blade - Game.QuestManager.Quests.Add(72738, new Quest { RewardXp = 6205, RewardGold = 1065, Completed = false, Saveable = true, NextQuest = 73236, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(72738, new Quest { RewardXp = 6205, RewardGold = 1065, Completed = false, Saveable = true, NextQuest = 73236}); Game.QuestManager.Quests[72738].Steps.Add(-1, new QuestStep { @@ -1590,7 +1590,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Doom of Vortham - Game.QuestManager.Quests.Add(73236, new Quest { RewardXp = 4950, RewardGold = 670, Completed = false, Saveable = true, NextQuest = 72546, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(73236, new Quest { RewardXp = 4950, RewardGold = 670, Completed = false, Saveable = true, NextQuest = 72546}); Game.QuestManager.Quests[73236].Steps.Add(-1, new QuestStep { @@ -1778,7 +1778,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region To the Black Cult - Game.QuestManager.Quests.Add(72546, new Quest { RewardXp = 8275, RewardGold = 455, Completed = false, Saveable = true, NextQuest = 72801, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(72546, new Quest { RewardXp = 8275, RewardGold = 455, Completed = false, Saveable = true, NextQuest = 72801}); Game.QuestManager.Quests[72546].Steps.Add(-1, new QuestStep { @@ -2008,7 +2008,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Captived Angel - Game.QuestManager.Quests.Add(72801, new Quest { RewardXp = 10925, RewardGold = 1465, Completed = false, Saveable = true, NextQuest = 136656, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(72801, new Quest { RewardXp = 10925, RewardGold = 1465, Completed = false, Saveable = true, NextQuest = 136656}); Game.QuestManager.Quests[72801].Steps.Add(-1, new QuestStep { @@ -2202,7 +2202,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem }); #endregion #region Return to New Tristram - Game.QuestManager.Quests.Add(136656, new Quest { RewardXp = 0, RewardGold = 0, Completed = false, Saveable = true, NextQuest = -1, Steps = new Dictionary { } }); + Game.QuestManager.Quests.Add(136656, new Quest { RewardXp = 0, RewardGold = 0, Completed = false, Saveable = true, NextQuest = -1}); Game.QuestManager.Quests[136656].Steps.Add(-1, new QuestStep { diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestProgress.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestProgress.cs index b04ae7e..3aeb5da 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestProgress.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/QuestSystem/QuestProgress.cs @@ -33,7 +33,7 @@ namespace DiIiS_NA.GameServer.GSSystem.QuestSystem public class Quest { public bool Completed; - public Dictionary Steps; + public Dictionary Steps = new(); public int NextQuest; public int RewardXp; public int RewardGold; diff --git a/src/DiIiS-NA/D3-GameServer/MessageSystem/Message/Definitions/Artisan/DyeItemMessage.cs b/src/DiIiS-NA/D3-GameServer/MessageSystem/Message/Definitions/Artisan/DyeItemMessage.cs index 4315cde..c5d43a4 100644 --- a/src/DiIiS-NA/D3-GameServer/MessageSystem/Message/Definitions/Artisan/DyeItemMessage.cs +++ b/src/DiIiS-NA/D3-GameServer/MessageSystem/Message/Definitions/Artisan/DyeItemMessage.cs @@ -35,7 +35,5 @@ namespace DiIiS_NA.GameServer.MessageSystem.Message.Definitions.Artisan b.Append(' ', --pad); b.AppendLine("}"); } - - } } diff --git a/src/DiIiS-NA/Extensions.cs b/src/DiIiS-NA/Extensions.cs index bcc26c7..a66938c 100644 --- a/src/DiIiS-NA/Extensions.cs +++ b/src/DiIiS-NA/Extensions.cs @@ -6,87 +6,5 @@ namespace DiIiS_NA { public static class Extensions { - /// - /// Transforms a timespan to a readable text. - /// E.g.: - /// 1 day, 2 hours, 3 minutes and 4 seconds - /// 5 hours, 6 minutes and 7 seconds - /// - /// If over certain threshold (millennium or more) it will only return the number of days. - /// - /// The timespan to be converted - /// The readable text - public static string ToText(this TimeSpan span) - { - List parts = new(); - - // if days are divided by 365, we have years, otherwise we have months or days - if (span.Days / 365 > 0) - { - // if days are divided by 365, we have years - parts.Add($"{((double)span.Days / 365):F} year{(span.Days / 365 > 1 ? "s" : "")}"); - // get months from the remaining days - int months = span.Days % 365 / 30; - if (months > 0) - parts.Add($"{months} month{(months > 1 ? "s" : "")}"); - - // get remaining days - int days = span.Days % 365 % 30; - if (days > 0) - parts.Add($"{days} day{(days > 1 ? "s" : "")}"); - } - else if (span.Days / 30 > 0) - { - // if days are divided by 30, we have months - parts.Add($"{((double)span.Days / 30):F} month{(span.Days / 30 > 1 ? "s" : "")}"); - // get remaining days - int days = span.Days % 30; - if (days > 0) - parts.Add($"{days} day{(days > 1 ? "s" : "")}"); - } - else if (span.Days > 0) - // if days are not divided by 365 or 30, we have days - parts.Add( $"{span.Days} day{(span.Days > 1 ? "s" : "")}"); - if (span.Hours > 0) - parts.Add($"{span.Hours} hour{(span.Hours > 1 ? "s" : "")}"); - if (span.Minutes > 0) - parts.Add($"{span.Minutes} minute{(span.Minutes > 1 ? "s" : "")}"); - if (span.Seconds > 0) - parts.Add($"{span.Seconds} second{(span.Seconds > 1 ? "s" : "")}"); - - var result = parts.ToArray(); - return string.Join(", ", result[..^1]) + (result.Length > 1 ? " and " : "") + parts[^1]; - } - - public static string ToSmallText(this TimeSpan span) - { - List parts = new(); - if (span.Days / 365 > 0) - { - parts.Add($"{((double)span.Days / 365):F}y"); - int months = span.Days % 365 / 30; - if (months > 0) - parts.Add($"{months}m"); - int days = span.Days % 365 % 30; - if (days > 0) - parts.Add($"{days}d"); - } - else if (span.Days / 30 > 0) - { - parts.Add($"{((double)span.Days / 30):F}m"); - int days = span.Days % 30; - if (days > 0) - parts.Add($"{days}d"); - } - else if (span.Days > 0) - parts.Add($"{span.Days}d"); - if (span.Hours > 0) - parts.Add($"{span.Hours}h"); - if (span.Minutes > 0) - parts.Add($"{span.Minutes}m"); - if (span.Seconds > 0) - parts.Add($"{span.Seconds}s"); - return string.Join(" ", parts); - } } } \ No newline at end of file