Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated The War Within db2 structures with generated ones #887

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions WowPacketParser/DBC/DBC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ await Task.WhenAll(Task.Run(() =>
}));
}

public static HashSet<ushort> GetPhaseGroups(ICollection<ushort> phases)
public static HashSet<int> GetPhaseGroups(ICollection<ushort> phases)
{
if (!phases.Any())
return new HashSet<ushort>();
return new HashSet<int>();

HashSet<ushort> phaseGroups = new HashSet<ushort>();
HashSet<int> phaseGroups = new HashSet<int>();

foreach (var phaseGroup in Phases)
{
Expand All @@ -229,6 +229,6 @@ public static HashSet<ushort> GetPhaseGroups(ICollection<ushort> phases)
public static readonly Dictionary<ushort, string> CriteriaStores = new Dictionary<ushort, string>();
public static readonly Dictionary<uint, FactionEntry> FactionStores = new Dictionary<uint, FactionEntry>();
public static readonly Dictionary<Tuple<uint, uint>, SpellEffectEntry> SpellEffectStores = new Dictionary<Tuple<uint, uint>, SpellEffectEntry>();
public static readonly Dictionary<ushort, List<ushort>> Phases = new Dictionary<ushort, List<ushort>>();
public static readonly Dictionary<int, List<ushort>> Phases = new Dictionary<int, List<ushort>>();
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("Achievement")]

public sealed class AchievementEntry
{
public string Description;
Expand All @@ -18,7 +17,7 @@ public sealed class AchievementEntry
public sbyte MinimumCriteria;
public sbyte Points;
public int Flags;
public short UiOrder;
public ushort UiOrder;
public int IconFileID;
public int RewardItemID;
public uint CriteriaTree;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("BroadcastText")]

public sealed class BroadcastTextEntry
{
public string Text;
Expand All @@ -17,7 +16,7 @@ public sealed class BroadcastTextEntry
public uint ChatBubbleDurationMs;
public int VoiceOverPriorityID;
[Cardinality(2)]
public uint[] SoundEntriesID = new uint[2];
public uint[] SoundKitID = new uint[2];
[Cardinality(3)]
public ushort[] EmoteID = new ushort[3];
[Cardinality(3)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("CreatureDifficulty")]

public sealed class CreatureDifficultyEntry
{
[Index(true)]
public uint ID;
public int UnkMin;
public int UnkMax;
public int Unknown901_0;
public int Unknown901_1;
public ushort FactionTemplateID;
public int ContentTuningID;
[Cardinality(8)]
public int[] Flags = new int[8];
public uint CreatureID;
[NonInlineRelation(typeof(uint))]
public int CreatureID;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down Expand Up @@ -31,8 +31,8 @@ public sealed class CreatureDisplayInfoEntry
public int DissolveOutEffectID;
public sbyte CreatureModelMinLod;
public ushort ConditionalCreatureModelID;
public float Unknown_1100_1;
public ushort Unknown_1100_2;
public float MountMaxBankingAngle;
public ushort Unknown1100;
[Cardinality(4)]
public int[] TextureVariationFileDataID = new int[4];
}
Expand Down
6 changes: 3 additions & 3 deletions WowPacketParser/DBC/Structures/TheWarWithin/CreatureEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand All @@ -16,10 +16,10 @@ public sealed class CreatureEntry
public ushort CreatureFamily;
public byte StartAnimState;
[Cardinality(4)]
public uint[] DisplayID = new uint[4];
public int[] DisplayID = new int[4];
[Cardinality(4)]
public float[] DisplayProbability = new float[4];
[Cardinality(3)]
public uint[] AlwaysItem = new uint[3];
public int[] AlwaysItem = new int[3];
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("CreatureFamily")]

public sealed class CreatureFamilyEntry
{
[Index(true)]
Expand Down
4 changes: 2 additions & 2 deletions WowPacketParser/DBC/Structures/TheWarWithin/CriteriaEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand All @@ -17,6 +17,6 @@ public sealed class CriteriaEntry
public int FailAsset;
public int Flags;
public short EligibilityWorldStateID;
public sbyte EligibilityWorldStatevalue;
public sbyte EligibilityWorldStateValue;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand All @@ -17,8 +17,8 @@ public sealed class DifficultyEntry
public ushort Flags;
public byte ItemContext;
public byte ToggleDifficultyID;
public uint GroupSizeHealthCurveID; // unproven
public uint GroupSizeDmgCurveID; // unproven
public uint GroupSizeSpellPointsCurveID; // unproven
public uint GroupSizeHealthCurveID;
public uint GroupSizeDmgCurveID;
public uint GroupSizeSpellPointsCurveID;
}
}
3 changes: 1 addition & 2 deletions WowPacketParser/DBC/Structures/TheWarWithin/FactionEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down Expand Up @@ -33,4 +33,3 @@ public sealed class FactionEntry
public byte[] ParentFactionCap = new byte[2];
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down
2 changes: 1 addition & 1 deletion WowPacketParser/DBC/Structures/TheWarWithin/ItemEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DBFileReaderLib.Attributes;
using System;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down Expand Up @@ -48,7 +47,7 @@ public sealed class ItemSparseEntry
public ushort RequiredTransmogHoliday;
public ushort RequiredHoliday;
public ushort GemProperties;
public ushort SocketMatchEnchantmentId;
public ushort SocketMatchEnchantmentID;
public ushort TotemCategoryID;
public ushort InstanceBound;
[Cardinality(2)]
Expand All @@ -71,7 +70,7 @@ public sealed class ItemSparseEntry
public byte Material;
public byte PageMaterialID;
public byte Bonding;
public byte DamageDamageType;
public byte DamageType;
public byte ContainerSlots;
public byte RequiredPVPMedal;
public byte RequiredPVPRank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("MapDifficulty")]

