diff --git a/SpellWork.sln b/SpellWork.sln index 2a8e7b08..3651bab8 100644 --- a/SpellWork.sln +++ b/SpellWork.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 14.0.23107.0 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpellWork", "SpellWork\SpellWork.csproj", "{49A3559B-529A-4406-824B-F7E2831DE1B2}" EndProject diff --git a/SpellWork/DBC/DB2Reader.cs b/SpellWork/DBC/DB2Reader.cs index 292897d2..eb746aed 100644 --- a/SpellWork/DBC/DB2Reader.cs +++ b/SpellWork/DBC/DB2Reader.cs @@ -41,9 +41,8 @@ private T BuildEntry(byte[] byteRow) if (prop.FieldType.IsArray) value = BuildArrayField(byteRow, propertyIndex, prop); else - value = BuildSimpleField(byteRow, propertyIndex, prop); + value = BuildSimpleField(byteRow, propertyIndex, prop.FieldType, 0); - //FieldStructures[propertyIndex].ValueSetter(structure, value); ++propertyIndex; prop.SetValue(structure, value); } @@ -61,86 +60,29 @@ private object BuildArrayField(byte[] byteRow, int propertyIndex, FieldInfo prop { var fieldStructure = FieldStructures[propertyIndex]; var fieldPosition = (int)fieldStructure.Position; + var positionOffset = 0; var nextMarker = propertyIndex + 1 == FieldCount ? RecordSize : FieldStructures[propertyIndex + 1].Position; var arraySize = (nextMarker - fieldPosition) / fieldStructure.ByteSize; var elementType = prop.FieldType.GetElementType(); - var typeCode = Type.GetTypeCode(elementType); var instanceValue = Array.CreateInstance(elementType, arraySize); for (var i = 0; i < arraySize; ++i) { - switch (typeCode) - { - case TypeCode.SByte: - instanceValue.SetValue((sbyte)byteRow[fieldPosition], i); - break; - case TypeCode.Byte: - instanceValue.SetValue(byteRow[fieldPosition], i); - break; - case TypeCode.Int16: - instanceValue.SetValue((short)(byteRow[fieldPosition] | (byteRow[fieldPosition + 1] << 8)), i); - break; - case TypeCode.UInt16: - instanceValue.SetValue((ushort)(byteRow[fieldPosition] | (byteRow[fieldPosition + 1] << 8)), i); - break; - case TypeCode.Int32: - { - var elementVal = 0; - for (var k = 0; k < fieldStructure.ByteSize; ++k) - elementVal |= byteRow[fieldPosition + k] << (8 * k); - instanceValue.SetValue(elementVal, i); - break; - } - case TypeCode.UInt32: - { - var elementVal = 0u; - for (var k = 0; k < fieldStructure.ByteSize; ++k) - elementVal |= (uint)(byteRow[fieldPosition + k] << (8 * k)); - instanceValue.SetValue(elementVal, i); - break; - } - case TypeCode.Int64: - instanceValue.SetValue(BitConverter.ToInt64(byteRow, fieldPosition), i); - break; - case TypeCode.UInt64: - instanceValue.SetValue(BitConverter.ToUInt64(byteRow, fieldPosition), i); - break; - case TypeCode.Single: - instanceValue.SetValue(BitConverter.ToSingle(byteRow, fieldPosition), i); - break; - case TypeCode.String: - { - if (HasInlineStrings) - { - //! TODO 7.x Implement, only Item-Sparse has this - instanceValue.SetValue(string.Empty, i); - } - else - { - var stringOffset = BitConverter.ToInt32(byteRow, fieldPosition); - if (StringTable.ContainsKey(stringOffset)) - instanceValue.SetValue(StringTable[stringOffset], i); - else - instanceValue.SetValue(string.Empty, i); - } - break; - } - } - - fieldPosition += fieldStructure.ByteSize; + instanceValue.SetValue(BuildSimpleField(byteRow, propertyIndex, elementType, positionOffset), i); + positionOffset += fieldStructure.ByteSize; } return instanceValue; } - private object BuildSimpleField(byte[] byteRow, int propertyIndex, FieldInfo prop) + private object BuildSimpleField(byte[] byteRow, int propertyIndex, Type fieldType, int positionOffset) { var fieldStructure = FieldStructures[propertyIndex]; - var fieldPosition = (int)fieldStructure.Position; + var fieldPosition = (int)fieldStructure.Position + positionOffset; object instanceValue = null; - switch (Type.GetTypeCode(prop.FieldType)) + switch (Type.GetTypeCode(fieldType)) { case TypeCode.SByte: instanceValue = (sbyte)byteRow[fieldPosition]; @@ -244,7 +186,8 @@ private void Read(BinaryReader reader) var maxId = reader.ReadInt32(); reader.ReadInt32(); // Locale var copyTableSize = reader.ReadInt32(); - var flags = reader.ReadInt32(); + var flags = reader.ReadInt16(); + var indexField = reader.ReadInt16(); HasOffsetMap = (flags & 0x01) != 0; HasNonInlineIDs = (flags & 0x04) != 0; @@ -297,7 +240,20 @@ private void Read(BinaryReader reader) // Populate data storage now. for (var i = 0; i < RecordCount; ++i) - Add(HasNonInlineIDs ? nonInlineIDs[i] : i, BuildEntry(reader.ReadBytes(RecordSize))); + { + byte[] rowBytes = reader.ReadBytes(RecordSize); + int id; + if (!HasNonInlineIDs) + { + var idBytes = new byte[4]; + Array.Copy(rowBytes, FieldStructures[indexField].Position, idBytes, 0, FieldStructures[indexField].ByteSize); + id = BitConverter.ToInt32(idBytes, 0); + } + else + id = nonInlineIDs[i]; + + Add(id, BuildEntry(rowBytes)); + } // Populate copy table foreach (var kv in copyTable) diff --git a/SpellWork/DBC/DBC.cs b/SpellWork/DBC/DBC.cs index 145c3d25..e085d659 100644 --- a/SpellWork/DBC/DBC.cs +++ b/SpellWork/DBC/DBC.cs @@ -1,15 +1,14 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Threading.Tasks; using SpellWork.Database; using SpellWork.DBC.Structures; +using SpellWork.GameTables; using SpellWork.GameTables.Structures; -using SpellWork.Spell; using SpellWork.Properties; -using SpellWork.GameTables; +using SpellWork.Spell; +using System; using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Reflection; namespace SpellWork.DBC { @@ -22,7 +21,7 @@ public static class DBC public static DB2Reader AreaTable = new DB2Reader(); public static DB2Reader OverrideSpellData = new DB2Reader(); public static DB2Reader ScreenEffect = new DB2Reader(); - private static DB2Reader Spell = new DB2Reader(); + public static DB2Reader Spell = new DB2Reader(); private static DB2Reader SpellAuraOptions = new DB2Reader(); private static DB2Reader SpellAuraRestrictions = new DB2Reader(); private static DB2Reader SpellCastingRequirements = new DB2Reader(); @@ -62,34 +61,11 @@ public static class DBC public static Dictionary SkilllLineAbilityStore = new Dictionary(); public static Dictionary SkilllLineStore = new Dictionary(); - private static readonly Dictionary SpellInfoLoadData = new Dictionary(); + private static readonly IDictionary SpellInfoLoadData = new ConcurrentDictionary(); + public static readonly IDictionary> SpellTriggerStore = new Dictionary>(); public static void Load() { - if (!Directory.Exists(Settings.Default.DbcPath)) - { - var browserDialog = new System.Windows.Forms.FolderBrowserDialog { - Description = "Select the path to the directory containing your DB2 files." - }; - if (browserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) - { - Settings.Default.DbcPath = browserDialog.SelectedPath; - Settings.Default.Save(); - } - } - - if (!Directory.Exists(Settings.Default.GtPath)) - { - var browserDialog = new System.Windows.Forms.FolderBrowserDialog { - Description = "Select the path to the directory containing your GameTable files." - }; - if (browserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) - { - Settings.Default.GtPath = browserDialog.SelectedPath; - Settings.Default.Save(); - } - } - foreach (var dbc in typeof(DBC).GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { if (!dbc.FieldType.IsGenericType || dbc.FieldType.GetGenericTypeDefinition() != typeof(DB2Reader<>)) @@ -103,16 +79,13 @@ public static void Load() try { - OnLoadProgress?.Invoke(0, $"Loading {dbc.Name}.db2 ..."); dbc.FieldType.GetMethod("Open", new [] { typeof(string) }).Invoke(dbc.GetValue(null), new object[] { $@"{Settings.Default.DbcPath}\{name}.db2" }); } catch (DirectoryNotFoundException) { - OnLoadProgress?.Invoke(0, $"Could not open {dbc.Name}.db2 ..."); } catch (TargetInvocationException tie) { - OnLoadProgress?.Invoke(0, $"Could not open {dbc.Name}.db2 ..."); if (tie.InnerException is ArgumentException) throw new ArgumentException($"Failed to load {dbc.Name}.db2: {tie.InnerException.Message}"); @@ -133,352 +106,219 @@ public static void Load() skillLine.Clear(); skillLineAbility.Clear(); - // Use ConcurrentQueue to enable safe enqueueing from multiple threads. - var exceptions = new ConcurrentQueue(); - - OnLoadProgress?.Invoke(0, "Generating SpellInfo store ..."); - foreach (var spell in Spell) - SpellInfoLoadData[spell.Value.ID] = new SpellInfoLoadData() { - Spell = spell.Value - }; + SpellInfoLoadData[spell.Value.ID] = new SpellInfoLoadData() { Spell = spell.Value }; - Parallel.ForEach(SpellInfoLoadData, effect => + foreach (var effect in SpellInfoLoadData) { - try - { - if (!SpellMisc.ContainsKey(effect.Value.Spell.MiscID)) - { - Console.WriteLine( - $"Spell {effect.Key} is referencing unknown SpellMisc {effect.Value.Spell.MiscID}, ignoring!"); - return; - } - effect.Value.Misc = SpellMisc[(int) effect.Value.Spell.MiscID]; - } - catch (Exception e) + if (!SpellMisc.ContainsKey(effect.Value.Spell.MiscID)) { - exceptions.Enqueue(e); + Console.WriteLine($"Spell {effect.Key} is referencing unknown SpellMisc {effect.Value.Spell.MiscID}, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell effects ..."); + effect.Value.Misc = SpellMisc[(int) effect.Value.Spell.MiscID]; + } - Parallel.ForEach(SpellEffect, effect => + foreach (var effect in SpellEffect) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"Spell effect {effect.Value.ID} is referencing unknown spell {effect.Value.SpellID}, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Effects.Add(effect.Value); - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"Spell effect {effect.Value.ID} is referencing unknown spell {effect.Value.SpellID}, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell target restrictions ..."); + SpellInfoLoadData[effect.Value.SpellID].Effects.Add(effect.Value); + var triggerid = effect.Value.EffectTriggerSpell; + if (triggerid != 0) + { + if (SpellTriggerStore.ContainsKey(triggerid)) + SpellTriggerStore[triggerid].Add(effect.Value.SpellID); + else + SpellTriggerStore.Add(triggerid, new SortedSet { effect.Value.SpellID }); + } + } - Parallel.ForEach(SpellTargetRestrictions, effect => + foreach (var effect in SpellTargetRestrictions) { if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - Console.WriteLine( - $"SpellTargetRestrictions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; + Console.WriteLine($"SpellTargetRestrictions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - SpellInfoLoadData[effect.Value.SpellID].TargetRestrictions.Add(effect.Value); - }); - OnLoadProgress?.Invoke(0, "Loading spell visuals ..."); + SpellInfoLoadData[effect.Value.SpellID].TargetRestrictions.Add(effect.Value); + } - Parallel.ForEach(SpellXSpellVisual, effect => + foreach (var effect in SpellXSpellVisual) { if (effect.Value.DifficultyID != 0 || effect.Value.PlayerConditionID != 0) - return; + continue; - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellXSpellVisual: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].SpellXSpellVisual = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellXSpellVisual: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell scaling parameters ..."); + SpellInfoLoadData[effect.Value.SpellID].SpellXSpellVisual = effect.Value; + } - Parallel.ForEach(SpellScaling, effect => + foreach (var effect in SpellScaling) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellScaling: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Scaling = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellScaling: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading aura options ..."); + SpellInfoLoadData[effect.Value.SpellID].Scaling = effect.Value; + } - Parallel.ForEach(SpellAuraOptions, effect => + foreach (var effect in SpellAuraOptions) { - try - { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellAuraOptions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].AuraOptions = effect.Value; - if (effect.Value.SpellProcsPerMinuteID != 0) - SpellInfoLoadData[effect.Value.SpellID].ProcsPerMinute = SpellProcsPerMinute[effect.Value.SpellProcsPerMinuteID]; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellAuraOptions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - SpellProcsPerMinute.Clear(); - - OnLoadProgress?.Invoke(0, "Loading aura restrictions ..."); + SpellInfoLoadData[effect.Value.SpellID].AuraOptions = effect.Value; + if (effect.Value.SpellProcsPerMinuteID != 0) + SpellInfoLoadData[effect.Value.SpellID].ProcsPerMinute = SpellProcsPerMinute[effect.Value.SpellProcsPerMinuteID]; + } - Parallel.ForEach(SpellAuraRestrictions, effect => + foreach (var effect in SpellAuraRestrictions) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellAuraRestrictions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].AuraRestrictions = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellAuraRestrictions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell categories ..."); + SpellInfoLoadData[effect.Value.SpellID].AuraRestrictions = effect.Value; + } - Parallel.ForEach(SpellCategories, effect => + foreach (var effect in SpellCategories) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellCategories: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Categories = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellCategories: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading casting requirements ..."); + SpellInfoLoadData[effect.Value.SpellID].Categories = effect.Value; + } - Parallel.ForEach(SpellCastingRequirements, effect => + foreach (var effect in SpellCastingRequirements) { if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - Console.WriteLine( - $"SpellCastingRequirements: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + Console.WriteLine($"SpellCastingRequirements: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); return; } - SpellInfoLoadData[effect.Value.SpellID].CastingRequirements = effect.Value; - }); - OnLoadProgress?.Invoke(0, "Loading spell class options ..."); + SpellInfoLoadData[effect.Value.SpellID].CastingRequirements = effect.Value; + } - Parallel.ForEach(SpellClassOptions, effect => + foreach (var effect in SpellClassOptions) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellClassOptions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].ClassOptions = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellClassOptions: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading cooldowns ..."); + SpellInfoLoadData[effect.Value.SpellID].ClassOptions = effect.Value; + } - Parallel.ForEach(SpellCooldowns, effect => + foreach (var effect in SpellCooldowns) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellCooldowns: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Cooldowns = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellCooldowns: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - Parallel.ForEach(SpellEffectScaling, effect => + SpellInfoLoadData[effect.Value.SpellID].Cooldowns = effect.Value; + } + + foreach (var effect in SpellEffectScaling) { - try - { - if (!SpellEffect.ContainsKey((int)effect.Value.SpellEffectId)) - { - Console.WriteLine( - $"SpellEffectScaling: Unknown spell effect {effect.Value.SpellEffectId} referenced, ignoring!"); - return; - } - - SpellEffect[effect.Value.SpellEffectId].SpellEffectScalingEntry = effect.Value; - } - catch (Exception e) + if (!SpellEffect.ContainsKey((int)effect.Value.SpellEffectId)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellEffectScaling: Unknown spell effect {effect.Value.SpellEffectId} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading interrupts ..."); + SpellEffect[effect.Value.SpellEffectId].SpellEffectScalingEntry = effect.Value; + } - Parallel.ForEach(SpellInterrupts, effect => + foreach (var effect in SpellInterrupts) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellInterrupts: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Interrupts = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellInterrupts: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading equipped items ..."); + SpellInfoLoadData[effect.Value.SpellID].Interrupts = effect.Value; + } - Parallel.ForEach(SpellEquippedItems, effect => + foreach (var effect in SpellEquippedItems) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellEquippedItems: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].EquippedItems = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellEquippedItems: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell levels ..."); + SpellInfoLoadData[effect.Value.SpellID].EquippedItems = effect.Value; + } - Parallel.ForEach(SpellLevels, effect => + foreach (var effect in SpellLevels) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellLevels: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Levels = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellLevels: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell reagents costs ..."); + SpellInfoLoadData[effect.Value.SpellID].Levels = effect.Value; + } - Parallel.ForEach(SpellReagents, effect => + foreach (var effect in SpellReagents) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellReagents: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Reagents = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellReagents: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell shapeshift conditions ..."); + SpellInfoLoadData[effect.Value.SpellID].Reagents = effect.Value; + } - Parallel.ForEach(SpellShapeshift, effect => + foreach (var effect in SpellShapeshift) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellShapeshift: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Shapeshift = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellShapeshift: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); - OnLoadProgress?.Invoke(0, "Loading spell totem cost ..."); + SpellInfoLoadData[effect.Value.SpellID].Shapeshift = effect.Value; + } - Parallel.ForEach(SpellTotems, effect => + foreach (var effect in SpellTotems) { - try { - if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) - { - Console.WriteLine( - $"SpellTotems: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); - return; - } - SpellInfoLoadData[effect.Value.SpellID].Totems = effect.Value; - } - catch (Exception e) + if (!SpellInfoLoadData.ContainsKey(effect.Value.SpellID)) { - exceptions.Enqueue(e); + Console.WriteLine($"SpellTotems: Unknown spell {effect.Value.SpellID} referenced, ignoring!"); + continue; } - }); + + SpellInfoLoadData[effect.Value.SpellID].Totems = effect.Value; + } /*OnLoadProgress?.Invoke($"Generating ItemTemplate store ..."); @@ -493,41 +333,18 @@ public static void Load() }); }*/ - OnLoadProgress?.Invoke(0, "Generating spell structure ..."); - foreach (var e in SpellInfoLoadData) - // Parallel.ForEach(SpellInfoLoadData, e => { _spellInfo.Add((int) e.Key, new SpellInfoHelper(e.Value)); - // }); - - if (!exceptions.IsEmpty) - throw new Exception("Debug me!"); - - OnLoadProgress?.Invoke(0, "Cleaning leftover data ..."); - - foreach(var dbc in typeof(DBC).GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) - { - if (!dbc.FieldType.IsGenericType || dbc.FieldType.GetGenericTypeDefinition() != typeof(DB2Reader<>)) - continue; - - if (dbc.FieldType.GetGenericArguments()[0].IsValueType) - dbc.FieldType.GetMethod("Clear").Invoke(dbc.GetValue(null), new object[0]); - } - - OnLoadProgress?.Invoke(0, "Loading GameTables ..."); GameTable.Open($@"{Settings.Default.GtPath}\SpellScaling.txt"); - - OnLoadProgress?.Invoke(100, "Done!"); } public static List ItemTemplate = new List(); public static uint SelectedLevel = MaxLevel; + public static uint SelectedItemLevel = 890; private static Dictionary _spellInfo = new Dictionary(); public static Dictionary SpellInfoStore => _spellInfo; - - public static event Action OnLoadProgress; } } diff --git a/SpellWork/Extensions/LinqExtensions.cs b/SpellWork/Extensions/LinqExtensions.cs index b11a9467..5b84321e 100644 --- a/SpellWork/Extensions/LinqExtensions.cs +++ b/SpellWork/Extensions/LinqExtensions.cs @@ -52,9 +52,9 @@ public static bool CreateFilter(this T entry, object field, object val, Compa switch (basicValue.GetType().Name) { - case "public uint": + case "UInt32": return Compare(basicValue.ToUInt32(), val.ToUInt32(), compareType); - case "public int": + case "Int32": return Compare(basicValue.ToInt32(), val.ToInt32(), compareType); case "Single": return Compare(basicValue.ToFloat(), val.ToFloat(), compareType); @@ -62,12 +62,12 @@ public static bool CreateFilter(this T entry, object field, object val, Compa return Compare(basicValue.ToUlong(), val.ToUlong(), compareType); case "String": return Compare(basicValue.ToString(), val.ToString(), compareType); - case @"public uint[]": + case @"UInt32[]": { var valUint = val.ToUInt32(); return ((uint[])basicValue).Any(el => Compare(el, valUint, compareType)); } - case @"public int[]": + case @"Int32[]": { var valInt = val.ToInt32(); return ((int[])basicValue).Any(el => Compare(el, valInt, compareType)); diff --git a/SpellWork/Forms/FormMain.Designer.cs b/SpellWork/Forms/FormMain.Designer.cs index 4613e4b6..080e8370 100644 --- a/SpellWork/Forms/FormMain.Designer.cs +++ b/SpellWork/Forms/FormMain.Designer.cs @@ -39,7 +39,6 @@ private void InitializeComponent() this._tsmExit = new System.Windows.Forms.ToolStripMenuItem(); this._tsmHelp = new System.Windows.Forms.ToolStripMenuItem(); this._tsmAbout = new System.Windows.Forms.ToolStripMenuItem(); - this.ProgressButton = new System.Windows.Forms.ToolStripMenuItem(); this._ilPro = new System.Windows.Forms.ImageList(this.components); this.splitContainer7 = new System.Windows.Forms.SplitContainer(); this.splitContainer8 = new System.Windows.Forms.SplitContainer(); @@ -243,8 +242,7 @@ private void InitializeComponent() // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this._tsmFile, - this._tsmHelp, - this.ProgressButton}); + this._tsmHelp}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(872, 24); @@ -296,11 +294,6 @@ private void InitializeComponent() this._tsmAbout.Size = new System.Drawing.Size(113, 22); this._tsmAbout.Text = "About.."; // - // ProgressButton - // - this.ProgressButton.Name = "ProgressButton"; - this.ProgressButton.Size = new System.Drawing.Size(12, 20); - // // _ilPro // this._ilPro.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("_ilPro.ImageStream"))); @@ -685,7 +678,6 @@ private void InitializeComponent() this._cbTarget2.DropDownHeight = 500; this._cbTarget2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbTarget2.DropDownWidth = 302; - this._cbTarget2.Enabled = false; this._cbTarget2.FormattingEnabled = true; this._cbTarget2.IntegralHeight = false; this._cbTarget2.Location = new System.Drawing.Point(4, 111); @@ -701,7 +693,6 @@ private void InitializeComponent() this._cbTarget1.DropDownHeight = 500; this._cbTarget1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbTarget1.DropDownWidth = 302; - this._cbTarget1.Enabled = false; this._cbTarget1.FormattingEnabled = true; this._cbTarget1.IntegralHeight = false; this._cbTarget1.Location = new System.Drawing.Point(4, 87); @@ -717,7 +708,6 @@ private void InitializeComponent() this._cbSpellEffect.DropDownHeight = 500; this._cbSpellEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbSpellEffect.DropDownWidth = 302; - this._cbSpellEffect.Enabled = false; this._cbSpellEffect.FormattingEnabled = true; this._cbSpellEffect.ImeMode = System.Windows.Forms.ImeMode.NoControl; this._cbSpellEffect.IntegralHeight = false; @@ -734,7 +724,6 @@ private void InitializeComponent() this._cbSpellAura.DropDownHeight = 500; this._cbSpellAura.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbSpellAura.DropDownWidth = 302; - this._cbSpellAura.Enabled = false; this._cbSpellAura.FormattingEnabled = true; this._cbSpellAura.IntegralHeight = false; this._cbSpellAura.Location = new System.Drawing.Point(4, 38); @@ -750,7 +739,6 @@ private void InitializeComponent() this._cbSpellFamilyName.DropDownHeight = 500; this._cbSpellFamilyName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbSpellFamilyName.DropDownWidth = 302; - this._cbSpellFamilyName.Enabled = false; this._cbSpellFamilyName.FormattingEnabled = true; this._cbSpellFamilyName.IntegralHeight = false; this._cbSpellFamilyName.ItemHeight = 13; @@ -809,7 +797,6 @@ private void InitializeComponent() // _bSearch // this._bSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this._bSearch.Enabled = false; this._bSearch.Location = new System.Drawing.Point(341, 11); this._bSearch.Name = "_bSearch"; this._bSearch.Size = new System.Drawing.Size(50, 23); @@ -842,7 +829,6 @@ private void InitializeComponent() // this._tbSearchId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._tbSearchId.Enabled = false; this._tbSearchId.Location = new System.Drawing.Point(73, 13); this._tbSearchId.Name = "_tbSearchId"; this._tbSearchId.Size = new System.Drawing.Size(263, 20); @@ -1097,7 +1083,6 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this._cbProcSpellFamilyTree.DropDownHeight = 500; this._cbProcSpellFamilyTree.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcSpellFamilyTree.Enabled = false; this._cbProcSpellFamilyTree.FormattingEnabled = true; this._cbProcSpellFamilyTree.IntegralHeight = false; this._cbProcSpellFamilyTree.Location = new System.Drawing.Point(1, 2); @@ -1671,8 +1656,6 @@ private void InitializeComponent() // // _bWrite // - this._bWrite.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this._bWrite.Enabled = false; this._bWrite.Location = new System.Drawing.Point(686, 1); this._bWrite.Name = "_bWrite"; this._bWrite.Size = new System.Drawing.Size(51, 23); @@ -1684,7 +1667,6 @@ private void InitializeComponent() // // _bLevelScaling // - this._bLevelScaling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._bLevelScaling.Location = new System.Drawing.Point(808, 1); this._bLevelScaling.Name = "_bLevelScaling"; this._bLevelScaling.Size = new System.Drawing.Size(60, 23); @@ -1710,7 +1692,6 @@ private void InitializeComponent() this.Name = "FormMain"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "FormMain"; - this.Load += new System.EventHandler(this.OnFormLoad); this.Resize += new System.EventHandler(this.FormMainResize); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); @@ -1908,6 +1889,5 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem _tsmExit; private System.Windows.Forms.Button _bLevelScaling; private System.Windows.Forms.RichTextBox _rtbProcSpellInfo; - private System.Windows.Forms.ToolStripMenuItem ProgressButton; } } \ No newline at end of file diff --git a/SpellWork/Forms/FormMain.cs b/SpellWork/Forms/FormMain.cs index 43e6303f..93067e79 100644 --- a/SpellWork/Forms/FormMain.cs +++ b/SpellWork/Forms/FormMain.cs @@ -131,6 +131,7 @@ private void LevelScalingClick(object sender, EventArgs e) if (ret == DialogResult.OK) { DBC.DBC.SelectedLevel = scalingForm.SelectedLevel; + DBC.DBC.SelectedItemLevel = scalingForm.SelectedItemLevel; switch (tabControl1.SelectedIndex) { case 0: @@ -635,53 +636,5 @@ private void LvSqlDataRetrieveVirtualItem(object sender, RetrieveVirtualItemEven #endregion - private void OnFormLoad(object sender, EventArgs e) - { - var worker = new BackgroundWorker(); - worker.WorkerReportsProgress = true; - worker.WorkerSupportsCancellation = false; - var self = this; - worker.DoWork += (o, oe) => - { - Thread.Sleep(750); - DBC.DBC.OnLoadProgress += (pct, msg) => - { - worker.ReportProgress(pct, msg); - }; - DBC.DBC.Load(); - }; - worker.ProgressChanged += (wrk, msg) => { - self.InvokeIfRequired(() => - { - ProgressButton.Text = (string) msg.UserState; - if (msg.ProgressPercentage == 100) - { - _tbSearchId.Enabled = true; - _bSearch.Enabled = true; - _cbSpellFamilyName.Enabled = _cbSpellAura.Enabled = _cbSpellEffect.Enabled = true; - _cbTarget1.Enabled = _cbTarget2.Enabled = true; - _bCompareSearch1.Enabled = _bCompareSearch2.Enabled = true; - _cbProcSpellFamilyTree.Enabled = true; - } - }); - }; - worker.RunWorkerAsync(); - } - } - - public static class FormUtils - { - public static void InvokeIfRequired(this ISynchronizeInvoke obj, MethodInvoker action) - { - if (obj.InvokeRequired) - { - var args = new object[0]; - obj.Invoke(action, args); - } - else - { - action(); - } - } } } diff --git a/SpellWork/Forms/FormSpellScaling.Designer.cs b/SpellWork/Forms/FormSpellScaling.Designer.cs index f1758ab7..4cdfd572 100644 --- a/SpellWork/Forms/FormSpellScaling.Designer.cs +++ b/SpellWork/Forms/FormSpellScaling.Designer.cs @@ -34,43 +34,47 @@ private void InitializeComponent() this._tbxLevel = new System.Windows.Forms.TextBox(); this._tbLevel = new System.Windows.Forms.TrackBar(); this._lInfo = new System.Windows.Forms.Label(); + this._lIlvl = new System.Windows.Forms.Label(); + this._tbItemLevel = new System.Windows.Forms.TrackBar(); + this._tbxItemLevel = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this._tbLevel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this._tbItemLevel)).BeginInit(); this.SuspendLayout(); - // + // // _bOk - // + // this._bOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this._bOk.Location = new System.Drawing.Point(116, 76); + this._bOk.Location = new System.Drawing.Point(116, 137); this._bOk.Name = "_bOk"; this._bOk.Size = new System.Drawing.Size(75, 23); this._bOk.TabIndex = 0; this._bOk.Text = "OK"; this._bOk.UseVisualStyleBackColor = true; - // + // // _bCancel - // + // this._bCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this._bCancel.Location = new System.Drawing.Point(197, 76); + this._bCancel.Location = new System.Drawing.Point(197, 137); this._bCancel.Name = "_bCancel"; this._bCancel.Size = new System.Drawing.Size(75, 23); this._bCancel.TabIndex = 1; this._bCancel.Text = "Cancel"; this._bCancel.UseVisualStyleBackColor = true; - // + // // _tbxLevel - // + // this._tbxLevel.Location = new System.Drawing.Point(244, 25); this._tbxLevel.MaxLength = 3; this._tbxLevel.Name = "_tbxLevel"; this._tbxLevel.Size = new System.Drawing.Size(28, 20); this._tbxLevel.TabIndex = 2; - this._tbxLevel.Text = "110"; + this._tbxLevel.Text = DBC.DBC.SelectedLevel.ToString(); this._tbxLevel.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this._tbxLevel.TextChanged += new System.EventHandler(this.LevelTextChanged); this._tbxLevel.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.LevelTextKeyPress); - // + // // _tbLevel - // + // this._tbLevel.Location = new System.Drawing.Point(12, 25); this._tbLevel.Maximum = 100; this._tbLevel.Minimum = 1; @@ -78,26 +82,64 @@ private void InitializeComponent() this._tbLevel.Size = new System.Drawing.Size(226, 45); this._tbLevel.TabIndex = 3; this._tbLevel.TickFrequency = 5; - this._tbLevel.Value = 100; + this._tbLevel.Value = (int)DBC.DBC.SelectedLevel; this._tbLevel.ValueChanged += new System.EventHandler(this.LevelValueChanged); - // + // // _lInfo - // + // this._lInfo.AutoSize = true; this._lInfo.Location = new System.Drawing.Point(12, 9); this._lInfo.Name = "_lInfo"; this._lInfo.Size = new System.Drawing.Size(62, 13); this._lInfo.TabIndex = 4; this._lInfo.Text = "Select level"; - // + // + // _lIlvl + // + this._lIlvl.AutoSize = true; + this._lIlvl.Location = new System.Drawing.Point(12, 70); + this._lIlvl.Name = "_lIlvl"; + this._lIlvl.Size = new System.Drawing.Size(84, 13); + this._lIlvl.TabIndex = 7; + this._lIlvl.Text = "Select item level"; + // + // _tbItemLevel + // + this._tbItemLevel.LargeChange = 20; + this._tbItemLevel.Location = new System.Drawing.Point(12, 86); + this._tbItemLevel.Maximum = 1300; + this._tbItemLevel.Minimum = 1; + this._tbItemLevel.Name = "_tbItemLevel"; + this._tbItemLevel.Size = new System.Drawing.Size(226, 45); + this._tbItemLevel.SmallChange = 5; + this._tbItemLevel.TabIndex = 6; + this._tbItemLevel.TickFrequency = 20; + this._tbItemLevel.Value = (int)DBC.DBC.SelectedItemLevel; + this._tbItemLevel.ValueChanged += new System.EventHandler(this.ItemLevelValueChanged); + // + // _tbxItemLevel + // + this._tbxItemLevel.Location = new System.Drawing.Point(244, 86); + this._tbxItemLevel.MaxLength = 3; + this._tbxItemLevel.Name = "_tbxItemLevel"; + this._tbxItemLevel.Size = new System.Drawing.Size(28, 20); + this._tbxItemLevel.TabIndex = 5; + this._tbxItemLevel.Text = DBC.DBC.SelectedItemLevel.ToString(); + this._tbxItemLevel.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this._tbxItemLevel.TextChanged += new System.EventHandler(this.ItemLevelTextChanged); + this._tbxItemLevel.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.LevelTextKeyPress); + // // FormSpellScaling - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 112); + this.ClientSize = new System.Drawing.Size(284, 174); this.Controls.Add(this._lInfo); this.Controls.Add(this._tbLevel); this.Controls.Add(this._tbxLevel); + this.Controls.Add(this._lIlvl); + this.Controls.Add(this._tbItemLevel); + this.Controls.Add(this._tbxItemLevel); this.Controls.Add(this._bCancel); this.Controls.Add(this._bOk); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -105,6 +147,7 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Spell scaler"; ((System.ComponentModel.ISupportInitialize)(this._tbLevel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this._tbItemLevel)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -117,5 +160,8 @@ private void InitializeComponent() private System.Windows.Forms.TextBox _tbxLevel; private System.Windows.Forms.TrackBar _tbLevel; private System.Windows.Forms.Label _lInfo; + private System.Windows.Forms.Label _lIlvl; + private System.Windows.Forms.TrackBar _tbItemLevel; + private System.Windows.Forms.TextBox _tbxItemLevel; } } \ No newline at end of file diff --git a/SpellWork/Forms/FormSpellScaling.cs b/SpellWork/Forms/FormSpellScaling.cs index bd9e9209..5ba22d1b 100644 --- a/SpellWork/Forms/FormSpellScaling.cs +++ b/SpellWork/Forms/FormSpellScaling.cs @@ -16,6 +16,12 @@ private void LevelValueChanged(object sender, EventArgs e) _tbxLevel.Text = ((TrackBar)sender).Value.ToString(); } + private void ItemLevelValueChanged(object sender, EventArgs e) + { + SelectedItemLevel = (uint)((TrackBar)sender).Value; + _tbxItemLevel.Text = ((TrackBar)sender).Value.ToString(); + } + private void LevelTextKeyPress(object sender, KeyPressEventArgs e) { if (!char.IsDigit(e.KeyChar) && e.KeyChar != (char)Keys.Back && e.KeyChar != (char)Keys.Delete && e.KeyChar != (char)Keys.Escape && e.KeyChar != (char)Keys.Enter) @@ -43,6 +49,28 @@ private void LevelTextChanged(object sender, EventArgs e) SelectedLevel = (uint)val; } + private void ItemLevelTextChanged(object sender, EventArgs e) + { + var tb = (TextBox)sender; + if (tb.Text.Length <= 0) + { + SelectedItemLevel = 1; + tb.Text = "1"; + return; + } + + var val = int.Parse(tb.Text); + if (val > 1300) + tb.Text = "1300"; + else if (val <= 0) + tb.Text = "1"; + + val = int.Parse(tb.Text); + _tbItemLevel.Value = val; + SelectedItemLevel = (uint)val; + } + public uint SelectedLevel; + public uint SelectedItemLevel; } } diff --git a/SpellWork/Program.cs b/SpellWork/Program.cs index b61edd27..67e47d37 100644 --- a/SpellWork/Program.cs +++ b/SpellWork/Program.cs @@ -18,6 +18,7 @@ static void Main() try { + DBC.DBC.Load(); Application.Run(new FormMain()); } catch (DirectoryNotFoundException dnfe) diff --git a/SpellWork/Properties/Resources.Designer.cs b/SpellWork/Properties/Resources.Designer.cs index 9b17c495..5853c0d4 100644 --- a/SpellWork/Properties/Resources.Designer.cs +++ b/SpellWork/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Ce code a été généré par un outil. -// Version du runtime :4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si -// le code est régénéré. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace SpellWork.Properties { /// - /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder - // à l'aide d'un outil, tel que ResGen ou Visual Studio. - // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen - // avec l'option /str ou régénérez votre projet VS. + // This class was auto-generated by the StronglyTypedResourceBuilder + // 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.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Remplace la propriété CurrentUICulture du thread actuel pour toutes - /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { diff --git a/SpellWork/Properties/Resources.resx b/SpellWork/Properties/Resources.resx index af7dbebb..1af7de15 100644 --- a/SpellWork/Properties/Resources.resx +++ b/SpellWork/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/SpellWork/Spell/SpellEnums.cs b/SpellWork/Spell/SpellEnums.cs index fa0f1b2f..dc87b903 100644 --- a/SpellWork/Spell/SpellEnums.cs +++ b/SpellWork/Spell/SpellEnums.cs @@ -329,7 +329,7 @@ public enum SpellEffects SPELL_EFFECT_ACTIVATE_GARRISON_BUILDING = 224, SPELL_EFFECT_GRANT_BATTLEPET_LEVEL = 225, SPELL_EFFECT_226 = 226, - SPELL_EFFECT_227 = 227, + SPELL_EFFECT_TELEPORT_TO_LFG_DUNGEON = 227, SPELL_EFFECT_228 = 228, SPELL_EFFECT_SET_FOLLOWER_QUALITY = 229, SPELL_EFFECT_INCREASE_FOLLOWER_ITEM_LEVEL = 230, @@ -342,22 +342,22 @@ public enum SpellEffects SPELL_EFFECT_GIVE_RESTED_EXPERIENCE_BONUS = 237, SPELL_EFFECT_INCREASE_SKILL = 238, SPELL_EFFECT_END_GARRISON_BUILDING_CONSTRUCTION = 239, // Instantly finishes building construction - SPELL_EFFECT_240 = 240, + SPELL_EFFECT_GIVE_ARTIFACT_POWER = 240, SPELL_EFFECT_241 = 241, - SPELL_EFFECT_242 = 242, + SPELL_EFFECT_GIVE_ARTIFACT_POWER_NO_BONUS = 242, SPELL_EFFECT_APPLY_ENCHANT_ILLUSION = 243, SPELL_EFFECT_LEARN_FOLLOWER_ABILITY = 244, SPELL_EFFECT_UPGRADE_HEIRLOOM = 245, SPELL_EFFECT_FINISH_GARRISON_MISSION = 246, SPELL_EFFECT_ADD_GARRISON_MISSION = 247, SPELL_EFFECT_FINISH_SHIPMENT = 248, - SPELL_EFFECT_249 = 249, + SPELL_EFFECT_CREATE_ARTIFACT = 249, SPELL_EFFECT_TAKE_SCREENSHOT = 250, // Serverside marker for selfie screenshot - achievement check SPELL_EFFECT_SET_GARRISON_CACHE_SIZE = 251, SPELL_EFFECT_TELEPORT_UNITS = 252, SPELL_EFFECT_253 = 253, - SPELL_EFFECT_254 = 254, - SPELL_EFFECT_255 = 255, + SPELL_EFFECT_GIVE_HONOR = 254, + SPELL_EFFECT_LEARN_TRANSMOG_SET = 255, TOTAL_SPELL_EFFECTS = 256, }; diff --git a/SpellWork/Spell/SpellInfo.cs b/SpellWork/Spell/SpellInfo.cs index b7383a5d..95a2b873 100644 --- a/SpellWork/Spell/SpellInfo.cs +++ b/SpellWork/Spell/SpellInfo.cs @@ -43,8 +43,7 @@ private void ViewSpellInfo() _rtb.AppendFormatLine(_line); var addline = false; - // TODO Reimplement - /*if (DBC.DBC.SpellTriggerStore.ContainsKey(_spell.ID)) + if (DBC.DBC.SpellTriggerStore.ContainsKey(_spell.ID)) { foreach (var procSpellId in DBC.DBC.SpellTriggerStore[_spell.ID]) { @@ -57,7 +56,7 @@ private void ViewSpellInfo() _rtb.SetDefaultStyle(); addline = true; } - }*/ + } if (addline) _rtb.AppendFormatLine(_line);