diff --git a/.gitignore b/.gitignore index 3a2238d6..5d6a8b28 100644 --- a/.gitignore +++ b/.gitignore @@ -152,6 +152,7 @@ publish/ **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ +!**/packages/DBFileReaderLib.1.0.0.0/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignoreable files diff --git a/SpellWork/DBC/DBC.cs b/SpellWork/DBC/DBC.cs index a48ea0ce..1d668b83 100644 --- a/SpellWork/DBC/DBC.cs +++ b/SpellWork/DBC/DBC.cs @@ -1,4 +1,4 @@ -using SpellWork.Database; +using DBFileReaderLib; using SpellWork.DBC.Structures; using SpellWork.GameTables; using SpellWork.GameTables.Structures; @@ -10,14 +10,13 @@ using System.IO; using System.Linq; using System.Reflection; -using DBFilesClient.NET; using System.Threading.Tasks; namespace SpellWork.DBC { public static class DBC { - public const string Version = "SpellWork 7.2.5 (24330)"; + public const string Version = "SpellWork 7.3.5 (26972)"; public const uint MaxLevel = 110; // ReSharper disable MemberCanBePrivate.Global @@ -37,7 +36,7 @@ public static class DBC public static Storage SpellDescriptionVariables { get; set; } public static Storage SpellDuration { get; set; } public static Storage SpellEffect { get; set; } - public static Storage SpellEffectScaling { get; set; } + //public static Storage SpellEffectScaling { get; set; } public static Storage SpellMisc { get; set; } public static Storage SpellEquippedItems { get; set; } public static Storage SpellInterrupts { get; set; } @@ -85,8 +84,9 @@ public static async void Load() try { - dbc.SetValue(dbc.GetValue(null), - Activator.CreateInstance(dbc.PropertyType, $@"{ Settings.Default.DbcPath }\{ Settings.Default.Locale }\{ name }.db2", true)); + var db2Reader = new DBReader($@"{Settings.Default.DbcPath}\{Settings.Default.Locale}\{name}.db2"); + dynamic storage = Activator.CreateInstance(dbc.PropertyType, db2Reader); + dbc.SetValue(dbc.GetValue(null), storage); } catch (DirectoryNotFoundException) { @@ -104,260 +104,267 @@ public static async void Load() await Task.WhenAll(Task.Run(() => { - foreach (var effect in SpellInfoStore.Where(effect => SpellMisc.ContainsKey(effect.Value.Spell.MiscID))) + foreach (var spellMisc in SpellMisc.Values.Where(misc => SpellInfoStore.ContainsKey(misc.SpellID))) { - effect.Value.Misc = SpellMisc[effect.Value.Spell.MiscID]; + if (spellMisc.DifficultyID != 0) + continue; + + var spell = SpellInfoStore[spellMisc.SpellID]; + spell.Misc = spellMisc; - if (SpellDuration.ContainsKey(effect.Value.Misc.DurationIndex)) - effect.Value.DurationEntry = SpellDuration[effect.Value.Misc.DurationIndex]; + if (SpellDuration.ContainsKey(spellMisc.DurationIndex)) + spell.DurationEntry = SpellDuration[spellMisc.DurationIndex]; - if (SpellRange.ContainsKey(effect.Value.Misc.RangeIndex)) - effect.Value.Range = SpellRange[effect.Value.Misc.RangeIndex]; + if (SpellRange.ContainsKey(spellMisc.RangeIndex)) + spell.Range = SpellRange[spellMisc.RangeIndex]; } }), Task.Run(() => { - foreach (var effect in SpellEffect) + foreach (var effect in SpellEffect.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(effect.SpellID)) { Console.WriteLine( - $"Spell effect {effect.Value.ID} is referencing unknown spell {effect.Value.SpellID}, ignoring!"); + $"Spell effect {effect.ID} is referencing unknown spell {effect.SpellID}, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Effects.Add(effect.Value); - SpellInfoStore[effect.Value.SpellID].SpellEffectInfoStore[effect.Value.EffectIndex] = new SpellEffectInfo(effect.Value); // Helper + SpellInfoStore[effect.SpellID].Effects.Add(effect); + SpellInfoStore[effect.SpellID].SpellEffectInfoStore[(uint)effect.EffectIndex] = new SpellEffectInfo(effect); // Helper - var triggerId = (int)effect.Value.EffectTriggerSpell; + var triggerId = (int)effect.EffectTriggerSpell; if (triggerId != 0) { if (SpellTriggerStore.ContainsKey(triggerId)) - SpellTriggerStore[triggerId].Add(effect.Value.SpellID); + SpellTriggerStore[triggerId].Add(effect.SpellID); else - SpellTriggerStore.Add(triggerId, new SortedSet { effect.Value.SpellID }); + SpellTriggerStore.Add(triggerId, new SortedSet { effect.SpellID }); } } }), Task.Run(() => { - foreach (var effect in SpellTargetRestrictions) + foreach (var spellTargetRestrictions in SpellTargetRestrictions.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellTargetRestrictions.SpellID)) { Console.WriteLine( - $"SpellTargetRestrictions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellTargetRestrictions: Unknown spell {spellTargetRestrictions.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].TargetRestrictions.Add(effect.Value); + SpellInfoStore[spellTargetRestrictions.SpellID].TargetRestrictions.Add(spellTargetRestrictions); } }), Task.Run(() => { - foreach (var effect in SpellXSpellVisual.Where(effect => - effect.Value.DifficultyID == 0 && effect.Value.PlayerConditionID == 0)) + foreach (var spellXSpellVisual in SpellXSpellVisual.Values.Where(effect => effect.CasterPlayerConditionID == 0)) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (spellXSpellVisual.DifficultyID != 0) + continue; + + if (!SpellInfoStore.ContainsKey(spellXSpellVisual.SpellID)) { Console.WriteLine( - $"SpellXSpellVisual: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellXSpellVisual: Unknown spell {spellXSpellVisual.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].SpellXSpellVisual = effect.Value; + SpellInfoStore[spellXSpellVisual.SpellID].SpellXSpellVisual = spellXSpellVisual; } }), Task.Run(() => { - foreach (var effect in SpellScaling) + foreach (var spellScaling in SpellScaling.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellScaling.SpellID)) { Console.WriteLine( - $"SpellScaling: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellScaling: Unknown spell {spellScaling.SpellID} referenced, ignoring!"); continue; } - - SpellInfoStore[effect.Value.SpellID].Scaling = effect.Value; + SpellInfoStore[spellScaling.SpellID].Scaling = spellScaling; } }), Task.Run(() => { - foreach (var effect in SpellAuraOptions) + foreach (var spellAuraOptions in SpellAuraOptions.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (spellAuraOptions.DifficultyID != 0) + continue; + + if (!SpellInfoStore.ContainsKey(spellAuraOptions.SpellID)) { Console.WriteLine( - $"SpellAuraOptions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellAuraOptions: Unknown spell {spellAuraOptions.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].AuraOptions = effect.Value; - if (effect.Value.SpellProcsPerMinuteID != 0) - SpellInfoStore[effect.Value.SpellID].ProcsPerMinute = SpellProcsPerMinute[effect.Value.SpellProcsPerMinuteID]; + SpellInfoStore[spellAuraOptions.SpellID].AuraOptions = spellAuraOptions; + if (spellAuraOptions.SpellProcsPerMinuteID != 0) + SpellInfoStore[spellAuraOptions.SpellID].ProcsPerMinute = SpellProcsPerMinute[spellAuraOptions.SpellProcsPerMinuteID]; } }), Task.Run(() => { - foreach (var effect in SpellAuraRestrictions) + foreach (var spellAuraRestrictions in SpellAuraRestrictions.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (spellAuraRestrictions.DifficultyID != 0) + continue; + + if (!SpellInfoStore.ContainsKey(spellAuraRestrictions.SpellID)) { Console.WriteLine( - $"SpellAuraRestrictions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellAuraRestrictions: Unknown spell {spellAuraRestrictions.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].AuraRestrictions = effect.Value; + SpellInfoStore[spellAuraRestrictions.SpellID].AuraRestrictions = spellAuraRestrictions; } }), Task.Run(() => { - foreach (var effect in SpellCategories) + foreach (var spellCategory in SpellCategories.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (spellCategory.DifficultyID != 0) + continue; + + if (!SpellInfoStore.ContainsKey(spellCategory.SpellID)) { Console.WriteLine( - $"SpellCategories: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellCategories: Unknown spell {spellCategory.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Categories = effect.Value; + SpellInfoStore[spellCategory.SpellID].Categories = spellCategory; } }), Task.Run(() => { - foreach (var effect in SpellCastingRequirements) + foreach (var spellCasting in SpellCastingRequirements.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellCasting.SpellID)) { Console.WriteLine( - $"SpellCastingRequirements: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellCastingRequirements: Unknown spell {spellCasting.SpellID} referenced, ignoring!"); return; } - SpellInfoStore[effect.Value.SpellID].CastingRequirements = effect.Value; + SpellInfoStore[spellCasting.SpellID].CastingRequirements = spellCasting; } }), Task.Run(() => { - foreach (var effect in SpellClassOptions) + foreach (var spellClassOptions in SpellClassOptions.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellClassOptions.SpellID)) { Console.WriteLine( - $"SpellClassOptions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellClassOptions: Unknown spell {spellClassOptions.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].ClassOptions = effect.Value; + SpellInfoStore[spellClassOptions.SpellID].ClassOptions = spellClassOptions; } }), Task.Run(() => { - foreach (var effect in SpellCooldowns) + foreach (var spellCooldown in SpellCooldowns.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellCooldowns: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + if (spellCooldown.DifficultyID != 0) continue; - } - SpellInfoStore[effect.Value.SpellID].Cooldowns = effect.Value; - } - }), Task.Run(() => - { - foreach (var effect in SpellEffectScaling) - { - if (!SpellEffect.ContainsKey(effect.Value.SpellEffectId)) + if (!SpellInfoStore.ContainsKey(spellCooldown.SpellID)) { Console.WriteLine( - $"SpellEffectScaling: Unknown spell effect {effect.Value.SpellEffectId} referenced, ignoring!"); + $"SpellCooldowns: Unknown spell {spellCooldown.SpellID} referenced, ignoring!"); continue; } - SpellEffect[effect.Value.SpellEffectId].SpellEffectScalingEntry = effect.Value; + SpellInfoStore[spellCooldown.SpellID].Cooldowns = spellCooldown; } }), Task.Run(() => { - foreach (var effect in SpellInterrupts) + foreach (var spellInterrupts in SpellInterrupts.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellInterrupts.SpellID)) { Console.WriteLine( - $"SpellInterrupts: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellInterrupts: Unknown spell {spellInterrupts.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Interrupts = effect.Value; + SpellInfoStore[spellInterrupts.SpellID].Interrupts = spellInterrupts; } }), Task.Run(() => { - foreach (var effect in SpellEquippedItems) + foreach (var spellEquippedItem in SpellEquippedItems.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellEquippedItem.SpellID)) { Console.WriteLine( - $"SpellEquippedItems: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellEquippedItems: Unknown spell {spellEquippedItem.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].EquippedItems = effect.Value; + SpellInfoStore[spellEquippedItem.SpellID].EquippedItems = spellEquippedItem; } }), Task.Run(() => { - foreach (var effect in SpellLevels) + foreach (var spellLevel in SpellLevels.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (spellLevel.DifficultyID != 0) + continue; + + if (!SpellInfoStore.ContainsKey(spellLevel.SpellID)) { - Console.WriteLine($"SpellLevels: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + Console.WriteLine($"SpellLevels: Unknown spell {spellLevel.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Levels = effect.Value; + SpellInfoStore[spellLevel.SpellID].Levels = spellLevel; } }), Task.Run(() => { - foreach (var effect in SpellReagents) + foreach (var spellReagents in SpellReagents) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellReagents.Value.SpellID)) { Console.WriteLine( - $"SpellReagents: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellReagents: Unknown spell {spellReagents.Value.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Reagents = effect.Value; + SpellInfoStore[spellReagents.Value.SpellID].Reagents = spellReagents.Value; } }), Task.Run(() => { - foreach (var reagentsCurrency in SpellReagentsCurrency) + foreach (var reagentsCurrency in SpellReagentsCurrency.Values) { - if (!SpellInfoStore.ContainsKey(reagentsCurrency.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(reagentsCurrency.SpellID)) { Console.WriteLine( - $"SpellReagentsCurrency: Unknown spell {reagentsCurrency.Value.SpellID} referenced, ignoring!"); + $"SpellReagentsCurrency: Unknown spell {reagentsCurrency.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[reagentsCurrency.Value.SpellID].ReagentsCurrency.Add(reagentsCurrency.Value); + SpellInfoStore[reagentsCurrency.SpellID].ReagentsCurrency.Add(reagentsCurrency); } }), Task.Run(() => { - foreach (var effect in SpellShapeshift) + foreach (var spellShapeShift in SpellShapeshift.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellShapeShift.SpellID)) { Console.WriteLine( - $"SpellShapeshift: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + $"SpellShapeshift: Unknown spell {spellShapeShift.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Shapeshift = effect.Value; + SpellInfoStore[spellShapeShift.SpellID].Shapeshift = spellShapeShift; } }), Task.Run(() => { - foreach (var effect in SpellTotems) + foreach (var spellTotem in SpellTotems.Values) { - if (!SpellInfoStore.ContainsKey(effect.Value.SpellID)) + if (!SpellInfoStore.ContainsKey(spellTotem.SpellID)) { - Console.WriteLine($"SpellTotems: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + Console.WriteLine($"SpellTotems: Unknown spell {spellTotem.SpellID} referenced, ignoring!"); continue; } - SpellInfoStore[effect.Value.SpellID].Totems = effect.Value; + SpellInfoStore[spellTotem.SpellID].Totems = spellTotem; } })); diff --git a/SpellWork/DBC/Structures/AreaGroupMemberEntry.cs b/SpellWork/DBC/Structures/AreaGroupMemberEntry.cs index 3b096dae..95e8c83a 100644 --- a/SpellWork/DBC/Structures/AreaGroupMemberEntry.cs +++ b/SpellWork/DBC/Structures/AreaGroupMemberEntry.cs @@ -1,8 +1,12 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class AreaGroupMemberEntry { - public ushort AreaGroupId; - public short AreaId; - } + [Index(true)] + public int ID; // $noninline,id$ID<32> + public ushort AreaID; // AreaID + public ushort AreaGroupID; // AreaGroupID + }; } diff --git a/SpellWork/DBC/Structures/AreaTableEntry.cs b/SpellWork/DBC/Structures/AreaTableEntry.cs index c4ae162d..b023aba1 100644 --- a/SpellWork/DBC/Structures/AreaTableEntry.cs +++ b/SpellWork/DBC/Structures/AreaTableEntry.cs @@ -1,29 +1,36 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class AreaTableEntry { - public uint[] Flags; - public string ZoneName; - public float AmbientMultiplier; - public string AreaName; - public ushort MapID; - public ushort ParentAreaID; - public short AreaBit; - public ushort AmbienceID; - public ushort ZoneMusic; - public ushort IntroSound; - public ushort[] LiquidTypeID; - public ushort UWZoneMusic; - public ushort UWAmbience; - public ushort PvPCombatWorldStateID; - public byte SoundProviderPref; - public byte SoundProviderPrefUnderwater; - public byte ExplorationLevel; - public byte FactionGroupMask; - public byte MountFlags; - public byte WildBattlePetLevelMin; - public byte WildBattlePetLevelMax; - public byte WindSettingsID; - public uint UWIntroSound; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public string ZoneName; // ZoneName + public string AreaName_lang; // AreaName_lang + [Cardinality(2)] + public int[] Flags = new int[2]; // Flags<32>[2] + public float Ambient_multiplier; // Ambient_multiplier + public ushort ContinentID; // ContinentID + public ushort ParentAreaID; // ParentAreaID + public short AreaBit; // AreaBit<16> + public ushort AmbienceID; // AmbienceID + public ushort ZoneMusic; // ZoneMusic + public ushort IntroSound; // IntroSound + [Cardinality(4)] + public ushort[] LiquidTypeID = new ushort[4]; // LiquidTypeID[4] + public ushort UwZoneMusic; // UwZoneMusic + public ushort UwAmbience; // UwAmbience + public short PvpCombatWorldStateID; // PvpCombatWorldStateID<16> + public byte SoundProviderPref; // SoundProviderPref + public byte SoundProviderPrefUnderwater; // SoundProviderPrefUnderwater + public sbyte ExplorationLevel; // ExplorationLevel<8> + public byte FactionGroupMask; // FactionGroupMask + public byte MountFlags; // MountFlags + public byte WildBattlePetLevelMin; // WildBattlePetLevelMin + public byte WildBattlePetLevelMax; // WildBattlePetLevelMax + public byte WindSettingsID; // WindSettingsID + public uint UwIntroSound; // UwIntroSound } } diff --git a/SpellWork/DBC/Structures/ItemEffectEntry.cs b/SpellWork/DBC/Structures/ItemEffectEntry.cs index c6af0f7d..3a8a33ce 100644 --- a/SpellWork/DBC/Structures/ItemEffectEntry.cs +++ b/SpellWork/DBC/Structures/ItemEffectEntry.cs @@ -1,15 +1,19 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class ItemEffectEntry { - public uint ItemID; - public uint SpellID; - public int Cooldown; - public int CategoryCooldown; - public short Charges; - public ushort Category; - public ushort ChrSpecializationID; - public byte OrderIndex; - public byte Trigger; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + public int CoolDownMSec; // CoolDownMSec<32> + public int CategoryCoolDownMSec; // CategoryCoolDownMSec<32> + public short Charges; // Charges<16> + public ushort SpellCategoryID; // SpellCategoryID + public ushort ChrSpecializationID; // ChrSpecializationID + public byte LegacySlotIndex; // LegacySlotIndex + public sbyte TriggerType; // TriggerType<8> + public int ParentItemID; // $noninline,relation$ParentItemID<32> } } diff --git a/SpellWork/DBC/Structures/ItemEntry.cs b/SpellWork/DBC/Structures/ItemEntry.cs index 28a611ae..b71e8a4d 100644 --- a/SpellWork/DBC/Structures/ItemEntry.cs +++ b/SpellWork/DBC/Structures/ItemEntry.cs @@ -1,14 +1,18 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class ItemEntry { - public uint FileDataID; - public byte Class; - public byte SubClass; - public sbyte SoundOverrideSubclass; - public sbyte Material; - public byte InventoryType; - public byte Sheath; - public byte GroupSoundsID; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int IconFileDataID; // IconFileDataID<32> + public byte ClassID; // ClassID + public byte SubclassID; // SubclassID + public sbyte Sound_override_subclassID; // Sound_override_subclassID<8> + public byte Material; // Material + public byte InventoryType; // InventoryType + public byte SheatheType; // SheatheType + public byte ItemGroupSoundsID; // ItemGroupSoundsID } } diff --git a/SpellWork/DBC/Structures/ItemSparseEntry.cs b/SpellWork/DBC/Structures/ItemSparseEntry.cs index 5da59685..9553ba99 100644 --- a/SpellWork/DBC/Structures/ItemSparseEntry.cs +++ b/SpellWork/DBC/Structures/ItemSparseEntry.cs @@ -1,70 +1,81 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class ItemSparseEntry { - public uint[] Flags; - public float Unk1; - public float Unk2; - public uint BuyCount; - public uint BuyPrice; - public uint SellPrice; - public int AllowableRace; - public uint RequiredSpell; - public uint MaxCount; - public uint Stackable; - public int[] ItemStatAllocation; - public float[] ItemStatSocketCostMultiplier; - public float RangedModRange; - public string Name; - public string Name2; - public string Name3; - public string Name4; - public string Description; - public uint BagFamily; - public float ArmorDamageModifier; - public uint Duration; - public float StatScalingFactor; - public ushort AllowableClass; - public ushort ItemLevel; - public ushort RequiredSkill; - public ushort RequiredSkillRank; - public ushort RequiredReputationFaction; - public short[] ItemStatValue; - public ushort ScalingStatDistribution; - public ushort Delay; - public ushort PageText; - public ushort StartQuest; - public ushort LockID; - public ushort RandomProperty; - public ushort RandomSuffix; - public ushort ItemSet; - public ushort Area; - public ushort Map; - public ushort TotemCategory; - public ushort SocketBonus; - public ushort GemProperties; - public ushort ItemLimitCategory; - public ushort HolidayID; - public ushort RequiredTransmogHolidayID; - public ushort ItemNameDescriptionID; - public byte Quality; - public byte InventoryType; - public sbyte RequiredLevel; - public byte RequiredHonorRank; - public byte RequiredCityRank; - public byte RequiredReputationRank; - public byte ContainerSlots; - public sbyte[] ItemStatType; - public byte DamageType; - public byte Bonding; - public byte LanguageID; - public byte PageMaterial; - public sbyte Material; - public byte Sheath; - public byte[] SocketColor; - public byte CurrencySubstitutionID; - public byte CurrencySubstitutionCount; - public byte ArtifactID; - public byte RequiredExpansion; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public long AllowableRace; // AllowableRace<64> + public string Display_lang; // Display_lang + public string Display1_lang; // Display1_lang + public string Display2_lang; // Display2_lang + public string Display3_lang; // Display3_lang + public string Description_lang; // Description_lang + [Cardinality(4)] + public int[] Flags = new int[4]; // Flags<32>[4] + public float PriceRandomValue; // PriceRandomValue + public float PriceVariance; // PriceVariance + public uint VendorStackCount; // VendorStackCount + public uint BuyPrice; // BuyPrice + public uint SellPrice; // SellPrice + public uint RequiredAbility; // RequiredAbility + public int MaxCount; // MaxCount<32> + public int Stackable; // Stackable<32> + [Cardinality(10)] + public int[] StatPercentEditor = new int[10]; // StatPercentEditor<32>[10] + [Cardinality(10)] + public float[] StatPercentageOfSocket = new float[10]; // StatPercentageOfSocket[10] + public int ItemRange; // ItemRange + public uint BagFamily; // BagFamily + public int QualityModifier; // QualityModifier + public uint DurationInInventory; // DurationInInventory + public float DmgVariance; // DmgVariance + public short AllowableClass; // AllowableClass<16> + public ushort ItemLevel; // ItemLevel + public ushort RequiredSkill; // RequiredSkill + public ushort RequiredSkillRank; // RequiredSkillRank + public ushort MinFactionID; // MinFactionID + [Cardinality(10)] + public short[] StatModifier_bonusAmount = new short[10]; // StatModifier_bonusAmount<16>[10] + public ushort ScalingStatDistributionID; // ScalingStatDistributionID + public ushort ItemDelay; // ItemDelay + public ushort PageID; // PageID + public ushort StartQuestID; // StartQuestID + public ushort LockID; // LockID + public ushort RandomSelect; // RandomSelect + public ushort ItemRandomSuffixGroupID; // ItemRandomSuffixGroupID + public ushort ItemSet; // ItemSet + public ushort ZoneBound; // ZoneBound + public ushort InstanceBound; // InstanceBound + public ushort TotemCategoryID; // TotemCategoryID + public ushort Socket_match_enchantment_ID; // Socket_match_enchantment_ID + public ushort Gem_properties; // Gem_properties + public ushort LimitCategory; // LimitCategory + public ushort RequiredHoliday; // RequiredHoliday + public ushort RequiredTransmogHoliday; // RequiredTransmogHoliday + public ushort ItemNameDescriptionID; // ItemNameDescriptionID + public byte OverallQualityID; // OverallQualityID + public byte InventoryType; // InventoryType + public sbyte RequiredLevel; // RequiredLevel<8> + public byte RequiredPVPRank; // RequiredPVPRank + public byte RequiredPVPMedal; // RequiredPVPMedal + public byte MinReputation; // MinReputation + public byte ContainerSlots; // ContainerSlots + [Cardinality(10)] + public sbyte[] StatModifier_bonusStat = new sbyte[10]; // StatModifier_bonusStat<8>[10] + public byte Damage_damageType; // Damage_damageType + public byte Bonding; // Bonding + public byte LanguageID; // LanguageID + public byte PageMaterialID; // PageMaterialID + public byte Material; // Material + public byte SheatheType; // SheatheType + [Cardinality(3)] + public byte[] SocketType = new byte[3]; // SocketType[3] + public byte SpellWeightCategory; // SpellWeightCategory + public byte SpellWeight; // SpellWeight + public byte ArtifactID; // ArtifactID + public byte ExpansionID; // ExpansionID } } diff --git a/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs b/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs index 8b4477b4..3a6f1164 100644 --- a/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs +++ b/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs @@ -1,9 +1,14 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class OverrideSpellDataEntry { - public uint[] Spells; - public uint PlayerActionbarFileDataID; - public byte Flags; + [Index(true)] + public int ID; // $noninline,id$ID<32> + [Cardinality(10)] + public int[] Spells = new int[10]; // Spells<32>[10] + public int PlayerActionbarFileDataID; // PlayerActionbarFileDataID<32> + public byte Flags; // Flags } } diff --git a/SpellWork/DBC/Structures/RandPropPointsEntry.cs b/SpellWork/DBC/Structures/RandPropPointsEntry.cs index 84e81773..cb756874 100644 --- a/SpellWork/DBC/Structures/RandPropPointsEntry.cs +++ b/SpellWork/DBC/Structures/RandPropPointsEntry.cs @@ -1,9 +1,16 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class RandPropPointsEntry { - public uint[] Epic; - public uint[] Superior; - public uint[] Good; + [Index(true)] + public int ID; // $noninline,id$ID<32> + [Cardinality(5)] + public uint[] Epic = new uint[5]; // Epic[5] + [Cardinality(5)] + public uint[] Superior = new uint[5]; // Superior[5] + [Cardinality(5)] + public uint[] Good = new uint[5]; // Good[5] } } diff --git a/SpellWork/DBC/Structures/ScreenEffectEntry.cs b/SpellWork/DBC/Structures/ScreenEffectEntry.cs index 2e24c904..9f8706ec 100644 --- a/SpellWork/DBC/Structures/ScreenEffectEntry.cs +++ b/SpellWork/DBC/Structures/ScreenEffectEntry.cs @@ -1,18 +1,24 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class ScreenEffectEntry { - public string Name; - public int[] field04; - public ushort field14; - public ushort field16; - public ushort field18; - public ushort field1A; - public byte field1C; - public byte field1D; - public byte field1E; - public int field1F; - public int field23; - public int field27; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public string Name; // Name + [Cardinality(4)] + public int[] Param = new int[4]; // Param<32>[4] + public ushort LightParamsID; // LightParamsID + public ushort LightParamsFadeIn; // LightParamsFadeIn + public ushort LightParamsFadeOut; // LightParamsFadeOut + public short TimeOfDayOverride; // TimeOfDayOverride<16> + public byte Effect; // Effect + public byte LightFlags; // LightFlags + public sbyte EffectMask; // EffectMask<8> + public uint FullScreenEffectID; // FullScreenEffectID + public uint SoundAmbienceID; // SoundAmbienceID + public uint ZoneMusicID; // ZoneMusicID } } diff --git a/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs b/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs index 1a641896..e1a24729 100644 --- a/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs +++ b/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs @@ -1,19 +1,23 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class SkillLineAbilityEntry { - public int SpellID; - public uint RaceMask; - public uint SupercedesSpell; - public ushort SkillLine; - public ushort MinSkillLineRank; - public ushort TrivialSkillLineRankHigh; - public ushort TrivialSkillLineRankLow; - public ushort UniqueBit; - public ushort TradeSkillCategoryID; - public byte AquireMethod; - public byte NumSkillUps; - public byte Unknown703; - public uint ClassMask; + public long RaceMask; // RaceMask<64> + [Index(true)] + public int ID; // $id$ID<32> + public int Spell; // Spell<32> + public int SupercedesSpell; // SupercedesSpell<32> + public short SkillLine; // $relation$SkillLine<16> + public short TrivialSkillLineRankHigh; // TrivialSkillLineRankHigh<16> + public short TrivialSkillLineRankLow; // TrivialSkillLineRankLow<16> + public short UniqueBit; // UniqueBit<16> + public short TradeSkillCategoryID; // TradeSkillCategoryID<16> + public sbyte NumSkillUps; // NumSkillUps<8> + public int ClassMask; // ClassMask<32> + public short MinSkillLineRank; // MinSkillLineRank<16> + public sbyte AcquireMethod; // AcquireMethod<8> + public sbyte Flags; // Flags<8> } } diff --git a/SpellWork/DBC/Structures/SkillLineEntry.cs b/SpellWork/DBC/Structures/SkillLineEntry.cs index ba85f9c2..aced4ed3 100644 --- a/SpellWork/DBC/Structures/SkillLineEntry.cs +++ b/SpellWork/DBC/Structures/SkillLineEntry.cs @@ -1,14 +1,19 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SkillLineEntry { - public string DisplayName; - public string Description; - public string AlternateVerb; - public ushort Flags; - public byte CategoryID; - public byte CanLink; - public uint IconFileDataID; - public uint ParentSkillLineID; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public string DisplayName_lang; // DisplayName_lang + public string Description_lang; // Description_lang + public string AlternateVerb_lang; // AlternateVerb_lang + public ushort Flags; // Flags + public sbyte CategoryID; // CategoryID<8> + public sbyte CanLink; // CanLink<8> + public int SpellIconFileID; // SpellIconFileID<32> + public uint ParentSkillLineID; // ParentSkillLineID } } diff --git a/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs b/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs index a7494ecb..612f5a18 100644 --- a/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs +++ b/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs @@ -1,14 +1,19 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellAuraOptionsEntry { - public int SpellID; - public uint ProcCharges; - public uint ProcTypeMask; - public uint ProcCategoryRecovery; - public ushort CumulativeAura; - public byte DifficultyID; - public byte ProcChance; - public byte SpellProcsPerMinuteID; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int ProcCharges; // ProcCharges<32> + [Cardinality(2)] + public int[] ProcTypeMask = new int[2]; // ProcTypeMask<32>[2] + public int ProcCategoryRecovery; // ProcCategoryRecovery<32> + public ushort CumulativeAura; // CumulativeAura + public ushort SpellProcsPerMinuteID; // SpellProcsPerMinuteID + public byte DifficultyID; // DifficultyID + public byte ProcChance; // ProcChance + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs b/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs index c4f3a348..7fc381fc 100644 --- a/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs +++ b/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs @@ -1,16 +1,20 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellAuraRestrictionsEntry { - public int SpellID; - public uint CasterAuraSpell; - public uint TargetAuraSpell; - public uint ExcludeCasterAuraSpell; - public uint ExcludeTargetAuraSpell; - public byte DifficultyID; - public byte CasterAuraState; - public byte TargetAuraState; - public byte ExcludeCasterAuraState; - public byte ExcludeTargetAuraState; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int CasterAuraSpell; // CasterAuraSpell<32> + public int TargetAuraSpell; // TargetAuraSpell<32> + public int ExcludeCasterAuraSpell; // ExcludeCasterAuraSpell<32> + public int ExcludeTargetAuraSpell; // ExcludeTargetAuraSpell<32> + public byte DifficultyID; // DifficultyID + public byte CasterAuraState; // CasterAuraState + public byte TargetAuraState; // TargetAuraState + public byte ExcludeCasterAuraState; // ExcludeCasterAuraState + public byte ExcludeTargetAuraState; // ExcludeTargetAuraState + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellCastTimesEntry.cs b/SpellWork/DBC/Structures/SpellCastTimesEntry.cs index d37aa276..2e0391dc 100644 --- a/SpellWork/DBC/Structures/SpellCastTimesEntry.cs +++ b/SpellWork/DBC/Structures/SpellCastTimesEntry.cs @@ -1,9 +1,13 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellCastTimesEntry { - public int CastTime; - public int MinCastTime; - public short CastTimePerLevel; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int Base; // Base<32> + public int Minimum; // Minimum<32> + public short PerLevel; // PerLevel<16> } } diff --git a/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs b/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs index a83995e3..e83aa508 100644 --- a/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs +++ b/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs @@ -1,13 +1,17 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellCastingRequirementsEntry { - public int SpellID; - public ushort MinFactionID; - public ushort RequiredAreasID; - public ushort RequiresSpellFocus; - public byte FacingCasterFlags; - public byte MinReputation; - public byte RequiredAuraVision; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + public ushort MinFactionID; // MinFactionID + public ushort RequiredAreasID; // RequiredAreasID + public ushort RequiresSpellFocus; // RequiresSpellFocus + public byte FacingCasterFlags; // FacingCasterFlags + public sbyte MinReputation; // MinReputation<8> + public byte RequiredAuraVision; // RequiredAuraVision } } diff --git a/SpellWork/DBC/Structures/SpellCategoriesEntry.cs b/SpellWork/DBC/Structures/SpellCategoriesEntry.cs index 980c629c..6e15dfde 100644 --- a/SpellWork/DBC/Structures/SpellCategoriesEntry.cs +++ b/SpellWork/DBC/Structures/SpellCategoriesEntry.cs @@ -1,15 +1,19 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellCategoriesEntry { - public int SpellID; - public ushort Category; - public ushort StartRecoveryCategory; - public ushort ChargeCategory; - public byte DifficultyID; - public byte DefenseType; - public byte DispelType; - public byte Mechanic; - public byte PreventionType; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public short Category; // Category<16> + public short StartRecoveryCategory; // StartRecoveryCategory<16> + public short ChargeCategory; // ChargeCategory<16> + public byte DifficultyID; // DifficultyID + public sbyte DefenseType; // DefenseType<8> + public sbyte DispelType; // DispelType<8> + public sbyte Mechanic; // Mechanic<8> + public sbyte PreventionType; // PreventionType<8> + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs b/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs index 185687db..c3e146e2 100644 --- a/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs +++ b/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs @@ -1,10 +1,15 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellClassOptionsEntry { - public int SpellID; - public uint[] SpellFamilyFlags; - public byte SpellClassSet; - public uint ModalNextSpell; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + [Cardinality(4)] + public int[] SpellClassMask = new int[4]; // SpellClassMask<32>[4] + public byte SpellClassSet; // SpellClassSet + public uint ModalNextSpell; // ModalNextSpell } } diff --git a/SpellWork/DBC/Structures/SpellCooldownsEntry.cs b/SpellWork/DBC/Structures/SpellCooldownsEntry.cs index d6f4c122..96bbf87f 100644 --- a/SpellWork/DBC/Structures/SpellCooldownsEntry.cs +++ b/SpellWork/DBC/Structures/SpellCooldownsEntry.cs @@ -1,11 +1,15 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellCooldownsEntry { - public int SpellID; - public uint CategoryRecoveryTime; - public uint RecoveryTime; - public uint StartRecoveryTime; - public byte DifficultyID; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int CategoryRecoveryTime; // CategoryRecoveryTime<32> + public int RecoveryTime; // RecoveryTime<32> + public int StartRecoveryTime; // StartRecoveryTime<32> + public byte DifficultyID; // DifficultyID + public int SpellID; // SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs b/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs index b1dd67ad..5f46d64d 100644 --- a/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs +++ b/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs @@ -1,7 +1,11 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class SpellDescriptionVariablesEntry { + [Index(true)] + public int ID; public string Variables; } } diff --git a/SpellWork/DBC/Structures/SpellDurationEntry.cs b/SpellWork/DBC/Structures/SpellDurationEntry.cs index 65b2080b..09e74f55 100644 --- a/SpellWork/DBC/Structures/SpellDurationEntry.cs +++ b/SpellWork/DBC/Structures/SpellDurationEntry.cs @@ -1,9 +1,13 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class SpellDurationEntry { - public int Duration; - public int MaxDuration; - public int DurationPerLevel; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int Duration; // Duration<32> + public int MaxDuration; // MaxDuration<32> + public uint DurationPerLevel; // DurationPerLevel } } diff --git a/SpellWork/DBC/Structures/SpellEffectEntry.cs b/SpellWork/DBC/Structures/SpellEffectEntry.cs index af58aa21..b5646c2c 100644 --- a/SpellWork/DBC/Structures/SpellEffectEntry.cs +++ b/SpellWork/DBC/Structures/SpellEffectEntry.cs @@ -1,40 +1,47 @@ -using System.Runtime.InteropServices; +using DBFileReaderLib.Attributes; +using System.Runtime.InteropServices; +using System.Security.Policy; namespace SpellWork.DBC.Structures { [StructLayout(LayoutKind.Sequential)] public class SpellEffectEntry { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public uint[] EffectSpellClassMask; - public uint ID; - public int SpellID; - public uint Effect; - public uint EffectAura; - public int EffectBasePoints; - public uint EffectIndex; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public int[] EffectMiscValues; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public uint[] EffectRadiusIndex; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public uint[] ImplicitTarget; - public uint DifficultyID; - public float EffectAmplitude; - public uint EffectAuraPeriod; - public float EffectBonusCoefficient; - public float EffectChainAmplitude; - public uint EffectChainTargets; - public int EffectDieSides; - public uint EffectItemType; - public uint EffectMechanic; - public float EffectPointsPerResource; - public float EffectRealPointsPerLevel; - public uint EffectTriggerSpell; - public float EffectPosFacing; - public uint EffectAttributes; - public float BonusCoefficientFromAP; - public float PvPMultiplier; + [Index(false)] + public int ID; // $id$ID<32> + public uint Effect; // Effect + public int EffectBasePoints; // EffectBasePoints<32> + public int EffectIndex; // EffectIndex<32> + public int EffectAura; // EffectAura<32> + public int DifficultyID; // DifficultyID<32> + public float EffectAmplitude; // EffectAmplitude + public int EffectAuraPeriod; // EffectAuraPeriod<32> + public float EffectBonusCoefficient; // EffectBonusCoefficient + public float EffectChainAmplitude; // EffectChainAmplitude + public int EffectChainTargets; // EffectChainTargets<32> + public int EffectDieSides; // EffectDieSides<32> + public int EffectItemType; // EffectItemType<32> + public int EffectMechanic; // EffectMechanic<32> + public float EffectPointsPerResource; // EffectPointsPerResource + public float EffectRealPointsPerLevel; // EffectRealPointsPerLevel + public int EffectTriggerSpell; // EffectTriggerSpell<32> + public float EffectPos_facing; // EffectPos_facing + public int EffectAttributes; // EffectAttributes<32> + public float BonusCoefficientFromAP; // BonusCoefficientFromAP + public float PvpMultiplier; // PvpMultiplier + public float Coefficient; // Coefficient + public float Variance; // Variance + public float ResourceCoefficient; // ResourceCoefficient + public float GroupSizeBasePointsCoefficient; // GroupSizeBasePointsCoefficient + [Cardinality(4)] + public int[] EffectSpellClassMask = new int[4]; // EffectSpellClassMask<32>[4] + [Cardinality(2)] + public int[] EffectMiscValue = new int[2]; // EffectMiscValue<32>[2] + [Cardinality(2)] + public uint[] EffectRadiusIndex = new uint[2]; // EffectRadiusIndex[2] + [Cardinality(2)] + public uint[] ImplicitTarget = new uint[2]; // ImplicitTarget[2] + public int SpellID; // $noninline,relation$SpellID<32> public SpellEffectScalingEntry SpellEffectScalingEntry { get; set; } @@ -46,7 +53,7 @@ public string MaxRadius return string.Empty; return $"Max Radius (Id {EffectRadiusIndex[1]}) {DBC.SpellRadius[(int)EffectRadiusIndex[1]].Radius:F}" + - $" (Min: {DBC.SpellRadius[(int)EffectRadiusIndex[1]].RadiusMin:F} Max: {DBC.SpellRadius[(int)EffectRadiusIndex[1]].MaxRadius:F})"; + $" (Min: {DBC.SpellRadius[(int)EffectRadiusIndex[1]].RadiusMin:F} Max: {DBC.SpellRadius[(int)EffectRadiusIndex[1]].RadiusMax:F})"; } } @@ -58,7 +65,7 @@ public string Radius return string.Empty; return $"Radius (Id {EffectRadiusIndex[0]}) {DBC.SpellRadius[(int)EffectRadiusIndex[0]].Radius:F}" + - $" (Min: {DBC.SpellRadius[(int)EffectRadiusIndex[0]].RadiusMin:F} Max: {DBC.SpellRadius[(int)EffectRadiusIndex[0]].MaxRadius:F})"; + $" (Min: {DBC.SpellRadius[(int)EffectRadiusIndex[0]].RadiusMin:F} Max: {DBC.SpellRadius[(int)EffectRadiusIndex[0]].RadiusMax:F})"; } } } diff --git a/SpellWork/DBC/Structures/SpellEffectScalingEntry.cs b/SpellWork/DBC/Structures/SpellEffectScalingEntry.cs index 8c08aa00..a153623a 100644 --- a/SpellWork/DBC/Structures/SpellEffectScalingEntry.cs +++ b/SpellWork/DBC/Structures/SpellEffectScalingEntry.cs @@ -1,10 +1,15 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public class SpellEffectScalingEntry { - public float Coefficient; - public float Variance; - public float ResourceCoefficient; - public int SpellEffectId; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public float Coefficient; // Coefficient + public float Variance; // Variance + public float ResourceCoefficient; // ResourceCoefficient + public int SpellEffectID; // SpellEffectID<32> } } diff --git a/SpellWork/DBC/Structures/SpellEntry.cs b/SpellWork/DBC/Structures/SpellEntry.cs index 8f579750..d8e291a8 100644 --- a/SpellWork/DBC/Structures/SpellEntry.cs +++ b/SpellWork/DBC/Structures/SpellEntry.cs @@ -1,14 +1,16 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellEntry { - public string Name; - public string NameSubtext; - public string Description; - public string AuraDescription; - public int MiscID; - public int ID; - public int DescriptionVariablesID; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public string Name_lang; // Name_lang + public string NameSubtext_lang; // NameSubtext_lang + public string Description_lang; // Description_lang + public string AuraDescription_lang; // AuraDescription_lang /*public List SpellPowerList { diff --git a/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs b/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs index c087d41a..5f531297 100644 --- a/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs +++ b/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs @@ -1,10 +1,14 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellEquippedItemsEntry { - public int SpellID; - public uint EquippedItemInventoryTypeMask; - public uint EquippedItemSubClassMask; - public byte EquippedItemClass; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + public int EquippedItemInvTypes; // EquippedItemInvTypes<32> + public int EquippedItemSubclass; // EquippedItemSubclass<32> + public sbyte EquippedItemClass; // EquippedItemClass<8> } } diff --git a/SpellWork/DBC/Structures/SpellInterruptsEntry.cs b/SpellWork/DBC/Structures/SpellInterruptsEntry.cs index 23371cbe..ecce37a6 100644 --- a/SpellWork/DBC/Structures/SpellInterruptsEntry.cs +++ b/SpellWork/DBC/Structures/SpellInterruptsEntry.cs @@ -1,11 +1,18 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellInterruptsEntry { - public int SpellID; - public uint[] AuraInterruptFlags; - public uint[] ChannelInterruptFlags; - public ushort InterruptFlags; - public byte Difficulty; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public byte DifficultyID; // DifficultyID + public short InterruptFlags; // InterruptFlags<16> + [Cardinality(2)] + public int[] AuraInterruptFlags = new int[2]; // AuraInterruptFlags<32>[2] + [Cardinality(2)] + public int[] ChannelInterruptFlags = new int[2]; // ChannelInterruptFlags<32>[2] + public int SpellID; // SpellID<32> + } } diff --git a/SpellWork/DBC/Structures/SpellLevelsEntry.cs b/SpellWork/DBC/Structures/SpellLevelsEntry.cs index 0918e701..bd800515 100644 --- a/SpellWork/DBC/Structures/SpellLevelsEntry.cs +++ b/SpellWork/DBC/Structures/SpellLevelsEntry.cs @@ -1,12 +1,16 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellLevelsEntry { - public int SpellID; - public ushort BaseLevel; - public ushort MaxLevel; - public ushort SpellLevel; - public byte Difficulty; - public byte MaxUsableLevel; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public short BaseLevel; // BaseLevel<16> + public short MaxLevel; // MaxLevel<16> + public short SpellLevel; // SpellLevel<16> + public byte DifficultyID; // DifficultyID + public byte MaxPassiveAuraLevel; // MaxPassiveAuraLevel + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellMiscEntry.cs b/SpellWork/DBC/Structures/SpellMiscEntry.cs index c7c0fd34..3ad4ea95 100644 --- a/SpellWork/DBC/Structures/SpellMiscEntry.cs +++ b/SpellWork/DBC/Structures/SpellMiscEntry.cs @@ -1,15 +1,22 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellMiscEntry { - public uint[] Attributes; - public float Speed; - public float MultistrikeSpeedMod; + [Index(true)] + public int ID; public ushort CastingTimeIndex; public ushort DurationIndex; public ushort RangeIndex; public byte SchoolMask; - public uint IconFileDataID; - public uint ActiveIconFileDataID; + public int SpellIconFileDataID; + public float Speed; + public int ActiveIconFileDataID; + public float LaunchDelay; + public byte DifficultyID; + [Cardinality(14)] + public int[] Attributes = new int[14]; + public int SpellID; } } diff --git a/SpellWork/DBC/Structures/SpellMissileEntry.cs b/SpellWork/DBC/Structures/SpellMissileEntry.cs index ef2b08cd..201d497a 100644 --- a/SpellWork/DBC/Structures/SpellMissileEntry.cs +++ b/SpellWork/DBC/Structures/SpellMissileEntry.cs @@ -1,21 +1,26 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellMissileEntry { - public uint Flags; - public float DefaultPitchMin; - public float DefaultPitchMax; - public float DefaultSpeedMin; - public float DefaultSpeedMax; - public float RandomizeFacingMin; - public float RandomizeFacingMax; - public float RandomizePitchMin; - public float RandomizePitchMax; - public float RandomizeSpeedMin; - public float RandomizeSpeedMax; - public float Gravity; - public float MaxDuration; - public float CollisionRadius; - public byte UnkLegion; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + public float DefaultPitchMin; // DefaultPitchMin + public float DefaultPitchMax; // DefaultPitchMax + public float DefaultSpeedMin; // DefaultSpeedMin + public float DefaultSpeedMax; // DefaultSpeedMax + public float RandomizeFacingMin; // RandomizeFacingMin + public float RandomizeFacingMax; // RandomizeFacingMax + public float RandomizePitchMin; // RandomizePitchMin + public float RandomizePitchMax; // RandomizePitchMax + public float RandomizeSpeedMin; // RandomizeSpeedMin + public float RandomizeSpeedMax; // RandomizeSpeedMax + public float Gravity; // Gravity + public float MaxDuration; // MaxDuration + public float CollisionRadius; // CollisionRadius + public byte Flags; // Flags } } diff --git a/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs b/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs index c7469c1d..5ba2ee50 100644 --- a/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs +++ b/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs @@ -1,10 +1,15 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellMissileMotionEntry { - public string Name; - public string Script; - public byte Flags; - public byte MissileCount; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public string Name; // Name + public string ScriptBody; // ScriptBody + public byte Flags; // Flags + public byte MissileCount; // MissileCount } } diff --git a/SpellWork/DBC/Structures/SpellPowerEntry.cs b/SpellWork/DBC/Structures/SpellPowerEntry.cs index 0699dc67..4ed16522 100644 --- a/SpellWork/DBC/Structures/SpellPowerEntry.cs +++ b/SpellWork/DBC/Structures/SpellPowerEntry.cs @@ -1,21 +1,24 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellPowerEntry { - public uint SpellID; - public uint ManaCost; - public float ManaCostPercentage; - public float ManaCostPercentagePerSecond; - public uint RequiredAura; - public float HealthCostPercentage; - public byte PowerIndex; - public byte PowerType; - public uint ID; - public uint ManaCostPerLevel; - public uint ManaCostPerSecond; - public uint ManaCostAdditional; // Spell uses [ManaCost, ManaCost+ManaCostAdditional] power - affects tooltip parsing as multiplier on SpellEffectEntry::EffectPointsPerResource - // only SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE, SPELL_EFFECT_WEAPON_DAMAGE, SPELL_EFFECT_NORMALIZED_WEAPON_DMG - public uint PowerDisplayID; - public uint UnitPowerBarID; + public int ManaCost; // ManaCost<32> + public float PowerCostPct; // PowerCostPct + public float PowerPctPerSecond; // PowerPctPerSecond + public int RequiredAuraSpellID; // RequiredAuraSpellID<32> + public float PowerCostMaxPct; // PowerCostMaxPct + public byte OrderIndex; // OrderIndex + public sbyte PowerType; // PowerType<8> + [Index(false)] + public int ID; // $id$ID<32> + public int ManaCostPerLevel; // ManaCostPerLevel<32> + public int ManaPerSecond; // ManaPerSecond<32> + public uint OptionalCost; // OptionalCost + public uint PowerDisplayID; // PowerDisplayID + public int AltPowerBarID; // AltPowerBarID<32> + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellProcsPerMinuteEntry.cs b/SpellWork/DBC/Structures/SpellProcsPerMinuteEntry.cs index c929d227..a0f88a87 100644 --- a/SpellWork/DBC/Structures/SpellProcsPerMinuteEntry.cs +++ b/SpellWork/DBC/Structures/SpellProcsPerMinuteEntry.cs @@ -1,8 +1,13 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public class SpellProcsPerMinuteEntry { - public float BaseProcRate; - public byte Flags; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public float BaseProcRate; // BaseProcRate + public byte Flags; // Flags } } diff --git a/SpellWork/DBC/Structures/SpellRadiusEntry.cs b/SpellWork/DBC/Structures/SpellRadiusEntry.cs index 48184752..0da9ad6c 100644 --- a/SpellWork/DBC/Structures/SpellRadiusEntry.cs +++ b/SpellWork/DBC/Structures/SpellRadiusEntry.cs @@ -1,10 +1,14 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class SpellRadiusEntry { + [Index(true)] + public int ID; public float Radius; public float RadiusPerLevel; public float RadiusMin; - public float MaxRadius; + public float RadiusMax; } } diff --git a/SpellWork/DBC/Structures/SpellRangeEntry.cs b/SpellWork/DBC/Structures/SpellRangeEntry.cs index 8af25a0b..cc882df3 100644 --- a/SpellWork/DBC/Structures/SpellRangeEntry.cs +++ b/SpellWork/DBC/Structures/SpellRangeEntry.cs @@ -1,11 +1,17 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public sealed class SpellRangeEntry { - public float[] MinRange; - public float[] MaxRange; + [Index(true)] + public int ID; public string DisplayName; public string DisplayNameShort; + [Cardinality(2)] + public float[] MinRange; + [Cardinality(2)] + public float[] MaxRange; public byte Flags; } } diff --git a/SpellWork/DBC/Structures/SpellReagentsCurrencyEntry.cs b/SpellWork/DBC/Structures/SpellReagentsCurrencyEntry.cs index 4183bca8..0dcefdf5 100644 --- a/SpellWork/DBC/Structures/SpellReagentsCurrencyEntry.cs +++ b/SpellWork/DBC/Structures/SpellReagentsCurrencyEntry.cs @@ -1,9 +1,13 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellReagentsCurrencyEntry { - public int SpellID; - public ushort CurrencyTypeID; - public ushort CurrencyCount; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // $relation$SpellID<32> + public ushort CurrencyTypesID; // CurrencyTypesID + public ushort CurrencyCount; // CurrencyCount } } diff --git a/SpellWork/DBC/Structures/SpellReagentsEntry.cs b/SpellWork/DBC/Structures/SpellReagentsEntry.cs index efb02c2a..e860b5dc 100644 --- a/SpellWork/DBC/Structures/SpellReagentsEntry.cs +++ b/SpellWork/DBC/Structures/SpellReagentsEntry.cs @@ -1,12 +1,16 @@ -using System.Runtime.InteropServices; +using DBFileReaderLib.Attributes; +using System.Runtime.InteropServices; namespace SpellWork.DBC.Structures { public class SpellReagentsEntry { - public int SpellID; - public uint[] Reagent; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public ushort[] ReagentCount; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + [Cardinality(8)] + public int[] Reagent = new int[8]; // Reagent<32>[8] + [Cardinality(8)] + public short[] ReagentCount = new short[8]; // ReagentCount<16>[8] } } diff --git a/SpellWork/DBC/Structures/SpellScalingEntry.cs b/SpellWork/DBC/Structures/SpellScalingEntry.cs index 268d9401..1764d32e 100644 --- a/SpellWork/DBC/Structures/SpellScalingEntry.cs +++ b/SpellWork/DBC/Structures/SpellScalingEntry.cs @@ -1,11 +1,15 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellScalingEntry { - public int SpellID; - public ushort ScalesFromItemLevel; - public int ScalingClass; - public uint MinScalingLevel; - public uint MaxScalingLevel; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + public short ScalesFromItemLevel; // ScalesFromItemLevel<16> + public int Class; // Class<32> + public uint MinScalingLevel; // MinScalingLevel + public uint MaxScalingLevel; // MaxScalingLevel } } diff --git a/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs b/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs index 41aa6db7..60999376 100644 --- a/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs +++ b/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs @@ -1,10 +1,16 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; + +namespace SpellWork.DBC.Structures { public class SpellShapeshiftEntry { - public int SpellID; - public uint[] ShapeshiftExclude; - public uint[] ShapeshiftMask; - public int StanceBarOrder; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + [Cardinality(2)] + public int[] ShapeshiftExclude = new int[2]; // ShapeshiftExclude<32>[2] + [Cardinality(2)] + public int[] ShapeshiftMask = new int[2]; // ShapeshiftMask<32>[2] + public sbyte StanceBarOrder; // StanceBarOrder<8> } } diff --git a/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs b/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs index f6f7c6af..5c7aa2a9 100644 --- a/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs +++ b/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs @@ -1,14 +1,19 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellTargetRestrictionsEntry { - public int SpellID; - public float ConeAngle; - public float Width; - public uint Targets; - public ushort TargetCreatureType; - public byte DifficultyID; - public byte MaxAffectedTargets; - public uint MaxTargetLevel; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public float ConeDegrees; // ConeDegrees + public float Width; // Width + public int Targets; // Targets<32> + public short TargetCreatureType; // TargetCreatureType<16> + public byte DifficultyID; // DifficultyID + public byte MaxTargets; // MaxTargets + public uint MaxTargetLevel; // MaxTargetLevel + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/DBC/Structures/SpellTotemsEntry.cs b/SpellWork/DBC/Structures/SpellTotemsEntry.cs index 82718b93..5a0632b8 100644 --- a/SpellWork/DBC/Structures/SpellTotemsEntry.cs +++ b/SpellWork/DBC/Structures/SpellTotemsEntry.cs @@ -1,12 +1,16 @@ -using System.Runtime.InteropServices; +using DBFileReaderLib.Attributes; +using System.Runtime.InteropServices; namespace SpellWork.DBC.Structures { public class SpellTotemsEntry { - public int SpellID; - public uint[] Totem; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public ushort[] RequiredTotemCategoryID; + [Index(true)] + public int ID; // $noninline,id$ID<32> + public int SpellID; // SpellID<32> + [Cardinality(2)] + public int[] Totem = new int[2]; // Totem<32>[2] + [Cardinality(2)] + public ushort[] RequiredTotemCategoryID = new ushort[2]; // RequiredTotemCategoryID[2] } } diff --git a/SpellWork/DBC/Structures/SpellVisualEntry.cs b/SpellWork/DBC/Structures/SpellVisualEntry.cs index c44c88f9..4a88b5c3 100644 --- a/SpellWork/DBC/Structures/SpellVisualEntry.cs +++ b/SpellWork/DBC/Structures/SpellVisualEntry.cs @@ -1,37 +1,27 @@ -namespace SpellWork.DBC.Structures +using DBFileReaderLib.Attributes; +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellVisualEntry { - public uint ID; - public uint UnkMoP1; - public uint PrecastKit; - public uint CastingKit; - public uint ImpactKit; - public uint StateKit; - public uint StateDoneKit; - public uint ChannelKit; - public uint UnkMoP2; - public uint MissileModel; - public uint Flags; - public uint CasterImpactKit; - public uint TargetImpactKit; - public int MissileMotionId; - public uint MissileTargetingKit; - public uint UnkMoP3; - public uint InstantAreaKit; - public uint ImpactAreaKit; - public uint PersistentAreaKit; - public float MissileCastOffsetX; - public float MissileCastOffsetY; - public float MissileCastOffsetZ; - public float MissileImpactOffsetX; - public float MissileImpactOffsetY; - public float MissileImpactOffsetZ; - public uint UnkCata1; - public uint Id; - public uint UnkMoP4; - public uint UnkMoP5; - public uint UnkMoP6; - public uint MissileGroupingId; + [Index(true)] + public int ID; // $noninline,id$ID<32> + [Cardinality(3)] + public float[] MissileCastOffset = new float[3]; // MissileCastOffset[3] + [Cardinality(3)] + public float[] MissileImpactOffset = new float[3]; // MissileImpactOffset[3] + public int Flags; // Flags<32> + public ushort SpellVisualMissileSetID; // SpellVisualMissileSetID + public sbyte MissileDestinationAttachment; // MissileDestinationAttachment<8> + public sbyte MissileAttachment; // MissileAttachment<8> + public uint MissileCastPositionerID; // MissileCastPositionerID + public uint MissileImpactPositionerID; // MissileImpactPositionerID + public int MissileTargetingKit; // MissileTargetingKit<32> + public uint AnimEventSoundID; // AnimEventSoundID + public ushort DamageNumberDelay; // DamageNumberDelay + public uint HostileSpellVisualID; // HostileSpellVisualID + public uint CasterSpellVisualID; // CasterSpellVisualID + public uint LowViolenceSpellVisualID; // LowViolenceSpellVisualID } } diff --git a/SpellWork/DBC/Structures/SpellXSpellVisualEntry.cs b/SpellWork/DBC/Structures/SpellXSpellVisualEntry.cs index ce62879e..f0c22e1f 100644 --- a/SpellWork/DBC/Structures/SpellXSpellVisualEntry.cs +++ b/SpellWork/DBC/Structures/SpellXSpellVisualEntry.cs @@ -1,19 +1,20 @@ -namespace SpellWork.DBC.Structures +using System.Security.Policy; + +namespace SpellWork.DBC.Structures { public sealed class SpellXSpellVisualEntry { - public int SpellID; - public uint SpellVisualID; - public uint ID; - public float Chance; - public ushort CasterPlayerConditionID; - public ushort CasterUnitConditionID; - public ushort PlayerConditionID; - public ushort UnitConditionID; - public uint IconFileDataID; - public uint ActiveIconFileDataID; - public byte Flags; - public byte DifficultyID; - public byte Priority; + public uint SpellVisualID; // SpellVisualID + public float Probability; // Probability + public ushort CasterPlayerConditionID; // CasterPlayerConditionID + public ushort CasterUnitConditionID; // CasterUnitConditionID + public ushort ViewerPlayerConditionID; // ViewerPlayerConditionID + public ushort ViewerUnitConditionID; // ViewerUnitConditionID + public int SpellIconFileID; // SpellIconFileID<32> + public int ActiveIconFileID; // ActiveIconFileID<32> + public byte Flags; // Flags + public byte DifficultyID; // DifficultyID + public byte Priority; // Priority + public int SpellID; // $noninline,relation$SpellID<32> } } diff --git a/SpellWork/Database/MySQLConnect.cs b/SpellWork/Database/MySQLConnect.cs index bc643548..2d770126 100644 --- a/SpellWork/Database/MySQLConnect.cs +++ b/SpellWork/Database/MySQLConnect.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Windows.Forms; using MySql.Data.MySqlClient; @@ -38,6 +39,27 @@ private static string GetSpellName(uint id) return string.Empty; } + public static ArrayList GetScriptNames(uint id) + { + ArrayList scripts = new ArrayList(); + string query = $"SELECT * FROM `spell_script_names` where `spell_id` = {id};"; + using (_conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString)) + { + _command = new MySqlCommand(query, _conn); + _conn.Open(); + + using (var reader = _command.ExecuteReader()) + { + while (reader.Read()) + { + var scriptName = reader.GetString(1); + scripts.Add(scriptName); + } + } + } + return scripts; + } + public static void SelectProc(string query) { using (_conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString)) diff --git a/SpellWork/Forms/FormMain.cs b/SpellWork/Forms/FormMain.cs index 401e343f..d553494b 100644 --- a/SpellWork/Forms/FormMain.cs +++ b/SpellWork/Forms/FormMain.cs @@ -423,7 +423,7 @@ private void FamilyTreeAfterCheck(object sender, TreeViewEventArgs e) where spell.SpellFamilyName == ProcInfo.SpellProc.SpellFamilyName && spell.SpellFamilyFlags.ContainsElement(mask) - join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.SpellID into temp1 + join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.Spell into temp1 from skill in temp1.DefaultIfEmpty(new SkillLineAbilityEntry()) join skl in DBC.DBC.SkillLine on skill.SkillLine equals skl.Key into temp2 from SkillLine in temp2.DefaultIfEmpty() diff --git a/SpellWork/Properties/Resources.Designer.cs b/SpellWork/Properties/Resources.Designer.cs index 5853c0d4..8413b602 100644 --- a/SpellWork/Properties/Resources.Designer.cs +++ b/SpellWork/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace SpellWork.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/SpellWork/Properties/Settings.Designer.cs b/SpellWork/Properties/Settings.Designer.cs index 3a425ca8..a39ce870 100644 --- a/SpellWork/Properties/Settings.Designer.cs +++ b/SpellWork/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SpellWork.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -118,18 +118,15 @@ public string GtPath { this["GtPath"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("enUS")] - public string Locale - { - get - { + public string Locale { + get { return ((string)(this["Locale"])); } - set - { + set { this["Locale"] = value; } } diff --git a/SpellWork/Properties/Settings.settings b/SpellWork/Properties/Settings.settings index b3bb84f4..4faf2dca 100644 --- a/SpellWork/Properties/Settings.settings +++ b/SpellWork/Properties/Settings.settings @@ -26,5 +26,8 @@ gt + + enUS + \ No newline at end of file diff --git a/SpellWork/Spell/ProcInfo.cs b/SpellWork/Spell/ProcInfo.cs index bfeab378..6a209b76 100644 --- a/SpellWork/Spell/ProcInfo.cs +++ b/SpellWork/Spell/ProcInfo.cs @@ -19,7 +19,7 @@ public static void Fill(TreeView familyTree, SpellFamilyNames spellfamily) var spells = from spell in DBC.DBC.SpellInfoStore.Values where spell.SpellFamilyName == (uint)spellfamily - join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.SpellID into temp1 + join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.Spell into temp1 from skill in temp1.DefaultIfEmpty(new SkillLineAbilityEntry()) join skl in DBC.DBC.SkillLine on skill.SkillLine equals skl.Key into temp2 @@ -69,11 +69,11 @@ from skillLine in temp2.DefaultIfEmpty() if (isSkill) { - name.AppendFormat("(Skill: ({0}) {1}) ", elem.SkillLine, elem.skillLine.DisplayName); + name.AppendFormat("(Skill: ({0}) {1}) ", elem.SkillLine, elem.skillLine.DisplayName_lang); toolTip.AppendLine(); - toolTip.AppendFormatLine("Skill Name: {0}", elem.skillLine.DisplayName); - toolTip.AppendFormatLine("Description: {0}", elem.skillLine.Description); + toolTip.AppendFormatLine("Skill Name: {0}", elem.skillLine.DisplayName_lang); + toolTip.AppendFormatLine("Description: {0}", elem.skillLine.Description_lang); } name.AppendFormat("({0})", ((SpellSchoolMask)spell.SchoolMask).ToString().NormalizeString("MASK_")); diff --git a/SpellWork/Spell/SpellEnums.cs b/SpellWork/Spell/SpellEnums.cs index fd61cdc0..fc888dca 100644 --- a/SpellWork/Spell/SpellEnums.cs +++ b/SpellWork/Spell/SpellEnums.cs @@ -866,201 +866,216 @@ public enum AuraType /// public enum Targets { - NO_TARGET = 0, - TARGET_UNIT_CASTER = 1, - TARGET_UNIT_NEARBY_ENEMY = 2, - TARGET_UNIT_NEARBY_PARTY = 3, - TARGET_UNIT_NEARBY_ALLY = 4, - TARGET_UNIT_PET = 5, - TARGET_UNIT_TARGET_ENEMY = 6, - TARGET_UNIT_SRC_AREA_ENTRY = 7, - TARGET_UNIT_DEST_AREA_ENTRY = 8, - TARGET_DEST_HOME = 9, - TARGET_10 = 10, - TARGET_UNIT_SRC_AREA_UNK_11 = 11, // teleport target to caster - TARGET_12 = 12, - TARGET_13 = 13, - TARGET_14 = 14, - TARGET_UNIT_SRC_AREA_ENEMY = 15, - TARGET_UNIT_DEST_AREA_ENEMY = 16, - TARGET_DEST_DB = 17, - TARGET_DEST_CASTER = 18, - TARGET_19 = 19, - TARGET_UNIT_CASTER_AREA_PARTY = 20, - TARGET_UNIT_TARGET_ALLY = 21, - TARGET_SRC_CASTER = 22, - TARGET_GAMEOBJECT_TARGET = 23, - TARGET_UNIT_CONE_ENEMY_24 = 24, - TARGET_UNIT_TARGET_ANY = 25, - TARGET_GAMEOBJECT_ITEM_TARGET = 26, - TARGET_UNIT_MASTER = 27, - TARGET_DEST_DYNOBJ_ENEMY = 28, - TARGET_DEST_DYNOBJ_ALLY = 29, - TARGET_UNIT_SRC_AREA_ALLY = 30, - TARGET_UNIT_DEST_AREA_ALLY = 31, - TARGET_DEST_CASTER_SUMMON = 32, // front left, doesn't use radius - TARGET_UNIT_SRC_AREA_PARTY = 33, - TARGET_UNIT_DEST_AREA_PARTY = 34, - TARGET_UNIT_TARGET_PARTY = 35, - TARGET_DEST_CASTER_UNK_36 = 36, - TARGET_UNIT_LASTTARGET_AREA_PARTY = 37, - TARGET_UNIT_NEARBY_ENTRY = 38, - TARGET_DEST_CASTER_FISHING = 39, - TARGET_GAMEOBJECT_NEARBY_ENTRY = 40, - TARGET_DEST_CASTER_FRONT_RIGHT = 41, - TARGET_DEST_CASTER_BACK_RIGHT = 42, - TARGET_DEST_CASTER_BACK_LEFT = 43, - TARGET_DEST_CASTER_FRONT_LEFT = 44, - TARGET_UNIT_TARGET_CHAINHEAL_ALLY = 45, - TARGET_DEST_NEARBY_ENTRY = 46, - TARGET_DEST_CASTER_FRONT = 47, - TARGET_DEST_CASTER_BACK = 48, - TARGET_DEST_CASTER_RIGHT = 49, - TARGET_DEST_CASTER_LEFT = 50, - TARGET_GAMEOBJECT_SRC_AREA = 51, - TARGET_GAMEOBJECT_DEST_AREA = 52, - TARGET_DEST_TARGET_ENEMY = 53, - TARGET_UNIT_CONE_ENEMY_54 = 54, - TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell - TARGET_UNIT_CASTER_AREA_RAID = 56, - TARGET_UNIT_TARGET_RAID = 57, - TARGET_UNIT_NEARBY_RAID = 58, - TARGET_UNIT_CONE_ALLY = 59, - TARGET_UNIT_CONE_ENTRY = 60, - TARGET_UNIT_TARGET_AREA_RAID_CLASS = 61, - TARGET_UNK_62 = 62, - TARGET_DEST_TARGET_ANY = 63, - TARGET_DEST_TARGET_FRONT = 64, - TARGET_DEST_TARGET_BACK = 65, - TARGET_DEST_TARGET_RIGHT = 66, - TARGET_DEST_TARGET_LEFT = 67, - TARGET_DEST_TARGET_FRONT_RIGHT = 68, - TARGET_DEST_TARGET_BACK_RIGHT = 69, - TARGET_DEST_TARGET_BACK_LEFT = 70, - TARGET_DEST_TARGET_FRONT_LEFT = 71, - TARGET_DEST_CASTER_RANDOM = 72, - TARGET_DEST_CASTER_RADIUS = 73, - TARGET_DEST_TARGET_RANDOM = 74, - TARGET_DEST_TARGET_RADIUS = 75, - TARGET_DEST_CHANNEL_TARGET = 76, - TARGET_UNIT_CHANNEL_TARGET = 77, - TARGET_DEST_DEST_FRONT = 78, - TARGET_DEST_DEST_BACK = 79, - TARGET_DEST_DEST_RIGHT = 80, - TARGET_DEST_DEST_LEFT = 81, - TARGET_DEST_DEST_FRONT_RIGHT = 82, - TARGET_DEST_DEST_BACK_RIGHT = 83, - TARGET_DEST_DEST_BACK_LEFT = 84, - TARGET_DEST_DEST_FRONT_LEFT = 85, - TARGET_DEST_DEST_RANDOM = 86, - TARGET_DEST_DEST = 87, - TARGET_DEST_DYNOBJ_NONE = 88, - TARGET_DEST_TRAJ = 89, - TARGET_UNIT_TARGET_MINIPET = 90, - TARGET_DEST_DEST_RADIUS = 91, - TARGET_UNIT_SUMMONER = 92, - TARGET_CORPSE_SRC_AREA_ENEMY = 93, // NYI - TARGET_UNIT_VEHICLE = 94, - TARGET_UNIT_TARGET_PASSENGER = 95, - TARGET_UNIT_PASSENGER_0 = 96, - TARGET_UNIT_PASSENGER_1 = 97, - TARGET_UNIT_PASSENGER_2 = 98, - TARGET_UNIT_PASSENGER_3 = 99, - TARGET_UNIT_PASSENGER_4 = 100, - TARGET_UNIT_PASSENGER_5 = 101, - TARGET_UNIT_PASSENGER_6 = 102, - TARGET_UNIT_PASSENGER_7 = 103, - TARGET_UNIT_CONE_ENEMY_104 = 104, - TARGET_UNIT_UNK_105 = 105, // 1 spell - TARGET_DEST_CHANNEL_CASTER = 106, - TARGET_UNK_DEST_AREA_UNK_107 = 107, // not enough info - only generic spells avalible - TARGET_GAMEOBJECT_CONE = 108, - TARGET_109 = 109, - TARGET_DEST_UNK_110 = 110, // 1 spell - TARGET_UNK_111 = 111, - TARGET_UNK_112 = 112, - TARGET_UNK_113 = 113, - TARGET_UNK_114 = 114, - TARGET_UNK_115 = 115, - TARGET_UNK_116 = 116, - TARGET_UNK_117 = 117, - TARGET_UNK_118 = 118, - TARGET_UNK_119 = 119, - TARGET_UNK_120 = 120, - TARGET_UNK_121 = 121, - TARGET_UNK_122 = 122, - TARGET_UNK_123 = 123, - TARGET_UNK_124 = 124, - TARGET_UNK_125 = 125, - TARGET_UNK_126 = 126, - TARGET_UNK_127 = 127, - TARGET_UNK_128 = 128, - TARGET_UNK_129 = 129, - TARGET_UNK_130 = 130, - TARGET_UNK_131 = 131, - TARGET_UNK_132 = 132, - TARGET_UNK_133 = 133, - TARGET_UNK_134 = 134, - TARGET_UNK_135 = 135, - TARGET_UNK_136 = 136, - TARGET_UNK_137 = 137, - TARGET_UNK_138 = 138, - TARGET_UNK_139 = 139, - TARGET_UNK_140 = 140, - TARGET_UNK_141 = 141, - TARGET_UNK_142 = 142, - TARGET_UNK_143 = 143, - TARGET_UNK_144 = 144, - TARGET_UNK_145 = 145, - TARGET_UNK_146 = 146, - TARGET_UNK_147 = 147, - TARGET_UNK_148 = 148, - TOTAL_SPELL_TARGETS, + NO_TARGET = 0, + TARGET_UNIT_CASTER = 1, + TARGET_UNIT_NEARBY_ENEMY = 2, + TARGET_UNIT_NEARBY_ALLY = 3, + TARGET_UNIT_NEARBY_PARTY = 4, + TARGET_UNIT_PET = 5, + TARGET_UNIT_TARGET_ENEMY = 6, + TARGET_UNIT_SRC_AREA_ENTRY = 7, + TARGET_UNIT_DEST_AREA_ENTRY = 8, + TARGET_DEST_HOME = 9, + TARGET_UNK_10 = 10, + TARGET_UNIT_SRC_AREA_UNK_11 = 11, + TARGET_UNK_12 = 12, + TARGET_UNK_13 = 13, + TARGET_UNK_14 = 14, + TARGET_UNIT_SRC_AREA_ENEMY = 15, + TARGET_UNIT_DEST_AREA_ENEMY = 16, + TARGET_DEST_DB = 17, + TARGET_DEST_CASTER = 18, + TARGET_UNK_19 = 19, + TARGET_UNIT_CASTER_AREA_PARTY = 20, + TARGET_UNIT_TARGET_ALLY = 21, + TARGET_SRC_CASTER = 22, + TARGET_GAMEOBJECT_TARGET = 23, + TARGET_UNIT_CONE_ENEMY_24 = 24, + TARGET_UNIT_TARGET_ANY = 25, + TARGET_GAMEOBJECT_ITEM_TARGET = 26, + TARGET_UNIT_MASTER = 27, + TARGET_DEST_DYNOBJ_ENEMY = 28, + TARGET_DEST_DYNOBJ_ALLY = 29, + TARGET_UNIT_SRC_AREA_ALLY = 30, + TARGET_UNIT_DEST_AREA_ALLY = 31, + TARGET_DEST_CASTER_SUMMON = 32, // front left, doesn't use radius + TARGET_UNIT_SRC_AREA_PARTY = 33, + TARGET_UNIT_DEST_AREA_PARTY = 34, + TARGET_UNIT_TARGET_PARTY = 35, + TARGET_DEST_CASTER_UNK_36 = 36, + TARGET_UNIT_LASTTARGET_AREA_PARTY = 37, + TARGET_UNIT_NEARBY_ENTRY = 38, + TARGET_DEST_CASTER_FISHING = 39, + TARGET_GAMEOBJECT_NEARBY_ENTRY = 40, + TARGET_DEST_CASTER_FRONT_RIGHT = 41, + TARGET_DEST_CASTER_BACK_RIGHT = 42, + TARGET_DEST_CASTER_BACK_LEFT = 43, + TARGET_DEST_CASTER_FRONT_LEFT = 44, + TARGET_UNIT_TARGET_CHAINHEAL_ALLY = 45, + TARGET_DEST_NEARBY_ENTRY = 46, + TARGET_DEST_CASTER_FRONT = 47, + TARGET_DEST_CASTER_BACK = 48, + TARGET_DEST_CASTER_RIGHT = 49, + TARGET_DEST_CASTER_LEFT = 50, + TARGET_GAMEOBJECT_SRC_AREA = 51, + TARGET_GAMEOBJECT_DEST_AREA = 52, + TARGET_DEST_TARGET_ENEMY = 53, + TARGET_UNIT_CONE_180_DEG_ENEMY = 54, // Defaults to 180 if ConeDegrees is not set + TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell + TARGET_UNIT_CASTER_AREA_RAID = 56, + TARGET_UNIT_TARGET_RAID = 57, + TARGET_UNIT_NEARBY_RAID = 58, + TARGET_UNIT_CONE_ALLY = 59, + TARGET_UNIT_CONE_ENTRY = 60, + TARGET_UNIT_TARGET_AREA_RAID_CLASS = 61, + TARGET_DEST_CASTER_GROUND = 62, + TARGET_DEST_TARGET_ANY = 63, + TARGET_DEST_TARGET_FRONT = 64, + TARGET_DEST_TARGET_BACK = 65, + TARGET_DEST_TARGET_RIGHT = 66, + TARGET_DEST_TARGET_LEFT = 67, + TARGET_DEST_TARGET_FRONT_RIGHT = 68, + TARGET_DEST_TARGET_BACK_RIGHT = 69, + TARGET_DEST_TARGET_BACK_LEFT = 70, + TARGET_DEST_TARGET_FRONT_LEFT = 71, + TARGET_DEST_CASTER_RANDOM = 72, + TARGET_DEST_CASTER_RADIUS = 73, + TARGET_DEST_TARGET_RANDOM = 74, + TARGET_DEST_TARGET_RADIUS = 75, + TARGET_DEST_CHANNEL_TARGET = 76, + TARGET_UNIT_CHANNEL_TARGET = 77, + TARGET_DEST_DEST_FRONT = 78, + TARGET_DEST_DEST_BACK = 79, + TARGET_DEST_DEST_RIGHT = 80, + TARGET_DEST_DEST_LEFT = 81, + TARGET_DEST_DEST_FRONT_RIGHT = 82, + TARGET_DEST_DEST_BACK_RIGHT = 83, + TARGET_DEST_DEST_BACK_LEFT = 84, + TARGET_DEST_DEST_FRONT_LEFT = 85, + TARGET_DEST_DEST_RANDOM = 86, + TARGET_DEST_DEST = 87, + TARGET_DEST_DYNOBJ_NONE = 88, + TARGET_DEST_TRAJ = 89, + TARGET_UNIT_TARGET_MINIPET = 90, + TARGET_DEST_DEST_RADIUS = 91, + TARGET_UNIT_SUMMONER = 92, + TARGET_CORPSE_SRC_AREA_ENEMY = 93, // NYI + TARGET_UNIT_VEHICLE = 94, + TARGET_UNIT_TARGET_PASSENGER = 95, + TARGET_UNIT_PASSENGER_0 = 96, + TARGET_UNIT_PASSENGER_1 = 97, + TARGET_UNIT_PASSENGER_2 = 98, + TARGET_UNIT_PASSENGER_3 = 99, + TARGET_UNIT_PASSENGER_4 = 100, + TARGET_UNIT_PASSENGER_5 = 101, + TARGET_UNIT_PASSENGER_6 = 102, + TARGET_UNIT_PASSENGER_7 = 103, + TARGET_UNIT_CONE_CASTER_TO_DEST_ENEMY = 104, + TARGET_UNIT_CASTER_AND_PASSENGERS = 105, + TARGET_DEST_CHANNEL_CASTER = 106, + TARGET_DEST_NEARBY_ENTRY_2 = 107, + TARGET_GAMEOBJECT_CONE_CASTER_TO_DEST_ENEMY = 108, + TARGET_GAMEOBJECT_CONE_CASTER_TO_DEST_ALLY = 109, + TARGET_UNIT_CONE_CASTER_TO_DEST_ENTRY = 110, + TARGET_UNK_111 = 111, // NYI + TARGET_UNK_112 = 112, // NYI + TARGET_UNK_113 = 113, // NYI + TARGET_UNK_114 = 114, // NYI + TARGET_UNIT_SRC_AREA_FURTHEST_ENEMY = 115, + TARGET_UNIT_AND_DEST_LAST_ENEMY = 116, + TARGET_UNK_117 = 117, + TARGET_UNIT_TARGET_ALLY_OR_RAID = 118, // If target is in your party or raid, all party and raid members will be affected + TARGET_CORPSE_SRC_AREA_RAID = 119, + TARGET_UNIT_CASTER_AND_SUMMONS = 120, + TARGET_CORPSE_TARGET_ALLY = 121, + TARGET_UNIT_AREA_THREAT_LIST = 122, // any unit on threat list + TARGET_UNIT_AREA_TAP_LIST = 123, + TARGET_UNIT_TARGET_TAP_LIST = 124, + TARGET_DEST_CASTER_GROUND_2 = 125, + TARGET_UNIT_CASTER_AREA_ENEMY_CLUMP = 126, // NYI + TARGET_DEST_CASTER_ENEMY_CLUMP_CENTROID = 127, // NYI + TARGET_UNIT_RECT_CASTER_ALLY = 128, + TARGET_UNIT_RECT_CASTER_ENEMY = 129, + TARGET_UNIT_RECT_CASTER = 130, + TARGET_DEST_SUMMONER = 131, + TARGET_DEST_TARGET_ALLY = 132, + TARGET_UNIT_LINE_CASTER_TO_DEST_ALLY = 133, + TARGET_UNIT_LINE_CASTER_TO_DEST_ENEMY = 134, + TARGET_UNIT_LINE_CASTER_TO_DEST = 135, + TARGET_UNIT_CONE_CASTER_TO_DEST_ALLY = 136, + TARGET_DEST_CASTER_MOVEMENT_DIRECTION = 137, + TARGET_DEST_DEST_GROUND = 138, + TARGET_UNK_139 = 139, + TARGET_DEST_CASTER_CLUMP_CENTROID = 140, // NYI + TARGET_UNK_141 = 141, + TARGET_UNK_142 = 142, + TARGET_UNK_143 = 143, + TARGET_UNK_144 = 144, + TARGET_UNK_145 = 145, + TARGET_UNK_146 = 146, + TARGET_UNK_147 = 147, + TARGET_UNK_148 = 148, + TOTAL_SPELL_TARGETS }; /// ///Spell proc event related declarations (accessed using SpellMgr functions) /// [Flags] - public enum ProcFlags + public enum ProcFlags : uint { - PROC_FLAG_KILLED = 0x00000001, // 00 Killed by agressor - not sure about this flag - PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward) + PROC_FLAG_HEARTBEAT = 0x00000001, // 00 Heartbeat + PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward) - PROC_FLAG_DONE_MELEE_AUTO_ATTACK = 0x00000004, // 02 Done melee auto attack - PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK = 0x00000008, // 03 Taken melee auto attack + PROC_FLAG_DEAL_MELEE_SWING = 0x00000004, // 02 Deal Melee Swing + PROC_FLAG_TAKE_MELEE_SWING = 0x00000008, // 03 Take Melee Swing - PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS = 0x00000010, // 04 Done attack by Spell that has dmg class melee - PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS = 0x00000020, // 05 Taken attack by Spell that has dmg class melee + PROC_FLAG_DEAL_MELEE_ABILITY = 0x00000010, // 04 Deal Melee Ability + PROC_FLAG_TAKE_MELEE_ABILITY = 0x00000020, // 05 Take Melee Ability - PROC_FLAG_DONE_RANGED_AUTO_ATTACK = 0x00000040, // 06 Done ranged auto attack - PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK = 0x00000080, // 07 Taken ranged auto attack + PROC_FLAG_DEAL_RANGED_ATTACK = 0x00000040, // 06 Deal Ranged Attack + PROC_FLAG_TAKE_RANGED_ATTACK = 0x00000080, // 07 Take Ranged Attack - PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS = 0x00000100, // 08 Done attack by Spell that has dmg class ranged - PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS = 0x00000200, // 09 Taken attack by Spell that has dmg class ranged + PROC_FLAG_DEAL_RANGED_ABILITY = 0x00000100, // 08 Deal Ranged Ability + PROC_FLAG_TAKE_RANGED_ABILITY = 0x00000200, // 09 Take Ranged Ability - PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS = 0x00000400, // 10 Done positive spell that has dmg class none - PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS = 0x00000800, // 11 Taken positive spell that has dmg class none + PROC_FLAG_DEAL_HELPFUL_ABILITY = 0x00000400, // 10 Deal Helpful Ability + PROC_FLAG_TAKE_HELPFUL_ABILITY = 0x00000800, // 11 Take Helpful Ability - PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG = 0x00001000, // 12 Done negative spell that has dmg class none - PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG = 0x00002000, // 13 Taken negative spell that has dmg class none + PROC_FLAG_DEAL_HARMFUL_ABILITY = 0x00001000, // 12 Deal Harmful Ability + PROC_FLAG_TAKE_HARMFUL_ABILITY = 0x00002000, // 13 Take Harmful Ability - PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS = 0x00004000, // 14 Done positive spell that has dmg class magic - PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS = 0x00008000, // 15 Taken positive spell that has dmg class magic + PROC_FLAG_DEAL_HELPFUL_SPELL = 0x00004000, // 14 Deal Helpful Spell + PROC_FLAG_TAKE_HELPFUL_SPELL = 0x00008000, // 15 Take Helpful Spell - PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG = 0x00010000, // 16 Done negative spell that has dmg class magic - PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG = 0x00020000, // 17 Taken negative spell that has dmg class magic + PROC_FLAG_DEAL_HARMFUL_SPELL = 0x00010000, // 16 Deal Harmful Spell + PROC_FLAG_TAKE_HARMFUL_SPELL = 0x00020000, // 17 Take Harmful Spell - PROC_FLAG_DONE_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing) - PROC_FLAG_TAKEN_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing) + PROC_FLAG_DEAL_HARMFUL_PERIODIC = 0x00040000, // 18 Deal Harmful Periodic + PROC_FLAG_TAKE_HARMFUL_PERIODIC = 0x00080000, // 19 Take Harmful Periodic - PROC_FLAG_TAKEN_DAMAGE = 0x00100000, // 20 Taken any damage - PROC_FLAG_DONE_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation (possibly needs name change to ON_GAMEOBJECT_CAST or USE) + PROC_FLAG_TAKE_ANY_DAMAGE = 0x00100000, // 20 Take Any Damage - PROC_FLAG_DONE_MAINHAND_ATTACK = 0x00400000, // 22 Done main-hand melee attacks (spell and autoattack) - PROC_FLAG_DONE_OFFHAND_ATTACK = 0x00800000, // 23 Done off-hand melee attacks (spell and autoattack) + PROC_FLAG_DEAL_HELPFUL_PERIODIC = 0x00200000, // 21 Deal Helpful Periodic - PROC_FLAG_DEATH = 0x01000000 // 24 Died in any way + PROC_FLAG_MAIN_HAND_WEAPON_SWING = 0x00400000, // 22 Main Hand Weapon Swing + PROC_FLAG_OFF_HAND_WEAPON_SWING = 0x00800000, // 23 Off Hand Weapon Swing + + PROC_FLAG_DEATH = 0x01000000, // 24 Died in any way + + PROC_FLAG_JUMP = 0x02000000, // 25 Jumped + + PROC_FLAG_PROC_CLONE_SPELL = 0x04000000, // 26 Proc Clone Spell + + PROC_FLAG_ENTER_COMBAT = 0x08000000, // 27 Entered combat + + PROC_FLAG_ENCOUNTER_START = 0x10000000, // 28 Encounter started + + PROC_FLAG_CAST_ENDED = 0x20000000, // 29 Cast Ended + + PROC_FLAG_LOOTED = 0x40000000, // 30 Looted (took from loot, not opened loot window) + + PROC_FLAG_TAKE_HELPFUL_PERIODIC = 0x80000000, // 31 Take Helpful Periodic }; [Flags] @@ -1196,9 +1211,10 @@ public enum SpellDmgClass public enum SpellPreventionType { - SPELL_PREVENTION_TYPE_NONE = 0, - SPELL_PREVENTION_TYPE_SILENCE = 1, - SPELL_PREVENTION_TYPE_PACIFY = 2 + SPELL_PREVENTION_TYPE_NONE = 0, + SPELL_PREVENTION_TYPE_SILENCE = 1, + SPELL_PREVENTION_TYPE_PACIFY = 2, + SPELL_PREVENTION_TYPE_NO_ACTIONS = 4 }; [Flags] @@ -1441,7 +1457,7 @@ public enum ItemSubClassWeaponMask POLEARM = 1 << 6, SWORD = 1 << 7, SWORD2 = 1 << 8, - OBSOLETE = 1 << 9, + WARGLAIVES = 1 << 9, STAFF = 1 << 10, EXOTIC = 1 << 11, EXOTIC2 = 1 << 12, @@ -1458,30 +1474,32 @@ public enum ItemSubClassWeaponMask [Flags] public enum ItemSubClassArmorMask { - ALL = -1, - MISC = 1 << 0, - CLOTH = 1 << 1, - LEATHER = 1 << 2, - MAIL = 1 << 3, - PLATE = 1 << 4, - BUCKLER = 1 << 5, - SHIELD = 1 << 6, - LIBRAM = 1 << 7, - IDOL = 1 << 8, - TOTEM = 1 << 9, - SIGIL = 1 << 10 + ALL = -1, + MISCELLANEOUS = 1 << 0, + CLOTH = 1 << 1, + LEATHER = 1 << 2, + MAIL = 1 << 3, + PLATE = 1 << 4, + COSMETIC = 1 << 5, + SHIELD = 1 << 6, + LIBRAM = 1 << 7, + IDOL = 1 << 8, + TOTEM = 1 << 9, + SIGIL = 1 << 10, + RELIC = 1 << 11, }; [Flags] public enum ItemSubClassMiscMask { - ALL = -1, - JUNK = 1 << 0, - REAGENT = 1 << 1, - PET = 1 << 2, - HOLIDAY = 1 << 3, - OTHER = 1 << 4, - MOUNT = 1 << 5, + ALL = -1, + JUNK = 1 << 0, + REAGENT = 1 << 1, + COMPANION_PET = 1 << 2, + HOLIDAY = 1 << 3, + OTHER = 1 << 4, + MOUNT = 1 << 5, + MOUNT_EQUIPMENT = 1 << 6 } [Flags] @@ -1501,7 +1519,9 @@ public enum CreatureTypeMask NOT_SPECIFIED = 1 << 9, TOTEM = 1 << 10, NON_COMBAT_PET = 1 << 11, - GAS_CLOUD = 1 << 12 + GAS_CLOUD = 1 << 12, + WILD_PET = 1 << 13, + ABERRATION = 1 << 14 }; [Flags] @@ -2105,52 +2125,84 @@ public enum UnitMods [Flags] enum SpellInterruptFlags { - SPELL_INTERRUPT_FLAG_MOVEMENT = 0x01, // why need this for instant? - SPELL_INTERRUPT_FLAG_PUSH_BACK = 0x02, // push back - SPELL_INTERRUPT_FLAG_UNK3 = 0x04, // any info? - SPELL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt - SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10, // _complete_ interrupt on direct damage - SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph" + None = 0, + Movement = 0x00000001, + DamagePushbackPlayerOnly = 0x00000002, + Stun = 0x00000004, // useless, even spells without it get interrupted + Combat = 0x00000008, + DamageCancelsPlayerOnly = 0x00000010, + MeleeCombat = 0x00000020, // NYI + Immunity = 0x00000040, // NYI + DamageAbsorb = 0x00000080, + ZeroDamageCancels = 0x00000100, + DamagePushback = 0x00000200, + DamageCancels = 0x00000400 }; [Flags] - enum SpellChannelInterruptFlags + enum SpellAuraInterruptFlags : uint { - CHANNEL_INTERRUPT_FLAG_INTERRUPT = 0x0008, // interrupt - CHANNEL_FLAG_DELAY = 0x4000 + None = 0, + HostileActionReceived = 0x00000001, + Damage = 0x00000002, + Action = 0x00000004, + Moving = 0x00000008, + Turning = 0x00000010, + Anim = 0x00000020, + Dismount = 0x00000040, + UnderWater = 0x00000080, + AboveWater = 0x00000100, + Sheathing = 0x00000200, + Interacting = 0x00000400, + Looting = 0x00000800, + Attacking = 0x00001000, + ItemUse = 0x00002000, + DamageChannelDuration = 0x00004000, + Shapeshifting = 0x00008000, + ActionDelayed = 0x00010000, + Mount = 0x00020000, + Standing = 0x00040000, + LeaveWorld = 0x00080000, + StealthOrInvis = 0x00100000, + InvulnerabilityBuff = 0x00200000, + EnterWorld = 0x00400000, + PvPActive = 0x00800000, + NonPeriodicDamage = 0x01000000, + LandingOrFlight = 0x02000000, + Release = 0x04000000, + DamageScript = 0x08000000, + EnteringCombat = 0x10000000, + Login = 0x20000000, + Summon = 0x40000000, + LeavingCombat = 0x80000000, }; [Flags] - enum SpellAuraInterruptFlags + enum SpellAuraInterruptFlags2 : uint { - AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000001, // 0 removed when getting hit by a negative spell? - AURA_INTERRUPT_FLAG_TAKE_DAMAGE = 0x00000002, // 1 removed by any damage - AURA_INTERRUPT_FLAG_CAST = 0x00000004, // 2 cast any spells - AURA_INTERRUPT_FLAG_MOVE = 0x00000008, // 3 removed by any movement - AURA_INTERRUPT_FLAG_TURNING = 0x00000010, // 4 removed by any turning - AURA_INTERRUPT_FLAG_JUMP = 0x00000020, // 5 removed by entering combat - AURA_INTERRUPT_FLAG_NOT_MOUNTED = 0x00000040, // 6 removed by dismounting - AURA_INTERRUPT_FLAG_NOT_ABOVEWATER = 0x00000080, // 7 removed by entering water - AURA_INTERRUPT_FLAG_NOT_UNDERWATER = 0x00000100, // 8 removed by leaving water - AURA_INTERRUPT_FLAG_NOT_SHEATHED = 0x00000200, // 9 removed by unsheathing - AURA_INTERRUPT_FLAG_TALK = 0x00000400, // 10 talk to npc / loot? action on creature - AURA_INTERRUPT_FLAG_USE = 0x00000800, // 11 mine/use/open action on gameobject - AURA_INTERRUPT_FLAG_MELEE_ATTACK = 0x00001000, // 12 removed by attacking - AURA_INTERRUPT_FLAG_SPELL_ATTACK = 0x00002000, // 13 ??? - AURA_INTERRUPT_FLAG_UNK14 = 0x00004000, // 14 - AURA_INTERRUPT_FLAG_TRANSFORM = 0x00008000, // 15 removed by transform? - AURA_INTERRUPT_FLAG_UNK16 = 0x00010000, // 16 - AURA_INTERRUPT_FLAG_MOUNT = 0x00020000, // 17 misdirect, aspect, swim speed - AURA_INTERRUPT_FLAG_NOT_SEATED = 0x00040000, // 18 removed by standing up (used by food and drink mostly and sleep/Fake Death like) - AURA_INTERRUPT_FLAG_CHANGE_MAP = 0x00080000, // 19 leaving map/getting teleported - AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION = 0x00100000, // 20 removed by auras that make you invulnerable, or make other to lose selection on you - AURA_INTERRUPT_FLAG_UNK21 = 0x00200000, // 21 - AURA_INTERRUPT_FLAG_TELEPORTED = 0x00400000, // 22 - AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat - AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage - AURA_INTERRUPT_FLAG_LANDING = 0x02000000, // 25 removed by hitting the ground - - AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE) + None = 0, + Falling = 0x00000001, + Swimming = 0x00000002, + NotMoving = 0x00000004, + Ground = 0x00000008, + Transform = 0x00000010, + Jump = 0x00000020, + ChangeSpec = 0x00000040, + AbandonVehicle = 0x00000080, + StartOfEncounter = 0x00000100, + EndOfEncounter = 0x00000200, + Disconnect = 0x00000400, + EnteringInstance = 0x00000800, + DuelEnd = 0x00001000, + LeaveArenaOrBattleground = 0x00002000, + ChangeTalent = 0x00004000, + ChangeGlyph = 0x00008000, + SeamlessTransfer = 0x00010000, + WarModeLeave = 0x00020000, + TouchingGround = 0x00040000, + ChromieTime = 0x00080000, + SplineFlightOrFreeFlight = 0x00100000, + ProcOrPeriodicAttacking = 0x00200000 }; // ReSharper restore InconsistentNaming @@ -2162,7 +2214,7 @@ public class SpellEnums public static readonly string[] ProcFlagDesc = { //00 0x00000001 000000000000000000000001 - - "00 Killed by aggressor that receive experience or honor", + "00 Heartbeat", //01 0x00000002 000000000000000000000010 - "01 Kill that yields experience or honor", @@ -2214,7 +2266,7 @@ public class SpellEnums //20 0x00100000 000100000000000000000000 - "20 Taken any damage", //21 0x00200000 001000000000000000000000 - - "21 On trap activation", + "21 Deal helpful periodic", //22 0x00800000 010000000000000000000000 - "22 Successful main-hand melee attacks", @@ -2223,13 +2275,19 @@ public class SpellEnums //24 0x01000000 "24 On death", - "25", - "26", - "27", - "28", - "29", - "30", - "31" + //25 0x02000000 + "25 Jumped", + "26 Proc Clone Spell", + //27 0x08000000 + "27 Entered combat", + //28 0x10000000 + "28 Encounter started", + "29 On end of spell cast", + "30 Looted something", + "31 Taken helpful periodic", + "32 Kill or assist in killing target (not restricted to killing blow)", + "33 Knockback", + "34 Cast Successful", }; #endregion } diff --git a/SpellWork/Spell/SpellInfo.cs b/SpellWork/Spell/SpellInfo.cs index 383c333e..dd92e11c 100644 --- a/SpellWork/Spell/SpellInfo.cs +++ b/SpellWork/Spell/SpellInfo.cs @@ -45,38 +45,38 @@ public class SpellInfo #region SpellDuration public int Duration => DurationEntry?.Duration ?? 0; - public int DurationPerLevel => DurationEntry?.DurationPerLevel ?? 0; + public uint DurationPerLevel => DurationEntry?.DurationPerLevel ?? 0; public int MaxDuration => DurationEntry?.MaxDuration ?? 0; #endregion #region Spell public int ID => Spell.ID; - public string Name => Spell.Name; - public string Description => Spell.Description; - public string Tooltip => Spell.AuraDescription; - public int MiscID => Spell.MiscID; + public string Name => Spell.Name_lang; + public string Description => Spell.Description_lang; + public string Tooltip => Spell.AuraDescription_lang; + public int MiscID => Spell.ID; #endregion #region SpellMisc // SpellMisc - public uint Attributes => Misc?.Attributes[0] ?? 0; - public uint AttributesEx => Misc?.Attributes[1] ?? 0; - public uint AttributesEx2 => Misc?.Attributes[2] ?? 0; - public uint AttributesEx3 => Misc?.Attributes[3] ?? 0; - public uint AttributesEx4 => Misc?.Attributes[4] ?? 0; - public uint AttributesEx5 => Misc?.Attributes[5] ?? 0; - public uint AttributesEx6 => Misc?.Attributes[6] ?? 0; - public uint AttributesEx7 => Misc?.Attributes[7] ?? 0; - public uint AttributesEx8 => Misc?.Attributes[8] ?? 0; - public uint AttributesEx9 => Misc?.Attributes[9] ?? 0; - public uint AttributesEx10 => Misc?.Attributes[10] ?? 0; - public uint AttributesEx11 => Misc?.Attributes[11] ?? 0; - public uint AttributesEx12 => Misc?.Attributes[12] ?? 0; - public uint AttributesEx13 => Misc?.Attributes[13] ?? 0; + public uint Attributes => (uint)(Misc?.Attributes[0] ?? 0); + public uint AttributesEx => (uint)(Misc?.Attributes[1] ?? 0); + public uint AttributesEx2 => (uint)(Misc?.Attributes[2] ?? 0); + public uint AttributesEx3 => (uint)(Misc?.Attributes[3] ?? 0); + public uint AttributesEx4 => (uint)(Misc?.Attributes[4] ?? 0); + public uint AttributesEx5 => (uint)(Misc?.Attributes[5] ?? 0); + public uint AttributesEx6 => (uint)(Misc?.Attributes[6] ?? 0); + public uint AttributesEx7 => (uint)(Misc?.Attributes[7] ?? 0); + public uint AttributesEx8 => (uint)(Misc?.Attributes[8] ?? 0); + public uint AttributesEx9 => (uint)(Misc?.Attributes[9] ?? 0); + public uint AttributesEx10 => (uint)(Misc?.Attributes[10] ?? 0); + public uint AttributesEx11 => (uint)(Misc?.Attributes[11] ?? 0); + public uint AttributesEx12 => (uint)(Misc?.Attributes[12] ?? 0); + public uint AttributesEx13 => (uint)(Misc?.Attributes[13] ?? 0); public float Speed => Misc?.Speed ?? 0; public int CastingTimeIndex => Misc?.CastingTimeIndex ?? 0; - public uint ActiveIconFileDataID => Misc?.ActiveIconFileDataID ?? 0; - public uint IconFileDataID => Misc?.IconFileDataID ?? 0; + public int ActiveIconFileDataID => Misc?.ActiveIconFileDataID ?? 0; + public int IconFileDataID => Misc?.SpellIconFileDataID ?? 0; public int RangeIndex => Misc?.RangeIndex ?? 0; public uint SchoolMask => (uint)(Misc?.SchoolMask ?? 0); #endregion @@ -85,30 +85,30 @@ public class SpellInfo // SpellClassOptions public uint ModalNextSpell => ClassOptions?.ModalNextSpell ?? 0; public uint SpellFamilyName => ClassOptions?.SpellClassSet ?? 0; - public uint[] SpellFamilyFlags => ClassOptions?.SpellFamilyFlags ?? new uint[4]; + public uint[] SpellFamilyFlags => Array.ConvertAll(ClassOptions?.SpellClassMask ?? new int[4], i => (uint)i); #endregion #region SpellCategories // SpellCategories public int DamageClass => Categories?.DefenseType ?? 0; public int PreventionType => Categories?.PreventionType ?? 0; - public uint Category => Categories?.Category ?? 0; + public int Category => Categories?.Category ?? 0; public int Dispel => Categories?.DispelType ?? 0; public int Mechanic => Categories?.Mechanic ?? 0; #endregion #region SpellShapeshift // SpellShapeshift - public ulong Stances => ((Shapeshift?.ShapeshiftMask[0] ?? 0) << 32) | (Shapeshift?.ShapeshiftMask[1] ?? 0); - public ulong StancesNot => ((Shapeshift?.ShapeshiftExclude[0] ?? 0) << 32) | (Shapeshift?.ShapeshiftExclude[1] ?? 0); + public ulong Stances => (ulong)(((Shapeshift?.ShapeshiftMask[0] ?? 0) << 32) | (Shapeshift?.ShapeshiftMask[1] ?? 0)); + public ulong StancesNot => (ulong)(((Shapeshift?.ShapeshiftExclude[0] ?? 0) << 32) | (Shapeshift?.ShapeshiftExclude[1] ?? 0)); #endregion #region SpellCooldowns // SpellCooldowns - public uint CategoryRecoveryTime => Cooldowns?.CategoryRecoveryTime ?? 0; - public uint RecoveryTime => Cooldowns?.RecoveryTime ?? 0; - public uint StartRecoveryTime => Cooldowns?.StartRecoveryTime ?? 0; - public uint StartRecoveryCategory => Categories?.StartRecoveryCategory ?? 0; + public int CategoryRecoveryTime => Cooldowns?.CategoryRecoveryTime ?? 0; + public int RecoveryTime => Cooldowns?.RecoveryTime ?? 0; + public int StartRecoveryTime => Cooldowns?.StartRecoveryTime ?? 0; + public int StartRecoveryCategory => Categories?.StartRecoveryCategory ?? 0; #endregion #region SpellAuraRestrictions @@ -124,11 +124,12 @@ public class SpellInfo #endregion #region SpellAuraOptions - public uint ProcCharges => AuraOptions?.ProcCharges ?? 0; + public int ProcCharges => AuraOptions?.ProcCharges ?? 0; public uint ProcChance => AuraOptions?.ProcChance ?? 0; - public uint ProcFlags => AuraOptions?.ProcTypeMask ?? 0; + public uint ProcFlags => (uint)(AuraOptions?.ProcTypeMask[0] ?? 0); + public uint ProcFlagsEx => (uint)(AuraOptions?.ProcTypeMask[1] ?? 0); public uint CumulativeAura => AuraOptions?.CumulativeAura ?? 0; - public uint ProcCooldown => AuraOptions?.ProcCategoryRecovery ?? 0; + public int ProcCooldown => AuraOptions?.ProcCategoryRecovery ?? 0; #endregion #region SpellLevels @@ -136,14 +137,14 @@ public class SpellInfo public int BaseLevel => Levels?.BaseLevel ?? 0; public int MaxLevel => Levels?.MaxLevel ?? 0; public int SpellLevel => Levels?.SpellLevel ?? 0; - public int MaxUsableLevel => Levels?.MaxUsableLevel ?? 0; + public int MaxPassiveAuraLevel => Levels?.MaxPassiveAuraLevel ?? 0; #endregion #region EquippedItems // Equippeditems public int EquippedItemClass => EquippedItems?.EquippedItemClass ?? 0; - public uint EquippedItemInventoryTypeMask => EquippedItems?.EquippedItemInventoryTypeMask ?? 0; - public uint EquippedItemSubClassMask => EquippedItems?.EquippedItemSubClassMask ?? 0; + public int EquippedItemInventoryType => EquippedItems?.EquippedItemInvTypes ?? 0; + public int EquippedItemSubClass => EquippedItems?.EquippedItemSubclass ?? 0; #endregion #region SpellXSpellVisual @@ -154,7 +155,7 @@ public class SpellInfo public uint RequiredAreasId => CastingRequirements?.RequiredAreasID ?? 0; public uint FacingCasterFlags => CastingRequirements?.FacingCasterFlags ?? 0; public uint MinFactionID => CastingRequirements?.MinFactionID ?? 0; - public uint MinReputation => CastingRequirements?.MinReputation ?? 0; + public int MinReputation => CastingRequirements?.MinReputation ?? 0; public uint RequiredAuraVision => CastingRequirements?.RequiredAuraVision ?? 0; public uint RequiresSpellFocus => CastingRequirements?.RequiresSpellFocus ?? 0; #endregion @@ -166,11 +167,11 @@ public class SpellInfo #region SpellInterrupts // SpellInterrupts - public uint AuraInterruptFlags => Interrupts?.AuraInterruptFlags[0] ?? 0; - public uint AuraInterruptFlags2 => Interrupts?.AuraInterruptFlags[1] ?? 0; - public uint ChannelInterruptFlags => Interrupts?.ChannelInterruptFlags[0] ?? 0; - public uint ChannelInterruptFlags2 => Interrupts?.ChannelInterruptFlags[1] ?? 0; - public uint InterruptFlags => Interrupts?.InterruptFlags ?? 0; + public int AuraInterruptFlags => Interrupts?.AuraInterruptFlags[0] ?? 0; + public int AuraInterruptFlags2 => Interrupts?.AuraInterruptFlags[1] ?? 0; + public int ChannelInterruptFlags => Interrupts?.ChannelInterruptFlags[0] ?? 0; + public int ChannelInterruptFlags2 => Interrupts?.ChannelInterruptFlags[1] ?? 0; + public int InterruptFlags => Interrupts?.InterruptFlags ?? 0; #endregion public string ProcInfo @@ -198,7 +199,7 @@ public SpellInfo(SpellEntry spellEntry) { SpellDescriptionVariablesEntry variables; Spell = spellEntry; - if (DBC.DBC.SpellDescriptionVariables.TryGetValue(spellEntry.DescriptionVariablesID, out variables)) + if (DBC.DBC.SpellDescriptionVariables.TryGetValue(spellEntry.ID, out variables)) DescriptionVariables = variables; } @@ -210,6 +211,20 @@ public void Write(RichTextBox rtb) rtb.AppendFormatLine("ID - {0} {1}{2}", ID, Name, Scaling != null ? $" (Level {DBC.DBC.SelectedLevel})" : string.Empty); rtb.SetDefaultStyle(); + rtb.AppendLine($"https://wowhead.com/spell={ID}"); + + if (MySqlConnection.Connected) + { + var scripts = MySqlConnection.GetScriptNames((uint)ID); + if (scripts.Count > 0) + { + rtb.AppendLine("Scripts:"); + rtb.SetStyle(Color.Blue, FontStyle.Bold); + foreach (string script in scripts) + rtb.AppendLine(script); + rtb.SetDefaultStyle(); + } + } rtb.AppendFormatLine(Separator); @@ -222,7 +237,7 @@ public void Write(RichTextBox rtb) } rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", ModalNextSpell); - if (!string.IsNullOrEmpty(Spell.Description) && !string.IsNullOrEmpty(Spell.AuraDescription) && ModalNextSpell != 0) + if (!string.IsNullOrEmpty(Spell.Description_lang) && !string.IsNullOrEmpty(Spell.AuraDescription_lang) && ModalNextSpell != 0) rtb.AppendFormatLine(Separator); #region Triggered by ... @@ -233,7 +248,7 @@ public void Write(RichTextBox rtb) { var procname = "Spell Not Found"; if (DBC.DBC.Spell.ContainsKey(procSpellId)) - procname = DBC.DBC.Spell[procSpellId].Name; + procname = DBC.DBC.Spell[procSpellId].Name_lang; rtb.SetStyle(Color.Blue, FontStyle.Bold); rtb.AppendFormatLine("Triggered by spell: ({0}) {1}", procSpellId, procname); @@ -264,7 +279,7 @@ from eff in s.Effects { rtb.SetStyle(Color.Blue, FontStyle.Bold); rtb.AppendFormatLine("Modified by {0} ({1})", - DBC.DBC.SpellInfoStore[eff.SpellID].Spell.Name, eff.SpellID); + DBC.DBC.SpellInfoStore[eff.SpellID].Spell.Name_lang, eff.SpellID); } #endregion @@ -321,8 +336,8 @@ from eff in s.Effects rtb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})", targetRestriction.TargetCreatureType, (CreatureTypeMask)targetRestriction.TargetCreatureType); - if (targetRestriction.MaxAffectedTargets != 0) - rtb.AppendFormatLine("MaxAffectedTargets: {0}", targetRestriction.MaxAffectedTargets); + if (targetRestriction.MaxTargets != 0) + rtb.AppendFormatLine("MaxAffectedTargets: {0}", targetRestriction.MaxTargets); } } @@ -334,13 +349,13 @@ from eff in s.Effects // Skills { - var query = DBC.DBC.SkillLineAbility.Where(skl => skl.Value.SpellID == Spell.ID).ToArray(); + var query = DBC.DBC.SkillLineAbility.Where(skl => skl.Value.Spell == Spell.ID).ToArray(); if (query.Length != 0) { var skill = query.First().Value; var line = DBC.DBC.SkillLine[skill.SkillLine]; - rtb.AppendFormatLine(@"Skill (Id {0}) ""{1}""", skill.SkillLine, line.DisplayName); + rtb.AppendFormatLine(@"Skill (Id {0}) ""{1}""", skill.SkillLine, line.DisplayName_lang); rtb.AppendFormat(" MinSkillLineRank {0}", skill.MinSkillLineRank); rtb.AppendFormat(", SupercedesSpell = {0}, MinMaxValue ({1}, {2})", skill.SupercedesSpell, @@ -383,7 +398,7 @@ from eff in s.Effects printedHeader = true; } - rtb.AppendFormat(" {0} x{1}", reagentsCurrency.CurrencyTypeID, reagentsCurrency.CurrencyCount); + rtb.AppendFormat(" {0} x{1}", reagentsCurrency.CurrencyTypesID, reagentsCurrency.CurrencyCount); } if (printedHeader) @@ -391,30 +406,30 @@ from eff in s.Effects } rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, max usable {3}", - SpellLevel, BaseLevel, MaxLevel, MaxUsableLevel); + SpellLevel, BaseLevel, MaxLevel, MaxPassiveAuraLevel); if (EquippedItemClass != 0) { rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", EquippedItemClass, (ItemClass)EquippedItemClass); - if (EquippedItemSubClassMask != 0) + if (EquippedItemSubClass != 0) { switch ((ItemClass)EquippedItemClass) { case ItemClass.WEAPON: - rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", EquippedItemSubClassMask, (ItemSubClassWeaponMask)EquippedItemSubClassMask); + rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", EquippedItemSubClass, (ItemSubClassWeaponMask)EquippedItemSubClass); break; case ItemClass.ARMOR: - rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", EquippedItemSubClassMask, (ItemSubClassArmorMask)EquippedItemSubClassMask); + rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", EquippedItemSubClass, (ItemSubClassArmorMask)EquippedItemSubClass); break; case ItemClass.MISC: - rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", EquippedItemSubClassMask, (ItemSubClassMiscMask)EquippedItemSubClassMask); + rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", EquippedItemSubClass, (ItemSubClassMiscMask)EquippedItemSubClass); break; } } - if (EquippedItemInventoryTypeMask != 0) - rtb.AppendFormatLine(" InventoryType mask = 0x{0:X8} ({1})", EquippedItemInventoryTypeMask, (InventoryTypeMask)EquippedItemInventoryTypeMask); + if (EquippedItemInventoryType != 0) + rtb.AppendFormatLine(" InventoryType mask = 0x{0:X8} ({1})", EquippedItemInventoryType, (InventoryTypeMask)EquippedItemInventoryType); } rtb.AppendLine(); @@ -449,14 +464,14 @@ from eff in s.Effects level = Scaling.MaxScalingLevel; if (Levels != null && Levels.BaseLevel != 0) - level -= Levels.BaseLevel; + level -= (ushort)Levels.BaseLevel; if (Scaling != null && level < Scaling.MinScalingLevel) level = Scaling.MinScalingLevel; - var castTime = castTimeEntry.CastTime + castTimeEntry.CastTimePerLevel * level; - if (castTime < castTimeEntry.MinCastTime) - castTime = castTimeEntry.MinCastTime; + var castTime = castTimeEntry.Base + castTimeEntry.PerLevel * level; + if (castTime < castTimeEntry.Minimum) + castTime = castTimeEntry.Minimum; rtb.AppendFormatLine("Cast Time: (ID {0}): {1}", CastingTimeIndex, castTime); } @@ -473,8 +488,8 @@ from eff in s.Effects if (Interrupts != null) { rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8} ({1})", Interrupts.InterruptFlags, (SpellInterruptFlags)Interrupts.InterruptFlags); - rtb.AppendFormatLine("AuraInterrupt Flags: 0x{0:X8} ({1}), 0x{2:X8} ({3})", Interrupts.AuraInterruptFlags[0], (SpellAuraInterruptFlags)Interrupts.AuraInterruptFlags[0], Interrupts.AuraInterruptFlags[1], (SpellAuraInterruptFlags)Interrupts.AuraInterruptFlags[1]); - rtb.AppendFormatLine("ChannelInterrupt Flags: 0x{0:X8} ({1}), 0x{2:X8} ({3})", Interrupts.ChannelInterruptFlags[0], (SpellChannelInterruptFlags)Interrupts.ChannelInterruptFlags[0], Interrupts.ChannelInterruptFlags[1], (SpellChannelInterruptFlags)Interrupts.ChannelInterruptFlags[1]); + rtb.AppendFormatLine("AuraInterrupt Flags: 0x{0:X8} ({1}), 0x{2:X8} ({3})", Interrupts.AuraInterruptFlags[0], (SpellAuraInterruptFlags)Interrupts.AuraInterruptFlags[0], Interrupts.AuraInterruptFlags[1], (SpellAuraInterruptFlags2)Interrupts.AuraInterruptFlags[1]); + rtb.AppendFormatLine("ChannelInterrupt Flags: 0x{0:X8} ({1}), 0x{2:X8} ({3})", Interrupts.ChannelInterruptFlags[0], (SpellAuraInterruptFlags)Interrupts.ChannelInterruptFlags[0], Interrupts.ChannelInterruptFlags[1], (SpellAuraInterruptFlags)Interrupts.ChannelInterruptFlags[1]); } if (CasterAuraState != 0) @@ -492,7 +507,7 @@ from eff in s.Effects if (CasterAuraSpell != 0) { if (DBC.DBC.SpellInfoStore.ContainsKey(CasterAuraSpell)) - rtb.AppendFormatLine(" Caster Aura Spell ({0}) {1}", CasterAuraSpell, DBC.DBC.SpellInfoStore[CasterAuraSpell].Spell.Name); + rtb.AppendFormatLine(" Caster Aura Spell ({0}) {1}", CasterAuraSpell, DBC.DBC.SpellInfoStore[CasterAuraSpell].Spell.Name_lang); else rtb.AppendFormatLine(" Caster Aura Spell ({0}) ?????", CasterAuraSpell); } @@ -500,7 +515,7 @@ from eff in s.Effects if (TargetAuraSpell != 0) { if (DBC.DBC.SpellInfoStore.ContainsKey(TargetAuraSpell)) - rtb.AppendFormatLine(" Target Aura Spell ({0}) {1}", TargetAuraSpell, DBC.DBC.SpellInfoStore[TargetAuraSpell].Spell.Name); + rtb.AppendFormatLine(" Target Aura Spell ({0}) {1}", TargetAuraSpell, DBC.DBC.SpellInfoStore[TargetAuraSpell].Spell.Name_lang); else rtb.AppendFormatLine(" Target Aura Spell ({0}) ?????", TargetAuraSpell); } @@ -508,7 +523,7 @@ from eff in s.Effects if (ExcludeCasterAuraSpell != 0) { if (DBC.DBC.SpellInfoStore.ContainsKey(ExcludeCasterAuraSpell)) - rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) {1}", ExcludeCasterAuraSpell, DBC.DBC.SpellInfoStore[ExcludeCasterAuraSpell].Spell.Name); + rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) {1}", ExcludeCasterAuraSpell, DBC.DBC.SpellInfoStore[ExcludeCasterAuraSpell].Spell.Name_lang); else rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) ?????", ExcludeCasterAuraSpell); } @@ -516,14 +531,14 @@ from eff in s.Effects if (ExcludeTargetAuraSpell != 0) { if (DBC.DBC.SpellInfoStore.ContainsKey(ExcludeTargetAuraSpell)) - rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) {1}", ExcludeTargetAuraSpell, DBC.DBC.SpellInfoStore[ExcludeTargetAuraSpell].Spell.Name); + rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) {1}", ExcludeTargetAuraSpell, DBC.DBC.SpellInfoStore[ExcludeTargetAuraSpell].Spell.Name_lang); else rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) ?????", ExcludeTargetAuraSpell); } if (RequiredAreasId > 0) { - var areas = DBC.DBC.AreaGroupMember.Values.Where(ag => ag.AreaGroupId == RequiredAreasId).ToList(); + var areas = DBC.DBC.AreaGroupMember.Values.Where(ag => ag.AreaGroupID == RequiredAreasId).ToList(); if (areas.Count == 0) rtb.AppendFormatLine("Cannot find area group id {0} in AreaGroupMember.db2!", RequiredAreasId); else @@ -533,12 +548,12 @@ from eff in s.Effects rtb.AppendLine("Allowed areas:"); foreach (var areaGroupMember in areas) { - var areaId = areaGroupMember.AreaId; + var areaId = areaGroupMember.AreaID; if (!DBC.DBC.AreaTable.ContainsKey(areaId)) continue; var areaEntry = DBC.DBC.AreaTable[areaId]; - rtb.AppendFormatLine("{0} - {1} (Map: {2})", areaId, areaEntry.AreaName, areaEntry.MapID); + rtb.AppendFormatLine("{0} - {1} (Map: {2})", areaId, areaEntry.AreaName_lang, areaEntry.ContinentID); } rtb.AppendLine(); @@ -585,10 +600,9 @@ private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect) var value = 0.0f; - if (effect.SpellEffectScalingEntry != null && - Math.Abs(effect.SpellEffectScalingEntry.Coefficient) > 1.0E-5f && + if (Math.Abs(effect.Coefficient) > 1.0E-5f && Scaling != null && - Scaling.ScalingClass != 0) + Scaling.Class != 0) { var level = (int)(DBC.DBC.SelectedLevel - 1); if ((AttributesEx11 & (uint)SpellAtributeEx11.SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) == 0) @@ -605,16 +619,15 @@ private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect) if (level < 1) level = 1; - if (Scaling.ScalingClass != 0) + if (Scaling.Class != 0) { - if (Scaling.ScalesFromItemLevel == 0) { if ((AttributesEx11 & (uint)SpellAtributeEx11.SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) == 0) { var gtScaling = GameTable.GetRecord(level); Debug.Assert(gtScaling != null); - value = gtScaling.GetColumnForClass(Scaling.ScalingClass); + value = gtScaling.GetColumnForClass(Scaling.Class); } else if (DBC.DBC.RandPropPoints.ContainsKey(level)) { @@ -638,20 +651,20 @@ private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect) // value *= ((((1.0f - Scaling.NerfFactor) * (level - 1)) / (Scaling.NerfMaxLevel - 1)) + Scaling.NerfFactor); } - value *= effect.SpellEffectScalingEntry.Coefficient; + value *= effect.Coefficient; if (Math.Abs(value) > 1.0E-5f && value < 1.0f) value = 1.0f; - if (Math.Abs(effect.SpellEffectScalingEntry.Variance) > 1.0E-5f) + if (Math.Abs(effect.Variance) > 1.0E-5f) { - var delta = Math.Abs(value * effect.SpellEffectScalingEntry.Variance * 0.5f); + var delta = Math.Abs(value * effect.Variance * 0.5f); rtb.AppendFormat("BasePoints = {0:F} to {1:F}", value - delta, value + delta); } else rtb.AppendFormat("BasePoints = {0:F}", value); - if (Math.Abs(effect.SpellEffectScalingEntry.ResourceCoefficient) > 1.0E-5f) - rtb.AppendFormatIfNotNull(" + combo * {0:F}", effect.SpellEffectScalingEntry.ResourceCoefficient * value); + if (Math.Abs(effect.ResourceCoefficient) > 1.0E-5f) + rtb.AppendFormatIfNotNull(" + combo * {0:F}", effect.ResourceCoefficient * value); } else { @@ -673,15 +686,15 @@ private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect) } if (effect.EffectBonusCoefficient > 1.0E-5f) - rtb.AppendFormat(" + spellPower * {0}", effect.EffectBonusCoefficient); + rtb.AppendFormat(" + SP * {0}", effect.EffectBonusCoefficient); if (effect.BonusCoefficientFromAP > 1.0E-5) rtb.AppendFormat(" + AP * {0}", effect.BonusCoefficientFromAP); - // if (Math.Abs(effect.DamageMultiplier - 1.0f) > 1.0E-5f) - // rtb.AppendFormat(" x {0:F}", effect.DamageMultiplier); + if (Math.Abs(effect.EffectChainAmplitude - 1.0f) > 1.0E-5f) + rtb.AppendFormat(" x {0:F}", effect.EffectChainAmplitude); - // rtb.AppendFormatIfNotNull(" Multiple = {0:F}", effect.ValueMultiplier); + rtb.AppendFormatIfNotNull(" Multiple = {0:F}", effect.EffectAmplitude); rtb.AppendLine(); rtb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})", @@ -690,7 +703,7 @@ private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect) AuraModTypeName(rtb, effect); - var classMask = effect.EffectSpellClassMask; + var classMask = Array.ConvertAll(effect.EffectSpellClassMask, i => (uint)i); if (classMask[0] != 0 || classMask[1] != 0 || classMask[2] != 0 || classMask[3] != 0) { @@ -698,12 +711,12 @@ private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect) var query = from spell in DBC.DBC.SpellInfoStore.Values where spell.SpellFamilyName == SpellFamilyName && spell.SpellFamilyFlags.ContainsElement(classMask) - join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.SpellID into temp + join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.Spell into temp from skill in temp.DefaultIfEmpty(new SkillLineAbilityEntry()) select new { SpellID = spell.Spell.ID, - SpellName = spell.Spell.Name, + SpellName = spell.Spell.Name_lang, SkillId = skill.SkillLine }; @@ -734,9 +747,9 @@ from skill in temp.DefaultIfEmpty(new SkillLineAbilityEntry()) { var triggerSpell = DBC.DBC.SpellInfoStore[(int)trigger]; rtb.SetStyle(Color.Blue, FontStyle.Bold); - rtb.AppendFormatLine(" Trigger spell ({0}) {1}. Chance = {2}", trigger, triggerSpell.Spell.Name, ProcChance); - rtb.AppendFormatLineIfNotNull(" Description: {0}", triggerSpell.Spell.Description); - rtb.AppendFormatLineIfNotNull(" ToolTip: {0}", triggerSpell.Spell.AuraDescription); + rtb.AppendFormatLine(" Trigger spell ({0}) {1}. Chance = {2}", trigger, triggerSpell.Spell.Name_lang, ProcChance); + rtb.AppendFormatLineIfNotNull(" Description: {0}", triggerSpell.Spell.Description_lang); + rtb.AppendFormatLineIfNotNull(" ToolTip: {0}", triggerSpell.Spell.AuraDescription_lang); rtb.SetDefaultStyle(); if (triggerSpell.ProcFlags != 0) { @@ -756,19 +769,19 @@ from skill in temp.DefaultIfEmpty(new SkillLineAbilityEntry()) if ((Mechanics)effect.EffectMechanic != Mechanics.MECHANIC_NONE) rtb.AppendFormatLine("Effect Mechanic = {0} ({1})", effect.EffectMechanic, (Mechanics)effect.EffectMechanic); - rtb.AppendFormatLineIfNotNull("Attributes {0:X8} ({0})", effect.EffectAttributes); + rtb.AppendFormatLineIfNotNull("Attributes {0:X8} ({0})", (uint)effect.EffectAttributes); rtb.AppendLine(); } private static void AuraModTypeName(RichTextBox rtb, SpellEffectEntry effect) { var aura = (AuraType)effect.EffectAura; - var misc = effect.EffectMiscValues[0]; + var misc = effect.EffectMiscValue[0]; if (effect.EffectAura == 0) { - rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", effect.EffectMiscValues[0]); - rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", effect.EffectMiscValues[1]); + rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", effect.EffectMiscValue[0]); + rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", effect.EffectMiscValue[1]); rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", effect.EffectAmplitude); return; @@ -797,7 +810,7 @@ private static void AuraModTypeName(RichTextBox rtb, SpellEffectEntry effect) break; } - rtb.AppendFormat("), miscB = {0}", effect.EffectMiscValues[1]); + rtb.AppendFormat("), miscB = {0}", effect.EffectMiscValue[1]); rtb.AppendFormatLine(", amplitude = {0}, periodic = {1}", effect.EffectAmplitude, effect.EffectAuraPeriod); switch (aura) @@ -846,20 +859,20 @@ private void AppendItemInfo(RichTextBox rtb) foreach (var item in items) { - if (!DBC.DBC.ItemSparse.ContainsKey((int)item.Value.ItemID)) + if (!DBC.DBC.ItemSparse.ContainsKey((int)item.Value.ParentItemID)) { - rtb.AppendFormatLine($@" Non-existing Item-sparse.db2 entry { item.Value.ItemID }"); + rtb.AppendFormatLine($@" Non-existing Item-sparse.db2 entry { item.Value.ParentItemID}"); continue; } - var itemTemplate = DBC.DBC.ItemSparse[(int)item.Value.ItemID]; + var itemTemplate = DBC.DBC.ItemSparse[(int)item.Value.ParentItemID]; - var name = itemTemplate.Name; - var description = itemTemplate.Description; + var name = itemTemplate.Display_lang; + var description = itemTemplate.Description_lang; description = string.IsNullOrEmpty(description) ? string.Empty : $" - \"{ description }\""; - rtb.AppendFormatLine($@" { item.Value.ItemID }: { name } { description }"); + rtb.AppendFormatLine($@" { item.Value.ParentItemID }: { name } { description }"); } } @@ -935,30 +948,30 @@ public class SpellEffectInfo { public SpellEffectEntry SpellEffect { get; set; } - public uint ID => SpellEffect.ID; + public int ID => SpellEffect.ID; public int SpellID => SpellEffect.SpellID; - public uint DifficultyID => SpellEffect.DifficultyID; + public int DifficultyID => SpellEffect.DifficultyID; public uint Effect => SpellEffect.Effect; - public uint EffectIndex => SpellEffect.EffectIndex; - public uint EffectAttributes => SpellEffect.EffectAttributes; + public int EffectIndex => SpellEffect.EffectIndex; + public int EffectAttributes => SpellEffect.EffectAttributes; - public uint EffectAura => SpellEffect.EffectAura; - public uint EffectAuraPeriod => SpellEffect.EffectAuraPeriod; + public int EffectAura => SpellEffect.EffectAura; + public int EffectAuraPeriod => SpellEffect.EffectAuraPeriod; public int EffectBasePoints => SpellEffect.EffectBasePoints; - public int EffectMiscValueA => SpellEffect.EffectMiscValues[0]; - public int EffectMiscValueB => SpellEffect.EffectMiscValues[1]; + public int EffectMiscValueA => SpellEffect.EffectMiscValue[0]; + public int EffectMiscValueB => SpellEffect.EffectMiscValue[1]; - public uint EffectSpellClassMaskA => SpellEffect.EffectSpellClassMask[0]; - public uint EffectSpellClassMaskB => SpellEffect.EffectSpellClassMask[1]; - public uint EffectSpellClassMaskC => SpellEffect.EffectSpellClassMask[2]; - public uint EffectSpellClassMaskD => SpellEffect.EffectSpellClassMask[3]; + public int EffectSpellClassMaskA => SpellEffect.EffectSpellClassMask[0]; + public int EffectSpellClassMaskB => SpellEffect.EffectSpellClassMask[1]; + public int EffectSpellClassMaskC => SpellEffect.EffectSpellClassMask[2]; + public int EffectSpellClassMaskD => SpellEffect.EffectSpellClassMask[3]; - public uint EffectTriggerSpell => SpellEffect.EffectTriggerSpell; + public int EffectTriggerSpell => SpellEffect.EffectTriggerSpell; public uint TargetA => SpellEffect.ImplicitTarget[0]; public uint TargetB => SpellEffect.ImplicitTarget[1]; @@ -966,10 +979,10 @@ public class SpellEffectInfo public uint EffectRadiusIndex => SpellEffect.EffectRadiusIndex[0]; public uint EffectRadiusMaxIndex => SpellEffect.EffectRadiusIndex[1]; - public uint EffectChainTargets => SpellEffect.EffectChainTargets; + public int EffectChainTargets => SpellEffect.EffectChainTargets; public int EffectDieSides => SpellEffect.EffectDieSides; - public uint EffectItemType => SpellEffect.EffectItemType; - public uint EffectMechanic => SpellEffect.EffectMechanic; + public int EffectItemType => SpellEffect.EffectItemType; + public int EffectMechanic => SpellEffect.EffectMechanic; public float EffectAmplitude => SpellEffect.EffectAmplitude; public float EffectBonusCoefficient => SpellEffect.EffectBonusCoefficient; @@ -977,7 +990,7 @@ public class SpellEffectInfo public float EffectPointsPerResource => SpellEffect.EffectPointsPerResource; public float EffectRealPointsPerLevel => SpellEffect.EffectRealPointsPerLevel; - public float EffectPosFacing => SpellEffect.EffectPosFacing; + public float EffectPosFacing => SpellEffect.EffectPos_facing; public float BonusCoefficientFromAP => SpellEffect.BonusCoefficientFromAP; public SpellEffectInfo(SpellEffectEntry spellEffectEntry) diff --git a/SpellWork/SpellWork.csproj b/SpellWork/SpellWork.csproj index 46b935f1..2801ae0b 100644 --- a/SpellWork/SpellWork.csproj +++ b/SpellWork/SpellWork.csproj @@ -10,7 +10,7 @@ Properties SpellWork SpellWork - v4.6 + v4.8 512 New Icon.ico false @@ -62,9 +62,10 @@ false - - ..\packages\DBFilesClient.NET.1.1.4\lib\net452\DBFilesClient.NET.dll + + ..\packages\DBFileReaderLib.1.0.0.0\lib\DBFileReaderLib.dll + ..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll @@ -77,6 +78,7 @@ + diff --git a/SpellWork/app.config b/SpellWork/app.config index ea441927..9bc52cf3 100644 --- a/SpellWork/app.config +++ b/SpellWork/app.config @@ -1,8 +1,8 @@ - + -
+
@@ -31,14 +31,14 @@ gt - - enUS - + + enUS + - + - - + + diff --git a/packages/DBFileReaderLib.1.0.0.0/lib/DBFileReaderLib.dll b/packages/DBFileReaderLib.1.0.0.0/lib/DBFileReaderLib.dll new file mode 100644 index 00000000..0953e39b Binary files /dev/null and b/packages/DBFileReaderLib.1.0.0.0/lib/DBFileReaderLib.dll differ