public class MapDifficultyEntry
public sealed class MapDifficultyEntry
{
[Index(true)]
public uint ID;
Expand Down
4 changes: 2 additions & 2 deletions WowPacketParser/DBC/Structures/TheWarWithin/MapEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down Expand Up @@ -33,6 +33,6 @@ public sealed class MapEntry
public int NavigationMaxDistance;
public int PreloadFileDataID;
[Cardinality(3)]
public uint[] Flags = new uint[3];
public int[] Flags = new int[3];
}
}
4 changes: 2 additions & 2 deletions WowPacketParser/DBC/Structures/TheWarWithin/PhaseEntry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand All @@ -7,6 +7,6 @@ public sealed class PhaseEntry
{
[Index(true)]
public uint ID;
public short Flags;
public int Flags;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("PhaseXPhaseGroup")]

public sealed class PhaseXPhaseGroupEntry
{
[Index(true)]
public uint ID;
public ushort PhaseID;
public ushort PhaseGroupID;
[NonInlineRelation(typeof(uint))]
public int PhaseGroupID;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("QuestLineXQuest")]
public sealed class QuestLineXQuestEntry
{
[Index(true)]
public int ID;
public uint ID;
public uint QuestLineID;
public uint QuestID;
public uint OrderIndex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("SpellEffect")]

public sealed class SpellEffectEntry
{
[Index(true)]
Expand All @@ -30,7 +29,7 @@ public sealed class SpellEffectEntry
public float Variance;
public float ResourceCoefficient;
public float GroupSizeBasePointsCoefficient;
public float EffectBasePoints;
public float EffectBasePointsF;
public int ScalingClass;
[Cardinality(2)]
public int[] EffectMiscValue = new int[2];
Expand All @@ -40,6 +39,7 @@ public sealed class SpellEffectEntry
public int[] EffectSpellClassMask = new int[4];
[Cardinality(2)]
public short[] ImplicitTarget = new short[2];
[NonInlineRelation(typeof(uint))]
public int SpellID;
}
}
3 changes: 1 addition & 2 deletions WowPacketParser/DBC/Structures/TheWarWithin/SpellEntry.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
[DBFile("Spell")]

public sealed class SpellEntry
{
[Index(true)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DBFileReaderLib.Attributes;
using DBFileReaderLib.Attributes;

namespace WowPacketParser.DBC.Structures.TheWarWithin
{
Expand Down
2 changes: 1 addition & 1 deletion WowPacketParser/Misc/PacketReads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public string ReadSpellEntry(uint spellID, string name, params object[] indexes)

string auraInfo = string.Empty;
auraInfo += $"Aura Id {aura:D} ({ aura })";
auraInfo += $", value = { effect.EffectBasePoints }";
auraInfo += $", value = { effect.EffectBasePointsF }";
auraInfo += $", misc = { misc } (";

switch (aura)
Expand Down
12 changes: 6 additions & 6 deletions WowPacketParser/SQL/SQLDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ private static void LoadBroadcastText()
if (Settings.TargetedDatabase == TargetedDatabase.WrathOfTheLichKing || Settings.TargetedDatabase == TargetedDatabase.Cataclysm)
{
broadcastText.ConditionID = 0;
broadcastText.SoundEntriesID = new uint[2];
broadcastText.SoundEntriesID[0] = Convert.ToUInt32(reader["SoundEntriesID"]);
broadcastText.SoundEntriesID[1] = 0;
broadcastText.SoundKitID = new uint[2];
broadcastText.SoundKitID[0] = Convert.ToUInt32(reader["SoundKitID"]);
broadcastText.SoundKitID[1] = 0;
}
else
{
broadcastText.ConditionID = Convert.ToInt32(reader["ConditionID"]);
broadcastText.SoundEntriesID = new uint[2];
broadcastText.SoundEntriesID[0] = Convert.ToUInt32(reader[$"Sound{soundFieldName}ID1"]);
broadcastText.SoundEntriesID[1] = Convert.ToUInt32(reader[$"Sound{soundFieldName}ID2"]);
broadcastText.SoundKitID = new uint[2];
broadcastText.SoundKitID[0] = Convert.ToUInt32(reader[$"Sound{soundFieldName}ID1"]);
broadcastText.SoundKitID[1] = Convert.ToUInt32(reader[$"Sound{soundFieldName}ID2"]);
}

if (!DBC.DBC.BroadcastText.ContainsKey(id))
Expand Down
Loading