diff --git a/.gitignore b/.gitignore index beba2e75..8d5f41cb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ SpellWork/obj/* *.rej *.patch *.log +_ReSharper* diff --git a/README b/README index ce6076b0..6d183ab6 100644 --- a/README +++ b/README @@ -5,3 +5,4 @@ This project is a try to rebuild the application using C#. Thanks goes to: Chestr - for the idea and released source of original spell_work TOM_RUS - for code samples + Shauren - updating for TrinityCore \ No newline at end of file diff --git a/SpellWork_VS2010.sln b/SpellWork.sln similarity index 100% rename from SpellWork_VS2010.sln rename to SpellWork.sln diff --git a/SpellWork/.gitignore b/SpellWork/.gitignore new file mode 100644 index 00000000..8650b356 --- /dev/null +++ b/SpellWork/.gitignore @@ -0,0 +1,3 @@ + +bin/* +obj/* diff --git a/SpellWork/DBC/DBC.cs b/SpellWork/DBC/DBC.cs index 5e65ed94..13105d0b 100644 --- a/SpellWork/DBC/DBC.cs +++ b/SpellWork/DBC/DBC.cs @@ -1,36 +1,156 @@ +using System; using System.Collections.Generic; +using System.IO; +using System.Reflection; +using DBFilesClient.NET; +using SpellWork.Database; +using SpellWork.DBC.Structures; +using SpellWork.Spell; +using SpellWork.Properties; -namespace SpellWork +namespace SpellWork.DBC { public static class DBC { - public const string VERSION = "SpellWork 3.3.5a (12340)"; - public const string DBC_PATH = @"dbc"; - - public const int MAX_DBC_LOCALE = 16; - public const int MAX_EFFECT_INDEX = 3; - public const int SPELL_ENTRY_FOR_DETECT_LOCALE = 1; - - public static Dictionary Spell; - public static Dictionary SpellRadius; - public static Dictionary SpellCastTimes; - public static Dictionary SpellDifficulty; - public static Dictionary SpellRange; - public static Dictionary SpellDuration; - public static Dictionary SkillLineAbility; - public static Dictionary SkillLine; - public static Dictionary ScreenEffect; - public static Dictionary OverrideSpellData; - - public static Dictionary SpellStrings = new Dictionary(); - public static Dictionary SkillLineStrings = new Dictionary(); - public static Dictionary SpellRangeStrings = new Dictionary(); - public static Dictionary ScreenEffectStrings = new Dictionary(); - - // DB + public const string Version = "SpellWork 4.3.4 (15595)"; + public const uint MaxLevel = 85; + + public const int MaxDbcLocale = 16; + public const int MaxReagentCount = 8; + public const int MaxEffectIndex = 3; + public const int SpellEntryForDetectLocale = 1; + + public static DBCStorage AreaGroup = new DBCStorage(); + public static DBCStorage AreaTable = new DBCStorage(); + public static DBCStorage gtSpellScaling = new DBCStorage(); + public static DBCStorage OverrideSpellData = new DBCStorage(); + public static DBCStorage ScreenEffect = new DBCStorage(); + public static DBCStorage SkillLineAbility = new DBCStorage(); + public static DBCStorage SkillLine = new DBCStorage(); + public static DBCStorage Spell = new DBCStorage(); + public static DBCStorage SpellAuraOptions = new DBCStorage(); + public static DBCStorage SpellAuraRestrictions = new DBCStorage(); + public static DBCStorage SpellCastingRequirements = new DBCStorage(); + public static DBCStorage SpellCastTimes = new DBCStorage(); + public static DBCStorage SpellCategories = new DBCStorage(); + public static DBCStorage SpellClassOptions = new DBCStorage(); + public static DBCStorage SpellCooldowns = new DBCStorage(); + public static DBCStorage SpellDescriptionVariables = new DBCStorage(); + public static DBCStorage SpellDifficulty = new DBCStorage(); + public static DBCStorage SpellDuration = new DBCStorage(); + public static DBCStorage SpellEffect = new DBCStorage(); + public static DBCStorage SpellEquippedItems = new DBCStorage(); + public static DBCStorage SpellInterrupts = new DBCStorage(); + public static DBCStorage SpellLevels = new DBCStorage(); + public static DBCStorage SpellMissile = new DBCStorage(); + public static DBCStorage SpellMissileMotion = new DBCStorage(); + public static DBCStorage SpellPower = new DBCStorage(); + public static DBCStorage SpellRadius = new DBCStorage(); + public static DBCStorage SpellRange = new DBCStorage(); + public static DBCStorage SpellReagents = new DBCStorage(); + public static DBCStorage SpellRuneCost = new DBCStorage(); + public static DBCStorage SpellScaling = new DBCStorage(); + public static DBCStorage SpellShapeshift = new DBCStorage(); + public static DBCStorage SpellTargetRestrictions = new DBCStorage(); + public static DBCStorage SpellTotems = new DBCStorage(); + public static DBCStorage SpellVisual = new DBCStorage(); + + public static DB2Storage Item = new DB2Storage(); + + [DataStoreFileName("Item-sparse")] + public static DB2Storage ItemSparse = new DB2Storage(); + + public static Dictionary SpellInfoStore = new Dictionary(); + + public static void Load() + { + if (!Directory.Exists(Settings.Default.DbcPath)) + { + System.Windows.Forms.FolderBrowserDialog browserDialog = new System.Windows.Forms.FolderBrowserDialog(); + if (browserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + Settings.Default.DbcPath = browserDialog.SelectedPath; + Settings.Default.Save(); + } + } + + foreach (var dbc in typeof(DBC).GetFields(BindingFlags.Static | BindingFlags.Public)) + { + if (!dbc.FieldType.IsGenericType) + continue; + + string extension; + if (dbc.FieldType.GetGenericTypeDefinition() == typeof(DBCStorage<>)) + extension = "dbc"; + else if (dbc.FieldType.GetGenericTypeDefinition() == typeof(DB2Storage<>)) + extension = "db2"; + else + continue; + + string name = dbc.Name; + + DataStoreFileNameAttribute[] attributes = dbc.GetCustomAttributes(typeof(DataStoreFileNameAttribute), false) as DataStoreFileNameAttribute[]; + if (attributes.Length == 1) + name = attributes[0].FileName; + + try + { + using (var strm = new FileStream(String.Format("{0}\\{1}.{2}", Settings.Default.DbcPath, name, extension), FileMode.Open)) + dbc.FieldType.GetMethod("Load", new Type[] { typeof(FileStream) }).Invoke(dbc.GetValue(null), new object[] { strm }); + } + catch (DirectoryNotFoundException) + { + throw new DirectoryNotFoundException(String.Format("Could not open {0}.dbc!", dbc.Name)); + } + catch (TargetInvocationException tie) + { + if (tie.InnerException is ArgumentException) + throw new ArgumentException(String.Format("Failed to load {0}.dbc: {1}", dbc.Name, tie.InnerException.Message)); + + throw; + } + } + + foreach (var dbcInfo in Spell.Records) + SpellInfoStore.Add(dbcInfo.Id, new SpellInfoHelper(dbcInfo)); + + foreach (var effect in SpellEffect.Records) + { + if (!SpellInfoStore.ContainsKey(effect.SpellId)) + continue; + + SpellInfoStore[effect.SpellId].Effects[effect.Index] = effect; + var scaling = SpellInfoStore[effect.SpellId].Scaling; + if (scaling != null) + { + effect.ScalingMultiplier = scaling.Multiplier[effect.Index]; + effect.RandomPointsScalingMultiplier = scaling.RandomPointsMultiplier[effect.Index]; + effect.ComboPointsScalingMultiplier = scaling.OtherMultiplier[effect.Index]; + } + } + + foreach (var item in ItemSparse) + { + ItemTemplate.Add(new Item + { + Entry = item.Id, + Name = item.Name, + Description = item.Description, + SpellId = new[] + { + item.SpellId[0], + item.SpellId[1], + item.SpellId[2], + item.SpellId[3], + item.SpellId[4] + } + }); + } + } + + // DB public static List ItemTemplate = new List(); - // Locale - public static LocalesDBC Locale { get; set; } + public static uint SelectedLevel = MaxLevel; } } diff --git a/SpellWork/DBC/DBCReader.cs b/SpellWork/DBC/DBCReader.cs deleted file mode 100644 index 11a1c568..00000000 --- a/SpellWork/DBC/DBCReader.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Text; -using System.IO; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace SpellWork -{ - static class DBCReader - { - public static unsafe Dictionary ReadDBC(Dictionary strDict) where T : struct - { - Dictionary dict = new Dictionary(); - String fileName = Path.Combine(DBC.DBC_PATH, typeof(T).Name + ".dbc").Replace("Entry", String.Empty); - - using (BinaryReader reader = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read), Encoding.UTF8)) - { - if (!File.Exists(fileName)) - throw new FileNotFoundException(); - // read dbc header - DbcHeader header = reader.ReadStruct(); - int size = Marshal.SizeOf(typeof(T)); - - if (!header.IsDBC) - throw new Exception(fileName + " is not DBC files!"); - - if (header.RecordSize != size) - throw new Exception(string.Format("Size of row in DBC file ({0}) != size of DBC struct ({1}) in DBC: {2}", header.RecordSize, size, fileName)); - - // read dbc data - for (int r = 0; r < header.RecordsCount; ++r) - { - uint key = reader.ReadUInt32(); - reader.BaseStream.Position -= 4; - - T T_entry = reader.ReadStruct(); - - dict.Add(key, T_entry); - } - - // read dbc strings - if (strDict != null) - { - while (reader.BaseStream.Position != reader.BaseStream.Length) - { - var offset = (uint)(reader.BaseStream.Position - header.StartStringPosition); - var str = reader.ReadCString(); - strDict.Add(offset, str); - } - } - } - return dict; - } - } -} diff --git a/SpellWork/DBC/DataStoreFileNameAttribute.cs b/SpellWork/DBC/DataStoreFileNameAttribute.cs new file mode 100644 index 00000000..ad523f39 --- /dev/null +++ b/SpellWork/DBC/DataStoreFileNameAttribute.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SpellWork.DBC +{ + [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)] + sealed class DataStoreFileNameAttribute : Attribute + { + readonly string _fileName; + + public DataStoreFileNameAttribute(string filename) + { + this._fileName = filename; + } + + public string FileName + { + get { return _fileName; } + } + } +} diff --git a/SpellWork/DBC/Structure.cs b/SpellWork/DBC/Structure.cs deleted file mode 100644 index b7b2051f..00000000 --- a/SpellWork/DBC/Structure.cs +++ /dev/null @@ -1,529 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; - -namespace SpellWork -{ - public struct DbcHeader - { - public int Signature; - public int RecordsCount; - public int FieldsCount; - public int RecordSize; - public int StringTableSize; - - public bool IsDBC - { - get { return Signature == 0x43424457; } - } - - public long DataSize - { - get { return (long)(RecordsCount * RecordSize); } - } - - public long StartStringPosition - { - get { return DataSize + (long)Marshal.SizeOf(typeof(DbcHeader)); } - } - }; - - [StructLayout(LayoutKind.Sequential)] - public struct SpellEntry - { - public uint ID; // 0 m_ID - public uint Category; // 1 m_category - public uint Dispel; // 2 m_dispelType - public uint Mechanic; // 3 m_mechanic - public uint Attributes; // 4 m_attribute - public uint AttributesEx; // 5 m_attributesEx - public uint AttributesEx2; // 6 m_attributesExB - public uint AttributesEx3; // 7 m_attributesExC - public uint AttributesEx4; // 8 m_attributesExD - public uint AttributesEx5; // 9 m_attributesExE - public uint AttributesEx6; // 10 m_attributesExF - public uint AttributesExG; // 11 3.2.0 (0x20 - totems, 0x4 - paladin auras, etc...) - public ulong Stances; // 12-13 m_shapeshiftMask - public ulong StancesNot; // 14-15 m_shapeshiftExclude - public uint Targets; // 16 m_targets - public uint TargetCreatureType; // 17 m_targetCreatureType - public uint RequiresSpellFocus; // 18 m_requiresSpellFocus - public uint FacingCasterFlags; // 19 m_facingCasterFlags - public uint CasterAuraState; // 20 m_casterAuraState - public uint TargetAuraState; // 21 m_targetAuraState - public uint CasterAuraStateNot; // 22 m_excludeCasterAuraState - public uint TargetAuraStateNot; // 23 m_excludeTargetAuraState - public uint CasterAuraSpell; // 24 m_casterAuraSpell - public uint TargetAuraSpell; // 25 m_targetAuraSpell - public uint ExcludeCasterAuraSpell; // 26 m_excludeCasterAuraSpell - public uint ExcludeTargetAuraSpell; // 27 m_excludeTargetAuraSpell - public uint CastingTimeIndex; // 28 m_castingTimeIndex - public uint RecoveryTime; // 29 m_recoveryTime - public uint CategoryRecoveryTime; // 30 m_categoryRecoveryTime - public uint InterruptFlags; // 31 m_interruptFlags - public uint AuraInterruptFlags; // 32 m_auraInterruptFlags - public uint ChannelInterruptFlags; // 33 m_channelInterruptFlags - public uint ProcFlags; // 34 m_procTypeMask - public uint ProcChance; // 35 m_procChance - public uint ProcCharges; // 36 m_procCharges - public uint MaxLevel; // 37 m_maxLevel - public uint BaseLevel; // 38 m_baseLevel - public uint SpellLevel; // 39 m_spellLevel - public uint DurationIndex; // 40 m_durationIndex - public uint PowerType; // 41 m_powerType - public uint ManaCost; // 42 m_manaCost - public uint ManaCostPerlevel; // 43 m_manaCostPerLevel - public uint ManaPerSecond; // 44 m_manaPerSecond - public uint ManaPerSecondPerLevel; // 45 m_manaPerSecondPerLevel - public uint RangeIndex; // 46 m_rangeIndex - public float Speed; // 47 m_speed - public uint ModalNextSpell; // 48 m_modalNextSpell not used - public uint StackAmount; // 49 m_cumulativeAura - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public uint[] Totem; // 50-51 m_totem - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public int[] Reagent; // 52-59 m_reagent - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public uint[] ReagentCount; // 60-67 m_reagentCount - public int EquippedItemClass; // 68 m_equippedItemClass (value) - public int EquippedItemSubClassMask; // 69 m_equippedItemSubclass (mask) - public int EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask) - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] Effect; // 71-73 m_effect - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public int[] EffectDieSides; // 74-76 m_effectDieSides - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public float[] EffectRealPointsPerLevel; // 77-79 m_effectRealPointsPerLevel - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public int[] EffectBasePoints; // 80-82 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectMechanic; // 83-85 m_effectMechanic - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectImplicitTargetA; // 86-88 m_implicitTargetA - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectImplicitTargetB; // 89-91 m_implicitTargetB - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectRadiusIndex; // 92-94 m_effectRadiusIndex - spellradius.dbc - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectApplyAuraName; // 95-97 m_effectAura - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectAmplitude; // 98-100 m_effectAuraPeriod - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public float[] EffectMultipleValue; // 101-103 m_effectAmplitude - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectChainTarget; // 104-106 m_effectChainTargets - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectItemType; // 107-109 m_effectItemType - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public int[] EffectMiscValue; // 110-112 m_effectMiscValue - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public int[] EffectMiscValueB; // 113-115 m_effectMiscValueB - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectTriggerSpell; // 116-118 m_effectTriggerSpell - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public float[] EffectPointsPerComboPoint; // 119-121 m_effectPointsPerCombo - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectSpellClassMaskA; // 122-124 m_effectSpellClassMaskA, effect 0 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectSpellClassMaskB; // 125-127 m_effectSpellClassMaskB, effect 1 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)] - public uint[] EffectSpellClassMaskC; // 128-130 m_effectSpellClassMaskC, effect 2 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public uint[] SpellVisual; // 131-132 m_spellVisualID - public uint SpellIconID; // 133 m_spellIconID - public uint ActiveIconID; // 134 m_activeIconID - public uint SpellPriority; // 135 m_spellPriority not used - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_DBC_LOCALE)] - private uint[] _SpellName; // 136-151 m_name_lang - public uint SpellNameFlag; // 152 not used - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_DBC_LOCALE)] - private uint[] _Rank; // 153-168 m_nameSubtext_lang - public uint RankFlags; // 169 not used - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_DBC_LOCALE)] - private uint[] _Description; // 170-185 m_description_lang not used - public uint DescriptionFlags; // 186 not used - [MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_DBC_LOCALE)] - private uint[] _ToolTip; // 187-202 m_auraDescription_lang not used - public uint ToolTipFlags; // 203 not used - public uint ManaCostPercentage; // 204 m_manaCostPct - public uint StartRecoveryCategory; // 205 m_startRecoveryCategory - public uint StartRecoveryTime; // 206 m_startRecoveryTime - public uint MaxTargetLevel; // 207 m_maxTargetLevel - public uint SpellFamilyName; // 208 m_spellClassSet - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public uint[] SpellFamilyFlags; // 209-211 m_spellClassMask NOTE: size is 12 bytes!!! - public uint MaxAffectedTargets; // 212 m_maxTargets - public uint DmgClass; // 213 m_defenseType - public uint PreventionType; // 214 m_preventionType - public uint StanceBarOrder; // 215 m_stanceBarOrder not used - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public float[] DmgMultiplier; // 216-218 m_effectChainAmplitude - public uint MinFactionId; // 219 m_minFactionID not used - public uint MinReputation; // 220 m_minReputation not used - public uint RequiredAuraVision; // 221 m_requiredAuraVision not used - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public uint[] TotemCategory; // 222-223 m_requiredTotemCategoryID - public int AreaGroupId; // 224 m_requiredAreaGroupId - public uint SchoolMask; // 225 m_schoolMask - public uint RuneCostID; // 226 m_runeCostID - public uint SpellMissileID; // 227 m_spellMissileID not used - public uint PowerDisplayId; // 228 PowerDisplay.dbc, new in 3.1 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public float[] Unk_320_4; // 229-231 3.2.0 - public uint SpellDescriptionVariableID; // 232 3.2.0 - public uint SpellDifficultyId; // 233 3.3.0 // 239 3.3.0 - - /// - /// Return current Spell Name - /// - public string SpellName - { - get { return DBC.SpellStrings.GetValue(_SpellName[(uint)DBC.Locale]); } - } - - /// - /// Return current Spell Rank - /// - public string Rank - { - get { return _Rank[(uint)DBC.Locale] != 0 ? DBC.SpellStrings[_Rank[(uint)DBC.Locale]] : ""; } - } - - public string SpellNameRank - { - get { return Rank.IsEmpty() ? SpellName : String.Format("{0} ({1})", SpellName, Rank); } - } - - /// - /// Return current Spell Description - /// - public string Description - { - get { return DBC.SpellStrings.GetValue(_Description[(uint)DBC.Locale]); } - } - - /// - /// Return current Spell ToolTip - /// - public string ToolTip - { - get { return DBC.SpellStrings.GetValue(_ToolTip[(uint)DBC.Locale]); } - } - - public string GetName(byte loc) - { - return DBC.SpellStrings.GetValue(_SpellName[loc]); - } - - public string ProcInfo - { - get - { - int i = 0; - StringBuilder sb = new StringBuilder(); - uint proc = ProcFlags; - while (proc != 0) - { - if ((proc & 1) != 0) - sb.AppendFormatLine(" {0}", SpellEnums.ProcFlagDesc[i]); - i++; - proc >>= 1; - } - return sb.ToString(); - } - } - - public string Duration - { - get { return DBC.SpellDuration.ContainsKey(DurationIndex) ? DBC.SpellDuration[DurationIndex].ToString() : String.Empty; } - } - - public string Range - { - get - { - if (RangeIndex == 0 || !DBC.SpellRange.ContainsKey(RangeIndex)) - return String.Empty; - - SpellRangeEntry range = DBC.SpellRange[RangeIndex]; - StringBuilder sb = new StringBuilder(); - sb.AppendFormatLine("SpellRange: (Id {0}) \"{1}\":", range.ID, range.Description1); - sb.AppendFormatLine(" MinRange = {0}, MinRangeFriendly = {1}", range.MinRange, range.MinRangeFriendly); - sb.AppendFormatLine(" MaxRange = {0}, MaxRangeFriendly = {1}", range.MaxRange, range.MaxRangeFriendly); - - return sb.ToString(); - } - } - - public string GetRadius(int index) - { - uint rIndex = EffectRadiusIndex[index]; - if (rIndex != 0) - { - if (DBC.SpellRadius.ContainsKey(rIndex)) - return String.Format("Radius (Id {0}) {1:F}", rIndex, DBC.SpellRadius[rIndex].Radius); - else - return String.Format("Radius (Id {0}) Not found", rIndex); - } - return String.Empty; - } - - public string CastTime - { - get - { - if (CastingTimeIndex == 0) - return String.Empty; - - if (!DBC.SpellCastTimes.ContainsKey(CastingTimeIndex)) - return String.Format("CastingTime (Id {0}) = ????", CastingTimeIndex); - else - return String.Format("CastingTime (Id {0}) = {1:F}", - CastingTimeIndex, DBC.SpellCastTimes[CastingTimeIndex].CastTime / 1000.0f); - } - } - - public string SpellDifficulty - { - get - { - if (SpellDifficultyId == 0) - return string.Empty; - - StringBuilder builder = new StringBuilder("Spell Difficulty Id: " + SpellDifficultyId); - - SpellDifficultyEntry entry; - if (DBC.SpellDifficulty.TryGetValue(SpellDifficultyId, out entry)) - { - builder.AppendLine(); - - for (int i = 0; i < entry.Spells.Length; ++i) - { - int spellId = entry.Spells[i]; - - builder.AppendFormat(" {0}) {1} - ", i, spellId); - - SpellEntry spell; - if (DBC.Spell.TryGetValue((uint)spellId, out spell)) - builder.AppendLine(spell.SpellNameRank); - else - builder.AppendLine("(Not Found in Spell.dbc)"); - } - } - else - builder.AppendLine(" (Not Found in SpellDifficulty.dbc)"); - - return builder.ToString(); - } - } - - public SpellSchoolMask School - { - get - { - return (SpellSchoolMask)SchoolMask; - } - } - }; - - public struct SkillLineEntry - { - public uint ID; // 0 m_ID - public int CategoryId; // 1 m_categoryID - public uint SkillCostID; // 2 m_skillCostsID - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] _Name; // 3-18 m_displayName_lang - public uint NameFlags; // 19 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] _Description; // 20-35 m_description_lang - public uint DescriptionFlags; // 36 - public uint SpellIcon; // 37 m_spellIconID - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] _AlternateVerb; // 38-53 m_alternateVerb_lang - public uint AlternateVerbFlags; // 54 - public uint CanLink; // 55 m_canLink (prof. with recipes - - public string Name - { - get { return DBC.SkillLineStrings.GetValue(_Name[(uint)DBC.Locale]); } - } - - public string Description - { - get { return DBC.SkillLineStrings.GetValue(_Description[(uint)DBC.Locale]); } - } - - public string AlternateVerb - { - get { return DBC.SkillLineStrings.GetValue(_AlternateVerb[(uint)DBC.Locale]); } - } - }; - - public struct SkillLineAbilityEntry - { - public uint ID; // 0 m_ID - public uint SkillId; // 1 m_skillLine - public uint SpellId; // 2 m_spell - public uint Racemask; // 3 m_raceMask - public uint Classmask; // 4 m_classMask - public uint RacemaskNot; // 5 m_excludeRace - public uint ClassmaskNot; // 6 m_excludeClass - public uint Req_skill_value; // 7 m_minSkillLineRank - public uint Forward_spellid; // 8 m_supercededBySpell - public uint LearnOnGetSkill; // 9 m_acquireMethod - public uint Max_value; // 10 m_trivialSkillLineRankHigh - public uint Min_value; // 11 m_trivialSkillLineRankLow - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public uint[] CharacterPoints; // 12-13 m_characterPoints[2] - }; - - public struct SpellRadiusEntry - { - public uint ID; - public float Radius; - public int Zero; - public float Radius2; - }; - - public struct SpellRangeEntry - { - public uint ID; - public float MinRange; - public float MinRangeFriendly; - public float MaxRange; - public float MaxRangeFriendly; - public uint Field5; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] _Desc1; - public uint Desc1Flags; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public uint[] _Desc2; - public uint Desc2Flags; - - public string Description1 - { - get { return DBC.SpellRangeStrings.GetValue(_Desc1[(uint)DBC.Locale]); } - } - - public string Description2 - { - get { return DBC.SpellRangeStrings.GetValue(_Desc2[(uint)DBC.Locale]); } - } - }; - - public struct SpellDurationEntry - { - public uint ID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public int[] Duration; - - public override string ToString() - { - return String.Format("Duration: ID ({0}) {1}, {2}, {3}", ID, Duration[0], Duration[1], Duration[2]); - } - }; - - public struct SpellCastTimesEntry - { - public uint ID; - public int CastTime; - public float CastTimePerLevel; - public int MinCastTime; - }; - - public struct SpellDifficultyEntry - { - public uint Id; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public int[] Spells; - }; - - public struct ScreenEffectEntry - { - public uint Id; - public uint _Name; - public uint Unk0; - public float Unk1; - public uint Unk2; - public uint Unk3; // % of smth? - public uint Unk4; // all 0 - public int Unk5; - public uint Unk6; - public uint Unk7; - - public string Name - { - get { return DBC.ScreenEffectStrings.GetValue(_Name); } - } - }; - - public struct OverrideSpellDataEntry - { - public uint Id; - // Value 10 also used in SpellInfo.AuraModTypeName - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public uint[] Spells; - public uint unk; - }; - - //=============== DateBase =================\\ - - public struct SpellProcEventEntry - { - public uint ID; - public string SpellName; - public uint SchoolMask; - public uint SpellFamilyName; - public uint[,] SpellFamilyMask; - public uint ProcFlags; - public uint ProcEx; - public float PpmRate; - public float CustomChance; - public uint Cooldown; - - public string[] ToArray() - { - return new[] - { - ID.ToString(), - SpellName, - SchoolMask.ToString(), - SpellFamilyName.ToString(), - SpellFamilyMask[0,0].ToString(), - SpellFamilyMask[0,1].ToString(), - SpellFamilyMask[0,2].ToString(), - SpellFamilyMask[1,0].ToString(), - SpellFamilyMask[1,1].ToString(), - SpellFamilyMask[1,2].ToString(), - SpellFamilyMask[2,0].ToString(), - SpellFamilyMask[2,1].ToString(), - SpellFamilyMask[2,2].ToString(), - ProcFlags.ToString(), - ProcEx.ToString(), - PpmRate.ToString(), - CustomChance.ToString(), - Cooldown.ToString() - }; - } - }; - - public struct SpellChain - { - public int ID; - public int PrevSpell; - public int FirstSpell; - public int Rank; - public int ReqSpell; - }; - - public struct Item - { - public uint Entry; - public string Name; - public string Description; - public string LocalesName; - public string LocalesDescription; - public uint[] SpellID; - }; -} diff --git a/SpellWork/DBC/Structures/AreaGroupEntry.cs b/SpellWork/DBC/Structures/AreaGroupEntry.cs new file mode 100644 index 00000000..b3b5cd2f --- /dev/null +++ b/SpellWork/DBC/Structures/AreaGroupEntry.cs @@ -0,0 +1,12 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class AreaGroupEntry + { + public uint Id; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 6)] + public uint[] AreaId; + public uint NextGroup; + } +} diff --git a/SpellWork/DBC/Structures/AreaTableEntry.cs b/SpellWork/DBC/Structures/AreaTableEntry.cs new file mode 100644 index 00000000..376566f9 --- /dev/null +++ b/SpellWork/DBC/Structures/AreaTableEntry.cs @@ -0,0 +1,32 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class AreaTableEntry + { + public uint Id; + public uint MapId; + public uint ZoneId; + public uint ExploreFlag; + public uint Flags; + public uint SoundPreferences; + public uint SoundPreferencesUnderwater; + public uint SoundAmbience; + public uint ZoneMusic; + public uint ZoneIntroMusicTable; + public int Level; + public string Name; + public uint StringFlags; + public uint FactionFlags; + public uint LiquidType1; + public uint LiquidType2; + public uint LiquidType3; + public uint LiquidType4; + public float MinElevation; + public float AmbientMultiplier; + public uint Light; + public uint UnkCataclysm1; + public uint UnkCataclysm2; + public uint UnkCataclysm3; + public uint UnkCataclysm4; + public uint UnkCataclysm5; + } +} diff --git a/SpellWork/DBC/Structures/ItemEntry.cs b/SpellWork/DBC/Structures/ItemEntry.cs new file mode 100644 index 00000000..2ec26a1c --- /dev/null +++ b/SpellWork/DBC/Structures/ItemEntry.cs @@ -0,0 +1,16 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class ItemEntry + { + public uint Id; + public uint Class; + public uint SubClass; + public int SoundOverrideSubclass; + public int Material; + public uint DisplayId; + public uint InventoryType; + public uint Sheath; + } +} diff --git a/SpellWork/DBC/Structures/ItemSparseEntry.cs b/SpellWork/DBC/Structures/ItemSparseEntry.cs new file mode 100644 index 00000000..7336bc77 --- /dev/null +++ b/SpellWork/DBC/Structures/ItemSparseEntry.cs @@ -0,0 +1,89 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class ItemSparseEntry + { + public uint Id; + public uint Quality; + public uint Flags; + public uint Flags2; + public float Unk1; + public float Unk2; + public uint BuyCount; + public uint BuyPrice; + public uint SellPrice; + public uint InventoryType; + public int AllowableClass; + public int AllowableRace; + public uint ItemLevel; + public int RequiredLevel; + public uint RequiredSkill; + public uint RequiredSkillRank; + public uint RequiredSpell; + public uint RequiredHonorRank; + public uint RequiredCityRank; + public uint RequiredReputationFaction; + public uint RequiredReputationRank; + public uint MaxCount; + public uint Stackable; + public uint ContainerSlots; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 10)] + public int[] ItemStatType; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 10)] + public uint[] ItemStatValue; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 10)] + public int[] ItemStatUnk1; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 10)] + public int[] ItemStatUnk2; + public uint ScalingStatDistribution; + public uint DamageType; + public uint Delay; + public float RangedModRange; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 5)] + public int[] SpellId; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 5)] + public int[] SpellTrigger; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 5)] + public int[] SpellCharges; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 5)] + public int[] SpellCooldown; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 5)] + public int[] SpellCategory; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 5)] + public int[] SpellCategoryCooldown; + public uint Bonding; + public string Name; + public string Name2; + public string Name3; + public string Name4; + public string Description; + public uint PageText; + public uint LanguageID; + public uint PageMaterial; + public uint StartQuest; + public uint LockID; + public int Material; + public uint Sheath; + public uint RandomProperty; + public uint RandomSuffix; + public uint ItemSet; + public uint Area; + public uint Map; + public uint BagFamily; + public uint TotemCategory; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public uint[] Color; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public uint[] Content; + public int SocketBonus; + public uint GemProperties; + public float ArmorDamageModifier; + public uint Duration; + public uint ItemLimitCategory; + public uint HolidayId; + public float StatScalingFactor; + public int CurrencySubstitutionId; + public int CurrencySubstitutionCount; + } +} diff --git a/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs b/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs new file mode 100644 index 00000000..eb3fe25e --- /dev/null +++ b/SpellWork/DBC/Structures/OverrideSpellDataEntry.cs @@ -0,0 +1,13 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class OverrideSpellDataEntry + { + public uint Id; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 10)] + public uint[] Spells; + public uint Unk; + public string Name; + } +} diff --git a/SpellWork/DBC/Structures/ScreenEffectEntry.cs b/SpellWork/DBC/Structures/ScreenEffectEntry.cs new file mode 100644 index 00000000..b21c6f73 --- /dev/null +++ b/SpellWork/DBC/Structures/ScreenEffectEntry.cs @@ -0,0 +1,17 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class ScreenEffectEntry + { + public uint Id; + public string Name; + public uint Unk0; + public float Unk1; + public uint Unk2; + public uint Unk3; + public uint Unk4; + public int Unk5; + public uint Unk6; + public uint Unk7; + public int Unk8; + } +} diff --git a/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs b/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs new file mode 100644 index 00000000..6ef897f4 --- /dev/null +++ b/SpellWork/DBC/Structures/SkillLineAbilityEntry.cs @@ -0,0 +1,22 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SkillLineAbilityEntry + { + public uint Id; // 0 m_ID + public uint SkillId; // 1 m_skillLine + public uint SpellId; // 2 m_spell + public uint Racemask; // 3 m_raceMask + public uint Classmask; // 4 m_classMask + public uint RacemaskNot; // 5 m_excludeRace + public uint ClassmaskNot; // 6 m_excludeClass + public uint ReqSkillValue; // 7 m_minSkillLineRank + public uint ForwardSpellid; // 8 m_supercededBySpell + public uint LearnOnGetSkill; // 9 m_acquireMethod + public uint MaxValue; // 10 m_trivialSkillLineRankHigh + public uint MinValue; // 11 m_trivialSkillLineRankLow + [StoragePresence(StoragePresenceOption.Include, ArraySize = 2)] + public uint[] CharacterPoints; // 12-13 m_characterPoints[2] + } +} diff --git a/SpellWork/DBC/Structures/SkillLineEntry.cs b/SpellWork/DBC/Structures/SkillLineEntry.cs new file mode 100644 index 00000000..896538c9 --- /dev/null +++ b/SpellWork/DBC/Structures/SkillLineEntry.cs @@ -0,0 +1,13 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SkillLineEntry + { + public uint Id; + public int CategoryId; + public string Name; + public string Description; + public uint SpellIcon; + public string AlternateVerb; + public uint CanLink; + } +} diff --git a/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs b/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs new file mode 100644 index 00000000..a08051f8 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellAuraOptionsEntry.cs @@ -0,0 +1,11 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellAuraOptionsEntry + { + public uint Id; + public uint StackAmount; + public uint ProcChance; + public uint ProcCharges; + public uint ProcFlags; + } +} diff --git a/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs b/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs new file mode 100644 index 00000000..4c5dbe6e --- /dev/null +++ b/SpellWork/DBC/Structures/SpellAuraRestrictionsEntry.cs @@ -0,0 +1,15 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellAuraRestrictionsEntry + { + public uint Id; + public uint CasterAuraState; + public uint TargetAuraState; + public uint CasterAuraStateNot; + public uint TargetAuraStateNot; + public uint CasterAuraSpell; + public uint TargetAuraSpell; + public uint ExcludeCasterAuraSpell; + public uint ExcludeTargetAuraSpell; + } +} diff --git a/SpellWork/DBC/Structures/SpellCastTimesEntry.cs b/SpellWork/DBC/Structures/SpellCastTimesEntry.cs new file mode 100644 index 00000000..7d4a5139 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellCastTimesEntry.cs @@ -0,0 +1,10 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellCastTimesEntry + { + public uint Id; + public int CastTime; + public int CastTimePerLevel; + public int MinCastTime; + } +} diff --git a/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs b/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs new file mode 100644 index 00000000..137f4a0b --- /dev/null +++ b/SpellWork/DBC/Structures/SpellCastingRequirementsEntry.cs @@ -0,0 +1,13 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellCastingRequirementsEntry + { + public uint Id; + public uint FacingCasterFlags; + public uint MinFactionId; + public uint MinReputation; + public int AreaGroupId; + public uint RequiredAuraVision; + public uint RequiresSpellFocus; + } +} diff --git a/SpellWork/DBC/Structures/SpellCategoriesEntry.cs b/SpellWork/DBC/Structures/SpellCategoriesEntry.cs new file mode 100644 index 00000000..39b21c06 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellCategoriesEntry.cs @@ -0,0 +1,13 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellCategoriesEntry + { + public uint Id; + public uint Category; + public uint DmgClass; + public uint Dispel; + public uint Mechanic; + public uint PreventionType; + public uint StartRecoveryCategory; + } +} diff --git a/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs b/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs new file mode 100644 index 00000000..79ccdd2d --- /dev/null +++ b/SpellWork/DBC/Structures/SpellClassOptionsEntry.cs @@ -0,0 +1,14 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellClassOptionsEntry + { + public uint Id; + public uint ModalNextSpell; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public uint[] SpellFamilyFlags; + public uint SpellFamilyName; + public string Description; + } +} diff --git a/SpellWork/DBC/Structures/SpellCooldownsEntry.cs b/SpellWork/DBC/Structures/SpellCooldownsEntry.cs new file mode 100644 index 00000000..ad6a21a2 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellCooldownsEntry.cs @@ -0,0 +1,10 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellCooldownsEntry + { + public uint Id; + public uint CategoryRecoveryTime; + public uint RecoveryTime; + public uint StartRecoveryTime; + } +} diff --git a/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs b/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs new file mode 100644 index 00000000..4b570110 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellDescriptionVariablesEntry.cs @@ -0,0 +1,8 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellDescriptionVariablesEntry + { + public uint Id; + public string Variables; + } +} diff --git a/SpellWork/DBC/Structures/SpellDifficultyEntry.cs b/SpellWork/DBC/Structures/SpellDifficultyEntry.cs new file mode 100644 index 00000000..175aa0a5 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellDifficultyEntry.cs @@ -0,0 +1,11 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellDifficultyEntry + { + public uint Id; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 4)] + public uint[] SpellId; + } +} diff --git a/SpellWork/DBC/Structures/SpellDurationEntry.cs b/SpellWork/DBC/Structures/SpellDurationEntry.cs new file mode 100644 index 00000000..6aaa5c64 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellDurationEntry.cs @@ -0,0 +1,17 @@ +using System; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellDurationEntry + { + public uint Id; + public int Duration; + public int Unknown2; + public int MaxDuration; + + public override string ToString() + { + return String.Format("Duration: ID ({0}) {1}, {2}, {3}", Id, Duration, Unknown2, MaxDuration); + } + } +} diff --git a/SpellWork/DBC/Structures/SpellEffectEntry.cs b/SpellWork/DBC/Structures/SpellEffectEntry.cs new file mode 100644 index 00000000..777ccd9a --- /dev/null +++ b/SpellWork/DBC/Structures/SpellEffectEntry.cs @@ -0,0 +1,65 @@ +using System; +using System.Linq; +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellEffectEntry + { + public uint Id; + public uint Type; + public float ValueMultiplier; + public uint ApplyAuraName; + public uint Amplitude; + public int BasePoints; + public float BonusMultiplier; + public float DamageMultiplier; + public uint ChainTarget; + public int DieSides; + public uint ItemType; + public uint Mechanic; + public int MiscValue; + public int MiscValueB; + public float PointsPerComboPoint; + public uint RadiusIndex; + public uint RadiusMaxIndex; + public float RealPointsPerLevel; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public uint[] SpellClassMask; + public uint TriggerSpell; + public uint ImplicitTargetA; + public uint ImplicitTargetB; + public uint SpellId; + public uint Index; + public uint Unk0; + + [StoragePresence(StoragePresenceOption.Exclude)] + public float ScalingMultiplier; + [StoragePresence(StoragePresenceOption.Exclude)] + public float RandomPointsScalingMultiplier; + [StoragePresence(StoragePresenceOption.Exclude)] + public float ComboPointsScalingMultiplier; + + public string MaxRadius + { + get + { + if (RadiusMaxIndex == 0 || !DBC.SpellRadius.ContainsKey(RadiusMaxIndex)) + return String.Empty; + + return String.Format("Max Radius (Id {0}) {1:F}", RadiusMaxIndex, DBC.SpellRadius[RadiusMaxIndex].Radius); + } + } + + public string Radius + { + get + { + if (RadiusIndex == 0 || !DBC.SpellRadius.ContainsKey(RadiusIndex)) + return String.Empty; + + return String.Format("Radius (Id {0}) {1:F}", RadiusIndex, DBC.SpellRadius[RadiusIndex].Radius); + } + } + } +} diff --git a/SpellWork/DBC/Structures/SpellEntry.cs b/SpellWork/DBC/Structures/SpellEntry.cs new file mode 100644 index 00000000..9ceb99eb --- /dev/null +++ b/SpellWork/DBC/Structures/SpellEntry.cs @@ -0,0 +1,133 @@ +using System.Linq; +using DBFilesClient.NET; +using System.Text; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellEntry + { + public uint Id; + public uint Attributes; + public uint AttributesEx; + public uint AttributesEx2; + public uint AttributesEx3; + public uint AttributesEx4; + public uint AttributesEx5; + public uint AttributesEx6; + public uint AttributesEx7; + public uint AttributesEx8; + public uint AttributesEx9; + public uint AttributesEx10; + public uint CastingTimeIndex; + public uint DurationIndex; + public uint PowerType; + public uint RangeIndex; + public float Speed; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 2)] + public uint[] SpellVisual; + public uint SpellIconID; + public uint ActiveIconID; + public string SpellName; + public string Rank; + public string Description; + public string ToolTip; + public uint SchoolMask; + public uint RuneCostID; + public uint SpellMissileID; + public uint SpellDescriptionVariableID; + public uint SpellDifficultyId; + public float Unknown3; + public uint SpellScalingId; + public uint SpellAuraOptionsId; + public uint SpellAuraRestrictionsId; + public uint SpellCastingRequirementsId; + public uint SpellCategoriesId; + public uint SpellClassOptionsId; + public uint SpellCooldownsId; + public uint Unknown4; + public uint SpellEquippedItemsId; + public uint SpellInterruptsId; + public uint SpellLevelsId; + public uint SpellPowerId; + public uint SpellReagentsId; + public uint SpellShapeshiftId; + public uint SpellTargetRestrictionsId; + public uint SpellTotemsId; + public uint ResearchProject; + + public SpellAuraOptionsEntry AuraOptions + { + get { return SpellAuraOptionsId != 0 && DBC.SpellAuraOptions.ContainsKey(SpellAuraOptionsId) ? DBC.SpellAuraOptions[SpellAuraOptionsId] : null; } + } + + public SpellAuraRestrictionsEntry AuraRestrictions + { + get { return SpellAuraRestrictionsId != 0 && DBC.SpellAuraRestrictions.ContainsKey(SpellAuraRestrictionsId) ? DBC.SpellAuraRestrictions[SpellAuraRestrictionsId] : null; } + } + + public SpellCastingRequirementsEntry CastingRequirements + { + get { return SpellCastingRequirementsId != 0 && DBC.SpellCastingRequirements.ContainsKey(SpellCastingRequirementsId) ? DBC.SpellCastingRequirements[SpellCastingRequirementsId] : null; } + } + + public SpellCategoriesEntry Category + { + get { return SpellCategoriesId != 0 && DBC.SpellCategories.ContainsKey(SpellCategoriesId) ? DBC.SpellCategories[SpellCategoriesId] : null; } + } + + public SpellClassOptionsEntry ClassOptions + { + get { return SpellClassOptionsId != 0 && DBC.SpellClassOptions.ContainsKey(SpellClassOptionsId) ? DBC.SpellClassOptions[SpellClassOptionsId] : null; } + } + + public SpellCooldownsEntry Cooldowns + { + get { return SpellCooldownsId != 0 && DBC.SpellCooldowns.ContainsKey(SpellCooldownsId) ? DBC.SpellCooldowns[SpellCooldownsId] : null; } + } + + public SpellEquippedItemsEntry EquippedItems + { + get { return SpellEquippedItemsId != 0 && DBC.SpellEquippedItems.ContainsKey(SpellEquippedItemsId) ? DBC.SpellEquippedItems[SpellEquippedItemsId] : null; } + } + + public SpellInterruptsEntry Interrupts + { + get { return SpellInterruptsId != 0 && DBC.SpellInterrupts.ContainsKey(SpellInterruptsId) ? DBC.SpellInterrupts[SpellInterruptsId] : null; } + } + + public SpellLevelsEntry Levels + { + get { return SpellLevelsId != 0 && DBC.SpellLevels.ContainsKey(SpellLevelsId) ? DBC.SpellLevels[SpellLevelsId] : null; } + } + + public SpellPowerEntry Power + { + get { return SpellPowerId != 0 && DBC.SpellPower.ContainsKey(SpellPowerId) ? DBC.SpellPower[SpellPowerId] : null; } + } + + public SpellReagentsEntry Reagents + { + get { return SpellReagentsId != 0 && DBC.SpellReagents.ContainsKey(SpellReagentsId) ? DBC.SpellReagents[SpellReagentsId] : null; } + } + + public SpellScalingEntry Scaling + { + get { return SpellScalingId != 0 && DBC.SpellScaling.ContainsKey(SpellScalingId) ? DBC.SpellScaling[SpellScalingId] : null; } + } + + public SpellShapeshiftEntry Shapeshift + { + get { return SpellShapeshiftId != 0 && DBC.SpellShapeshift.ContainsKey(SpellShapeshiftId) ? DBC.SpellShapeshift[SpellShapeshiftId] : null; } + } + + public SpellTargetRestrictionsEntry TargetRestrictions + { + get { return SpellTargetRestrictionsId != 0 && DBC.SpellTargetRestrictions.ContainsKey(SpellTargetRestrictionsId) ? DBC.SpellTargetRestrictions[SpellTargetRestrictionsId] : null; } + } + + public SpellTotemsEntry Totems + { + get { return SpellTotemsId != 0 && DBC.SpellTotems.ContainsKey(SpellTotemsId) ? DBC.SpellTotems[SpellTotemsId] : null; } + } + } +} diff --git a/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs b/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs new file mode 100644 index 00000000..46ecadae --- /dev/null +++ b/SpellWork/DBC/Structures/SpellEquippedItemsEntry.cs @@ -0,0 +1,10 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellEquippedItemsEntry + { + public uint Id; + public uint EquippedItemClass; + public uint EquippedItemInventoryTypeMask; + public uint EquippedItemSubClassMask; + } +} diff --git a/SpellWork/DBC/Structures/SpellInterruptsEntry.cs b/SpellWork/DBC/Structures/SpellInterruptsEntry.cs new file mode 100644 index 00000000..b7fed5b6 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellInterruptsEntry.cs @@ -0,0 +1,12 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellInterruptsEntry + { + public uint Id; + public uint AuraInterruptFlags; + public uint Unknown1; + public uint ChannelInterruptFlags; + public uint Unknown2; + public uint InterruptFlags; + } +} diff --git a/SpellWork/DBC/Structures/SpellLevelsEntry.cs b/SpellWork/DBC/Structures/SpellLevelsEntry.cs new file mode 100644 index 00000000..6e28e4b5 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellLevelsEntry.cs @@ -0,0 +1,10 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellLevelsEntry + { + public uint Id; + public uint BaseLevel; + public uint MaxLevel; + public uint SpellLevel; + } +} diff --git a/SpellWork/DBC/Structures/SpellMissileEntry.cs b/SpellWork/DBC/Structures/SpellMissileEntry.cs new file mode 100644 index 00000000..894feb49 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellMissileEntry.cs @@ -0,0 +1,21 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellMissileEntry + { + public uint Id; + 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; + } +} diff --git a/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs b/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs new file mode 100644 index 00000000..a009ffb4 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellMissileMotionEntry.cs @@ -0,0 +1,11 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellMissileMotionEntry + { + public uint Id; + public string Name; + public string Script; + public uint Flags; + public uint MissileCount; + } +} diff --git a/SpellWork/DBC/Structures/SpellPowerEntry.cs b/SpellWork/DBC/Structures/SpellPowerEntry.cs new file mode 100644 index 00000000..e6fd0bf3 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellPowerEntry.cs @@ -0,0 +1,14 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellPowerEntry + { + public uint Id; + public uint ManaCost; + public uint ManaCostPerlevel; + public uint ManaCostPercentage; + public uint ManaPerSecond; + public uint PowerDisplayId; + public uint Unknown1; + public float Unknown2; + } +} diff --git a/SpellWork/DBC/Structures/SpellRadiusEntry.cs b/SpellWork/DBC/Structures/SpellRadiusEntry.cs new file mode 100644 index 00000000..2253d19d --- /dev/null +++ b/SpellWork/DBC/Structures/SpellRadiusEntry.cs @@ -0,0 +1,10 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellRadiusEntry + { + public uint Id; + public float Radius; + public float RadiusPerLevel; + public float MaxRadius; + } +} diff --git a/SpellWork/DBC/Structures/SpellRangeEntry.cs b/SpellWork/DBC/Structures/SpellRangeEntry.cs new file mode 100644 index 00000000..80524a2a --- /dev/null +++ b/SpellWork/DBC/Structures/SpellRangeEntry.cs @@ -0,0 +1,14 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellRangeEntry + { + public uint Id; + public float MinRangeNegative; + public float MinRangePositive; + public float MaxRangeNegative; + public float MaxRangePositive; + public uint Flags; + public string Name; + public string Name2; + } +} diff --git a/SpellWork/DBC/Structures/SpellReagentsEntry.cs b/SpellWork/DBC/Structures/SpellReagentsEntry.cs new file mode 100644 index 00000000..479ba1de --- /dev/null +++ b/SpellWork/DBC/Structures/SpellReagentsEntry.cs @@ -0,0 +1,13 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellReagentsEntry + { + public uint Id; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 8)] + public uint[] ItemId; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 8)] + public uint[] Count; + } +} diff --git a/SpellWork/DBC/Structures/SpellRuneCostEntry.cs b/SpellWork/DBC/Structures/SpellRuneCostEntry.cs new file mode 100644 index 00000000..873e6e88 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellRuneCostEntry.cs @@ -0,0 +1,12 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellRuneCostEntry + { + public uint Id; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public uint[] RuneCost; + public uint RunicPowerGain; + } +} diff --git a/SpellWork/DBC/Structures/SpellScalingEntry.cs b/SpellWork/DBC/Structures/SpellScalingEntry.cs new file mode 100644 index 00000000..e3b444b1 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellScalingEntry.cs @@ -0,0 +1,21 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellScalingEntry + { + public uint Id; + public int MinCastTime; + public int MaxCastTime; + public uint MaxCastTimeLevel; // player level at which cast time reaches max value + public int PlayerClass; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public float[] Multiplier; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public float[] RandomPointsMultiplier; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 3)] + public float[] OtherMultiplier; + public float CoefBase; + public uint CoefLevelBase; + } +} diff --git a/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs b/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs new file mode 100644 index 00000000..d75c2be9 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellShapeshiftEntry.cs @@ -0,0 +1,10 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellShapeshiftEntry + { + public uint Id; + public ulong StancesNot; + public ulong Stances; + public int StanceBarOrder; + } +} diff --git a/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs b/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs new file mode 100644 index 00000000..e6c61795 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellTargetRestrictionsEntry.cs @@ -0,0 +1,12 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellTargetRestrictionsEntry + { + public uint Id; + public float Unknown1; + public uint MaxAffectedTargets; + public uint MaxTargetLevel; + public uint TargetCreatureType; + public uint Targets; + } +} diff --git a/SpellWork/DBC/Structures/SpellTotemsEntry.cs b/SpellWork/DBC/Structures/SpellTotemsEntry.cs new file mode 100644 index 00000000..ecff6a4a --- /dev/null +++ b/SpellWork/DBC/Structures/SpellTotemsEntry.cs @@ -0,0 +1,13 @@ +using DBFilesClient.NET; + +namespace SpellWork.DBC.Structures +{ + public sealed class SpellTotemsEntry + { + public uint Id; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 2)] + public uint[] TotemCategory; + [StoragePresence(StoragePresenceOption.Include, ArraySize = 2)] + public uint[] Totem; + } +} diff --git a/SpellWork/DBC/Structures/SpellVisualEntry.cs b/SpellWork/DBC/Structures/SpellVisualEntry.cs new file mode 100644 index 00000000..224f9f86 --- /dev/null +++ b/SpellWork/DBC/Structures/SpellVisualEntry.cs @@ -0,0 +1,39 @@ +namespace SpellWork.DBC.Structures +{ + public sealed class SpellVisualEntry + { + public uint Id; + public uint PrecastKit; + public uint CastingKit; + public uint ImpactKit; + public uint StateKit; + public uint StateDoneKit; + public uint ChannelKit; + public int HasMissile; + public uint MissileModel; + public uint MissilePathType; + public uint MissileDestinationAttachment; + public uint MissileSound; + public uint AnimEventSoundID; + public uint Flags; + public uint CasterImpactKit; + public uint TargetImpactKit; + public int MissileAttachment; + public uint MissileFollowGroundHeight; + public uint MissileFollowGroundDropSpeed; + public uint MissileFollowGroundApprach; + public uint MissileFollowGroundFlags; + public uint MissileMotionId; + public uint MissileTargetingKit; + 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 Unknown; + } +} diff --git a/SpellWork/DBC/Structures/gtSpellScalingEntry.cs b/SpellWork/DBC/Structures/gtSpellScalingEntry.cs new file mode 100644 index 00000000..7012452e --- /dev/null +++ b/SpellWork/DBC/Structures/gtSpellScalingEntry.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SpellWork.DBC.Structures +{ + public sealed class gtSpellScalingEntry + { + public uint Index; + public float Multiplier; + } +} diff --git a/SpellWork/DBFilesClient.NET.XML b/SpellWork/DBFilesClient.NET.XML new file mode 100644 index 00000000..07d0c3c8 --- /dev/null +++ b/SpellWork/DBFilesClient.NET.XML @@ -0,0 +1,131 @@ + + + + DBFilesClient.NET + + + + + Controls how the field is treated by the DBC storage loader. + + + + + Initializes a new instance of + with the specified . + + + Specifies how the underlying class field should be treated when loading from a DBC storage. + + + + + Gets the value that specifies how the underlying class field should be treated when loading from a DBC storage. + + + + + Gets or sets the name of of the property that should be used instead of the underlying class field. + Use it with value. + + + + + Gets or sets the number of elements in the underlying array. + + + + + Initializes a new instance of class. + + + + + Removes all records from the current storage. + + + + + Loads the storage from a . + + + The from which the storage should be loaded. + + + + + Gets the number of records currently contained in the storage. + + + + + Gets the minimum record id in the storage. + Existance of a record with this id is not guaranteed. + + + + + Gets the maximum record id in the storage. + Existance of a record with this id is not guaranteed. + + + + + Initializes a new instance of class. + + + + + Loads the storage from a . + + + The from which the storage should be loaded. + + + + + Loads the storage from a . + + + The from which the storage should be loaded. + + + The to be used when loading. + + + + + Lazy C string computes the from the underlying signed byte stream by demand. + This functionality is disabled by default. Use to enable. + + + + + Specifies how a class field should be treated when loading from a DBC storage. + + + + + Specifies that the field should be included into the storage entry structure. + This is the default behavior. + + + + + Specifies that the field should be completely ignored by the DBC stoarge loader. + + + + + Specifies that the DBC storage loader should use property instead. + You should specify the property. + The property should be of the same type as the field, and its setter should be public. + + + + + Enables laziness of . + + + + diff --git a/SpellWork/DBFilesClient.NET.dll b/SpellWork/DBFilesClient.NET.dll new file mode 100644 index 00000000..e3ed910a Binary files /dev/null and b/SpellWork/DBFilesClient.NET.dll differ diff --git a/SpellWork/DataBase/MySQLConnect.cs b/SpellWork/DataBase/MySQLConnect.cs index b008a7f7..c779b404 100644 --- a/SpellWork/DataBase/MySQLConnect.cs +++ b/SpellWork/DataBase/MySQLConnect.cs @@ -1,14 +1,15 @@ using System; -using SpellWork.Properties; using System.Collections.Generic; -using MySql.Data.MySqlClient; using System.Windows.Forms; +using MySql.Data.MySqlClient; +using SpellWork.Extensions; +using SpellWork.Properties; -namespace SpellWork +namespace SpellWork.Database { - public static class MySQLConnect + public static class MySqlConnection { - private static MySqlConnection _conn; + private static MySql.Data.MySqlClient.MySqlConnection _conn; private static MySqlCommand _command; public static bool Connected { get; private set; } @@ -17,33 +18,29 @@ public static class MySQLConnect private static String ConnectionString { - get + get { - return String.Format("Server={0};Port={1};Uid={2};Pwd={3};Database={4};character set=utf8;Connection Timeout=10", - Settings.Default.Host, - Settings.Default.Port, - Settings.Default.User, - Settings.Default.Pass, - Settings.Default.Db_mangos); + if (Settings.Default.Host == ".") + return String.Format("Server=localhost;Pipe={0};UserID={1};Password={2};Database={3};CharacterSet=utf8;ConnectionTimeout=5;ConnectionProtocol=Pipe;", + Settings.Default.PortOrPipe, Settings.Default.User, Settings.Default.Pass, Settings.Default.WorldDbName); + + return String.Format("Server={0};Port={1};UserID={2};Password={3};Database={4};CharacterSet=utf8;ConnectionTimeout=5;", + Settings.Default.Host, Settings.Default.PortOrPipe, Settings.Default.User, Settings.Default.Pass, Settings.Default.WorldDbName); } } private static String GetSpellName(uint id) { - if (DBC.Spell.ContainsKey(id)) - { - return DBC.Spell[id].SpellNameRank; - } - else - { - Dropped.Add(String.Format("DELETE FROM `spell_proc_event` WHERE `entry` IN ({0});\r\n", id.ToUInt32())); - return String.Empty; - } + if (DBC.DBC.SpellInfoStore.ContainsKey(id)) + return DBC.DBC.SpellInfoStore[id].SpellNameRank; + + Dropped.Add(String.Format("DELETE FROM `spell_proc_event` WHERE `entry` IN ({0});\r\n", id.ToUInt32())); + return String.Empty; } public static void SelectProc(string query) { - using (_conn = new MySqlConnection(ConnectionString)) + using (_conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString)) { _command = new MySqlCommand(query, _conn); _conn.Open(); @@ -53,37 +50,25 @@ public static void SelectProc(string query) { while (reader.Read()) { - SpellProcEventEntry str; - - str.ID = reader[0].ToUInt32(); - str.SpellName = GetSpellName(str.ID); - str.SchoolMask = reader[1].ToUInt32(); - str.SpellFamilyName = reader[2].ToUInt32(); - str.SpellFamilyMask = new[,] - { - { - (uint)reader[3 ], - (uint)reader[4 ], - (uint)reader[5 ], - }, + uint spellId = reader.GetUInt32(0); + SpellProcEvent.Add(new SpellProcEventEntry + { + Id = spellId, + SpellName = GetSpellName(spellId), + SchoolMask = reader.GetByte(1), + SpellFamilyName = reader.GetUInt16(2), + SpellFamilyMask = new[] { - (uint)reader[6 ], - (uint)reader[7 ], - (uint)reader[8 ], + reader.GetUInt32(3), + reader.GetUInt32(4), + reader.GetUInt32(5) }, - { - (uint)reader[9 ], - (uint)reader[10], - (uint)reader[11], - } - }; - str.ProcFlags = reader[12].ToUInt32(); - str.ProcEx = reader[13].ToUInt32(); - str.PpmRate = reader[14].ToUInt32(); - str.CustomChance = reader[15].ToUInt32(); - str.Cooldown = reader[16].ToUInt32(); - - SpellProcEvent.Add(str); + ProcFlags = reader.GetUInt32(6), + ProcEx = reader.GetUInt32(7), + PpmRate = reader.GetFloat(8), + CustomChance = reader.GetFloat(9), + Cooldown = reader.GetUInt32(10) + }); } } } @@ -91,71 +76,60 @@ public static void SelectProc(string query) public static void Insert(string query) { - _conn = new MySqlConnection(ConnectionString); + _conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString); _command = new MySqlCommand(query, _conn); _conn.Open(); _command.ExecuteNonQuery(); _command.Connection.Close(); } - public static List SelectItems() + public static void AddDBItems() { - List items = DBC.ItemTemplate; // In order to reduce the search time, we make the first selection of all items that have spellid - string query = String.Format( - @"SELECT t.entry, - t.name, - t.description, - l.name_loc{0}, - l.description_loc{0}, - t.spellid_1, - t.spellid_2, - t.spellid_3, - t.spellid_4, - t.spellid_5 - FROM - `item_template` t - LEFT JOIN - `locales_item` l - ON - t.entry = l.entry - WHERE - t.spellid_1 <> 0 || - t.spellid_2 <> 0 || - t.spellid_3 <> 0 || - t.spellid_4 <> 0 || - t.spellid_5 <> 0;", - (int)DBC.Locale == 0 ? 1 : (int)DBC.Locale /* it's huck TODO: replase code*/); + var query = String.Format( + @"SELECT t.entry, + t.name, + t.description, + t.spellid_1, + t.spellid_2, + t.spellid_3, + t.spellid_4, + t.spellid_5 + FROM + `item_template` t + WHERE + t.spellid_1 <> 0 || + t.spellid_2 <> 0 || + t.spellid_3 <> 0 || + t.spellid_4 <> 0 || + t.spellid_5 <> 0;"); - using (_conn = new MySqlConnection(ConnectionString)) + using (_conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString)) { _command = new MySqlCommand(query, _conn); _conn.Open(); - using (MySqlDataReader reader = _command.ExecuteReader()) + using (var reader = _command.ExecuteReader()) { while (reader.Read()) { - items.Add(new Item + DBC.DBC.ItemTemplate.Add(new Item { - Entry = reader[0].ToUInt32(), - Name = reader[1].ToString(), - Description = reader[2].ToString(), - LocalesName = reader[3].ToString(), - LocalesDescription = reader[4].ToString(), - SpellID = new uint[] - { - (uint)reader[5], - (uint)reader[6], - (uint)reader[7], - (uint)reader[8], - (uint)reader[9] + Entry = reader.GetUInt32(0), + Name = reader.GetString(1), + Description = reader.GetString(2), + SpellId = new[] + { + reader.GetInt32(3), + reader.GetInt32(4), + reader.GetInt32(5), + reader.GetInt32(6), + reader.GetInt32(7) } }); } } } - return items; } public static void TestConnect() @@ -168,11 +142,16 @@ public static void TestConnect() try { - _conn = new MySqlConnection(ConnectionString); + _conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString); _conn.Open(); _conn.Close(); Connected = true; } + catch (MySqlException ex) + { + MessageBox.Show(string.Format("Errno {0}{1}{2}", ex.Number, Environment.NewLine, ex.Message)); + Connected = false; + } catch { Connected = false; diff --git a/SpellWork/Database/Structures.cs b/SpellWork/Database/Structures.cs new file mode 100644 index 00000000..82a8ede3 --- /dev/null +++ b/SpellWork/Database/Structures.cs @@ -0,0 +1,45 @@ +namespace SpellWork.Database +{ + public struct SpellProcEventEntry + { + public uint Id; + public string SpellName; + public byte SchoolMask; + public ushort SpellFamilyName; + public uint[] SpellFamilyMask; + public uint ProcFlags; + public uint ProcEx; + public float PpmRate; + public float CustomChance; + public uint Cooldown; + + public string[] ToArray() + { + return new[] + { + Id.ToString(), + SpellName, + SchoolMask.ToString(), + SpellFamilyName.ToString(), + SpellFamilyMask[0].ToString(), + SpellFamilyMask[1].ToString(), + SpellFamilyMask[2].ToString(), + ProcFlags.ToString(), + ProcEx.ToString(), + PpmRate.ToString(), + CustomChance.ToString(), + Cooldown.ToString() + }; + } + } + + public struct Item + { + public uint Entry; + public string Name; + public string Description; + public string LocalesName; + public string LocalesDescription; + public int[] SpellId; + } +} diff --git a/SpellWork/Extensions/Extensions.cs b/SpellWork/Extensions/Extensions.cs index 43339905..26fbec04 100644 --- a/SpellWork/Extensions/Extensions.cs +++ b/SpellWork/Extensions/Extensions.cs @@ -1,13 +1,14 @@ using System; using System.Collections.Generic; +using System.Data; using System.IO; +using System.Linq; +using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; -using System.Data; -using System.Reflection; -namespace SpellWork +namespace SpellWork.Extensions { public static class Extensions { @@ -19,7 +20,7 @@ public static class Extensions public static string ReadCString(this BinaryReader reader) { byte num; - List temp = new List(); + var temp = new List(); while ((num = reader.ReadByte()) != 0) { @@ -35,26 +36,21 @@ public static string ReadCString(this BinaryReader reader) /// Struct type. /// Stream to read from. /// Resulting struct. - public static unsafe T ReadStruct(this BinaryReader reader) where T : struct + public static T ReadStruct(this BinaryReader reader) where T : struct { - byte[] rawData = reader.ReadBytes(Marshal.SizeOf(typeof(T))); - - GCHandle handle = GCHandle.Alloc(rawData, GCHandleType.Pinned); - T returnObject = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); - + var rawData = reader.ReadBytes(Marshal.SizeOf(typeof(T))); + + var handle = GCHandle.Alloc(rawData, GCHandleType.Pinned); + var returnObject = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); + handle.Free(); - + return returnObject; } public static StringBuilder AppendFormatIfNotNull(this StringBuilder builder, string format, params object[] arg) { - if (arg[0].ToUInt32() != 0) - { - return builder.AppendFormat(format, arg); - } - - return builder; + return arg[0].ToUInt32() != 0 ? builder.AppendFormat(format, arg) : builder; } // Append Format Line @@ -65,22 +61,12 @@ public static StringBuilder AppendFormatLine(this StringBuilder builder, string public static StringBuilder AppendFormatLineIfNotNull(this StringBuilder builder, string format, int arg) { - if (arg != 0) - { - return builder.AppendFormat(format, arg).AppendLine(); - } - - return builder; + return arg != 0 ? builder.AppendFormat(format, arg).AppendLine() : builder; } public static StringBuilder AppendFormatLineIfNotNull(this StringBuilder builder, string format, uint arg) { - if (arg != 0) - { - return builder.AppendFormat(format, arg).AppendLine(); - } - - return builder; + return arg != 0 ? builder.AppendFormat(format, arg).AppendLine() : builder; } public static uint ToUInt32(this Object val) @@ -95,7 +81,7 @@ public static uint ToUInt32(this Object val) public static int ToInt32(this Object val) { - if (val == null) + if (val == null) return 0; int num; @@ -123,7 +109,7 @@ public static ulong ToUlong(this Object val) return num; } - public static String NormaliseString(this String text, String remove) + public static String NormalizeString(this String text, String remove) { var str = String.Empty; if (remove != String.Empty) @@ -133,7 +119,7 @@ public static String NormaliseString(this String text, String remove) foreach (var s in text.Split('_')) { - int i = 0; + var i = 0; foreach (var c in s.ToCharArray()) { str += i == 0 ? c.ToString().ToUpper() : c.ToString().ToLower(); @@ -145,67 +131,55 @@ public static String NormaliseString(this String text, String remove) return str.Remove(str.Length - 1); } - public static void SetCheckedItemFromFlag(this CheckedListBox _name, uint _value) + public static void SetCheckedItemFromFlag(this CheckedListBox name, uint value) { - for (int i = 0; i < _name.Items.Count; ++i) - { - _name.SetItemChecked(i, ((_value / (1U << (i - 1))) % 2) != 0); - } + for (var i = 0; i < name.Items.Count; ++i) + name.SetItemChecked(i, ((value / (1U << (i - 1))) % 2) != 0); } - public static uint GetFlagsValue(this CheckedListBox _name) + public static uint GetFlagsValue(this CheckedListBox name) { uint val = 0; - for (int i = 0; i < _name.CheckedIndices.Count; i++) - { - val += 1U << (_name.CheckedIndices[i] - 1); - } + for (var i = 0; i < name.CheckedIndices.Count; ++i) + val |= 1U << (name.CheckedIndices[i]); return val; } - public static void SetFlags(this CheckedListBox _clb) + public static void SetFlags(this CheckedListBox clb) { - _clb.Items.Clear(); + clb.Items.Clear(); foreach (var elem in Enum.GetValues(typeof(T))) - { - _clb.Items.Add(elem.ToString().NormaliseString(String.Empty)); - } + clb.Items.Add(elem.ToString().NormalizeString(String.Empty)); } - public static void SetFlags(this CheckedListBox _clb, String remove) + public static void SetFlags(this CheckedListBox clb, String remove) { - _clb.Items.Clear(); + clb.Items.Clear(); foreach (var elem in Enum.GetValues(typeof(T))) - { - _clb.Items.Add(elem.ToString().NormaliseString(remove)); - } + clb.Items.Add(elem.ToString().NormalizeString(remove)); } - public static void SetFlags(this CheckedListBox _clb, Type type, String remove) + public static void SetFlags(this CheckedListBox clb, Type type, String remove) { - _clb.Items.Clear(); + clb.Items.Clear(); foreach (var elem in Enum.GetValues(type)) - { - _clb.Items.Add(elem.ToString().NormaliseString(remove)); - } + clb.Items.Add(elem.ToString().NormalizeString(remove)); } - public static void SetEnumValues(this ComboBox cb, string NoValue) + public static void SetEnumValues(this ComboBox cb, string noValue) { - DataTable dt = new DataTable(); + var dt = new DataTable(); dt.Columns.Add("ID"); dt.Columns.Add("NAME"); - dt.Rows.Add(new Object[] { -1, NoValue }); + dt.Rows.Add(new Object[] { -1, noValue }); foreach (var str in Enum.GetValues(typeof(T))) - { dt.Rows.Add(new Object[] { (int)str, "(" + ((int)str).ToString("000") + ") " + str }); - } cb.DataSource = dt; cb.DisplayMember = "NAME"; @@ -217,7 +191,7 @@ public static void SetEnumValuesDirect(this ComboBox cb, Boolean setFirstValu cb.BeginUpdate(); cb.Items.Clear(); - foreach (object value in Enum.GetValues(typeof(T))) + foreach (var value in Enum.GetValues(typeof(T))) cb.Items.Add(((Enum)value).GetFullName()); if (setFirstValue && cb.Items.Count > 0) @@ -230,22 +204,22 @@ public static void SetStructFields(this ComboBox cb) { cb.Items.Clear(); - DataTable dt = new DataTable(); + var dt = new DataTable(); dt.Columns.Add("ID", typeof(MemberInfo)); dt.Columns.Add("NAME", typeof(String)); var type = typeof(T).GetMembers(); - int i = 0; - foreach (MemberInfo str in type) + var i = 0; + foreach (var str in type) { - if (str is FieldInfo || str is PropertyInfo) - { - DataRow dr = dt.NewRow(); - dr["ID"] = str; - dr["NAME"] = String.Format("({0:000}) {1}", i, str.Name); - dt.Rows.Add(dr); - i++; - } + if (!(str is FieldInfo) && !(str is PropertyInfo)) + continue; + + var dr = dt.NewRow(); + dr["ID"] = str; + dr["NAME"] = String.Format("({0:000}) {1}", i, str.Name); + dt.Rows.Add(dr); + ++i; } cb.DataSource = dt; @@ -272,26 +246,12 @@ public static bool ContainsText(this string text, string compareText) /// Boolean(true or false) public static bool ContainsText(this string text, string[] compareText) { - foreach (string str in compareText) - { - if ((text.IndexOf(str, StringComparison.CurrentCultureIgnoreCase) != -1)) - return true; - } - return false; + return compareText.Any(str => (text.IndexOf(str, StringComparison.CurrentCultureIgnoreCase) != -1)); } public static bool ContainsElement(this uint[] array, uint[] value) { - if (array.Length != value.Length) - return false; - - for(int i = 0; i < array.Length; i++) - { - if ((array[i] & value[i]) != 0) - return true; - } - - return false; + return array.Length == value.Length && array.Where((t, i) => (t & value[i]) != 0).Any(); } /// @@ -302,9 +262,12 @@ public static bool ContainsElement(this uint[] array, uint[] value) /// true or false public static bool ContainsElement(this uint[] array, uint value) { - foreach (uint i in array) - if (i == value) return true; - return false; + return array.Any(i => i == value); + } + + public static bool ContainsElement(this int[] array, int value) + { + return array.Any(i => i == value); } public static T GetValue(this Dictionary dictionary, uint key) @@ -319,18 +282,18 @@ public static bool IsEmpty(this String str) return str == String.Empty; } - public static string GetFullName(this Enum _enum) + public static string GetFullName(this Enum @enum) { - var field = _enum.GetType().GetField(_enum.ToString()); + var field = @enum.GetType().GetField(@enum.ToString()); if (field != null) { - FullNameAttribute[] attrs = (FullNameAttribute[])field.GetCustomAttributes(typeof(FullNameAttribute), false); + var attrs = (FullNameAttribute[])field.GetCustomAttributes(typeof(FullNameAttribute), false); if (attrs.Length > 0) return attrs[0].FullName; } - return _enum.ToString(); + return @enum.ToString(); } } @@ -341,7 +304,7 @@ public class FullNameAttribute : Attribute public FullNameAttribute(string fullName) { - this.FullName = fullName; + FullName = fullName; } } } diff --git a/SpellWork/Extensions/LinqExtensions.cs b/SpellWork/Extensions/LinqExtensions.cs index a13fee17..b4b4a4f3 100644 --- a/SpellWork/Extensions/LinqExtensions.cs +++ b/SpellWork/Extensions/LinqExtensions.cs @@ -1,7 +1,8 @@ using System; +using System.Linq; using System.Reflection; -namespace SpellWork +namespace SpellWork.Extensions { public enum CompareType { @@ -40,14 +41,15 @@ public static class LinqExtensions /// Compares two values object /// /// - /// + /// /// Value Type is MemberInfo /// + /// /// - public static bool CreateFilter(this T T_entry, object field, object val, CompareType compareType) + public static bool CreateFilter(this T entry, object field, object val, CompareType compareType) { - object basicValue = GetValue(T_entry, (MemberInfo)field); - + var basicValue = GetValue(entry, (MemberInfo)field); + switch (basicValue.GetType().Name) { case "UInt32": @@ -62,43 +64,23 @@ public static bool CreateFilter(this T T_entry, object field, object val, Com return Compare(basicValue.ToString(), val.ToString(), compareType); case @"UInt32[]": { - uint val_uint = val.ToUInt32(); - foreach (uint el in (uint[])basicValue) - { - if (Compare(el, val_uint, compareType)) - return true; - } - return false; + var valUint = val.ToUInt32(); + return ((uint[])basicValue).Any(el => Compare(el, valUint, compareType)); } case @"Int32[]": { - int val_int = val.ToInt32(); - foreach (int el in (int[])basicValue) - { - if (Compare(el, val_int, compareType)) - return true; - } - return false; + var valInt = val.ToInt32(); + return ((int[])basicValue).Any(el => Compare(el, valInt, compareType)); } case @"Single[]": { - float val_float = val.ToFloat(); - foreach (float el in (float[])basicValue) - { - if (Compare(el, val_float, compareType)) - return true; - } - return false; + var valFloat = val.ToFloat(); + return ((float[])basicValue).Any(el => Compare(el, valFloat, compareType)); } case @"UInt64[]": { - ulong val_ulong = val.ToUlong(); - foreach (ulong el in (ulong[])basicValue) - { - if (Compare(el, val_ulong, compareType)) - return true; - } - return false; + var valUlong = val.ToUlong(); + return ((ulong[])basicValue).Any(el => Compare(el, valUlong, compareType)); } default: return false; @@ -121,7 +103,6 @@ private static Boolean Compare(String baseValue, String value, CompareType compa case CompareType.NotEqual: return !baseValue.Equals(value, StringComparison.CurrentCultureIgnoreCase); - case CompareType.Equal: default: return baseValue.Equals(value, StringComparison.CurrentCultureIgnoreCase); } @@ -142,7 +123,6 @@ private static Boolean Compare(float baseValue, float value, CompareType compare case CompareType.NotEqual: return baseValue != value; - case CompareType.Equal: default: return baseValue == value; } @@ -170,7 +150,6 @@ private static Boolean Compare(UInt64 baseValue, UInt64 value, CompareType compa case CompareType.NotEqual: return baseValue != value; - case CompareType.Equal: default: return baseValue == value; } @@ -198,7 +177,6 @@ private static Boolean Compare(Int32 baseValue, Int32 value, CompareType compare case CompareType.NotEqual: return baseValue != value; - case CompareType.Equal: default: return baseValue == value; } @@ -226,7 +204,6 @@ private static Boolean Compare(UInt32 baseValue, UInt32 value, CompareType compa case CompareType.NotEqual: return baseValue != value; - case CompareType.Equal: default: return baseValue == value; } @@ -234,14 +211,13 @@ private static Boolean Compare(UInt32 baseValue, UInt32 value, CompareType compa #endregion - private static Object GetValue(T T_entry, MemberInfo field) + private static Object GetValue(T entry, MemberInfo field) { if (field is FieldInfo) - return typeof(T).GetField(field.Name).GetValue(T_entry); - else if (field is PropertyInfo) - return typeof(T).GetProperty(field.Name).GetValue(T_entry, null); - else - return null; + return typeof(T).GetField(field.Name).GetValue(entry); + if (field is PropertyInfo) + return typeof(T).GetProperty(field.Name).GetValue(entry, null); + return null; } } } diff --git a/SpellWork/Extensions/RichTextBoxExtensions.cs b/SpellWork/Extensions/RichTextBoxExtensions.cs index d56cd1ae..4a3aac78 100644 --- a/SpellWork/Extensions/RichTextBoxExtensions.cs +++ b/SpellWork/Extensions/RichTextBoxExtensions.cs @@ -2,12 +2,12 @@ using System.Drawing; using System.Windows.Forms; -namespace SpellWork +namespace SpellWork.Extensions { public static class RichTextBoxExtensions { - public const String DEFAULT_FAMILY = "Arial Unicode MS"; - public const float DEFAULT_SIZE = 9f; + public const String DefaultFamily = "Arial Unicode MS"; + public const float DefaultSize = 9f; public static void AppendFormatLine(this RichTextBox textbox, string format, params object[] arg0) { @@ -77,44 +77,42 @@ public static void AppendFormatIfNotNull(this RichTextBox builder, string format public static void SetStyle(this RichTextBox textbox, Color color, FontStyle style) { textbox.SelectionColor = color; - textbox.SelectionFont = new Font(DEFAULT_FAMILY, DEFAULT_SIZE, style); + textbox.SelectionFont = new Font(DefaultFamily, DefaultSize, style); } - + public static void SetBold(this RichTextBox textbox) { - textbox.SelectionFont = new Font(DEFAULT_FAMILY, DEFAULT_SIZE, FontStyle.Bold); + textbox.SelectionFont = new Font(DefaultFamily, DefaultSize, FontStyle.Bold); } public static void SetDefaultStyle(this RichTextBox textbox) { - textbox.SelectionFont = new Font(DEFAULT_FAMILY, DEFAULT_SIZE, FontStyle.Regular); + textbox.SelectionFont = new Font(DefaultFamily, DefaultSize, FontStyle.Regular); textbox.SelectionColor = Color.Black; } public static void ColorizeCode(this RichTextBox rtb) { string[] keywords = { "INSERT", "INTO", "DELETE", "FROM", "IN", "VALUES", "WHERE" }; - string text = rtb.Text; + var text = rtb.Text; rtb.SelectAll(); rtb.SelectionColor = rtb.ForeColor; - foreach (String keyword in keywords) + foreach (var keyword in keywords) { - int keywordPos = rtb.Find(keyword, RichTextBoxFinds.MatchCase | RichTextBoxFinds.WholeWord); - + var keywordPos = rtb.Find(keyword, RichTextBoxFinds.MatchCase | RichTextBoxFinds.WholeWord); + while (keywordPos != -1) { - int commentPos = text.LastIndexOf("-- ", keywordPos, StringComparison.OrdinalIgnoreCase); - int newLinePos = text.LastIndexOf("\n", keywordPos, StringComparison.OrdinalIgnoreCase); + var commentPos = text.LastIndexOf("-- ", keywordPos, StringComparison.OrdinalIgnoreCase); + var newLinePos = text.LastIndexOf("\n", keywordPos, StringComparison.OrdinalIgnoreCase); - int quoteCount = 0; - int quotePos = text.IndexOf("\"", newLinePos + 1, keywordPos - newLinePos, StringComparison.OrdinalIgnoreCase); + var quoteCount = 0; + var quotePos = text.IndexOf("\"", newLinePos + 1, keywordPos - newLinePos, StringComparison.OrdinalIgnoreCase); for (; quotePos != -1; quoteCount++) - { quotePos = text.IndexOf("\"", quotePos + 1, keywordPos - (quotePos + 1), StringComparison.OrdinalIgnoreCase); - } if (newLinePos >= commentPos && quoteCount % 2 == 0) rtb.SelectionColor = Color.Blue; diff --git a/SpellWork/Extensions/TreeViewExtensions.cs b/SpellWork/Extensions/TreeViewExtensions.cs index 7643067f..e8bbf427 100644 --- a/SpellWork/Extensions/TreeViewExtensions.cs +++ b/SpellWork/Extensions/TreeViewExtensions.cs @@ -1,6 +1,8 @@ -using System.Windows.Forms; +using System.Linq; +using System.Windows.Forms; +using SpellWork.Spell; -namespace SpellWork +namespace SpellWork.Extensions { public static class TreeViewExtensions { @@ -11,18 +13,15 @@ public static class TreeViewExtensions /// public static uint[] GetMask(this TreeView tv) { - uint[] val = new uint[3]; - foreach (TreeNode node in tv.Nodes) + var val = new uint[3]; + foreach (var node in tv.Nodes.Cast().Where(node => node.Checked)) { - if (node.Checked) - { - if(node.Index < 32) - val[0] += 1U << node.Index; - else if(node.Index < 64) - val[1] += 1U << (node.Index - 32); - else - val[2] += 1U << (node.Index - 64); - } + if (node.Index < 32) + val[0] += 1U << node.Index; + else if(node.Index < 64) + val[1] += 1U << (node.Index - 32); + else + val[2] += 1U << (node.Index - 64); } return val; } @@ -35,8 +34,8 @@ public static uint[] GetMask(this TreeView tv) public static void SetMask(this TreeView tv, uint[] mask) { ProcInfo.Update = false; - - for (int i = 0; i < tv.Nodes.Count; ++i) + + for (var i = 0; i < tv.Nodes.Count; ++i) { if (i < 32) tv.Nodes[i].Checked = ((mask[0] / (1 << i)) % 2) != 0; @@ -48,27 +47,5 @@ public static void SetMask(this TreeView tv, uint[] mask) ProcInfo.Update = true; } - - /// - /// Check items of the collection... - /// - /// - /// - public static void SetMask(this TreeView tv, uint[,] mask) - { - ProcInfo.Update = false; - - for (int i = 0; i < tv.Nodes.Count; ++i) - { - if (i < 32) - tv.Nodes[i].Checked = ((mask[0, 0] / (1 << i)) % 2) != 0; - else if (i < 64) - tv.Nodes[i].Checked = ((mask[0, 1] / (1 << (i - 32))) % 2) != 0; - else - tv.Nodes[i].Checked = ((mask[0, 2] / (1 << (i - 64))) % 2) != 0; - } - - ProcInfo.Update = true; - } } } diff --git a/SpellWork/Forms/FormAboutBox.Designer.cs b/SpellWork/Forms/FormAboutBox.Designer.cs index b5d99a20..d69b107e 100644 --- a/SpellWork/Forms/FormAboutBox.Designer.cs +++ b/SpellWork/Forms/FormAboutBox.Designer.cs @@ -1,6 +1,6 @@ -namespace SpellWork +namespace SpellWork.Forms { - partial class FormAboutBox + sealed partial class FormAboutBox { /// /// Требуется переменная конструктора. diff --git a/SpellWork/Forms/FormAboutBox.cs b/SpellWork/Forms/FormAboutBox.cs index 8e29a93c..ec4d5363 100644 --- a/SpellWork/Forms/FormAboutBox.cs +++ b/SpellWork/Forms/FormAboutBox.cs @@ -1,40 +1,32 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Linq; using System.Reflection; using System.Windows.Forms; -namespace SpellWork +namespace SpellWork.Forms { - partial class FormAboutBox : Form + sealed partial class FormAboutBox : Form { public FormAboutBox() { InitializeComponent(); - this.Text = String.Format("О {0} {0}", AssemblyTitle); - this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = String.Format("Версия {0} {0}", AssemblyVersion); - this.labelCopyright.Text = AssemblyCopyright; - this.labelCompanyName.Text = AssemblyCompany; - this.textBoxDescription.Text = AssemblyDescription; + Text = String.Format("О {0} {0}", AssemblyTitle); + labelProductName.Text = AssemblyProduct; + labelVersion.Text = String.Format("Версия {0} {0}", AssemblyVersion); + labelCopyright.Text = AssemblyCopyright; + labelCompanyName.Text = AssemblyCompany; + textBoxDescription.Text = AssemblyDescription; } - #region Методы доступа к атрибутам сборки - public string AssemblyTitle { get { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); + var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); if (attributes.Length > 0) { - AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; - if (titleAttribute.Title != "") - { + var titleAttribute = (AssemblyTitleAttribute)attributes[0]; + if (!string.IsNullOrEmpty(titleAttribute.Title)) return titleAttribute.Title; - } } return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); } @@ -52,12 +44,8 @@ public string AssemblyDescription { get { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyDescriptionAttribute)attributes[0]).Description; + var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); + return attributes.Length == 0 ? string.Empty : ((AssemblyDescriptionAttribute)attributes[0]).Description; } } @@ -65,12 +53,8 @@ public string AssemblyProduct { get { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyProductAttribute)attributes[0]).Product; + var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); + return attributes.Length == 0 ? string.Empty : ((AssemblyProductAttribute)attributes[0]).Product; } } @@ -78,12 +62,8 @@ public string AssemblyCopyright { get { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + return attributes.Length == 0 ? string.Empty : ((AssemblyCopyrightAttribute)attributes[0]).Copyright; } } @@ -91,14 +71,9 @@ public string AssemblyCompany { get { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCompanyAttribute)attributes[0]).Company; + var attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); + return attributes.Length == 0 ? string.Empty : ((AssemblyCompanyAttribute)attributes[0]).Company; } } - #endregion } } diff --git a/SpellWork/Forms/FormCalculateFlags.Designer.cs b/SpellWork/Forms/FormCalculateFlags.Designer.cs index 541e7248..8bca7c32 100644 --- a/SpellWork/Forms/FormCalculateFlags.Designer.cs +++ b/SpellWork/Forms/FormCalculateFlags.Designer.cs @@ -1,6 +1,6 @@ -namespace SpellWork +namespace SpellWork.Forms { - partial class FormCalculateFlags + sealed partial class FormCalculateFlags { /// /// Required designer variable. @@ -34,9 +34,9 @@ private void InitializeComponent() this._clbCalcFlags = new System.Windows.Forms.CheckedListBox(); this._lFlagValue = new System.Windows.Forms.Label(); this.SuspendLayout(); - // + // // _bNo - // + // this._bNo.DialogResult = System.Windows.Forms.DialogResult.Cancel; this._bNo.Location = new System.Drawing.Point(12, 270); this._bNo.Name = "_bNo"; @@ -44,20 +44,20 @@ private void InitializeComponent() this._bNo.TabIndex = 1; this._bNo.Text = "Cancel"; this._bNo.UseVisualStyleBackColor = true; - this._bNo.Click += new System.EventHandler(this._bNo_Click); - // + this._bNo.Click += new System.EventHandler(this.BNoClick); + // // _bOk - // + // this._bOk.Location = new System.Drawing.Point(201, 270); this._bOk.Name = "_bOk"; this._bOk.Size = new System.Drawing.Size(75, 23); this._bOk.TabIndex = 2; this._bOk.Text = "OK"; this._bOk.UseVisualStyleBackColor = true; - this._bOk.Click += new System.EventHandler(this._bOk_Click); - // + this._bOk.Click += new System.EventHandler(this.BOkClick); + // // _clbCalcFlags - // + // this._clbCalcFlags.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); @@ -67,10 +67,10 @@ private void InitializeComponent() this._clbCalcFlags.Name = "_clbCalcFlags"; this._clbCalcFlags.Size = new System.Drawing.Size(291, 259); this._clbCalcFlags.TabIndex = 0; - this._clbCalcFlags.SelectedValueChanged += new System.EventHandler(this._clbCalcFlags_SelectedValueChanged); - // + this._clbCalcFlags.SelectedValueChanged += new System.EventHandler(this.ClbCalcFlagsSelectedValueChanged); + // // _lFlagValue - // + // this._lFlagValue.AutoSize = true; this._lFlagValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this._lFlagValue.ForeColor = System.Drawing.Color.Blue; @@ -79,23 +79,22 @@ private void InitializeComponent() this._lFlagValue.Size = new System.Drawing.Size(54, 13); this._lFlagValue.TabIndex = 3; this._lFlagValue.Text = "Value: 0"; - // + // // FormCalculateFlags - // + // this.AcceptButton = this._bOk; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this._bNo; - this.ClientSize = new System.Drawing.Size(292, 297); + this.ClientSize = new System.Drawing.Size(284, 299); this.Controls.Add(this._lFlagValue); this.Controls.Add(this._clbCalcFlags); this.Controls.Add(this._bOk); this.Controls.Add(this._bNo); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(300, 331); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(300, 331); this.Name = "FormCalculateFlags"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; diff --git a/SpellWork/Forms/FormCalculateFlags.cs b/SpellWork/Forms/FormCalculateFlags.cs index 94cf2f51..8c3d5b7e 100644 --- a/SpellWork/Forms/FormCalculateFlags.cs +++ b/SpellWork/Forms/FormCalculateFlags.cs @@ -1,38 +1,39 @@ using System; using System.Windows.Forms; +using SpellWork.Extensions; -namespace SpellWork +namespace SpellWork.Forms { - public partial class FormCalculateFlags : Form + public sealed partial class FormCalculateFlags : Form { public uint Flags { get; private set; } - + public FormCalculateFlags(Type data, uint value, String remove) { InitializeComponent(); - - this._clbCalcFlags.SetFlags(data, remove); - this._clbCalcFlags.SetCheckedItemFromFlag(value); - this.Text = "Calculate " + data.Name; + _clbCalcFlags.SetFlags(data, remove); + _clbCalcFlags.SetCheckedItemFromFlag(value); + + Text = @"Calculate " + data.Name; } - private void _bOk_Click(object sender, EventArgs e) + private void BOkClick(object sender, EventArgs e) { - this.Flags = this._clbCalcFlags.GetFlagsValue(); - this.DialogResult = DialogResult.OK; - this.Close(); + Flags = _clbCalcFlags.GetFlagsValue(); + DialogResult = DialogResult.OK; + Close(); } - private void _bNo_Click(object sender, EventArgs e) + private void BNoClick(object sender, EventArgs e) { - this.Close(); + Close(); } - private void _clbCalcFlags_SelectedValueChanged(object sender, EventArgs e) + private void ClbCalcFlagsSelectedValueChanged(object sender, EventArgs e) { - this.Flags = this._clbCalcFlags.GetFlagsValue(); - _lFlagValue.Text = "Value: " + this.Flags; + Flags = _clbCalcFlags.GetFlagsValue(); + _lFlagValue.Text = @"Value: " + Flags; } } } diff --git a/SpellWork/Forms/FormMain.Designer.cs b/SpellWork/Forms/FormMain.Designer.cs index 44fc38a6..3baf6b0e 100644 --- a/SpellWork/Forms/FormMain.Designer.cs +++ b/SpellWork/Forms/FormMain.Designer.cs @@ -1,6 +1,6 @@ -namespace SpellWork +namespace SpellWork.Forms { - partial class FormMain + sealed partial class FormMain { /// /// Требуется переменная конструктора. @@ -20,8 +20,6 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - #region Код, автоматически созданный конструктором форм Windows - /// /// Обязательный метод для поддержки конструктора - не изменяйте /// содержимое данного метода при помощи редактора кода. @@ -41,7 +39,22 @@ 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.tabControl1 = new System.Windows.Forms.TabControl(); + this._ilPro = new System.Windows.Forms.ImageList(this.components); + this.splitContainer7 = new System.Windows.Forms.SplitContainer(); + this.splitContainer8 = new System.Windows.Forms.SplitContainer(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.richTextBox2 = new System.Windows.Forms.RichTextBox(); + this._tpCompare = new System.Windows.Forms.TabPage(); + this._scCompareRoot = new System.Windows.Forms.SplitContainer(); + this._bCompareSearch1 = new System.Windows.Forms.Button(); + this.label13 = new System.Windows.Forms.Label(); + this._tbCompareFilterSpell1 = new System.Windows.Forms.TextBox(); + this._rtbCompareSpell1 = new System.Windows.Forms.RichTextBox(); + this._bCompareSearch2 = new System.Windows.Forms.Button(); + this.label14 = new System.Windows.Forms.Label(); + this._rtbCompareSpell2 = new System.Windows.Forms.RichTextBox(); + this._tbCompareFilterSpell2 = new System.Windows.Forms.TextBox(); this._tpSpellInfo = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this._rtSpellInfo = new System.Windows.Forms.RichTextBox(); @@ -70,105 +83,97 @@ private void InitializeComponent() this._tbSearchAttributes = new System.Windows.Forms.TextBox(); this._tbSearchIcon = new System.Windows.Forms.TextBox(); this._tbSearchId = new System.Windows.Forms.TextBox(); + this.tabControl1 = new System.Windows.Forms.TabControl(); this._tpSpellProcInfo = new System.Windows.Forms.TabPage(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this._tpSqlData = new System.Windows.Forms.TabPage(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this._lvProcAdditionalInfo = new System.Windows.Forms.ListView(); + this._chID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this._chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this._clbProcFlags = new System.Windows.Forms.CheckedListBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this._clbProcFlagEx = new System.Windows.Forms.CheckedListBox(); - this._gSpellProcEvent = new System.Windows.Forms.GroupBox(); - this._clbSchools = new System.Windows.Forms.CheckedListBox(); - this._cbProcFitstSpellFamily = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); - this._tbPPM = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this._tbChance = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this._tbCooldown = new System.Windows.Forms.TextBox(); this.splitContainer4 = new System.Windows.Forms.SplitContainer(); - this._cbProcSpellFamilyTree = new System.Windows.Forms.ComboBox(); - this._tvFamilyTree = new System.Windows.Forms.TreeView(); - this._ilPro = new System.Windows.Forms.ImageList(this.components); this.splitContainer5 = new System.Windows.Forms.SplitContainer(); - this._rtbProcSpellInfo = new System.Windows.Forms.RichTextBox(); + this._cbProcSpellFamilyName = new System.Windows.Forms.ComboBox(); + this._cbProcSpellAura = new System.Windows.Forms.ComboBox(); + this._cbProcSpellEffect = new System.Windows.Forms.ComboBox(); + this._cbProcTarget1 = new System.Windows.Forms.ComboBox(); + this._cbProcTarget2 = new System.Windows.Forms.ComboBox(); + this._tbProcSeach = new System.Windows.Forms.TextBox(); + this._bProcSearch = new System.Windows.Forms.Button(); this._lvProcSpellList = new System.Windows.Forms.ListView(); this._chProcID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this._chProcName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this._bProcSearch = new System.Windows.Forms.Button(); - this._tbProcSeach = new System.Windows.Forms.TextBox(); - this._cbProcTarget2 = new System.Windows.Forms.ComboBox(); - this._cbProcTarget1 = new System.Windows.Forms.ComboBox(); - this._cbProcSpellEffect = new System.Windows.Forms.ComboBox(); - this._cbProcSpellAura = new System.Windows.Forms.ComboBox(); - this._cbProcSpellFamilyName = new System.Windows.Forms.ComboBox(); - this._lvProcAdditionalInfo = new System.Windows.Forms.ListView(); - this._chID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this._chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this._tpCompare = new System.Windows.Forms.TabPage(); - this._scCompareRoot = new System.Windows.Forms.SplitContainer(); - this._bCompareSearch1 = new System.Windows.Forms.Button(); - this.label13 = new System.Windows.Forms.Label(); - this._tbCompareFilterSpell1 = new System.Windows.Forms.TextBox(); - this._rtbCompareSpell1 = new System.Windows.Forms.RichTextBox(); - this._bCompareSearch2 = new System.Windows.Forms.Button(); - this.label14 = new System.Windows.Forms.Label(); - this._rtbCompareSpell2 = new System.Windows.Forms.RichTextBox(); - this._tbCompareFilterSpell2 = new System.Windows.Forms.TextBox(); - this._tpSqlData = new System.Windows.Forms.TabPage(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this._cbBinaryCompare = new System.Windows.Forms.CheckBox(); - this.label9 = new System.Windows.Forms.Label(); - this._tbSqlManual = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this._bSqlProcEx = new System.Windows.Forms.Button(); - this._bSqlProc = new System.Windows.Forms.Button(); - this._bSqlSchool = new System.Windows.Forms.Button(); - this._tbSqlProcEx = new System.Windows.Forms.TextBox(); - this._tbSqlProc = new System.Windows.Forms.TextBox(); - this._tbSqlSchool = new System.Windows.Forms.TextBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this._cbSqlSpellFamily = new System.Windows.Forms.ComboBox(); - this._bSelect = new System.Windows.Forms.Button(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); + this._rtbProcSpellInfo = new System.Windows.Forms.RichTextBox(); + this._tvFamilyTree = new System.Windows.Forms.TreeView(); + this._cbProcSpellFamilyTree = new System.Windows.Forms.ComboBox(); + this._gSpellProcEvent = new System.Windows.Forms.GroupBox(); + this._tbCooldown = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this._tbChance = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this._tbPPM = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this._cbProcFitstSpellFamily = new System.Windows.Forms.ComboBox(); + this._clbSchools = new System.Windows.Forms.CheckedListBox(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this._clbProcFlagEx = new System.Windows.Forms.CheckedListBox(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this._clbProcFlags = new System.Windows.Forms.CheckedListBox(); this.splitContainer6 = new System.Windows.Forms.SplitContainer(); + this._bSqlSave = new System.Windows.Forms.Button(); + this._bSqlToBase = new System.Windows.Forms.Button(); + this._rtbSqlLog = new System.Windows.Forms.RichTextBox(); this._lvDataList = new System.Windows.Forms.ListView(); this.entry = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.spellname = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.schoolmask = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.spellfamilyname = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskA0 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskA1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskA2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskB0 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskB1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskB2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskC0 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskC1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.spellfamilymaskC2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.spellfamilymask0 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.spellfamilymask1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.spellfamilymask2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.procflag = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.procEx = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ppmRate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.customchance = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.cooldown = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this._rtbSqlLog = new System.Windows.Forms.RichTextBox(); - this._bSqlToBase = new System.Windows.Forms.Button(); - this._bSqlSave = new System.Windows.Forms.Button(); + this._bSelect = new System.Windows.Forms.Button(); + this._cbSqlSpellFamily = new System.Windows.Forms.ComboBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this._tbSqlSchool = new System.Windows.Forms.TextBox(); + this._tbSqlProc = new System.Windows.Forms.TextBox(); + this._tbSqlProcEx = new System.Windows.Forms.TextBox(); + this._bSqlSchool = new System.Windows.Forms.Button(); + this._bSqlProc = new System.Windows.Forms.Button(); + this._bSqlProcEx = new System.Windows.Forms.Button(); + this.label7 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this._tbSqlManual = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this._cbBinaryCompare = new System.Windows.Forms.CheckBox(); this._cbProcFlag = new System.Windows.Forms.CheckBox(); this._bWrite = new System.Windows.Forms.Button(); - this.splitContainer7 = new System.Windows.Forms.SplitContainer(); - this.splitContainer8 = new System.Windows.Forms.SplitContainer(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.richTextBox2 = new System.Windows.Forms.RichTextBox(); + this._bLevelScaling = new System.Windows.Forms.Button(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); - this.tabControl1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer7)).BeginInit(); + this.splitContainer7.Panel1.SuspendLayout(); + this.splitContainer7.Panel2.SuspendLayout(); + this.splitContainer7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer8)).BeginInit(); + this.splitContainer8.Panel1.SuspendLayout(); + this.splitContainer8.SuspendLayout(); + this._tpCompare.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this._scCompareRoot)).BeginInit(); + this._scCompareRoot.Panel1.SuspendLayout(); + this._scCompareRoot.Panel2.SuspendLayout(); + this._scCompareRoot.SuspendLayout(); this._tpSpellInfo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); @@ -176,37 +181,19 @@ private void InitializeComponent() this._gSpellFilter.SuspendLayout(); this._gbAdvansedSearch.SuspendLayout(); this.groupBox7.SuspendLayout(); + this.tabControl1.SuspendLayout(); this._tpSpellProcInfo.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); this.splitContainer2.SuspendLayout(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); + this._tpSqlData.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); this.splitContainer3.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this._gSpellProcEvent.SuspendLayout(); - this.splitContainer4.Panel1.SuspendLayout(); - this.splitContainer4.Panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); this.splitContainer4.SuspendLayout(); - this.splitContainer5.Panel1.SuspendLayout(); - this.splitContainer5.Panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit(); this.splitContainer5.SuspendLayout(); - this._tpCompare.SuspendLayout(); - this._scCompareRoot.Panel1.SuspendLayout(); - this._scCompareRoot.Panel2.SuspendLayout(); - this._scCompareRoot.SuspendLayout(); - this._tpSqlData.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.splitContainer6.Panel1.SuspendLayout(); - this.splitContainer6.Panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer6)).BeginInit(); this.splitContainer6.SuspendLayout(); - this.splitContainer7.Panel1.SuspendLayout(); - this.splitContainer7.Panel2.SuspendLayout(); - this.splitContainer7.SuspendLayout(); - this.splitContainer8.Panel1.SuspendLayout(); - this.splitContainer8.SuspendLayout(); this.SuspendLayout(); // // statusStrip1 @@ -262,21 +249,21 @@ private void InitializeComponent() this._Connected.Name = "_Connected"; this._Connected.Size = new System.Drawing.Size(132, 22); this._Connected.Text = "Connected"; - this._Connected.Click += new System.EventHandler(this._Connected_Click); + this._Connected.Click += new System.EventHandler(this.ConnectedClick); // // _tsmSettings // this._tsmSettings.Name = "_tsmSettings"; this._tsmSettings.Size = new System.Drawing.Size(132, 22); this._tsmSettings.Text = "Setting"; - this._tsmSettings.Click += new System.EventHandler(this.Settings_Click); + this._tsmSettings.Click += new System.EventHandler(this.SettingsClick); // // _tsmExit // this._tsmExit.Name = "_tsmExit"; this._tsmExit.Size = new System.Drawing.Size(132, 22); this._tsmExit.Text = "Exit"; - this._tsmExit.Click += new System.EventHandler(this.Exit_Click); + this._tsmExit.Click += new System.EventHandler(this.ExitClick); // // _tsmHelp // @@ -291,90 +278,260 @@ private void InitializeComponent() this._tsmAbout.Name = "_tsmAbout"; this._tsmAbout.Size = new System.Drawing.Size(113, 22); this._tsmAbout.Text = "About.."; - this._tsmAbout.Click += new System.EventHandler(this.About_Click); + this._tsmAbout.Click += new System.EventHandler(this.AboutClick); // - // tabControl1 + // _ilPro // - this.tabControl1.Controls.Add(this._tpSpellInfo); - this.tabControl1.Controls.Add(this._tpSpellProcInfo); - this.tabControl1.Controls.Add(this._tpCompare); - this.tabControl1.Controls.Add(this._tpSqlData); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 24); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(872, 583); - this.tabControl1.TabIndex = 2; - this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); + this._ilPro.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("_ilPro.ImageStream"))); + this._ilPro.TransparentColor = System.Drawing.Color.Transparent; + this._ilPro.Images.SetKeyName(0, "info.ico"); + this._ilPro.Images.SetKeyName(1, "ok.ico"); + this._ilPro.Images.SetKeyName(2, "drop.ico"); + this._ilPro.Images.SetKeyName(3, "plus.ico"); + this._ilPro.Images.SetKeyName(4, "family.ico"); + this._ilPro.Images.SetKeyName(5, "munus.ico"); // - // _tpSpellInfo + // splitContainer7 // - this._tpSpellInfo.Controls.Add(this.splitContainer1); - this._tpSpellInfo.Location = new System.Drawing.Point(4, 22); - this._tpSpellInfo.Name = "_tpSpellInfo"; - this._tpSpellInfo.Padding = new System.Windows.Forms.Padding(3); - this._tpSpellInfo.Size = new System.Drawing.Size(864, 557); - this._tpSpellInfo.TabIndex = 0; - this._tpSpellInfo.Text = "Spell Info"; - this._tpSpellInfo.UseVisualStyleBackColor = true; + this.splitContainer7.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer7.Location = new System.Drawing.Point(0, 0); + this.splitContainer7.Name = "splitContainer7"; // - // splitContainer1 + // splitContainer7.Panel1 // - this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.splitContainer1.Location = new System.Drawing.Point(3, 3); - this.splitContainer1.Name = "splitContainer1"; + this.splitContainer7.Panel1.Controls.Add(this.splitContainer8); + this.splitContainer7.Panel1.Controls.Add(this.richTextBox1); // - // splitContainer1.Panel1 + // splitContainer7.Panel2 // - this.splitContainer1.Panel1.Controls.Add(this._rtSpellInfo); + this.splitContainer7.Panel2.Controls.Add(this.richTextBox2); + this.splitContainer7.Size = new System.Drawing.Size(858, 429); + this.splitContainer7.SplitterDistance = 424; + this.splitContainer7.TabIndex = 0; // - // splitContainer1.Panel2 + // splitContainer8 // - this.splitContainer1.Panel2.BackColor = System.Drawing.Color.Gainsboro; - this.splitContainer1.Panel2.Controls.Add(this.groupBox1); - this.splitContainer1.Size = new System.Drawing.Size(858, 551); - this.splitContainer1.SplitterDistance = 543; - this.splitContainer1.TabIndex = 0; + this.splitContainer8.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer8.Location = new System.Drawing.Point(0, 0); + this.splitContainer8.Name = "splitContainer8"; // - // _rtSpellInfo + // splitContainer8.Panel1 // - this._rtSpellInfo.BackColor = System.Drawing.Color.Gainsboro; - this._rtSpellInfo.Dock = System.Windows.Forms.DockStyle.Fill; - this._rtSpellInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._rtSpellInfo.Location = new System.Drawing.Point(0, 0); - this._rtSpellInfo.Name = "_rtSpellInfo"; - this._rtSpellInfo.ReadOnly = true; - this._rtSpellInfo.Size = new System.Drawing.Size(543, 551); - this._rtSpellInfo.TabIndex = 0; - this._rtSpellInfo.Text = ""; + this.splitContainer8.Panel1.Controls.Add(this.textBox2); + this.splitContainer8.Size = new System.Drawing.Size(424, 429); + this.splitContainer8.SplitterDistance = 209; + this.splitContainer8.TabIndex = 0; // - // groupBox1 + // textBox2 // - this.groupBox1.Controls.Add(this._lvSpellList); - this.groupBox1.Controls.Add(this._gSpellFilter); - this.groupBox1.Controls.Add(this.groupBox7); - this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox1.Location = new System.Drawing.Point(0, 0); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(311, 551); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; + this.textBox2.Location = new System.Drawing.Point(19, 12); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(100, 20); + this.textBox2.TabIndex = 0; // - // _lvSpellList + // richTextBox1 // - this._lvSpellList.AllowColumnReorder = true; - this._lvSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._lvSpellList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.chSpellID, - this.chSpellName}); - this._lvSpellList.FullRowSelect = true; - this._lvSpellList.GridLines = true; - this._lvSpellList.HideSelection = false; + this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBox1.Location = new System.Drawing.Point(0, 0); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(424, 429); + this.richTextBox1.TabIndex = 0; + this.richTextBox1.Text = ""; + // + // richTextBox2 + // + this.richTextBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBox2.Location = new System.Drawing.Point(0, 0); + this.richTextBox2.Name = "richTextBox2"; + this.richTextBox2.Size = new System.Drawing.Size(430, 429); + this.richTextBox2.TabIndex = 0; + this.richTextBox2.Text = ""; + // + // _tpCompare + // + this._tpCompare.Controls.Add(this._scCompareRoot); + this._tpCompare.Location = new System.Drawing.Point(4, 22); + this._tpCompare.Name = "_tpCompare"; + this._tpCompare.Padding = new System.Windows.Forms.Padding(3); + this._tpCompare.Size = new System.Drawing.Size(864, 557); + this._tpCompare.TabIndex = 4; + this._tpCompare.Text = "Compare Spells"; + this._tpCompare.UseVisualStyleBackColor = true; + // + // _scCompareRoot + // + this._scCompareRoot.Dock = System.Windows.Forms.DockStyle.Fill; + this._scCompareRoot.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this._scCompareRoot.Location = new System.Drawing.Point(3, 3); + this._scCompareRoot.Name = "_scCompareRoot"; + // + // _scCompareRoot.Panel1 + // + this._scCompareRoot.Panel1.BackColor = System.Drawing.Color.WhiteSmoke; + this._scCompareRoot.Panel1.Controls.Add(this._bCompareSearch1); + this._scCompareRoot.Panel1.Controls.Add(this.label13); + this._scCompareRoot.Panel1.Controls.Add(this._tbCompareFilterSpell1); + this._scCompareRoot.Panel1.Controls.Add(this._rtbCompareSpell1); + // + // _scCompareRoot.Panel2 + // + this._scCompareRoot.Panel2.BackColor = System.Drawing.Color.WhiteSmoke; + this._scCompareRoot.Panel2.Controls.Add(this._bCompareSearch2); + this._scCompareRoot.Panel2.Controls.Add(this.label14); + this._scCompareRoot.Panel2.Controls.Add(this._rtbCompareSpell2); + this._scCompareRoot.Panel2.Controls.Add(this._tbCompareFilterSpell2); + this._scCompareRoot.Size = new System.Drawing.Size(858, 551); + this._scCompareRoot.SplitterDistance = 426; + this._scCompareRoot.TabIndex = 0; + // + // _bCompareSearch1 + // + this._bCompareSearch1.Location = new System.Drawing.Point(238, 1); + this._bCompareSearch1.Name = "_bCompareSearch1"; + this._bCompareSearch1.Size = new System.Drawing.Size(51, 23); + this._bCompareSearch1.TabIndex = 3; + this._bCompareSearch1.Text = "Search"; + this._bCompareSearch1.UseVisualStyleBackColor = true; + this._bCompareSearch1.Click += new System.EventHandler(this.CompareSearch1Click); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(5, 6); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(61, 13); + this.label13.TabIndex = 2; + this.label13.Text = "ID or Name"; + // + // _tbCompareFilterSpell1 + // + this._tbCompareFilterSpell1.Location = new System.Drawing.Point(86, 3); + this._tbCompareFilterSpell1.Name = "_tbCompareFilterSpell1"; + this._tbCompareFilterSpell1.Size = new System.Drawing.Size(146, 20); + this._tbCompareFilterSpell1.TabIndex = 1; + this._tbCompareFilterSpell1.TextChanged += new System.EventHandler(this.CompareFilterSpellTextChanged); + // + // _rtbCompareSpell1 + // + this._rtbCompareSpell1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._rtbCompareSpell1.BackColor = System.Drawing.Color.Gainsboro; + this._rtbCompareSpell1.Font = new System.Drawing.Font("Arial Unicode MS", 9F); + this._rtbCompareSpell1.Location = new System.Drawing.Point(0, 29); + this._rtbCompareSpell1.Name = "_rtbCompareSpell1"; + this._rtbCompareSpell1.Size = new System.Drawing.Size(423, 522); + this._rtbCompareSpell1.TabIndex = 0; + this._rtbCompareSpell1.Text = ""; + // + // _bCompareSearch2 + // + this._bCompareSearch2.Location = new System.Drawing.Point(243, 1); + this._bCompareSearch2.Name = "_bCompareSearch2"; + this._bCompareSearch2.Size = new System.Drawing.Size(51, 23); + this._bCompareSearch2.TabIndex = 3; + this._bCompareSearch2.Text = "Search"; + this._bCompareSearch2.UseVisualStyleBackColor = true; + this._bCompareSearch2.Click += new System.EventHandler(this.CompareSearch2Click); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(10, 6); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(61, 13); + this.label14.TabIndex = 2; + this.label14.Text = "ID or Name"; + // + // _rtbCompareSpell2 + // + this._rtbCompareSpell2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._rtbCompareSpell2.BackColor = System.Drawing.Color.Gainsboro; + this._rtbCompareSpell2.Font = new System.Drawing.Font("Arial Unicode MS", 9F); + this._rtbCompareSpell2.Location = new System.Drawing.Point(3, 29); + this._rtbCompareSpell2.Name = "_rtbCompareSpell2"; + this._rtbCompareSpell2.Size = new System.Drawing.Size(425, 522); + this._rtbCompareSpell2.TabIndex = 0; + this._rtbCompareSpell2.Text = ""; + // + // _tbCompareFilterSpell2 + // + this._tbCompareFilterSpell2.Location = new System.Drawing.Point(91, 3); + this._tbCompareFilterSpell2.Name = "_tbCompareFilterSpell2"; + this._tbCompareFilterSpell2.Size = new System.Drawing.Size(146, 20); + this._tbCompareFilterSpell2.TabIndex = 1; + this._tbCompareFilterSpell2.TextChanged += new System.EventHandler(this.CompareFilterSpellTextChanged); + // + // _tpSpellInfo + // + this._tpSpellInfo.Controls.Add(this.splitContainer1); + this._tpSpellInfo.Location = new System.Drawing.Point(4, 22); + this._tpSpellInfo.Name = "_tpSpellInfo"; + this._tpSpellInfo.Padding = new System.Windows.Forms.Padding(3); + this._tpSpellInfo.Size = new System.Drawing.Size(864, 557); + this._tpSpellInfo.TabIndex = 0; + this._tpSpellInfo.Text = "Spell Info"; + this._tpSpellInfo.UseVisualStyleBackColor = true; + // + // splitContainer1 + // + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer1.Location = new System.Drawing.Point(3, 3); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this._rtSpellInfo); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.BackColor = System.Drawing.Color.Gainsboro; + this.splitContainer1.Panel2.Controls.Add(this.groupBox1); + this.splitContainer1.Size = new System.Drawing.Size(858, 551); + this.splitContainer1.SplitterDistance = 543; + this.splitContainer1.TabIndex = 0; + // + // _rtSpellInfo + // + this._rtSpellInfo.BackColor = System.Drawing.Color.Gainsboro; + this._rtSpellInfo.Dock = System.Windows.Forms.DockStyle.Fill; + this._rtSpellInfo.Font = new System.Drawing.Font("Arial Unicode MS", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._rtSpellInfo.Location = new System.Drawing.Point(0, 0); + this._rtSpellInfo.Name = "_rtSpellInfo"; + this._rtSpellInfo.ReadOnly = true; + this._rtSpellInfo.Size = new System.Drawing.Size(543, 551); + this._rtSpellInfo.TabIndex = 0; + this._rtSpellInfo.Text = ""; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this._lvSpellList); + this.groupBox1.Controls.Add(this._gSpellFilter); + this.groupBox1.Controls.Add(this.groupBox7); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(311, 551); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + // + // _lvSpellList + // + this._lvSpellList.AllowColumnReorder = true; + this._lvSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._lvSpellList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chSpellID, + this.chSpellName}); + this._lvSpellList.FullRowSelect = true; + this._lvSpellList.GridLines = true; + this._lvSpellList.HideSelection = false; this._lvSpellList.Location = new System.Drawing.Point(6, 284); this._lvSpellList.MultiSelect = false; this._lvSpellList.Name = "_lvSpellList"; @@ -383,8 +540,8 @@ private void InitializeComponent() this._lvSpellList.UseCompatibleStateImageBehavior = false; this._lvSpellList.View = System.Windows.Forms.View.Details; this._lvSpellList.VirtualMode = true; - this._lvSpellList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this._lvSpellList_RetrieveVirtualItem); - this._lvSpellList.SelectedIndexChanged += new System.EventHandler(this._lvSpellList_SelectedIndexChanged); + this._lvSpellList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.LvSpellListRetrieveVirtualItem); + this._lvSpellList.SelectedIndexChanged += new System.EventHandler(this.LvSpellListSelectedIndexChanged); // // chSpellID // @@ -461,7 +618,7 @@ private void InitializeComponent() this._tbAdvancedFilter2Val.Size = new System.Drawing.Size(85, 20); this._tbAdvancedFilter2Val.TabIndex = 1; this._tbAdvancedFilter2Val.Text = "0"; - this._tbAdvancedFilter2Val.KeyDown += new System.Windows.Forms.KeyEventHandler(this._tbAdvansedFilterVal_KeyDown); + this._tbAdvancedFilter2Val.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TbAdvansedFilterValKeyDown); // // _tbAdvancedFilter1Val // @@ -471,7 +628,7 @@ private void InitializeComponent() this._tbAdvancedFilter1Val.Size = new System.Drawing.Size(85, 20); this._tbAdvancedFilter1Val.TabIndex = 1; this._tbAdvancedFilter1Val.Text = "0"; - this._tbAdvancedFilter1Val.KeyDown += new System.Windows.Forms.KeyEventHandler(this._tbAdvansedFilterVal_KeyDown); + this._tbAdvancedFilter1Val.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TbAdvansedFilterValKeyDown); // // _cbAdvancedFilter2 // @@ -512,7 +669,7 @@ private void InitializeComponent() this._cbTarget2.Name = "_cbTarget2"; this._cbTarget2.Size = new System.Drawing.Size(302, 21); this._cbTarget2.TabIndex = 5; - this._cbTarget2.SelectedIndexChanged += new System.EventHandler(this._cbSpellFamilyNames_SelectedIndexChanged); + this._cbTarget2.SelectedIndexChanged += new System.EventHandler(this.CbSpellFamilyNamesSelectedIndexChanged); // // _cbTarget1 // @@ -527,7 +684,7 @@ private void InitializeComponent() this._cbTarget1.Name = "_cbTarget1"; this._cbTarget1.Size = new System.Drawing.Size(302, 21); this._cbTarget1.TabIndex = 5; - this._cbTarget1.SelectedIndexChanged += new System.EventHandler(this._cbSpellFamilyNames_SelectedIndexChanged); + this._cbTarget1.SelectedIndexChanged += new System.EventHandler(this.CbSpellFamilyNamesSelectedIndexChanged); // // _cbSpellEffect // @@ -542,7 +699,7 @@ private void InitializeComponent() this._cbSpellEffect.Name = "_cbSpellEffect"; this._cbSpellEffect.Size = new System.Drawing.Size(302, 21); this._cbSpellEffect.TabIndex = 4; - this._cbSpellEffect.SelectedIndexChanged += new System.EventHandler(this._cbSpellFamilyNames_SelectedIndexChanged); + this._cbSpellEffect.SelectedIndexChanged += new System.EventHandler(this.CbSpellFamilyNamesSelectedIndexChanged); // // _cbSpellAura // @@ -557,7 +714,7 @@ private void InitializeComponent() this._cbSpellAura.Name = "_cbSpellAura"; this._cbSpellAura.Size = new System.Drawing.Size(302, 21); this._cbSpellAura.TabIndex = 3; - this._cbSpellAura.SelectedIndexChanged += new System.EventHandler(this._cbSpellFamilyNames_SelectedIndexChanged); + this._cbSpellAura.SelectedIndexChanged += new System.EventHandler(this.CbSpellFamilyNamesSelectedIndexChanged); // // _cbSpellFamilyName // @@ -573,7 +730,7 @@ private void InitializeComponent() this._cbSpellFamilyName.Name = "_cbSpellFamilyName"; this._cbSpellFamilyName.Size = new System.Drawing.Size(302, 21); this._cbSpellFamilyName.TabIndex = 2; - this._cbSpellFamilyName.SelectedIndexChanged += new System.EventHandler(this._cbSpellFamilyNames_SelectedIndexChanged); + this._cbSpellFamilyName.SelectedIndexChanged += new System.EventHandler(this.CbSpellFamilyNamesSelectedIndexChanged); // // groupBox7 // @@ -630,7 +787,7 @@ private void InitializeComponent() this._bSearch.TabIndex = 1; this._bSearch.Text = "Search"; this._bSearch.UseVisualStyleBackColor = true; - this._bSearch.Click += new System.EventHandler(this._bSearch_Click); + this._bSearch.Click += new System.EventHandler(this.BSearchClick); // // _tbSearchAttributes // @@ -640,7 +797,7 @@ private void InitializeComponent() this._tbSearchAttributes.Name = "_tbSearchAttributes"; this._tbSearchAttributes.Size = new System.Drawing.Size(180, 20); this._tbSearchAttributes.TabIndex = 0; - this._tbSearchAttributes.KeyDown += new System.Windows.Forms.KeyEventHandler(this._tbSearchId_KeyDown); + this._tbSearchAttributes.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TbSearchIdKeyDown); // // _tbSearchIcon // @@ -650,7 +807,7 @@ private void InitializeComponent() this._tbSearchIcon.Name = "_tbSearchIcon"; this._tbSearchIcon.Size = new System.Drawing.Size(180, 20); this._tbSearchIcon.TabIndex = 0; - this._tbSearchIcon.KeyDown += new System.Windows.Forms.KeyEventHandler(this._tbSearchId_KeyDown); + this._tbSearchIcon.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TbSearchIdKeyDown); // // _tbSearchId // @@ -660,7 +817,21 @@ private void InitializeComponent() this._tbSearchId.Name = "_tbSearchId"; this._tbSearchId.Size = new System.Drawing.Size(180, 20); this._tbSearchId.TabIndex = 0; - this._tbSearchId.KeyDown += new System.Windows.Forms.KeyEventHandler(this._tbSearchId_KeyDown); + this._tbSearchId.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TbSearchIdKeyDown); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this._tpSpellInfo); + this.tabControl1.Controls.Add(this._tpSpellProcInfo); + this.tabControl1.Controls.Add(this._tpCompare); + this.tabControl1.Controls.Add(this._tpSqlData); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 24); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(872, 583); + this.tabControl1.TabIndex = 2; + this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.TabControl1SelectedIndexChanged); // // _tpSpellProcInfo // @@ -679,195 +850,104 @@ private void InitializeComponent() this.splitContainer2.Name = "splitContainer2"; this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.splitContainer3); - // // splitContainer2.Panel2 // this.splitContainer2.Panel2.BackColor = System.Drawing.Color.Gainsboro; - this.splitContainer2.Panel2.Controls.Add(this._lvProcAdditionalInfo); this.splitContainer2.Size = new System.Drawing.Size(864, 557); this.splitContainer2.SplitterDistance = 489; this.splitContainer2.TabIndex = 0; // - // splitContainer3 + // _tpSqlData // - this.splitContainer3.BackColor = System.Drawing.Color.White; - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + this._tpSqlData.Controls.Add(this.groupBox3); + this._tpSqlData.Controls.Add(this.groupBox2); + this._tpSqlData.Location = new System.Drawing.Point(4, 22); + this._tpSqlData.Name = "_tpSqlData"; + this._tpSqlData.Size = new System.Drawing.Size(864, 557); + this._tpSqlData.TabIndex = 3; + this._tpSqlData.Text = "Sql Data"; + this._tpSqlData.UseVisualStyleBackColor = true; // - // splitContainer3.Panel1 + // groupBox3 // - this.splitContainer3.Panel1.BackColor = System.Drawing.Color.White; - this.splitContainer3.Panel1.Controls.Add(this.groupBox5); - this.splitContainer3.Panel1.Controls.Add(this.groupBox4); - this.splitContainer3.Panel1.Controls.Add(this._gSpellProcEvent); + this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox3.BackColor = System.Drawing.Color.WhiteSmoke; + this.groupBox3.Controls.Add(this._cbBinaryCompare); + this.groupBox3.Controls.Add(this.label9); + this.groupBox3.Controls.Add(this._tbSqlManual); + this.groupBox3.Controls.Add(this.label8); + this.groupBox3.Controls.Add(this.label12); + this.groupBox3.Controls.Add(this.label11); + this.groupBox3.Controls.Add(this.label10); + this.groupBox3.Controls.Add(this.label7); + this.groupBox3.Controls.Add(this._bSqlProcEx); + this.groupBox3.Controls.Add(this._bSqlProc); + this.groupBox3.Controls.Add(this._bSqlSchool); + this.groupBox3.Controls.Add(this._tbSqlProcEx); + this.groupBox3.Controls.Add(this._tbSqlProc); + this.groupBox3.Controls.Add(this._tbSqlSchool); + this.groupBox3.Controls.Add(this.textBox1); + this.groupBox3.Controls.Add(this._cbSqlSpellFamily); + this.groupBox3.Controls.Add(this._bSelect); + this.groupBox3.Location = new System.Drawing.Point(6, 3); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(855, 85); + this.groupBox3.TabIndex = 1; + this.groupBox3.TabStop = false; // - // splitContainer3.Panel2 + // groupBox2 // - this.splitContainer3.Panel2.Controls.Add(this.splitContainer4); - this.splitContainer3.Size = new System.Drawing.Size(864, 489); - this.splitContainer3.SplitterDistance = 241; - this.splitContainer3.TabIndex = 0; - // - // groupBox5 - // - this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox5.BackColor = System.Drawing.Color.WhiteSmoke; - this.groupBox5.Controls.Add(this._clbProcFlags); - this.groupBox5.Location = new System.Drawing.Point(3, 128); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(858, 115); - this.groupBox5.TabIndex = 10; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Spell Proc Flags"; - // - // _clbProcFlags - // - this._clbProcFlags.CheckOnClick = true; - this._clbProcFlags.ColumnWidth = 170; - this._clbProcFlags.Dock = System.Windows.Forms.DockStyle.Fill; - this._clbProcFlags.FormattingEnabled = true; - this._clbProcFlags.Location = new System.Drawing.Point(3, 16); - this._clbProcFlags.MultiColumn = true; - this._clbProcFlags.Name = "_clbProcFlags"; - this._clbProcFlags.Size = new System.Drawing.Size(852, 96); - this._clbProcFlags.TabIndex = 0; - this._clbProcFlags.SelectedIndexChanged += new System.EventHandler(this._clbSchools_SelectedIndexChanged); - // - // groupBox4 - // - this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox4.BackColor = System.Drawing.Color.WhiteSmoke; - this.groupBox4.Controls.Add(this._clbProcFlagEx); - this.groupBox4.Location = new System.Drawing.Point(3, 60); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(858, 75); - this.groupBox4.TabIndex = 9; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Spell Proc Ex"; - // - // _clbProcFlagEx - // - this._clbProcFlagEx.CheckOnClick = true; - this._clbProcFlagEx.ColumnWidth = 120; - this._clbProcFlagEx.Dock = System.Windows.Forms.DockStyle.Fill; - this._clbProcFlagEx.FormattingEnabled = true; - this._clbProcFlagEx.Location = new System.Drawing.Point(3, 16); - this._clbProcFlagEx.MultiColumn = true; - this._clbProcFlagEx.Name = "_clbProcFlagEx"; - this._clbProcFlagEx.Size = new System.Drawing.Size(852, 56); - this._clbProcFlagEx.TabIndex = 3; - this._clbProcFlagEx.SelectedIndexChanged += new System.EventHandler(this._clbSchools_SelectedIndexChanged); - // - // _gSpellProcEvent - // - this._gSpellProcEvent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._gSpellProcEvent.BackColor = System.Drawing.Color.WhiteSmoke; - this._gSpellProcEvent.Controls.Add(this._clbSchools); - this._gSpellProcEvent.Controls.Add(this._cbProcFitstSpellFamily); - this._gSpellProcEvent.Controls.Add(this.label1); - this._gSpellProcEvent.Controls.Add(this._tbPPM); - this._gSpellProcEvent.Controls.Add(this.label2); - this._gSpellProcEvent.Controls.Add(this._tbChance); - this._gSpellProcEvent.Controls.Add(this.label3); - this._gSpellProcEvent.Controls.Add(this._tbCooldown); - this._gSpellProcEvent.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this._gSpellProcEvent.Location = new System.Drawing.Point(4, 0); - this._gSpellProcEvent.Name = "_gSpellProcEvent"; - this._gSpellProcEvent.Size = new System.Drawing.Size(857, 63); - this._gSpellProcEvent.TabIndex = 8; - this._gSpellProcEvent.TabStop = false; - this._gSpellProcEvent.Text = "Spell Proc Event"; - // - // _clbSchools - // - this._clbSchools.CheckOnClick = true; - this._clbSchools.ColumnWidth = 100; - this._clbSchools.Dock = System.Windows.Forms.DockStyle.Right; - this._clbSchools.FormattingEnabled = true; - this._clbSchools.Location = new System.Drawing.Point(391, 16); - this._clbSchools.MultiColumn = true; - this._clbSchools.Name = "_clbSchools"; - this._clbSchools.Size = new System.Drawing.Size(463, 44); - this._clbSchools.TabIndex = 5; - this._clbSchools.SelectedIndexChanged += new System.EventHandler(this._clbSchools_SelectedIndexChanged); - // - // _cbProcFitstSpellFamily - // - this._cbProcFitstSpellFamily.DropDownHeight = 500; - this._cbProcFitstSpellFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcFitstSpellFamily.FormattingEnabled = true; - this._cbProcFitstSpellFamily.IntegralHeight = false; - this._cbProcFitstSpellFamily.Location = new System.Drawing.Point(3, 14); - this._cbProcFitstSpellFamily.Name = "_cbProcFitstSpellFamily"; - this._cbProcFitstSpellFamily.Size = new System.Drawing.Size(342, 21); - this._cbProcFitstSpellFamily.TabIndex = 4; - this._cbProcFitstSpellFamily.SelectedIndexChanged += new System.EventHandler(this._clbSchools_SelectedIndexChanged); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(3, 41); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(30, 13); - this.label1.TabIndex = 6; - this.label1.Text = "PPM"; + this.groupBox2.Controls.Add(this.splitContainer6); + this.groupBox2.Location = new System.Drawing.Point(0, 94); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(864, 463); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; // - // _tbPPM + // _lvProcAdditionalInfo // - this._tbPPM.Location = new System.Drawing.Point(39, 38); - this._tbPPM.MaxLength = 10; - this._tbPPM.Name = "_tbPPM"; - this._tbPPM.Size = new System.Drawing.Size(60, 20); - this._tbPPM.TabIndex = 7; - this._tbPPM.TextChanged += new System.EventHandler(this._tbCooldown_TextChanged); - this._tbPPM.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBox_KeyPress); + this._lvProcAdditionalInfo.Dock = System.Windows.Forms.DockStyle.Fill; + this._lvProcAdditionalInfo.FullRowSelect = true; + this._lvProcAdditionalInfo.GridLines = true; + this._lvProcAdditionalInfo.Location = new System.Drawing.Point(0, 0); + this._lvProcAdditionalInfo.Name = "_lvProcAdditionalInfo"; + this._lvProcAdditionalInfo.Size = new System.Drawing.Size(864, 64); + this._lvProcAdditionalInfo.TabIndex = 0; + this._lvProcAdditionalInfo.UseCompatibleStateImageBehavior = false; + this._lvProcAdditionalInfo.View = System.Windows.Forms.View.Details; + this._lvProcAdditionalInfo.SelectedIndexChanged += new System.EventHandler(this.LvProcAdditionalInfoSelectedIndexChanged); // - // label2 + // _chID // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(105, 41); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(44, 13); - this.label2.TabIndex = 6; - this.label2.Text = "Chance"; + this._chID.DisplayIndex = 0; + this._chID.Text = "Entry"; + this._chID.Width = 100; // - // _tbChance + // _chName // - this._tbChance.Location = new System.Drawing.Point(155, 38); - this._tbChance.MaxLength = 10; - this._tbChance.Name = "_tbChance"; - this._tbChance.Size = new System.Drawing.Size(60, 20); - this._tbChance.TabIndex = 7; - this._tbChance.TextChanged += new System.EventHandler(this._tbCooldown_TextChanged); - this._tbChance.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBox_KeyPress); + this._chName.DisplayIndex = 1; + this._chName.Text = "Name"; + this._chName.Width = 685; // - // label3 + // splitContainer3 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(225, 41); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(54, 13); - this.label3.TabIndex = 6; - this.label3.Text = "Cooldown"; + this.splitContainer3.BackColor = System.Drawing.Color.White; + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; // - // _tbCooldown + // splitContainer3.Panel1 // - this._tbCooldown.Location = new System.Drawing.Point(285, 38); - this._tbCooldown.MaxLength = 10; - this._tbCooldown.Name = "_tbCooldown"; - this._tbCooldown.Size = new System.Drawing.Size(60, 20); - this._tbCooldown.TabIndex = 7; - this._tbCooldown.TextChanged += new System.EventHandler(this._tbCooldown_TextChanged); - this._tbCooldown.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBox_KeyPress); + this.splitContainer3.Panel1.BackColor = System.Drawing.Color.White; + this.splitContainer3.Size = new System.Drawing.Size(864, 489); + this.splitContainer3.SplitterDistance = 241; + this.splitContainer3.TabIndex = 0; // // splitContainer4 // @@ -880,58 +960,10 @@ private void InitializeComponent() // splitContainer4.Panel1 // this.splitContainer4.Panel1.BackColor = System.Drawing.Color.Gainsboro; - this.splitContainer4.Panel1.Controls.Add(this._cbProcSpellFamilyTree); - this.splitContainer4.Panel1.Controls.Add(this._tvFamilyTree); - // - // splitContainer4.Panel2 - // - this.splitContainer4.Panel2.Controls.Add(this.splitContainer5); this.splitContainer4.Size = new System.Drawing.Size(864, 244); this.splitContainer4.SplitterDistance = 260; this.splitContainer4.TabIndex = 0; // - // _cbProcSpellFamilyTree - // - this._cbProcSpellFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._cbProcSpellFamilyTree.DropDownHeight = 500; - this._cbProcSpellFamilyTree.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcSpellFamilyTree.FormattingEnabled = true; - this._cbProcSpellFamilyTree.IntegralHeight = false; - this._cbProcSpellFamilyTree.Location = new System.Drawing.Point(1, 2); - this._cbProcSpellFamilyTree.Name = "_cbProcSpellFamilyTree"; - this._cbProcSpellFamilyTree.Size = new System.Drawing.Size(258, 21); - this._cbProcSpellFamilyTree.TabIndex = 1; - this._cbProcSpellFamilyTree.SelectedIndexChanged += new System.EventHandler(this._tvFamilyTree_SelectedIndexChanged); - // - // _tvFamilyTree - // - this._tvFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._tvFamilyTree.CheckBoxes = true; - this._tvFamilyTree.ImageIndex = 0; - this._tvFamilyTree.ImageList = this._ilPro; - this._tvFamilyTree.Location = new System.Drawing.Point(1, 23); - this._tvFamilyTree.Name = "_tvFamilyTree"; - this._tvFamilyTree.SelectedImageIndex = 0; - this._tvFamilyTree.ShowNodeToolTips = true; - this._tvFamilyTree.Size = new System.Drawing.Size(258, 219); - this._tvFamilyTree.TabIndex = 0; - this._tvFamilyTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.FamilyTree_AfterCheck); - this._tvFamilyTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this._tvFamilyTree_AfterSelect); - // - // _ilPro - // - this._ilPro.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("_ilPro.ImageStream"))); - this._ilPro.TransparentColor = System.Drawing.Color.Transparent; - this._ilPro.Images.SetKeyName(0, "info.ico"); - this._ilPro.Images.SetKeyName(1, "ok.ico"); - this._ilPro.Images.SetKeyName(2, "drop.ico"); - this._ilPro.Images.SetKeyName(3, "plus.ico"); - this._ilPro.Images.SetKeyName(4, "family.ico"); - this._ilPro.Images.SetKeyName(5, "munus.ico"); - // // splitContainer5 // this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill; @@ -939,90 +971,68 @@ private void InitializeComponent() this.splitContainer5.Location = new System.Drawing.Point(0, 0); this.splitContainer5.Name = "splitContainer5"; // - // splitContainer5.Panel1 - // - this.splitContainer5.Panel1.Controls.Add(this._rtbProcSpellInfo); - // // splitContainer5.Panel2 // this.splitContainer5.Panel2.BackColor = System.Drawing.Color.Gainsboro; - this.splitContainer5.Panel2.Controls.Add(this._lvProcSpellList); - this.splitContainer5.Panel2.Controls.Add(this._bProcSearch); - this.splitContainer5.Panel2.Controls.Add(this._tbProcSeach); - this.splitContainer5.Panel2.Controls.Add(this._cbProcTarget2); - this.splitContainer5.Panel2.Controls.Add(this._cbProcTarget1); - this.splitContainer5.Panel2.Controls.Add(this._cbProcSpellEffect); - this.splitContainer5.Panel2.Controls.Add(this._cbProcSpellAura); - this.splitContainer5.Panel2.Controls.Add(this._cbProcSpellFamilyName); this.splitContainer5.Size = new System.Drawing.Size(600, 244); this.splitContainer5.SplitterDistance = 330; this.splitContainer5.TabIndex = 0; // - // _rtbProcSpellInfo + // _cbProcSpellFamilyName // - this._rtbProcSpellInfo.BackColor = System.Drawing.SystemColors.MenuBar; - this._rtbProcSpellInfo.Dock = System.Windows.Forms.DockStyle.Fill; - this._rtbProcSpellInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this._rtbProcSpellInfo.Location = new System.Drawing.Point(0, 0); - this._rtbProcSpellInfo.Name = "_rtbProcSpellInfo"; - this._rtbProcSpellInfo.Size = new System.Drawing.Size(330, 244); - this._rtbProcSpellInfo.TabIndex = 0; - this._rtbProcSpellInfo.Text = ""; + this._cbProcSpellFamilyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcSpellFamilyName.DropDownHeight = 500; + this._cbProcSpellFamilyName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbProcSpellFamilyName.FormattingEnabled = true; + this._cbProcSpellFamilyName.IntegralHeight = false; + this._cbProcSpellFamilyName.Location = new System.Drawing.Point(3, 24); + this._cbProcSpellFamilyName.Name = "_cbProcSpellFamilyName"; + this._cbProcSpellFamilyName.Size = new System.Drawing.Size(260, 21); + this._cbProcSpellFamilyName.TabIndex = 1; + this._cbProcSpellFamilyName.SelectedIndexChanged += new System.EventHandler(this.CbProcSpellFamilyNameSelectedIndexChanged); // - // _lvProcSpellList + // _cbProcSpellAura // - this._lvProcSpellList.AllowColumnReorder = true; - this._lvProcSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this._cbProcSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._lvProcSpellList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this._chProcID, - this._chProcName}); - this._lvProcSpellList.FullRowSelect = true; - this._lvProcSpellList.GridLines = true; - this._lvProcSpellList.HideSelection = false; - this._lvProcSpellList.Location = new System.Drawing.Point(2, 117); - this._lvProcSpellList.MultiSelect = false; - this._lvProcSpellList.Name = "_lvProcSpellList"; - this._lvProcSpellList.ShowItemToolTips = true; - this._lvProcSpellList.Size = new System.Drawing.Size(261, 124); - this._lvProcSpellList.TabIndex = 0; - this._lvProcSpellList.UseCompatibleStateImageBehavior = false; - this._lvProcSpellList.View = System.Windows.Forms.View.Details; - this._lvProcSpellList.VirtualMode = true; - this._lvProcSpellList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this._lvProcSpellList_RetrieveVirtualItem); - this._lvProcSpellList.SelectedIndexChanged += new System.EventHandler(this._lvProcSpellList_SelectedIndexChanged); + this._cbProcSpellAura.DropDownHeight = 500; + this._cbProcSpellAura.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbProcSpellAura.FormattingEnabled = true; + this._cbProcSpellAura.IntegralHeight = false; + this._cbProcSpellAura.Location = new System.Drawing.Point(3, 46); + this._cbProcSpellAura.Name = "_cbProcSpellAura"; + this._cbProcSpellAura.Size = new System.Drawing.Size(260, 21); + this._cbProcSpellAura.TabIndex = 2; + this._cbProcSpellAura.SelectedIndexChanged += new System.EventHandler(this.CbProcSpellFamilyNameSelectedIndexChanged); // - // _chProcID + // _cbProcSpellEffect // - this._chProcID.Text = "ID"; - this._chProcID.Width = 45; + this._cbProcSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcSpellEffect.DropDownHeight = 500; + this._cbProcSpellEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbProcSpellEffect.FormattingEnabled = true; + this._cbProcSpellEffect.IntegralHeight = false; + this._cbProcSpellEffect.Location = new System.Drawing.Point(3, 68); + this._cbProcSpellEffect.Name = "_cbProcSpellEffect"; + this._cbProcSpellEffect.Size = new System.Drawing.Size(260, 21); + this._cbProcSpellEffect.TabIndex = 3; + this._cbProcSpellEffect.SelectedIndexChanged += new System.EventHandler(this.CbProcSpellFamilyNameSelectedIndexChanged); // - // _chProcName + // _cbProcTarget1 // - this._chProcName.Text = "Name"; - this._chProcName.Width = 210; - // - // _bProcSearch - // - this._bProcSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this._bProcSearch.Location = new System.Drawing.Point(215, 3); - this._bProcSearch.Name = "_bProcSearch"; - this._bProcSearch.Size = new System.Drawing.Size(48, 20); - this._bProcSearch.TabIndex = 5; - this._bProcSearch.Text = "Search"; - this._bProcSearch.UseVisualStyleBackColor = true; - this._bProcSearch.Click += new System.EventHandler(this._bProcSearch_Click); - // - // _tbProcSeach - // - this._tbProcSeach.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this._cbProcTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._tbProcSeach.Location = new System.Drawing.Point(3, 3); - this._tbProcSeach.Name = "_tbProcSeach"; - this._tbProcSeach.Size = new System.Drawing.Size(207, 20); - this._tbProcSeach.TabIndex = 4; - this._tbProcSeach.KeyDown += new System.Windows.Forms.KeyEventHandler(this._tbSearch_KeyDown); + this._cbProcTarget1.DropDownHeight = 500; + this._cbProcTarget1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbProcTarget1.FormattingEnabled = true; + this._cbProcTarget1.IntegralHeight = false; + this._cbProcTarget1.Location = new System.Drawing.Point(3, 90); + this._cbProcTarget1.Name = "_cbProcTarget1"; + this._cbProcTarget1.Size = new System.Drawing.Size(122, 21); + this._cbProcTarget1.TabIndex = 3; + this._cbProcTarget1.SelectedIndexChanged += new System.EventHandler(this.CbProcSpellFamilyNameSelectedIndexChanged); // // _cbProcTarget2 // @@ -1035,411 +1045,240 @@ private void InitializeComponent() this._cbProcTarget2.Name = "_cbProcTarget2"; this._cbProcTarget2.Size = new System.Drawing.Size(119, 21); this._cbProcTarget2.TabIndex = 3; - this._cbProcTarget2.SelectedIndexChanged += new System.EventHandler(this._cbProcSpellFamilyName_SelectedIndexChanged); + this._cbProcTarget2.SelectedIndexChanged += new System.EventHandler(this.CbProcSpellFamilyNameSelectedIndexChanged); // - // _cbProcTarget1 - // - this._cbProcTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._cbProcTarget1.DropDownHeight = 500; - this._cbProcTarget1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcTarget1.FormattingEnabled = true; - this._cbProcTarget1.IntegralHeight = false; - this._cbProcTarget1.Location = new System.Drawing.Point(3, 90); - this._cbProcTarget1.Name = "_cbProcTarget1"; - this._cbProcTarget1.Size = new System.Drawing.Size(122, 21); - this._cbProcTarget1.TabIndex = 3; - this._cbProcTarget1.SelectedIndexChanged += new System.EventHandler(this._cbProcSpellFamilyName_SelectedIndexChanged); - // - // _cbProcSpellEffect + // _tbProcSeach // - this._cbProcSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this._tbProcSeach.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._cbProcSpellEffect.DropDownHeight = 500; - this._cbProcSpellEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcSpellEffect.FormattingEnabled = true; - this._cbProcSpellEffect.IntegralHeight = false; - this._cbProcSpellEffect.Location = new System.Drawing.Point(3, 68); - this._cbProcSpellEffect.Name = "_cbProcSpellEffect"; - this._cbProcSpellEffect.Size = new System.Drawing.Size(260, 21); - this._cbProcSpellEffect.TabIndex = 3; - this._cbProcSpellEffect.SelectedIndexChanged += new System.EventHandler(this._cbProcSpellFamilyName_SelectedIndexChanged); + this._tbProcSeach.Location = new System.Drawing.Point(3, 3); + this._tbProcSeach.Name = "_tbProcSeach"; + this._tbProcSeach.Size = new System.Drawing.Size(207, 20); + this._tbProcSeach.TabIndex = 4; + this._tbProcSeach.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TbSearchKeyDown); // - // _cbProcSpellAura + // _bProcSearch // - this._cbProcSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._cbProcSpellAura.DropDownHeight = 500; - this._cbProcSpellAura.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcSpellAura.FormattingEnabled = true; - this._cbProcSpellAura.IntegralHeight = false; - this._cbProcSpellAura.Location = new System.Drawing.Point(3, 46); - this._cbProcSpellAura.Name = "_cbProcSpellAura"; - this._cbProcSpellAura.Size = new System.Drawing.Size(260, 21); - this._cbProcSpellAura.TabIndex = 2; - this._cbProcSpellAura.SelectedIndexChanged += new System.EventHandler(this._cbProcSpellFamilyName_SelectedIndexChanged); + this._bProcSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._bProcSearch.Location = new System.Drawing.Point(215, 3); + this._bProcSearch.Name = "_bProcSearch"; + this._bProcSearch.Size = new System.Drawing.Size(48, 20); + this._bProcSearch.TabIndex = 5; + this._bProcSearch.Text = "Search"; + this._bProcSearch.UseVisualStyleBackColor = true; + this._bProcSearch.Click += new System.EventHandler(this.BProcSearchClick); // - // _cbProcSpellFamilyName + // _lvProcSpellList // - this._cbProcSpellFamilyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this._lvProcSpellList.AllowColumnReorder = true; + this._lvProcSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._cbProcSpellFamilyName.DropDownHeight = 500; - this._cbProcSpellFamilyName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbProcSpellFamilyName.FormattingEnabled = true; - this._cbProcSpellFamilyName.IntegralHeight = false; - this._cbProcSpellFamilyName.Location = new System.Drawing.Point(3, 24); - this._cbProcSpellFamilyName.Name = "_cbProcSpellFamilyName"; - this._cbProcSpellFamilyName.Size = new System.Drawing.Size(260, 21); - this._cbProcSpellFamilyName.TabIndex = 1; - this._cbProcSpellFamilyName.SelectedIndexChanged += new System.EventHandler(this._cbProcSpellFamilyName_SelectedIndexChanged); - // - // _lvProcAdditionalInfo - // - this._lvProcAdditionalInfo.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this._chID, - this._chName}); - this._lvProcAdditionalInfo.Dock = System.Windows.Forms.DockStyle.Fill; - this._lvProcAdditionalInfo.FullRowSelect = true; - this._lvProcAdditionalInfo.GridLines = true; - this._lvProcAdditionalInfo.Location = new System.Drawing.Point(0, 0); - this._lvProcAdditionalInfo.Name = "_lvProcAdditionalInfo"; - this._lvProcAdditionalInfo.Size = new System.Drawing.Size(864, 64); - this._lvProcAdditionalInfo.SmallImageList = this._ilPro; - this._lvProcAdditionalInfo.TabIndex = 0; - this._lvProcAdditionalInfo.UseCompatibleStateImageBehavior = false; - this._lvProcAdditionalInfo.View = System.Windows.Forms.View.Details; - this._lvProcAdditionalInfo.SelectedIndexChanged += new System.EventHandler(this._lvProcAdditionalInfo_SelectedIndexChanged); - // - // _chID - // - this._chID.Text = "Entry"; - this._chID.Width = 100; - // - // _chName - // - this._chName.Text = "Name"; - this._chName.Width = 685; - // - // _tpCompare - // - this._tpCompare.Controls.Add(this._scCompareRoot); - this._tpCompare.Location = new System.Drawing.Point(4, 22); - this._tpCompare.Name = "_tpCompare"; - this._tpCompare.Padding = new System.Windows.Forms.Padding(3); - this._tpCompare.Size = new System.Drawing.Size(864, 557); - this._tpCompare.TabIndex = 4; - this._tpCompare.Text = "Compare Spells"; - this._tpCompare.UseVisualStyleBackColor = true; - // - // _scCompareRoot - // - this._scCompareRoot.Dock = System.Windows.Forms.DockStyle.Fill; - this._scCompareRoot.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this._scCompareRoot.Location = new System.Drawing.Point(3, 3); - this._scCompareRoot.Name = "_scCompareRoot"; - // - // _scCompareRoot.Panel1 - // - this._scCompareRoot.Panel1.BackColor = System.Drawing.Color.WhiteSmoke; - this._scCompareRoot.Panel1.Controls.Add(this._bCompareSearch1); - this._scCompareRoot.Panel1.Controls.Add(this.label13); - this._scCompareRoot.Panel1.Controls.Add(this._tbCompareFilterSpell1); - this._scCompareRoot.Panel1.Controls.Add(this._rtbCompareSpell1); - // - // _scCompareRoot.Panel2 - // - this._scCompareRoot.Panel2.BackColor = System.Drawing.Color.WhiteSmoke; - this._scCompareRoot.Panel2.Controls.Add(this._bCompareSearch2); - this._scCompareRoot.Panel2.Controls.Add(this.label14); - this._scCompareRoot.Panel2.Controls.Add(this._rtbCompareSpell2); - this._scCompareRoot.Panel2.Controls.Add(this._tbCompareFilterSpell2); - this._scCompareRoot.Size = new System.Drawing.Size(858, 551); - this._scCompareRoot.SplitterDistance = 426; - this._scCompareRoot.TabIndex = 0; + this._lvProcSpellList.FullRowSelect = true; + this._lvProcSpellList.GridLines = true; + this._lvProcSpellList.HideSelection = false; + this._lvProcSpellList.Location = new System.Drawing.Point(2, 117); + this._lvProcSpellList.MultiSelect = false; + this._lvProcSpellList.Name = "_lvProcSpellList"; + this._lvProcSpellList.ShowItemToolTips = true; + this._lvProcSpellList.Size = new System.Drawing.Size(261, 124); + this._lvProcSpellList.TabIndex = 0; + this._lvProcSpellList.UseCompatibleStateImageBehavior = false; + this._lvProcSpellList.View = System.Windows.Forms.View.Details; + this._lvProcSpellList.VirtualMode = true; + this._lvProcSpellList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.LvProcSpellListRetrieveVirtualItem); + this._lvProcSpellList.SelectedIndexChanged += new System.EventHandler(this.LvProcSpellListSelectedIndexChanged); // - // _bCompareSearch1 + // _chProcID // - this._bCompareSearch1.Location = new System.Drawing.Point(238, 1); - this._bCompareSearch1.Name = "_bCompareSearch1"; - this._bCompareSearch1.Size = new System.Drawing.Size(51, 23); - this._bCompareSearch1.TabIndex = 3; - this._bCompareSearch1.Text = "Search"; - this._bCompareSearch1.UseVisualStyleBackColor = true; - this._bCompareSearch1.Click += new System.EventHandler(this.CompareSearch1_Click); + this._chProcID.DisplayIndex = 0; + this._chProcID.Text = "ID"; + this._chProcID.Width = 45; // - // label13 + // _chProcName // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(5, 6); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(61, 13); - this.label13.TabIndex = 2; - this.label13.Text = "ID or Name"; + this._chProcName.DisplayIndex = 1; + this._chProcName.Text = "Name"; + this._chProcName.Width = 210; // - // _tbCompareFilterSpell1 + // _rtbProcSpellInfo // - this._tbCompareFilterSpell1.Location = new System.Drawing.Point(86, 3); - this._tbCompareFilterSpell1.Name = "_tbCompareFilterSpell1"; - this._tbCompareFilterSpell1.Size = new System.Drawing.Size(146, 20); - this._tbCompareFilterSpell1.TabIndex = 1; - this._tbCompareFilterSpell1.TextChanged += new System.EventHandler(this.CompareFilterSpell_TextChanged); + this._rtbProcSpellInfo.BackColor = System.Drawing.SystemColors.MenuBar; + this._rtbProcSpellInfo.Dock = System.Windows.Forms.DockStyle.Fill; + this._rtbProcSpellInfo.Font = new System.Drawing.Font("Arial Unicode MS", 9F); + this._rtbProcSpellInfo.Location = new System.Drawing.Point(0, 0); + this._rtbProcSpellInfo.Name = "_rtbProcSpellInfo"; + this._rtbProcSpellInfo.Size = new System.Drawing.Size(330, 244); + this._rtbProcSpellInfo.TabIndex = 0; + this._rtbProcSpellInfo.Text = ""; // - // _rtbCompareSpell1 + // _tvFamilyTree // - this._rtbCompareSpell1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this._tvFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._rtbCompareSpell1.BackColor = System.Drawing.Color.Gainsboro; - this._rtbCompareSpell1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this._rtbCompareSpell1.Location = new System.Drawing.Point(0, 29); - this._rtbCompareSpell1.Name = "_rtbCompareSpell1"; - this._rtbCompareSpell1.Size = new System.Drawing.Size(423, 522); - this._rtbCompareSpell1.TabIndex = 0; - this._rtbCompareSpell1.Text = ""; - // - // _bCompareSearch2 - // - this._bCompareSearch2.Location = new System.Drawing.Point(243, 1); - this._bCompareSearch2.Name = "_bCompareSearch2"; - this._bCompareSearch2.Size = new System.Drawing.Size(51, 23); - this._bCompareSearch2.TabIndex = 3; - this._bCompareSearch2.Text = "Search"; - this._bCompareSearch2.UseVisualStyleBackColor = true; - this._bCompareSearch2.Click += new System.EventHandler(this.CompareSearch2_Click); - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(10, 6); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(61, 13); - this.label14.TabIndex = 2; - this.label14.Text = "ID or Name"; + this._tvFamilyTree.CheckBoxes = true; + this._tvFamilyTree.LineColor = System.Drawing.Color.Empty; + this._tvFamilyTree.Location = new System.Drawing.Point(1, 23); + this._tvFamilyTree.Name = "_tvFamilyTree"; + this._tvFamilyTree.ShowNodeToolTips = true; + this._tvFamilyTree.Size = new System.Drawing.Size(258, 219); + this._tvFamilyTree.TabIndex = 0; + this._tvFamilyTree.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.FamilyTreeAfterCheck); + this._tvFamilyTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TvFamilyTreeAfterSelect); // - // _rtbCompareSpell2 + // _cbProcSpellFamilyTree // - this._rtbCompareSpell2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this._cbProcSpellFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this._rtbCompareSpell2.BackColor = System.Drawing.Color.Gainsboro; - this._rtbCompareSpell2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this._rtbCompareSpell2.Location = new System.Drawing.Point(3, 29); - this._rtbCompareSpell2.Name = "_rtbCompareSpell2"; - this._rtbCompareSpell2.Size = new System.Drawing.Size(425, 522); - this._rtbCompareSpell2.TabIndex = 0; - this._rtbCompareSpell2.Text = ""; - // - // _tbCompareFilterSpell2 - // - this._tbCompareFilterSpell2.Location = new System.Drawing.Point(91, 3); - this._tbCompareFilterSpell2.Name = "_tbCompareFilterSpell2"; - this._tbCompareFilterSpell2.Size = new System.Drawing.Size(146, 20); - this._tbCompareFilterSpell2.TabIndex = 1; - this._tbCompareFilterSpell2.TextChanged += new System.EventHandler(this.CompareFilterSpell_TextChanged); - // - // _tpSqlData - // - this._tpSqlData.Controls.Add(this.groupBox3); - this._tpSqlData.Controls.Add(this.groupBox2); - this._tpSqlData.Location = new System.Drawing.Point(4, 22); - this._tpSqlData.Name = "_tpSqlData"; - this._tpSqlData.Size = new System.Drawing.Size(864, 557); - this._tpSqlData.TabIndex = 3; - this._tpSqlData.Text = "Sql Data"; - this._tpSqlData.UseVisualStyleBackColor = true; + this._cbProcSpellFamilyTree.DropDownHeight = 500; + this._cbProcSpellFamilyTree.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbProcSpellFamilyTree.FormattingEnabled = true; + this._cbProcSpellFamilyTree.IntegralHeight = false; + this._cbProcSpellFamilyTree.Location = new System.Drawing.Point(1, 2); + this._cbProcSpellFamilyTree.Name = "_cbProcSpellFamilyTree"; + this._cbProcSpellFamilyTree.Size = new System.Drawing.Size(258, 21); + this._cbProcSpellFamilyTree.TabIndex = 1; + this._cbProcSpellFamilyTree.SelectedIndexChanged += new System.EventHandler(this.TvFamilyTreeSelectedIndexChanged); // - // groupBox3 + // _gSpellProcEvent // - this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this._gSpellProcEvent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox3.BackColor = System.Drawing.Color.WhiteSmoke; - this.groupBox3.Controls.Add(this._cbBinaryCompare); - this.groupBox3.Controls.Add(this.label9); - this.groupBox3.Controls.Add(this._tbSqlManual); - this.groupBox3.Controls.Add(this.label8); - this.groupBox3.Controls.Add(this.label12); - this.groupBox3.Controls.Add(this.label11); - this.groupBox3.Controls.Add(this.label10); - this.groupBox3.Controls.Add(this.label7); - this.groupBox3.Controls.Add(this._bSqlProcEx); - this.groupBox3.Controls.Add(this._bSqlProc); - this.groupBox3.Controls.Add(this._bSqlSchool); - this.groupBox3.Controls.Add(this._tbSqlProcEx); - this.groupBox3.Controls.Add(this._tbSqlProc); - this.groupBox3.Controls.Add(this._tbSqlSchool); - this.groupBox3.Controls.Add(this.textBox1); - this.groupBox3.Controls.Add(this._cbSqlSpellFamily); - this.groupBox3.Controls.Add(this._bSelect); - this.groupBox3.Location = new System.Drawing.Point(6, 3); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(855, 85); - this.groupBox3.TabIndex = 1; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Filter"; - // - // _cbBinaryCompare - // - this._cbBinaryCompare.AutoSize = true; - this._cbBinaryCompare.Location = new System.Drawing.Point(752, 55); - this._cbBinaryCompare.Name = "_cbBinaryCompare"; - this._cbBinaryCompare.Size = new System.Drawing.Size(100, 17); - this._cbBinaryCompare.TabIndex = 8; - this._cbBinaryCompare.Text = "Binary Compare"; - this._cbBinaryCompare.UseVisualStyleBackColor = true; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(6, 56); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(45, 13); - this.label9.TabIndex = 7; - this.label9.Text = "Manual:"; - // - // _tbSqlManual - // - this._tbSqlManual.Location = new System.Drawing.Point(81, 53); - this._tbSqlManual.Name = "_tbSqlManual"; - this._tbSqlManual.Size = new System.Drawing.Size(272, 20); - this._tbSqlManual.TabIndex = 6; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(6, 20); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(70, 13); - this.label8.TabIndex = 5; - this.label8.Text = "Family Name:"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(571, 56); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(47, 13); - this.label12.TabIndex = 5; - this.label12.Text = "Proc Ex:"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(376, 56); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(32, 13); - this.label11.TabIndex = 5; - this.label11.Text = "Proc:"; + this._gSpellProcEvent.BackColor = System.Drawing.Color.WhiteSmoke; + this._gSpellProcEvent.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this._gSpellProcEvent.Location = new System.Drawing.Point(4, 0); + this._gSpellProcEvent.Name = "_gSpellProcEvent"; + this._gSpellProcEvent.Size = new System.Drawing.Size(857, 63); + this._gSpellProcEvent.TabIndex = 8; + this._gSpellProcEvent.TabStop = false; // - // label10 + // _tbCooldown // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(571, 20); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(43, 13); - this.label10.TabIndex = 5; - this.label10.Text = "School:"; + this._tbCooldown.Location = new System.Drawing.Point(285, 38); + this._tbCooldown.MaxLength = 10; + this._tbCooldown.Name = "_tbCooldown"; + this._tbCooldown.Size = new System.Drawing.Size(60, 20); + this._tbCooldown.TabIndex = 7; + this._tbCooldown.TextChanged += new System.EventHandler(this.TbCooldownTextChanged); + this._tbCooldown.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxKeyPress); // - // label7 + // label3 // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(376, 20); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(47, 13); - this.label7.TabIndex = 5; - this.label7.Text = "Spell ID:"; + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(225, 41); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(54, 13); + this.label3.TabIndex = 6; // - // _bSqlProcEx + // _tbChance // - this._bSqlProcEx.Location = new System.Drawing.Point(718, 51); - this._bSqlProcEx.Name = "_bSqlProcEx"; - this._bSqlProcEx.Size = new System.Drawing.Size(28, 23); - this._bSqlProcEx.TabIndex = 4; - this._bSqlProcEx.Text = "..."; - this._bSqlProcEx.UseVisualStyleBackColor = true; - this._bSqlProcEx.Click += new System.EventHandler(this.CalcProcFlags_Click); + this._tbChance.Location = new System.Drawing.Point(155, 38); + this._tbChance.MaxLength = 10; + this._tbChance.Name = "_tbChance"; + this._tbChance.Size = new System.Drawing.Size(60, 20); + this._tbChance.TabIndex = 7; + this._tbChance.TextChanged += new System.EventHandler(this.TbCooldownTextChanged); + this._tbChance.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxKeyPress); // - // _bSqlProc + // label2 // - this._bSqlProc.Location = new System.Drawing.Point(535, 51); - this._bSqlProc.Name = "_bSqlProc"; - this._bSqlProc.Size = new System.Drawing.Size(28, 23); - this._bSqlProc.TabIndex = 4; - this._bSqlProc.Text = "..."; - this._bSqlProc.UseVisualStyleBackColor = true; - this._bSqlProc.Click += new System.EventHandler(this.CalcProcFlags_Click); + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(105, 41); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(44, 13); + this.label2.TabIndex = 6; // - // _bSqlSchool + // _tbPPM // - this._bSqlSchool.Location = new System.Drawing.Point(718, 15); - this._bSqlSchool.Name = "_bSqlSchool"; - this._bSqlSchool.Size = new System.Drawing.Size(28, 23); - this._bSqlSchool.TabIndex = 4; - this._bSqlSchool.Text = "..."; - this._bSqlSchool.UseVisualStyleBackColor = true; - this._bSqlSchool.Click += new System.EventHandler(this.CalcProcFlags_Click); + this._tbPPM.Location = new System.Drawing.Point(39, 38); + this._tbPPM.MaxLength = 10; + this._tbPPM.Name = "_tbPPM"; + this._tbPPM.Size = new System.Drawing.Size(60, 20); + this._tbPPM.TabIndex = 7; + this._tbPPM.TextChanged += new System.EventHandler(this.TbCooldownTextChanged); + this._tbPPM.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxKeyPress); // - // _tbSqlProcEx + // label1 // - this._tbSqlProcEx.Location = new System.Drawing.Point(620, 53); - this._tbSqlProcEx.Name = "_tbSqlProcEx"; - this._tbSqlProcEx.Size = new System.Drawing.Size(92, 20); - this._tbSqlProcEx.TabIndex = 3; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 41); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 13); + this.label1.TabIndex = 6; // - // _tbSqlProc + // _cbProcFitstSpellFamily // - this._tbSqlProc.Location = new System.Drawing.Point(429, 53); - this._tbSqlProc.Name = "_tbSqlProc"; - this._tbSqlProc.Size = new System.Drawing.Size(100, 20); - this._tbSqlProc.TabIndex = 3; + this._cbProcFitstSpellFamily.DropDownHeight = 500; + this._cbProcFitstSpellFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbProcFitstSpellFamily.FormattingEnabled = true; + this._cbProcFitstSpellFamily.IntegralHeight = false; + this._cbProcFitstSpellFamily.Location = new System.Drawing.Point(3, 14); + this._cbProcFitstSpellFamily.Name = "_cbProcFitstSpellFamily"; + this._cbProcFitstSpellFamily.Size = new System.Drawing.Size(342, 21); + this._cbProcFitstSpellFamily.TabIndex = 4; + this._cbProcFitstSpellFamily.SelectedIndexChanged += new System.EventHandler(this.ClbSchoolsSelectedIndexChanged); // - // _tbSqlSchool + // _clbSchools // - this._tbSqlSchool.Location = new System.Drawing.Point(620, 17); - this._tbSqlSchool.Name = "_tbSqlSchool"; - this._tbSqlSchool.Size = new System.Drawing.Size(92, 20); - this._tbSqlSchool.TabIndex = 3; + this._clbSchools.CheckOnClick = true; + this._clbSchools.ColumnWidth = 100; + this._clbSchools.Dock = System.Windows.Forms.DockStyle.Right; + this._clbSchools.FormattingEnabled = true; + this._clbSchools.Location = new System.Drawing.Point(391, 16); + this._clbSchools.MultiColumn = true; + this._clbSchools.Name = "_clbSchools"; + this._clbSchools.Size = new System.Drawing.Size(463, 44); + this._clbSchools.TabIndex = 5; + this._clbSchools.SelectedIndexChanged += new System.EventHandler(this.ClbSchoolsSelectedIndexChanged); // - // textBox1 + // groupBox4 // - this.textBox1.Location = new System.Drawing.Point(429, 17); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(100, 20); - this.textBox1.TabIndex = 2; + this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox4.BackColor = System.Drawing.Color.WhiteSmoke; + this.groupBox4.Location = new System.Drawing.Point(3, 60); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(858, 75); + this.groupBox4.TabIndex = 9; + this.groupBox4.TabStop = false; // - // _cbSqlSpellFamily + // _clbProcFlagEx // - this._cbSqlSpellFamily.DropDownHeight = 500; - this._cbSqlSpellFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this._cbSqlSpellFamily.FormattingEnabled = true; - this._cbSqlSpellFamily.IntegralHeight = false; - this._cbSqlSpellFamily.Location = new System.Drawing.Point(81, 17); - this._cbSqlSpellFamily.Name = "_cbSqlSpellFamily"; - this._cbSqlSpellFamily.Size = new System.Drawing.Size(272, 21); - this._cbSqlSpellFamily.TabIndex = 1; + this._clbProcFlagEx.CheckOnClick = true; + this._clbProcFlagEx.ColumnWidth = 120; + this._clbProcFlagEx.Dock = System.Windows.Forms.DockStyle.Fill; + this._clbProcFlagEx.FormattingEnabled = true; + this._clbProcFlagEx.Location = new System.Drawing.Point(3, 16); + this._clbProcFlagEx.MultiColumn = true; + this._clbProcFlagEx.Name = "_clbProcFlagEx"; + this._clbProcFlagEx.Size = new System.Drawing.Size(852, 56); + this._clbProcFlagEx.TabIndex = 3; + this._clbProcFlagEx.SelectedIndexChanged += new System.EventHandler(this.ClbSchoolsSelectedIndexChanged); // - // _bSelect + // groupBox5 // - this._bSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this._bSelect.Location = new System.Drawing.Point(775, 10); - this._bSelect.Name = "_bSelect"; - this._bSelect.Size = new System.Drawing.Size(75, 23); - this._bSelect.TabIndex = 0; - this._bSelect.Text = "Select"; - this._bSelect.UseVisualStyleBackColor = true; - this._bSelect.Click += new System.EventHandler(this.Select_Click); + this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox5.BackColor = System.Drawing.Color.WhiteSmoke; + this.groupBox5.Location = new System.Drawing.Point(3, 128); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(858, 115); + this.groupBox5.TabIndex = 10; + this.groupBox5.TabStop = false; // - // groupBox2 + // _clbProcFlags // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox2.Controls.Add(this.splitContainer6); - this.groupBox2.Location = new System.Drawing.Point(0, 94); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(864, 463); - this.groupBox2.TabIndex = 0; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Spell Proc Event (Select item and press Enter or Mouse double click)"; + this._clbProcFlags.CheckOnClick = true; + this._clbProcFlags.ColumnWidth = 170; + this._clbProcFlags.Dock = System.Windows.Forms.DockStyle.Fill; + this._clbProcFlags.FormattingEnabled = true; + this._clbProcFlags.Location = new System.Drawing.Point(3, 16); + this._clbProcFlags.MultiColumn = true; + this._clbProcFlags.Name = "_clbProcFlags"; + this._clbProcFlags.Size = new System.Drawing.Size(852, 96); + this._clbProcFlags.TabIndex = 0; + this._clbProcFlags.SelectedIndexChanged += new System.EventHandler(this.ClbSchoolsSelectedIndexChanged); // // splitContainer6 // @@ -1455,12 +1294,43 @@ private void InitializeComponent() // splitContainer6.Panel2 // this.splitContainer6.Panel2.BackColor = System.Drawing.Color.WhiteSmoke; - this.splitContainer6.Panel2.Controls.Add(this._rtbSqlLog); - this.splitContainer6.Panel2.Controls.Add(this._bSqlToBase); - this.splitContainer6.Panel2.Controls.Add(this._bSqlSave); this.splitContainer6.Size = new System.Drawing.Size(858, 444); this.splitContainer6.SplitterDistance = 229; this.splitContainer6.TabIndex = 0; + this.splitContainer6.Panel2.Controls.Add(this._rtbSqlLog); + this.splitContainer6.Panel2.Controls.Add(this._bSqlToBase); + this.splitContainer6.Panel2.Controls.Add(this._bSqlSave); + // + // _bSqlSave + // + this._bSqlSave.Location = new System.Drawing.Point(3, 3); + this._bSqlSave.Name = "_bSqlSave"; + this._bSqlSave.Size = new System.Drawing.Size(75, 23); + this._bSqlSave.TabIndex = 1; + this._bSqlSave.Text = "Save"; + this._bSqlSave.UseVisualStyleBackColor = true; + this._bSqlSave.Click += new System.EventHandler(this.SqlSaveClick); + // + // _bSqlToBase + // + this._bSqlToBase.Location = new System.Drawing.Point(84, 3); + this._bSqlToBase.Name = "_bSqlToBase"; + this._bSqlToBase.Size = new System.Drawing.Size(75, 23); + this._bSqlToBase.TabIndex = 2; + this._bSqlToBase.Text = "To DB"; + this._bSqlToBase.UseVisualStyleBackColor = true; + this._bSqlToBase.Click += new System.EventHandler(this.SqlToBaseClick); + // + // _rtbSqlLog + // + this._rtbSqlLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._rtbSqlLog.Location = new System.Drawing.Point(0, 32); + this._rtbSqlLog.Name = "_rtbSqlLog"; + this._rtbSqlLog.Size = new System.Drawing.Size(858, 182); + this._rtbSqlLog.TabIndex = 3; + this._rtbSqlLog.Text = ""; // // _lvDataList // @@ -1469,15 +1339,9 @@ private void InitializeComponent() this.spellname, this.schoolmask, this.spellfamilyname, - this.spellfamilymaskA0, - this.spellfamilymaskA1, - this.spellfamilymaskA2, - this.spellfamilymaskB0, - this.spellfamilymaskB1, - this.spellfamilymaskB2, - this.spellfamilymaskC0, - this.spellfamilymaskC1, - this.spellfamilymaskC2, + this.spellfamilymask0, + this.spellfamilymask1, + this.spellfamilymask2, this.procflag, this.procEx, this.ppmRate, @@ -1495,218 +1359,274 @@ private void InitializeComponent() this._lvDataList.UseCompatibleStateImageBehavior = false; this._lvDataList.View = System.Windows.Forms.View.Details; this._lvDataList.VirtualMode = true; - this._lvDataList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this._lvSqlData_RetrieveVirtualItem); - this._lvDataList.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Sql_DataList_KeyDown); - this._lvDataList.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Sql_DataList_MouseDoubleClick); + this._lvDataList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.LvSqlDataRetrieveVirtualItem); + this._lvDataList.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SqlDataListKeyDown); + this._lvDataList.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SqlDataListMouseDoubleClick); // // entry // + this.entry.DisplayIndex = 0; this.entry.Text = "Entry"; this.entry.Width = 56; // // spellname // + this.spellname.DisplayIndex = 1; this.spellname.Text = "Spell Name"; this.spellname.Width = 300; // // schoolmask // + this.schoolmask.DisplayIndex = 2; this.schoolmask.Text = "School Mask"; this.schoolmask.Width = 78; // // spellfamilyname // + this.spellfamilyname.DisplayIndex = 3; this.spellfamilyname.Text = "Spell Family Name"; this.spellfamilyname.Width = 103; // - // spellfamilymaskA0 - // - this.spellfamilymaskA0.Text = "Spell Family Mask A 0"; - this.spellfamilymaskA0.Width = 120; - // - // spellfamilymaskA1 - // - this.spellfamilymaskA1.Text = "Spell Family Mask A 1"; - this.spellfamilymaskA1.Width = 120; - // - // spellfamilymaskA2 - // - this.spellfamilymaskA2.Text = "Spell Family Mask A 2"; - this.spellfamilymaskA2.Width = 120; + // spellfamilymask0 // - // spellfamilymaskB0 + this.spellfamilymask0.DisplayIndex = 4; + this.spellfamilymask0.Text = "Spell Family Mask 0"; + this.spellfamilymask0.Width = 110; // - this.spellfamilymaskB0.Text = "Spell Family Mask B 0"; - this.spellfamilymaskB0.Width = 120; + // spellfamilymask1 // - // spellfamilymaskB1 + this.spellfamilymask1.DisplayIndex = 5; + this.spellfamilymask1.Text = "Spell Family Mask 1"; + this.spellfamilymask1.Width = 110; // - this.spellfamilymaskB1.Text = "Spell Family Mask B 1"; - this.spellfamilymaskB1.Width = 120; + // spellfamilymask2 // - // spellfamilymaskB2 - // - this.spellfamilymaskB2.Text = "Spell Family Mask B 2"; - this.spellfamilymaskB2.Width = 120; - // - // spellfamilymaskC0 - // - this.spellfamilymaskC0.Text = "Spell Family Mask C 0"; - this.spellfamilymaskC0.Width = 120; - // - // spellfamilymaskC1 - // - this.spellfamilymaskC1.Text = "Spell Family Mask C 1"; - this.spellfamilymaskC1.Width = 120; - // - // spellfamilymaskC2 - // - this.spellfamilymaskC2.Text = "Spell Family Mask C 2"; - this.spellfamilymaskC2.Width = 120; + this.spellfamilymask2.DisplayIndex = 6; + this.spellfamilymask2.Text = "Spell Family Mask 2"; + this.spellfamilymask2.Width = 110; // // procflag // + this.procflag.DisplayIndex = 7; this.procflag.Text = "Proc Flags"; this.procflag.Width = 80; // // procEx // + this.procEx.DisplayIndex = 8; this.procEx.Text = "Proc Ex"; this.procEx.Width = 80; // // ppmRate // + this.ppmRate.DisplayIndex = 9; this.ppmRate.Text = "PPM Rate"; this.ppmRate.Width = 67; // // customchance // + this.customchance.DisplayIndex = 10; this.customchance.Text = "Custom Chance"; this.customchance.Width = 93; // // cooldown // + this.cooldown.DisplayIndex = 11; this.cooldown.Text = "Colldown"; + // + // _bSelect + // + this._bSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this._bSelect.Location = new System.Drawing.Point(775, 10); + this._bSelect.Name = "_bSelect"; + this._bSelect.Size = new System.Drawing.Size(75, 23); + this._bSelect.TabIndex = 0; + this._bSelect.Text = "Select"; + this._bSelect.UseVisualStyleBackColor = true; + this._bSelect.Click += new System.EventHandler(this.SelectClick); // - // _rtbSqlLog + // _cbSqlSpellFamily // - this._rtbSqlLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._rtbSqlLog.Location = new System.Drawing.Point(0, 32); - this._rtbSqlLog.Name = "_rtbSqlLog"; - this._rtbSqlLog.Size = new System.Drawing.Size(858, 182); - this._rtbSqlLog.TabIndex = 3; - this._rtbSqlLog.Text = ""; + this._cbSqlSpellFamily.DropDownHeight = 500; + this._cbSqlSpellFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this._cbSqlSpellFamily.FormattingEnabled = true; + this._cbSqlSpellFamily.IntegralHeight = false; + this._cbSqlSpellFamily.Location = new System.Drawing.Point(81, 17); + this._cbSqlSpellFamily.Name = "_cbSqlSpellFamily"; + this._cbSqlSpellFamily.Size = new System.Drawing.Size(272, 21); + this._cbSqlSpellFamily.TabIndex = 1; // - // _bSqlToBase + // textBox1 // - this._bSqlToBase.Location = new System.Drawing.Point(84, 3); - this._bSqlToBase.Name = "_bSqlToBase"; - this._bSqlToBase.Size = new System.Drawing.Size(75, 23); - this._bSqlToBase.TabIndex = 2; - this._bSqlToBase.Text = "To DB"; - this._bSqlToBase.UseVisualStyleBackColor = true; - this._bSqlToBase.Click += new System.EventHandler(this.SqlToBase_Click); + this.textBox1.Location = new System.Drawing.Point(429, 17); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 2; // - // _bSqlSave + // _tbSqlSchool // - this._bSqlSave.Location = new System.Drawing.Point(3, 3); - this._bSqlSave.Name = "_bSqlSave"; - this._bSqlSave.Size = new System.Drawing.Size(75, 23); - this._bSqlSave.TabIndex = 1; - this._bSqlSave.Text = "Save"; - this._bSqlSave.UseVisualStyleBackColor = true; - this._bSqlSave.Click += new System.EventHandler(this.SqlSave_Click); + this._tbSqlSchool.Location = new System.Drawing.Point(620, 17); + this._tbSqlSchool.Name = "_tbSqlSchool"; + this._tbSqlSchool.Size = new System.Drawing.Size(92, 20); + this._tbSqlSchool.TabIndex = 3; + // + // _tbSqlProc + // + this._tbSqlProc.Location = new System.Drawing.Point(429, 53); + this._tbSqlProc.Name = "_tbSqlProc"; + this._tbSqlProc.Size = new System.Drawing.Size(100, 20); + this._tbSqlProc.TabIndex = 3; + // + // _tbSqlProcEx + // + this._tbSqlProcEx.Location = new System.Drawing.Point(620, 53); + this._tbSqlProcEx.Name = "_tbSqlProcEx"; + this._tbSqlProcEx.Size = new System.Drawing.Size(92, 20); + this._tbSqlProcEx.TabIndex = 3; + // + // _bSqlSchool + // + this._bSqlSchool.Location = new System.Drawing.Point(718, 15); + this._bSqlSchool.Name = "_bSqlSchool"; + this._bSqlSchool.Size = new System.Drawing.Size(28, 23); + this._bSqlSchool.TabIndex = 4; + this._bSqlSchool.Text = "..."; + this._bSqlSchool.UseVisualStyleBackColor = true; + this._bSqlSchool.Click += new System.EventHandler(this.CalcProcFlagsClick); + // + // _bSqlProc + // + this._bSqlProc.Location = new System.Drawing.Point(535, 51); + this._bSqlProc.Name = "_bSqlProc"; + this._bSqlProc.Size = new System.Drawing.Size(28, 23); + this._bSqlProc.TabIndex = 4; + this._bSqlProc.Text = "..."; + this._bSqlProc.UseVisualStyleBackColor = true; + this._bSqlProc.Click += new System.EventHandler(this.CalcProcFlagsClick); + // + // _bSqlProcEx + // + this._bSqlProcEx.Location = new System.Drawing.Point(718, 51); + this._bSqlProcEx.Name = "_bSqlProcEx"; + this._bSqlProcEx.Size = new System.Drawing.Size(28, 23); + this._bSqlProcEx.TabIndex = 4; + this._bSqlProcEx.Text = "..."; + this._bSqlProcEx.UseVisualStyleBackColor = true; + this._bSqlProcEx.Click += new System.EventHandler(this.CalcProcFlagsClick); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(376, 20); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(47, 13); + this.label7.TabIndex = 5; + this.label7.Text = "Spell ID:"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(571, 20); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(43, 13); + this.label10.TabIndex = 5; + this.label10.Text = "School:"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(376, 56); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(32, 13); + this.label11.TabIndex = 5; + this.label11.Text = "Proc:"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(571, 56); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(47, 13); + this.label12.TabIndex = 5; + this.label12.Text = "Proc Ex:"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(6, 20); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(70, 13); + this.label8.TabIndex = 5; + this.label8.Text = "Family Name:"; + // + // _tbSqlManual + // + this._tbSqlManual.Location = new System.Drawing.Point(81, 53); + this._tbSqlManual.Name = "_tbSqlManual"; + this._tbSqlManual.Size = new System.Drawing.Size(272, 20); + this._tbSqlManual.TabIndex = 6; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(6, 56); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(45, 13); + this.label9.TabIndex = 7; + this.label9.Text = "Manual:"; + // + // _cbBinaryCompare + // + this._cbBinaryCompare.AutoSize = true; + this._cbBinaryCompare.Location = new System.Drawing.Point(752, 55); + this._cbBinaryCompare.Name = "_cbBinaryCompare"; + this._cbBinaryCompare.Size = new System.Drawing.Size(100, 17); + this._cbBinaryCompare.TabIndex = 8; + this._cbBinaryCompare.Text = "Binary Compare"; + this._cbBinaryCompare.UseVisualStyleBackColor = true; // // _cbProcFlag // this._cbProcFlag.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._cbProcFlag.Appearance = System.Windows.Forms.Appearance.Button; this._cbProcFlag.AutoSize = true; - this._cbProcFlag.Location = new System.Drawing.Point(809, 1); + this._cbProcFlag.Location = new System.Drawing.Point(743, 1); this._cbProcFlag.Name = "_cbProcFlag"; this._cbProcFlag.Size = new System.Drawing.Size(59, 23); this._cbProcFlag.TabIndex = 2; this._cbProcFlag.Text = "ProcFlag"; this._cbProcFlag.UseVisualStyleBackColor = true; this._cbProcFlag.Visible = false; - this._cbProcFlag.CheckedChanged += new System.EventHandler(this._cbProcFlag_CheckedChanged); + this._cbProcFlag.CheckedChanged += new System.EventHandler(this.CbProcFlagCheckedChanged); // // _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(728, 1); + this._bWrite.Location = new System.Drawing.Point(686, 1); this._bWrite.Name = "_bWrite"; - this._bWrite.Size = new System.Drawing.Size(75, 23); + this._bWrite.Size = new System.Drawing.Size(51, 23); this._bWrite.TabIndex = 3; this._bWrite.Text = "Write"; this._bWrite.UseVisualStyleBackColor = true; this._bWrite.Visible = false; - this._bWrite.Click += new System.EventHandler(this.Write_Click); - // - // splitContainer7 - // - this.splitContainer7.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer7.Location = new System.Drawing.Point(0, 0); - this.splitContainer7.Name = "splitContainer7"; - // - // splitContainer7.Panel1 - // - this.splitContainer7.Panel1.Controls.Add(this.splitContainer8); - this.splitContainer7.Panel1.Controls.Add(this.richTextBox1); - // - // splitContainer7.Panel2 - // - this.splitContainer7.Panel2.Controls.Add(this.richTextBox2); - this.splitContainer7.Size = new System.Drawing.Size(858, 429); - this.splitContainer7.SplitterDistance = 424; - this.splitContainer7.TabIndex = 0; - // - // splitContainer8 - // - this.splitContainer8.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer8.Location = new System.Drawing.Point(0, 0); - this.splitContainer8.Name = "splitContainer8"; - // - // splitContainer8.Panel1 - // - this.splitContainer8.Panel1.Controls.Add(this.textBox2); - this.splitContainer8.Size = new System.Drawing.Size(424, 429); - this.splitContainer8.SplitterDistance = 209; - this.splitContainer8.TabIndex = 0; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(19, 12); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(100, 20); - this.textBox2.TabIndex = 0; - // - // richTextBox1 - // - this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.richTextBox1.Location = new System.Drawing.Point(0, 0); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(424, 429); - this.richTextBox1.TabIndex = 0; - this.richTextBox1.Text = ""; + this._bWrite.Click += new System.EventHandler(this.WriteClick); // - // richTextBox2 + // _bLevelScaling // - this.richTextBox2.Dock = System.Windows.Forms.DockStyle.Fill; - this.richTextBox2.Location = new System.Drawing.Point(0, 0); - this.richTextBox2.Name = "richTextBox2"; - this.richTextBox2.Size = new System.Drawing.Size(430, 429); - this.richTextBox2.TabIndex = 0; - this.richTextBox2.Text = ""; + this._bLevelScaling.Location = new System.Drawing.Point(808, 1); + this._bLevelScaling.Name = "_bLevelScaling"; + this._bLevelScaling.Size = new System.Drawing.Size(60, 23); + this._bLevelScaling.TabIndex = 4; + this._bLevelScaling.Text = "Scaling"; + this._bLevelScaling.UseVisualStyleBackColor = true; + this._bLevelScaling.Click += new System.EventHandler(this.LevelScalingClick); // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(872, 629); + this.Controls.Add(this._bLevelScaling); this.Controls.Add(this._bWrite); this.Controls.Add(this._cbProcFlag); this.Controls.Add(this.tabControl1); @@ -1718,15 +1638,30 @@ private void InitializeComponent() this.Name = "FormMain"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "FormMain"; - this.Resize += new System.EventHandler(this.FormMain_Resize); + this.Resize += new System.EventHandler(this.FormMainResize); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); - this.tabControl1.ResumeLayout(false); + this.splitContainer7.Panel1.ResumeLayout(false); + this.splitContainer7.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer7)).EndInit(); + this.splitContainer7.ResumeLayout(false); + this.splitContainer8.Panel1.ResumeLayout(false); + this.splitContainer8.Panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer8)).EndInit(); + this.splitContainer8.ResumeLayout(false); + this._tpCompare.ResumeLayout(false); + this._scCompareRoot.Panel1.ResumeLayout(false); + this._scCompareRoot.Panel1.PerformLayout(); + this._scCompareRoot.Panel2.ResumeLayout(false); + this._scCompareRoot.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this._scCompareRoot)).EndInit(); + this._scCompareRoot.ResumeLayout(false); this._tpSpellInfo.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this._gSpellFilter.ResumeLayout(false); @@ -1734,184 +1669,153 @@ private void InitializeComponent() this._gbAdvansedSearch.PerformLayout(); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); + this.tabControl1.ResumeLayout(false); this._tpSpellProcInfo.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); + this._tpSqlData.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); this.splitContainer3.ResumeLayout(false); - this.groupBox5.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); - this._gSpellProcEvent.ResumeLayout(false); - this._gSpellProcEvent.PerformLayout(); - this.splitContainer4.Panel1.ResumeLayout(false); - this.splitContainer4.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); this.splitContainer4.ResumeLayout(false); - this.splitContainer5.Panel1.ResumeLayout(false); - this.splitContainer5.Panel2.ResumeLayout(false); - this.splitContainer5.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).EndInit(); this.splitContainer5.ResumeLayout(false); - this._tpCompare.ResumeLayout(false); - this._scCompareRoot.Panel1.ResumeLayout(false); - this._scCompareRoot.Panel1.PerformLayout(); - this._scCompareRoot.Panel2.ResumeLayout(false); - this._scCompareRoot.Panel2.PerformLayout(); - this._scCompareRoot.ResumeLayout(false); - this._tpSqlData.ResumeLayout(false); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.splitContainer6.Panel1.ResumeLayout(false); - this.splitContainer6.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer6)).EndInit(); this.splitContainer6.ResumeLayout(false); - this.splitContainer7.Panel1.ResumeLayout(false); - this.splitContainer7.Panel2.ResumeLayout(false); - this.splitContainer7.ResumeLayout(false); - this.splitContainer8.Panel1.ResumeLayout(false); - this.splitContainer8.Panel1.PerformLayout(); - this.splitContainer8.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } - #endregion - private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.ToolStripStatusLabel _status; + private System.Windows.Forms.ToolStripStatusLabel _ProcStatus; + private System.Windows.Forms.ToolStripStatusLabel _dbConnect; + private System.Windows.Forms.SplitContainer splitContainer7; + private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.RichTextBox richTextBox2; + private System.Windows.Forms.SplitContainer splitContainer8; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.ImageList _ilPro; + private System.Windows.Forms.TabPage _tpCompare; + private System.Windows.Forms.SplitContainer _scCompareRoot; + private System.Windows.Forms.Button _bCompareSearch1; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox _tbCompareFilterSpell1; + private System.Windows.Forms.RichTextBox _rtbCompareSpell1; + private System.Windows.Forms.Button _bCompareSearch2; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.RichTextBox _rtbCompareSpell2; + private System.Windows.Forms.TextBox _tbCompareFilterSpell2; private System.Windows.Forms.TabPage _tpSpellInfo; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.RichTextBox _rtSpellInfo; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Button _bSearch; - private System.Windows.Forms.TextBox _tbSearchId; - private System.Windows.Forms.ComboBox _cbSpellFamilyName; private System.Windows.Forms.ListView _lvSpellList; private System.Windows.Forms.ColumnHeader chSpellID; private System.Windows.Forms.ColumnHeader chSpellName; + private System.Windows.Forms.GroupBox _gSpellFilter; + private System.Windows.Forms.GroupBox _gbAdvansedSearch; + private System.Windows.Forms.ComboBox _cbAdvancedFilter2CompareType; + private System.Windows.Forms.ComboBox _cbAdvancedFilter1CompareType; + private System.Windows.Forms.TextBox _tbAdvancedFilter2Val; + private System.Windows.Forms.TextBox _tbAdvancedFilter1Val; + private System.Windows.Forms.ComboBox _cbAdvancedFilter2; + private System.Windows.Forms.ComboBox _cbAdvancedFilter1; + private System.Windows.Forms.ComboBox _cbTarget2; private System.Windows.Forms.ComboBox _cbTarget1; private System.Windows.Forms.ComboBox _cbSpellEffect; private System.Windows.Forms.ComboBox _cbSpellAura; + private System.Windows.Forms.ComboBox _cbSpellFamilyName; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button _bSearch; + private System.Windows.Forms.TextBox _tbSearchAttributes; + private System.Windows.Forms.TextBox _tbSearchIcon; + private System.Windows.Forms.TextBox _tbSearchId; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.ToolStripMenuItem _tsmHelp; + private System.Windows.Forms.ToolStripMenuItem _tsmAbout; private System.Windows.Forms.TabPage _tpSpellProcInfo; + private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.TabPage _tpSqlData; + private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.ListView _lvProcAdditionalInfo; + private System.Windows.Forms.ColumnHeader _chID; + private System.Windows.Forms.ColumnHeader _chName; private System.Windows.Forms.SplitContainer splitContainer3; private System.Windows.Forms.SplitContainer splitContainer4; private System.Windows.Forms.SplitContainer splitContainer5; - private System.Windows.Forms.ComboBox _cbProcSpellEffect; - private System.Windows.Forms.ComboBox _cbProcSpellAura; private System.Windows.Forms.ComboBox _cbProcSpellFamilyName; - private System.Windows.Forms.ListView _lvProcSpellList; + private System.Windows.Forms.ComboBox _cbProcSpellAura; + private System.Windows.Forms.ComboBox _cbProcSpellEffect; + private System.Windows.Forms.ComboBox _cbProcTarget1; + private System.Windows.Forms.ComboBox _cbProcTarget2; private System.Windows.Forms.TextBox _tbProcSeach; private System.Windows.Forms.Button _bProcSearch; - private System.Windows.Forms.ListView _lvProcAdditionalInfo; - private System.Windows.Forms.TreeView _tvFamilyTree; - private System.Windows.Forms.ComboBox _cbProcSpellFamilyTree; - private System.Windows.Forms.RichTextBox _rtbProcSpellInfo; - private System.Windows.Forms.ColumnHeader _chID; - private System.Windows.Forms.ColumnHeader _chName; - private System.Windows.Forms.ToolStripStatusLabel _status; - private System.Windows.Forms.ComboBox _cbTarget2; - private System.Windows.Forms.CheckBox _cbProcFlag; - private System.Windows.Forms.CheckedListBox _clbProcFlags; - private System.Windows.Forms.SplitContainer splitContainer6; - private System.Windows.Forms.ListView _lvDataList; - private System.Windows.Forms.ToolStripMenuItem _tsmFile; - private System.Windows.Forms.ToolStripMenuItem _tsmExit; - private System.Windows.Forms.ToolStripMenuItem _tsmHelp; - private System.Windows.Forms.ToolStripMenuItem _tsmAbout; - private System.Windows.Forms.ComboBox _cbProcTarget2; - private System.Windows.Forms.ComboBox _cbProcTarget1; + private System.Windows.Forms.ListView _lvProcSpellList; private System.Windows.Forms.ColumnHeader _chProcID; private System.Windows.Forms.ColumnHeader _chProcName; - private System.Windows.Forms.ToolStripMenuItem _tsmSettings; - private System.Windows.Forms.CheckedListBox _clbProcFlagEx; - private System.Windows.Forms.CheckedListBox _clbSchools; - private System.Windows.Forms.ComboBox _cbProcFitstSpellFamily; - private System.Windows.Forms.ToolStripStatusLabel _ProcStatus; + private System.Windows.Forms.RichTextBox _rtbProcSpellInfo; + private System.Windows.Forms.TreeView _tvFamilyTree; + private System.Windows.Forms.ComboBox _cbProcSpellFamilyTree; + private System.Windows.Forms.GroupBox _gSpellProcEvent; private System.Windows.Forms.TextBox _tbCooldown; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox _tbChance; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox _tbPPM; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button _bWrite; - private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.ComboBox _cbProcFitstSpellFamily; + private System.Windows.Forms.CheckedListBox _clbSchools; private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.GroupBox _gSpellProcEvent; - private System.Windows.Forms.GroupBox groupBox7; - private System.Windows.Forms.GroupBox _gSpellFilter; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox _tbSearchAttributes; - private System.Windows.Forms.TextBox _tbSearchIcon; + private System.Windows.Forms.CheckedListBox _clbProcFlagEx; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.CheckedListBox _clbProcFlags; + private System.Windows.Forms.SplitContainer splitContainer6; + private System.Windows.Forms.Button _bSqlSave; + private System.Windows.Forms.Button _bSqlToBase; + private System.Windows.Forms.RichTextBox _rtbSqlLog; + private System.Windows.Forms.ListView _lvDataList; private System.Windows.Forms.ColumnHeader entry; + private System.Windows.Forms.ColumnHeader spellname; private System.Windows.Forms.ColumnHeader schoolmask; private System.Windows.Forms.ColumnHeader spellfamilyname; - private System.Windows.Forms.ColumnHeader spellfamilymaskA0; - private System.Windows.Forms.ColumnHeader spellfamilymaskA1; - private System.Windows.Forms.ColumnHeader spellfamilymaskA2; + private System.Windows.Forms.ColumnHeader spellfamilymask0; + private System.Windows.Forms.ColumnHeader spellfamilymask1; + private System.Windows.Forms.ColumnHeader spellfamilymask2; private System.Windows.Forms.ColumnHeader procflag; private System.Windows.Forms.ColumnHeader procEx; private System.Windows.Forms.ColumnHeader ppmRate; private System.Windows.Forms.ColumnHeader customchance; private System.Windows.Forms.ColumnHeader cooldown; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.ColumnHeader spellname; - private System.Windows.Forms.Button _bSqlToBase; - private System.Windows.Forms.Button _bSqlSave; private System.Windows.Forms.Button _bSelect; - private System.Windows.Forms.ToolStripMenuItem _Connected; - private System.Windows.Forms.ToolStripStatusLabel _dbConnect; - private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.ComboBox _cbSqlSpellFamily; - private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox _tbSqlSchool; + private System.Windows.Forms.TextBox _tbSqlProc; + private System.Windows.Forms.TextBox _tbSqlProcEx; + private System.Windows.Forms.Button _bSqlSchool; + private System.Windows.Forms.Button _bSqlProc; + private System.Windows.Forms.Button _bSqlProcEx; private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label10; - private System.Windows.Forms.Button _bSqlProcEx; - private System.Windows.Forms.Button _bSqlProc; - private System.Windows.Forms.Button _bSqlSchool; - private System.Windows.Forms.TextBox _tbSqlProcEx; - private System.Windows.Forms.TextBox _tbSqlProc; - private System.Windows.Forms.TextBox _tbSqlSchool; - private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label8; private System.Windows.Forms.TextBox _tbSqlManual; + private System.Windows.Forms.Label label9; private System.Windows.Forms.CheckBox _cbBinaryCompare; - private System.Windows.Forms.TabPage _tpCompare; - private System.Windows.Forms.SplitContainer splitContainer7; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.Windows.Forms.RichTextBox richTextBox2; - private System.Windows.Forms.SplitContainer splitContainer8; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.SplitContainer _scCompareRoot; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.TextBox _tbCompareFilterSpell1; - private System.Windows.Forms.RichTextBox _rtbCompareSpell1; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.RichTextBox _rtbCompareSpell2; - private System.Windows.Forms.TextBox _tbCompareFilterSpell2; - private System.Windows.Forms.Button _bCompareSearch1; - private System.Windows.Forms.Button _bCompareSearch2; - private System.Windows.Forms.GroupBox _gbAdvansedSearch; - private System.Windows.Forms.TextBox _tbAdvancedFilter2Val; - private System.Windows.Forms.TextBox _tbAdvancedFilter1Val; - private System.Windows.Forms.ComboBox _cbAdvancedFilter2; - private System.Windows.Forms.ComboBox _cbAdvancedFilter1; - private System.Windows.Forms.RichTextBox _rtbSqlLog; - private System.Windows.Forms.ImageList _ilPro; - private System.Windows.Forms.ColumnHeader spellfamilymaskB0; - private System.Windows.Forms.ColumnHeader spellfamilymaskB1; - private System.Windows.Forms.ColumnHeader spellfamilymaskB2; - private System.Windows.Forms.ColumnHeader spellfamilymaskC0; - private System.Windows.Forms.ColumnHeader spellfamilymaskC1; - private System.Windows.Forms.ColumnHeader spellfamilymaskC2; - private System.Windows.Forms.ComboBox _cbAdvancedFilter2CompareType; - private System.Windows.Forms.ComboBox _cbAdvancedFilter1CompareType; + private System.Windows.Forms.CheckBox _cbProcFlag; + private System.Windows.Forms.Button _bWrite; + private System.Windows.Forms.ToolStripMenuItem _tsmFile; + private System.Windows.Forms.ToolStripMenuItem _Connected; + private System.Windows.Forms.ToolStripMenuItem _tsmSettings; + private System.Windows.Forms.ToolStripMenuItem _tsmExit; + private System.Windows.Forms.Button _bLevelScaling; } } \ No newline at end of file diff --git a/SpellWork/Forms/FormMain.cs b/SpellWork/Forms/FormMain.cs index 0816a0b5..c96dc52d 100644 --- a/SpellWork/Forms/FormMain.cs +++ b/SpellWork/Forms/FormMain.cs @@ -1,23 +1,26 @@ using System; -using System.Linq; -using System.Windows.Forms; +using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Text; -using System.Collections.Generic; +using System.Linq; using System.Reflection; -using System.Threading; +using System.Text; +using System.Windows.Forms; +using SpellWork.Database; +using SpellWork.DBC.Structures; +using SpellWork.Extensions; +using SpellWork.Spell; -namespace SpellWork +namespace SpellWork.Forms { - public partial class FormMain : Form + public sealed partial class FormMain : Form { public FormMain() { InitializeComponent(); splitContainer3.SplitterDistance = 128; - - Text = DBC.VERSION; + + Text = DBC.DBC.Version; _cbSpellFamilyName.SetEnumValues("SpellFamilyName"); _cbSpellAura.SetEnumValues("Aura"); @@ -40,10 +43,8 @@ public FormMain() _cbSqlSpellFamily.SetEnumValues("SpellFamilyName"); - _status.Text = String.Format("DBC Locale: {0}", DBC.Locale); - - _cbAdvancedFilter1.SetStructFields(); - _cbAdvancedFilter2.SetStructFields(); + _cbAdvancedFilter1.SetStructFields(); + _cbAdvancedFilter2.SetStructFields(); _cbAdvancedFilter1CompareType.SetEnumValuesDirect(true); _cbAdvancedFilter2CompareType.SetEnumValuesDirect(true); @@ -53,134 +54,151 @@ public FormMain() #region FORM - private void Exit_Click(object sender, EventArgs e) + private void ExitClick(object sender, EventArgs e) { Application.Exit(); } - private void About_Click(object sender, EventArgs e) + private void AboutClick(object sender, EventArgs e) { - FormAboutBox ab = new FormAboutBox(); + var ab = new FormAboutBox(); ab.ShowDialog(); } - private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + private void TabControl1SelectedIndexChanged(object sender, EventArgs e) { _cbProcFlag.Visible = _bWrite.Visible = ((TabControl)sender).SelectedIndex == 1; } - private void Settings_Click(object sender, EventArgs e) + private void SettingsClick(object sender, EventArgs e) { - FormSettings frm = new FormSettings(); + var frm = new FormSettings(); frm.ShowDialog(this); ConnStatus(); } - private void FormMain_Resize(object sender, EventArgs e) + private void FormMainResize(object sender, EventArgs e) { try { - // Чтобы панели в сплит контейнере были одинаковы при изменении размера формы, сделаем так. - // Может можно как-то можно через привязки, но я пока незнаю как _scCompareRoot.SplitterDistance = (((Form)sender).Size.Width / 2) - 25; _chName.Width = (((Form)sender).Size.Width - 140); } - catch { } + // ReSharper disable EmptyGeneralCatchClause + catch (Exception) + // ReSharper restore EmptyGeneralCatchClause + { + } } private void ConnStatus() { - MySQLConnect.TestConnect(); + MySqlConnection.TestConnect(); - if (MySQLConnect.Connected) + if (MySqlConnection.Connected) { - _dbConnect.Text = "Connection is successfully"; + _dbConnect.Text = @"Connection successful."; _dbConnect.ForeColor = Color.Green; - // read db data - DBC.ItemTemplate = MySQLConnect.SelectItems(); + Database.MySqlConnection.AddDBItems(); } else { - _dbConnect.Text = "No DB Connected"; + _dbConnect.Text = @"No DB Connected"; _dbConnect.ForeColor = Color.Red; } } - private void _Connected_Click(object sender, EventArgs e) + private void ConnectedClick(object sender, EventArgs e) { - MySQLConnect.TestConnect(); + MySqlConnection.TestConnect(); - if (MySQLConnect.Connected) - MessageBox.Show("Connection is successfully!", "MySQL Connections!", MessageBoxButtons.OK, MessageBoxIcon.Information); + if (MySqlConnection.Connected) + MessageBox.Show(@"Connection is successful!", @"MySQL Connections!", MessageBoxButtons.OK, + MessageBoxIcon.Information); else - MessageBox.Show("Connection is failed!", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(@"Connection failed!", @"ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error); ConnStatus(); } - private void TextBox_KeyPress(object sender, KeyPressEventArgs e) + private void TextBoxKeyPress(object sender, KeyPressEventArgs e) { if (!((Char.IsDigit(e.KeyChar) || e.KeyChar == (char)Keys.Back))) e.Handled = true; } + private void LevelScalingClick(object sender, EventArgs e) + { + var scalingForm = new FormSpellScaling(); + var ret = scalingForm.ShowDialog(this); + if (ret == DialogResult.OK) + { + DBC.DBC.SelectedLevel = scalingForm.SelectedLevel; + switch (tabControl1.SelectedIndex) + { + case 0: + LvSpellListSelectedIndexChanged(null, null); + break; + case 1: + LvProcSpellListSelectedIndexChanged(null, null); + break; + case 2: + CompareFilterSpellTextChanged(null, null); + break; + case 3: + break; + } + } + } + #endregion #region SPELL INFO PAGE - private void _lvSpellList_SelectedIndexChanged(object sender, EventArgs e) + private void LvSpellListSelectedIndexChanged(object sender, EventArgs e) { if (_lvSpellList.SelectedIndices.Count > 0) new SpellInfo(_rtSpellInfo, _spellList[_lvSpellList.SelectedIndices[0]]); } - private void _tbSearchId_KeyDown(object sender, KeyEventArgs e) + private void TbSearchIdKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) AdvancedSearch(); } - private void _bSearch_Click(object sender, EventArgs e) + private void BSearchClick(object sender, EventArgs e) { AdvancedSearch(); } - private void _cbSpellFamilyNames_SelectedIndexChanged(object sender, EventArgs e) + private void CbSpellFamilyNamesSelectedIndexChanged(object sender, EventArgs e) { if (((ComboBox)sender).SelectedIndex != 0) - AdvansedFilter(); + AdvancedFilter(); } - private void _tbAdvansedFilterVal_KeyDown(object sender, KeyEventArgs e) + private void TbAdvansedFilterValKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) - AdvansedFilter(); + AdvancedFilter(); } private void AdvancedSearch() { - string name = _tbSearchId.Text; - uint id = name.ToUInt32(); - uint ic = _tbSearchIcon.Text.ToUInt32(); - uint at = _tbSearchAttributes.Text.ToUInt32(); - - _spellList = (from spell in DBC.Spell.Values - - where ((id == 0 || spell.ID == id) - - && (ic == 0 || spell.SpellIconID == ic) - - && (at == 0 || (spell.Attributes & at) != 0 - || (spell.AttributesEx & at) != 0 - || (spell.AttributesEx2 & at) != 0 - || (spell.AttributesEx3 & at) != 0 - || (spell.AttributesEx4 & at) != 0 - || (spell.AttributesEx5 & at) != 0 - || (spell.AttributesEx6 & at) != 0 - || (spell.AttributesExG & at) != 0)) - - && ((id != 0 || ic != 0 && at != 0) || spell.SpellName.ContainsText(name)) - + var name = _tbSearchId.Text; + var id = name.ToUInt32(); + var ic = _tbSearchIcon.Text.ToUInt32(); + var at = _tbSearchAttributes.Text.ToUInt32(); + + _spellList = (from spell in DBC.DBC.SpellInfoStore.Values + where + ((id == 0 || spell.ID == id) && (ic == 0 || spell.SpellIconID == ic) && + (at == 0 || (spell.Attributes & at) != 0 || (spell.AttributesEx & at) != 0 || + (spell.AttributesEx2 & at) != 0 || (spell.AttributesEx3 & at) != 0 || + (spell.AttributesEx4 & at) != 0 || (spell.AttributesEx5 & at) != 0 || + (spell.AttributesEx6 & at) != 0 || (spell.AttributesEx7 & at) != 0)) && + ((id != 0 || ic != 0 && at != 0) || spell.SpellName.ContainsText(name)) select spell).ToList(); _lvSpellList.VirtualListSize = _spellList.Count(); @@ -188,7 +206,7 @@ private void AdvancedSearch() _lvSpellList.Items[_lvSpellList.SelectedIndices[0]].Selected = false; } - private void AdvansedFilter() + private void AdvancedFilter() { var bFamilyNames = _cbSpellFamilyName.SelectedIndex != 0; var fFamilyNames = _cbSpellFamilyName.SelectedValue.ToInt32(); @@ -212,112 +230,102 @@ private void AdvansedFilter() var field1 = (MemberInfo)_cbAdvancedFilter1.SelectedValue; var field2 = (MemberInfo)_cbAdvancedFilter2.SelectedValue; - bool use1val = advVal1 != string.Empty; - bool use2val = advVal2 != string.Empty; - - CompareType field1ct = (CompareType)_cbAdvancedFilter1CompareType.SelectedIndex; - CompareType field2ct = (CompareType)_cbAdvancedFilter2CompareType.SelectedIndex; - - _spellList = (from spell in DBC.Spell.Values - - where ( !bFamilyNames || spell.SpellFamilyName == fFamilyNames) - && (!bSpellEffect || spell.Effect.ContainsElement((uint)fSpellEffect)) - && (!bSpellAura || spell.EffectApplyAuraName.ContainsElement((uint)fSpellAura)) - && (!bTarget1 || spell.EffectImplicitTargetA.ContainsElement((uint)fTarget1)) - && (!bTarget2 || spell.EffectImplicitTargetB.ContainsElement((uint)fTarget2)) - && (!use1val || spell.CreateFilter(field1, advVal1, field1ct)) - && (!use2val || spell.CreateFilter(field2, advVal2, field2ct)) - + var use1Val = advVal1 != string.Empty; + var use2Val = advVal2 != string.Empty; + + var field1Ct = (CompareType)_cbAdvancedFilter1CompareType.SelectedIndex; + var field2Ct = (CompareType)_cbAdvancedFilter2CompareType.SelectedIndex; + + _spellList = (from spell in DBC.DBC.SpellInfoStore.Values + where + (!bFamilyNames || spell.SpellFamilyName == fFamilyNames) && + (!bSpellEffect || spell.HasEffect((SpellEffects)fSpellEffect)) && + (!bSpellAura || spell.HasAura((AuraType)fSpellAura)) && + (!bTarget1 || spell.HasTargetA((Targets)fTarget1)) && + (!bTarget2 || spell.HasTargetB((Targets)fTarget2)) && + (!use1Val || spell.CreateFilter(field1, advVal1, field1Ct)) && + (!use2Val || spell.CreateFilter(field2, advVal2, field2Ct)) select spell).ToList(); _lvSpellList.VirtualListSize = _spellList.Count(); if (_lvSpellList.SelectedIndices.Count > 0) _lvSpellList.Items[_lvSpellList.SelectedIndices[0]].Selected = false; - } #endregion #region SPELL PROC INFO PAGE - private void _cbProcSpellFamilyName_SelectedIndexChanged(object sender, EventArgs e) + private void CbProcSpellFamilyNameSelectedIndexChanged(object sender, EventArgs e) { if (((ComboBox)sender).SelectedIndex > 0) ProcFilter(); } - private void _bSpellInfo_Click(object sender, EventArgs e) - { - splitContainer2.Panel2Collapsed = !splitContainer2.Panel2Collapsed; - } - - private void _cbProcFlag_CheckedChanged(object sender, EventArgs e) + private void CbProcFlagCheckedChanged(object sender, EventArgs e) { splitContainer3.SplitterDistance = ((CheckBox)sender).Checked ? 240 : 128; } - private void _tvFamilyTree_AfterSelect(object sender, TreeViewEventArgs e) + private void TvFamilyTreeAfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Level > 0) - SetProcAtribute(DBC.Spell[e.Node.Name.ToUInt32()]); + SetProcAtribute(DBC.DBC.SpellInfoStore[e.Node.Name.ToUInt32()]); } - private void _lvProcSpellList_SelectedIndexChanged(object sender, EventArgs e) + private void LvProcSpellListSelectedIndexChanged(object sender, EventArgs e) { var lv = (ListView)sender; - if (lv.SelectedIndices.Count > 0) - { - SetProcAtribute(_spellProcList[lv.SelectedIndices[0]]); - _lvProcAdditionalInfo.Items.Clear(); - } + if (lv.SelectedIndices.Count <= 0) + return; + SetProcAtribute(_spellProcList[lv.SelectedIndices[0]]); + _lvProcAdditionalInfo.Items.Clear(); } - private void _lvProcAdditionalInfo_SelectedIndexChanged(object sender, EventArgs e) + private void LvProcAdditionalInfoSelectedIndexChanged(object sender, EventArgs e) { if (_lvProcAdditionalInfo.SelectedIndices.Count > 0) - SetProcAtribute(DBC.Spell[_lvProcAdditionalInfo.SelectedItems[0].SubItems[0].Text.ToUInt32()]); + SetProcAtribute(DBC.DBC.SpellInfoStore[_lvProcAdditionalInfo.SelectedItems[0].SubItems[0].Text.ToUInt32()]); } - - private void _clbSchools_SelectedIndexChanged(object sender, EventArgs e) + + private void ClbSchoolsSelectedIndexChanged(object sender, EventArgs e) { - if (ProcInfo.SpellProc.ID != 0) - { - _bWrite.Enabled = true; - GetProcAttribute(ProcInfo.SpellProc); - } + if (ProcInfo.SpellProc.ID == 0) + return; + _bWrite.Enabled = true; + GetProcAttribute(ProcInfo.SpellProc); } - private void _tbCooldown_TextChanged(object sender, EventArgs e) + private void TbCooldownTextChanged(object sender, EventArgs e) { - if (ProcInfo.SpellProc.ID != 0) - { - _bWrite.Enabled = true; - GetProcAttribute(ProcInfo.SpellProc); - } + if (ProcInfo.SpellProc.ID == 0) + return; + _bWrite.Enabled = true; + GetProcAttribute(ProcInfo.SpellProc); } - private void _bProcSearch_Click(object sender, EventArgs e) + private void BProcSearchClick(object sender, EventArgs e) { Search(); } - private void _tbSearch_KeyDown(object sender, KeyEventArgs e) + private void TbSearchKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) Search(); } - private void _tvFamilyTree_SelectedIndexChanged(object sender, EventArgs e) + private void TvFamilyTreeSelectedIndexChanged(object sender, EventArgs e) { - if ((int)((ComboBox)sender).SelectedIndex == 0) + if (((ComboBox)sender).SelectedIndex == 0) return; _tvFamilyTree.Nodes.Clear(); - SpellFamilyNames spellfamily = (SpellFamilyNames)(((ComboBox)sender).SelectedValue.ToInt32()); + var spellfamily = (SpellFamilyNames)(((ComboBox)sender).SelectedValue.ToInt32()); new ProcInfo(_tvFamilyTree, spellfamily); } - private void SetProcAtribute(SpellEntry spell) + private void SetProcAtribute(SpellInfoHelper spell) { new SpellInfo(_rtbProcSpellInfo, spell); @@ -325,38 +333,34 @@ private void SetProcAtribute(SpellEntry spell) _clbProcFlags.SetCheckedItemFromFlag(spell.ProcFlags); _clbSchools.SetCheckedItemFromFlag(spell.SchoolMask); _cbProcFitstSpellFamily.SelectedValue = spell.SpellFamilyName; - _tbPPM.Text = "0"; // need correct value + _tbPPM.Text = @"0"; // need correct value _tbChance.Text = spell.ProcChance.ToString(); _tbCooldown.Text = (spell.RecoveryTime / 1000f).ToString(); } - private void GetProcAttribute(SpellEntry spell) + private void GetProcAttribute(SpellInfoHelper spell) { - uint[] SpellFamilyFlags = _tvFamilyTree.GetMask(); - var statusproc = String.Format("Spell ({0}) {1}. Proc Event ==> SchoolMask 0x{2:X2}, SpellFamily {3}, 0x{4:X8} {5:X8} {6:X8}, procFlag 0x{7:X8}, procEx 0x{8:X8}, PPMRate {9}", - spell.ID, - spell.SpellNameRank, - _clbSchools.GetFlagsValue(), - _cbProcFitstSpellFamily.ValueMember, - SpellFamilyFlags[0], - SpellFamilyFlags[1], - SpellFamilyFlags[2], - _clbProcFlags.GetFlagsValue(), - _clbProcFlagEx.GetFlagsValue(), - _tbPPM.Text.ToFloat()); + var spellFamilyFlags = _tvFamilyTree.GetMask(); + var statusproc = + String.Format( + "Spell ({0}) {1}. Proc Event ==> SchoolMask 0x{2:X2}, SpellFamily {3}, 0x{4:X8} {5:X8} {6:X8}, procFlag 0x{7:X8}, procEx 0x{8:X8}, PPMRate {9}", + spell.ID, spell.SpellNameRank, _clbSchools.GetFlagsValue(), _cbProcFitstSpellFamily.ValueMember, + spellFamilyFlags[0], spellFamilyFlags[1], spellFamilyFlags[2], _clbProcFlags.GetFlagsValue(), + _clbProcFlagEx.GetFlagsValue(), _tbPPM.Text.ToFloat()); - _gSpellProcEvent.Text = "Spell Proc Event " + statusproc; + _gSpellProcEvent.Text = @"Spell Proc Event " + statusproc; } private void Search() { - uint id = _tbProcSeach.Text.ToUInt32(); - - _spellProcList = (from spell in DBC.Spell.Values - where (id == 0 || spell.ID == id) - && (id != 0 || spell.SpellName.ContainsText(_tbProcSeach.Text)) - select spell).ToList(); - + var id = _tbProcSeach.Text.ToUInt32(); + + _spellProcList = (from spell in DBC.DBC.SpellInfoStore.Values + where + (id == 0 || spell.ID == id) && + (id != 0 || spell.SpellName.ContainsText(_tbProcSeach.Text)) + select spell).ToList(); + _lvProcSpellList.VirtualListSize = _spellProcList.Count; if (_lvProcSpellList.SelectedIndices.Count > 0) _lvProcSpellList.Items[_lvProcSpellList.SelectedIndices[0]].Selected = false; @@ -379,51 +383,50 @@ private void ProcFilter() var bTarget2 = _cbProcTarget2.SelectedIndex != 0; var fTarget2 = _cbProcTarget2.SelectedValue.ToInt32(); - _spellProcList = (from spell in DBC.Spell.Values - - where (!bFamilyNames || spell.SpellFamilyName == fFamilyNames) - && (!bSpellEffect || spell.Effect.ContainsElement((uint)fSpellEffect)) - && (!bSpellAura || spell.EffectApplyAuraName.Contains((uint)fSpellAura)) - && (!bTarget1 || spell.EffectImplicitTargetA.ContainsElement((uint)fTarget1)) - && (!bTarget2 || spell.EffectImplicitTargetB.ContainsElement((uint)fTarget2)) - + _spellProcList = (from spell in DBC.DBC.SpellInfoStore.Values + where + (!bFamilyNames || spell.SpellFamilyName == fFamilyNames) && + (!bSpellEffect || spell.HasEffect((SpellEffects)fSpellEffect)) && + (!bSpellAura || spell.HasAura((AuraType)fSpellAura)) && + (!bTarget1 || spell.HasTargetA((Targets)fTarget1)) && + (!bTarget2 || spell.HasTargetB((Targets)fTarget2)) select spell).ToList(); _lvProcSpellList.VirtualListSize = _spellProcList.Count(); if (_lvProcSpellList.SelectedIndices.Count > 0) _lvProcSpellList.Items[_lvProcSpellList.SelectedIndices[0]].Selected = false; } - - private void FamilyTree_AfterCheck(object sender, TreeViewEventArgs e) + + private void FamilyTreeAfterCheck(object sender, TreeViewEventArgs e) { - if (!ProcInfo.Update) return; + if (!ProcInfo.Update) + return; _bWrite.Enabled = true; _lvProcAdditionalInfo.Items.Clear(); - uint[] mask = ((TreeView)sender).GetMask(); + var mask = ((TreeView)sender).GetMask(); - var query = from Spell in DBC.Spell.Values - where Spell.SpellFamilyName == ProcInfo.SpellProc.SpellFamilyName - && Spell.SpellFamilyFlags.ContainsElement(mask) - join sk in DBC.SkillLineAbility on Spell.ID equals sk.Value.SpellId into temp1 - from Skill in temp1.DefaultIfEmpty() + var query = from spell in DBC.DBC.SpellInfoStore.Values + 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 + from skill in temp1.DefaultIfEmpty(new SkillLineAbilityEntry()) //join skl in DBC.SkillLine on Skill.Value.SkillId equals skl.Value.ID into temp2 //from SkillLine in temp2.DefaultIfEmpty() - orderby Skill.Key descending - select new - { - SpellID = Spell.ID, - SpellName = Spell.SpellNameRank + " " + Spell.Description, - SkillId = Skill.Value.SkillId - }; - - foreach (var str in query) - { - ListViewItem lvi = new ListViewItem(new string[] { str.SpellID.ToString(), str.SpellName }); - lvi.ImageKey = str.SkillId != 0 ? "plus.ico" : "munus.ico"; + orderby skill.Id descending + select + new + { + SpellID = spell.ID, + SpellName = spell.SpellNameRank + " " + spell.Description, + skill.SkillId + }; + + foreach (var lvi in + query.Select(str => new ListViewItem(new[] {str.SpellID.ToString(), str.SpellName}) {ImageKey = str.SkillId != 0 ? "plus.ico" : "munus.ico"})) _lvProcAdditionalInfo.Items.Add(lvi); - } GetProcAttribute(ProcInfo.SpellProc); } @@ -432,28 +435,27 @@ orderby Skill.Key descending #region COMPARE PAGE - private void CompareFilterSpell_TextChanged(object sender, EventArgs e) + private void CompareFilterSpellTextChanged(object sender, EventArgs e) { - uint spell1 = _tbCompareFilterSpell1.Text.ToUInt32(); - uint spell2 = _tbCompareFilterSpell2.Text.ToUInt32(); - - if (DBC.Spell.ContainsKey(spell1) && DBC.Spell.ContainsKey(spell2)) - new SpellCompare(_rtbCompareSpell1, _rtbCompareSpell2, DBC.Spell[spell1], DBC.Spell[spell2]); + var spell1 = _tbCompareFilterSpell1.Text.ToUInt32(); + var spell2 = _tbCompareFilterSpell2.Text.ToUInt32(); + if (DBC.DBC.SpellInfoStore.ContainsKey(spell1) && DBC.DBC.SpellInfoStore.ContainsKey(spell2)) + new SpellCompare(_rtbCompareSpell1, _rtbCompareSpell2, DBC.DBC.SpellInfoStore[spell1], DBC.DBC.SpellInfoStore[spell2]); } - private void CompareSearch1_Click(object sender, EventArgs e) + private void CompareSearch1Click(object sender, EventArgs e) { - FormSearch form = new FormSearch(); + var form = new FormSearch(); form.ShowDialog(this); if (form.DialogResult == DialogResult.OK) _tbCompareFilterSpell1.Text = form.Spell.ID.ToString(); form.Dispose(); } - private void CompareSearch2_Click(object sender, EventArgs e) + private void CompareSearch2Click(object sender, EventArgs e) { - FormSearch form = new FormSearch(); + var form = new FormSearch(); form.ShowDialog(this); if (form.DialogResult == DialogResult.OK) _tbCompareFilterSpell2.Text = form.Spell.ID.ToString(); @@ -464,138 +466,140 @@ private void CompareSearch2_Click(object sender, EventArgs e) #region SQL PAGE - private void Sql_DataList_MouseDoubleClick(object sender, MouseEventArgs e) + private void SqlDataListMouseDoubleClick(object sender, MouseEventArgs e) { ProcParse(sender); } - private void Sql_DataList_KeyDown(object sender, KeyEventArgs e) + private void SqlDataListKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) ProcParse(sender); } - private void SqlToBase_Click(object sender, EventArgs e) + private void SqlToBaseClick(object sender, EventArgs e) { - if (MySQLConnect.Connected) - MySQLConnect.Insert(_rtbSqlLog.Text); + if (MySqlConnection.Connected) + MySqlConnection.Insert(_rtbSqlLog.Text); else - MessageBox.Show("Can't connect to database!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(@"Can't connect to database!", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } - private void SqlSave_Click(object sender, EventArgs e) + private void SqlSaveClick(object sender, EventArgs e) { - if (_rtbSqlLog.Text != String.Empty) - { - SaveFileDialog _sd = new SaveFileDialog(); - _sd.Filter = "SQL files|*.sql"; - if (_sd.ShowDialog() == DialogResult.OK) - using (StreamWriter _sw = new StreamWriter(_sd.FileName, false, Encoding.UTF8)) - _sw.Write(_rtbSqlLog.Text); - } + if (_rtbSqlLog.Text == String.Empty) + return; + + var sd = new SaveFileDialog {Filter = @"SQL files|*.sql"}; + if (sd.ShowDialog() == DialogResult.OK) + using (var sw = new StreamWriter(sd.FileName, false, Encoding.UTF8)) + sw.Write(_rtbSqlLog.Text); } - private void CalcProcFlags_Click(object sender, EventArgs e) + private void CalcProcFlagsClick(object sender, EventArgs e) { switch (((Button)sender).Name) { case "_bSqlSchool": - { - uint val = _tbSqlSchool.Text.ToUInt32(); - FormCalculateFlags form = new FormCalculateFlags(typeof(SpellSchools), val, ""); - form.ShowDialog(this); - if (form.DialogResult == DialogResult.OK) - _tbSqlSchool.Text = form.Flags.ToString(); - } + { + var val = _tbSqlSchool.Text.ToUInt32(); + var form = new FormCalculateFlags(typeof(SpellSchools), val, string.Empty); + form.ShowDialog(this); + if (form.DialogResult == DialogResult.OK) + _tbSqlSchool.Text = form.Flags.ToString(); + } break; case "_bSqlProc": - { - uint val = _tbSqlProc.Text.ToUInt32(); - FormCalculateFlags form = new FormCalculateFlags(typeof(ProcFlags), val, "PROC_FLAG_"); - form.ShowDialog(this); - if (form.DialogResult == DialogResult.OK) - _tbSqlProc.Text = form.Flags.ToString(); - } + { + var val = _tbSqlProc.Text.ToUInt32(); + var form = new FormCalculateFlags(typeof(ProcFlags), val, "PROC_FLAG_"); + form.ShowDialog(this); + if (form.DialogResult == DialogResult.OK) + _tbSqlProc.Text = form.Flags.ToString(); + } break; case "_bSqlProcEx": - { - uint val = _tbSqlProcEx.Text.ToUInt32(); - FormCalculateFlags form = new FormCalculateFlags(typeof(ProcFlagsEx), val, "PROC_EX_"); - form.ShowDialog(this); - if (form.DialogResult == DialogResult.OK) - _tbSqlProcEx.Text = form.Flags.ToString(); - } + { + var val = _tbSqlProcEx.Text.ToUInt32(); + var form = new FormCalculateFlags(typeof(ProcFlagsEx), val, "PROC_EX_"); + form.ShowDialog(this); + if (form.DialogResult == DialogResult.OK) + _tbSqlProcEx.Text = form.Flags.ToString(); + } break; } } - private void Select_Click(object sender, EventArgs e) + private void SelectClick(object sender, EventArgs e) { - if (!MySQLConnect.Connected) + if (!MySqlConnection.Connected) { - MessageBox.Show("Can't connect to database!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(@"Can't connect to database!", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - StringBuilder sb = new StringBuilder("WHERE "); - string compare = _cbBinaryCompare.Checked ? "&" : "="; + var sb = new StringBuilder("WHERE"); + var compare = _cbBinaryCompare.Checked ? "&" : "="; if (_cbSqlSpellFamily.SelectedValue.ToInt32() != -1) sb.AppendFormat(" SpellFamilyName = {0} &&", _cbSqlSpellFamily.SelectedValue.ToInt32()); sb.AppendFormatIfNotNull(" SchoolMask {1} {0} &&", _tbSqlSchool.Text.ToInt32(), compare); sb.AppendFormatIfNotNull(" procFlags {1} {0} &&", _tbSqlProc.Text.ToInt32(), compare); - sb.AppendFormatIfNotNull(" procEx {1} {0} &&", _tbSqlProcEx.Text.ToInt32(), compare); + sb.AppendFormatIfNotNull(" procEx {1} {0}", _tbSqlProcEx.Text.ToInt32(), compare); - String subquery = sb.ToString().Remove(sb.Length - 2, 2); - subquery = subquery == "WHERE" ? "" : subquery; + var subquery = sb.ToString() == "WHERE" ? string.Empty : sb.ToString(); + + if (subquery == string.Empty && _tbSqlManual.Text != string.Empty) + subquery = "WHERE " + _tbSqlManual.Text; - String query = String.Format("SELECT * FROM `spell_proc_event` {0} ORDER BY entry", subquery); - MySQLConnect.SelectProc(query); + var query = String.Format("SELECT * FROM `spell_proc_event` {0} ORDER BY entry", subquery); + try + { + MySqlConnection.SelectProc(query); + } + catch (Exception ex) + { + MessageBox.Show("Error: " + ex.Message); + } - _lvDataList.VirtualListSize = MySQLConnect.SpellProcEvent.Count; + _lvDataList.VirtualListSize = MySqlConnection.SpellProcEvent.Count; if (_lvDataList.SelectedIndices.Count > 0) _lvDataList.Items[_lvDataList.SelectedIndices[0]].Selected = false; // check bad spell and drop - foreach (String str in MySQLConnect.Dropped) + foreach (var str in MySqlConnection.Dropped) _rtbSqlLog.AppendText(str); } - private void Write_Click(object sender, EventArgs e) + private void WriteClick(object sender, EventArgs e) { - uint[] SpellFamilyFlags = _tvFamilyTree.GetMask(); + var spellFamilyFlags = _tvFamilyTree.GetMask(); // spell comment var comment = String.Format("-- ({0}) {1}", ProcInfo.SpellProc.ID, ProcInfo.SpellProc.SpellNameRank); // drop query var drop = String.Format("DELETE FROM `spell_proc_event` WHERE `entry` IN ({0});", ProcInfo.SpellProc.ID); // insert query - var insert = String.Format("INSERT INTO `spell_proc_event` VALUES ({0}, 0x{1:X2}, 0x{2:X2}, 0x{3:X8}, 0x{4:X8}, 0x{5:X8}, 0x{6:X8}, 0x{7:X8}, 0x{8:X8}, 0x{9:X8}, 0x{10:X8}, 0x{11:X8}, 0x{12:X8}, 0x{13:X8}, {14}, {15}, {16});", - ProcInfo.SpellProc.ID, - _clbSchools.GetFlagsValue(), - _cbProcFitstSpellFamily.SelectedValue.ToUInt32(), - SpellFamilyFlags[0], - SpellFamilyFlags[1], - SpellFamilyFlags[2], - 0,0,0,0,0,0,// пока что так, пока не пойму как... - _clbProcFlags.GetFlagsValue(), - _clbProcFlagEx.GetFlagsValue(), - _tbPPM.Text.Replace(',', '.'), - _tbChance.Text.Replace(',', '.'), - _tbCooldown.Text.Replace(',', '.')); + var insert = + String.Format( + "INSERT INTO `spell_proc_event` VALUES ({0}, 0x{1:X2}, 0x{2:X2}, 0x{3:X8}, 0x{4:X8}, 0x{5:X8}, 0x{6:X8}, 0x{7:X8}, {8}, {9}, {10});", + ProcInfo.SpellProc.ID, _clbSchools.GetFlagsValue(), _cbProcFitstSpellFamily.SelectedValue.ToUInt32(), + spellFamilyFlags[0], spellFamilyFlags[1], spellFamilyFlags[2], _clbProcFlags.GetFlagsValue(), + _clbProcFlagEx.GetFlagsValue(), _tbPPM.Text.Replace(',', '.'), _tbChance.Text.Replace(',', '.'), + _tbCooldown.Text.Replace(',', '.')); _rtbSqlLog.AppendText(comment + "\r\n" + drop + "\r\n" + insert + "\r\n\r\n"); _rtbSqlLog.ColorizeCode(); - if (MySQLConnect.Connected) - MySQLConnect.Insert(drop + insert); + if (MySqlConnection.Connected) + MySqlConnection.Insert(drop + insert); ((Button)sender).Enabled = false; } - + private void ProcParse(object sender) { - SpellProcEventEntry proc = MySQLConnect.SpellProcEvent[((ListView)sender).SelectedIndices[0]]; - SpellEntry spell = DBC.Spell[proc.ID]; + var proc = MySqlConnection.SpellProcEvent[((ListView)sender).SelectedIndices[0]]; + var spell = DBC.DBC.SpellInfoStore[proc.Id]; ProcInfo.SpellProc = spell; new SpellInfo(_rtbProcSpellInfo, spell); @@ -612,7 +616,7 @@ private void ProcParse(object sender) _tbCooldown.Text = proc.Cooldown.ToString(); _tvFamilyTree.SetMask(proc.SpellFamilyMask); - + tabControl1.SelectedIndex = 1; } @@ -620,23 +624,26 @@ private void ProcParse(object sender) #region VIRTUAL MODE - private List _spellList = new List(); - - private void _lvSpellList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) + private List _spellList = new List(); + + private List _spellProcList = new List(); + + private void LvSpellListRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { - e.Item = new ListViewItem(new[] { _spellList[e.ItemIndex].ID.ToString(), _spellList[e.ItemIndex].SpellNameRank }); + e.Item = + new ListViewItem(new[] {_spellList[e.ItemIndex].ID.ToString(), _spellList[e.ItemIndex].SpellNameRank}); } - private List _spellProcList = new List(); - - private void _lvProcSpellList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) + private void LvProcSpellListRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { - e.Item = new ListViewItem(new[] { _spellProcList[e.ItemIndex].ID.ToString(), _spellProcList[e.ItemIndex].SpellNameRank }); + e.Item = + new ListViewItem(new[] + {_spellProcList[e.ItemIndex].ID.ToString(), _spellProcList[e.ItemIndex].SpellNameRank}); } - private void _lvSqlData_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) + private void LvSqlDataRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { - e.Item = new ListViewItem(MySQLConnect.SpellProcEvent[e.ItemIndex].ToArray()); + e.Item = new ListViewItem(MySqlConnection.SpellProcEvent[e.ItemIndex].ToArray()); } #endregion diff --git a/SpellWork/Forms/FormMain.resx b/SpellWork/Forms/FormMain.resx index 66fc0621..caf512b9 100644 --- a/SpellWork/Forms/FormMain.resx +++ b/SpellWork/Forms/FormMain.resx @@ -112,18 +112,18 @@ 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 - + 126, 17 - + 17, 17 - + 236, 17 @@ -131,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAY - DQAAAk1TRnQBSQFMAgEBBgEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DQAAAk1TRnQBSQFMAgEBBgEAAVQBAAFUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -189,10 +189,10 @@ AYACAAH4AR8BgAEBAf8BwAEBAYAB+AEfAcABAwH/AeABgwHBAfgBHwHwAQ8B/wHwAccB4wH4AR8L - + 43 - + AAABAAUAICAAAAEACACoCAAAVgAAADAwAAABACAAqCUAAP4IAAAQEBAAAQAEACgBAACmLgAAEBAAAAEA diff --git a/SpellWork/Forms/FormSearch.Designer.cs b/SpellWork/Forms/FormSearch.Designer.cs index 1fd79cb1..73003cfc 100644 --- a/SpellWork/Forms/FormSearch.Designer.cs +++ b/SpellWork/Forms/FormSearch.Designer.cs @@ -1,4 +1,4 @@ -namespace SpellWork +namespace SpellWork.Forms { partial class FormSearch { @@ -32,7 +32,7 @@ private void InitializeComponent() this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this._rtbSpellInfo = new System.Windows.Forms.RichTextBox(); this._bOk = new System.Windows.Forms.Button(); - this._bCencel = new System.Windows.Forms.Button(); + this._bCancel = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -41,52 +41,56 @@ private void InitializeComponent() this._tbIcon = new System.Windows.Forms.TextBox(); this._tbIdName = new System.Windows.Forms.TextBox(); this._lvSpellList = new System.Windows.Forms.ListView(); - this._chID = new System.Windows.Forms.ColumnHeader(); - this._chName = new System.Windows.Forms.ColumnHeader(); + this._chID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this._chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.groupBox2 = new System.Windows.Forms.GroupBox(); this._cbTarget2 = new System.Windows.Forms.ComboBox(); this._cbTarget1 = new System.Windows.Forms.ComboBox(); this._cbSpellEffect = new System.Windows.Forms.ComboBox(); this._cbSpellAura = new System.Windows.Forms.ComboBox(); this._cbSpellFamily = new System.Windows.Forms.ComboBox(); + this.buttonSearch = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); - // + // // splitContainer1 - // + // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Name = "splitContainer1"; - // + // // splitContainer1.Panel1 - // + // this.splitContainer1.Panel1.Controls.Add(this._rtbSpellInfo); - // + // // splitContainer1.Panel2 - // + // this.splitContainer1.Panel2.Controls.Add(this._bOk); - this.splitContainer1.Panel2.Controls.Add(this._bCencel); + this.splitContainer1.Panel2.Controls.Add(this._bCancel); this.splitContainer1.Panel2.Controls.Add(this.groupBox1); this.splitContainer1.Size = new System.Drawing.Size(672, 455); this.splitContainer1.SplitterDistance = 381; this.splitContainer1.TabIndex = 0; - // + // // _rtbSpellInfo - // + // + this._rtbSpellInfo.BackColor = System.Drawing.Color.Gainsboro; this._rtbSpellInfo.Dock = System.Windows.Forms.DockStyle.Fill; this._rtbSpellInfo.Location = new System.Drawing.Point(0, 0); this._rtbSpellInfo.Name = "_rtbSpellInfo"; + this._rtbSpellInfo.ReadOnly = true; this._rtbSpellInfo.Size = new System.Drawing.Size(381, 455); this._rtbSpellInfo.TabIndex = 11; this._rtbSpellInfo.Text = ""; - // + // // _bOk - // + // this._bOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this._bOk.Location = new System.Drawing.Point(209, 425); this._bOk.Name = "_bOk"; @@ -94,24 +98,25 @@ private void InitializeComponent() this._bOk.TabIndex = 9; this._bOk.Text = "OK"; this._bOk.UseVisualStyleBackColor = true; - this._bOk.Click += new System.EventHandler(this.Ok_Click); - // - // _bCencel - // - this._bCencel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this._bCencel.Location = new System.Drawing.Point(128, 425); - this._bCencel.Name = "_bCencel"; - this._bCencel.Size = new System.Drawing.Size(75, 23); - this._bCencel.TabIndex = 10; - this._bCencel.Text = "Cencel"; - this._bCencel.UseVisualStyleBackColor = true; - this._bCencel.Click += new System.EventHandler(this.Cencel_Click); + this._bOk.Click += new System.EventHandler(this.OkClick); + // + // _bCancel + // + this._bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this._bCancel.Location = new System.Drawing.Point(128, 425); + this._bCancel.Name = "_bCancel"; + this._bCancel.Size = new System.Drawing.Size(75, 23); + this._bCancel.TabIndex = 10; + this._bCancel.Text = "Cancel"; + this._bCancel.UseVisualStyleBackColor = true; + this._bCancel.Click += new System.EventHandler(this.CancelClick); // // groupBox1 - // + // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.buttonSearch); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this._lIDName); @@ -126,69 +131,69 @@ private void InitializeComponent() this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "Spell Search"; - // + // // label3 - // + // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(6, 69); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(49, 13); this.label3.TabIndex = 3; this.label3.Text = "Attribute:"; - // + // // label2 - // + // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(6, 43); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(45, 13); this.label2.TabIndex = 3; this.label2.Text = "Icon ID:"; - // + // // _lIDName - // + // this._lIDName.AutoSize = true; this._lIDName.Location = new System.Drawing.Point(6, 17); this._lIDName.Name = "_lIDName"; this._lIDName.Size = new System.Drawing.Size(64, 13); this._lIDName.TabIndex = 3; this._lIDName.Text = "ID or Name:"; - // + // // _tbAttribute - // + // this._tbAttribute.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this._tbAttribute.Location = new System.Drawing.Point(74, 66); this._tbAttribute.Name = "_tbAttribute"; this._tbAttribute.Size = new System.Drawing.Size(198, 20); this._tbAttribute.TabIndex = 2; - this._tbAttribute.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IdName_KeyDown); - // + this._tbAttribute.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IdNameKeyDown); + // // _tbIcon - // + // this._tbIcon.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this._tbIcon.Location = new System.Drawing.Point(74, 40); this._tbIcon.Name = "_tbIcon"; this._tbIcon.Size = new System.Drawing.Size(198, 20); this._tbIcon.TabIndex = 1; - this._tbIcon.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IdName_KeyDown); - // + this._tbIcon.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IdNameKeyDown); + // // _tbIdName - // + // this._tbIdName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this._tbIdName.Location = new System.Drawing.Point(74, 14); this._tbIdName.Name = "_tbIdName"; - this._tbIdName.Size = new System.Drawing.Size(198, 20); + this._tbIdName.Size = new System.Drawing.Size(145, 20); this._tbIdName.TabIndex = 0; - this._tbIdName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IdName_KeyDown); - // + this._tbIdName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IdNameKeyDown); + // // _lvSpellList - // + // this._lvSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._lvSpellList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this._chID, this._chName}); @@ -202,23 +207,23 @@ private void InitializeComponent() this._lvSpellList.UseCompatibleStateImageBehavior = false; this._lvSpellList.View = System.Windows.Forms.View.Details; this._lvSpellList.VirtualMode = true; - this._lvSpellList.SelectedIndexChanged += new System.EventHandler(this.SpellList_SelectedIndexChanged); - this._lvSpellList.DoubleClick += new System.EventHandler(this.Ok_Click); - this._lvSpellList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.SpellList_RetrieveVirtualItem); - // + this._lvSpellList.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.SpellListRetrieveVirtualItem); + this._lvSpellList.SelectedIndexChanged += new System.EventHandler(this.SpellListSelectedIndexChanged); + this._lvSpellList.DoubleClick += new System.EventHandler(this.OkClick); + // // _chID - // + // this._chID.Text = "ID"; - // + // // _chName - // + // this._chName.Text = "Name"; this._chName.Width = 213; - // + // // groupBox2 - // + // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Controls.Add(this._cbTarget2); this.groupBox2.Controls.Add(this._cbTarget1); this.groupBox2.Controls.Add(this._cbSpellEffect); @@ -230,9 +235,9 @@ private void InitializeComponent() this.groupBox2.TabIndex = 0; this.groupBox2.TabStop = false; this.groupBox2.Text = "Spell Filter"; - // + // // _cbTarget2 - // + // this._cbTarget2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this._cbTarget2.DropDownHeight = 500; this._cbTarget2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -242,10 +247,10 @@ private void InitializeComponent() this._cbTarget2.Name = "_cbTarget2"; this._cbTarget2.Size = new System.Drawing.Size(263, 21); this._cbTarget2.TabIndex = 7; - this._cbTarget2.SelectedIndexChanged += new System.EventHandler(this.SpellFamily_SelectedIndexChanged); - // + this._cbTarget2.SelectedIndexChanged += new System.EventHandler(this.SpellFamilySelectedIndexChanged); + // // _cbTarget1 - // + // this._cbTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this._cbTarget1.DropDownHeight = 500; this._cbTarget1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -255,10 +260,10 @@ private void InitializeComponent() this._cbTarget1.Name = "_cbTarget1"; this._cbTarget1.Size = new System.Drawing.Size(263, 21); this._cbTarget1.TabIndex = 6; - this._cbTarget1.SelectedIndexChanged += new System.EventHandler(this.SpellFamily_SelectedIndexChanged); - // + this._cbTarget1.SelectedIndexChanged += new System.EventHandler(this.SpellFamilySelectedIndexChanged); + // // _cbSpellEffect - // + // this._cbSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this._cbSpellEffect.DropDownHeight = 500; this._cbSpellEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -268,10 +273,10 @@ private void InitializeComponent() this._cbSpellEffect.Name = "_cbSpellEffect"; this._cbSpellEffect.Size = new System.Drawing.Size(263, 21); this._cbSpellEffect.TabIndex = 5; - this._cbSpellEffect.SelectedIndexChanged += new System.EventHandler(this.SpellFamily_SelectedIndexChanged); - // + this._cbSpellEffect.SelectedIndexChanged += new System.EventHandler(this.SpellFamilySelectedIndexChanged); + // // _cbSpellAura - // + // this._cbSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this._cbSpellAura.DropDownHeight = 500; this._cbSpellAura.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -281,10 +286,10 @@ private void InitializeComponent() this._cbSpellAura.Name = "_cbSpellAura"; this._cbSpellAura.Size = new System.Drawing.Size(263, 21); this._cbSpellAura.TabIndex = 4; - this._cbSpellAura.SelectedIndexChanged += new System.EventHandler(this.SpellFamily_SelectedIndexChanged); - // + this._cbSpellAura.SelectedIndexChanged += new System.EventHandler(this.SpellFamilySelectedIndexChanged); + // // _cbSpellFamily - // + // this._cbSpellFamily.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this._cbSpellFamily.DropDownHeight = 500; this._cbSpellFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -294,7 +299,17 @@ private void InitializeComponent() this._cbSpellFamily.Name = "_cbSpellFamily"; this._cbSpellFamily.Size = new System.Drawing.Size(263, 21); this._cbSpellFamily.TabIndex = 3; - this._cbSpellFamily.SelectedIndexChanged += new System.EventHandler(this.SpellFamily_SelectedIndexChanged); + this._cbSpellFamily.SelectedIndexChanged += new System.EventHandler(this.SpellFamilySelectedIndexChanged); + // + // buttonSearch + // + this.buttonSearch.Location = new System.Drawing.Point(219, 13); + this.buttonSearch.Name = "buttonSearch"; + this.buttonSearch.Size = new System.Drawing.Size(53, 22); + this.buttonSearch.TabIndex = 9; + this.buttonSearch.Text = "Search"; + this.buttonSearch.UseVisualStyleBackColor = true; + this.buttonSearch.Click += new System.EventHandler(this.buttonSearch_Click); // // FormSearch // @@ -309,6 +324,7 @@ private void InitializeComponent() this.Text = "Spell Search"; this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); @@ -322,7 +338,7 @@ private void InitializeComponent() private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.RichTextBox _rtbSpellInfo; private System.Windows.Forms.Button _bOk; - private System.Windows.Forms.Button _bCencel; + private System.Windows.Forms.Button _bCancel; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.ListView _lvSpellList; private System.Windows.Forms.GroupBox groupBox2; @@ -339,5 +355,6 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox _cbSpellEffect; private System.Windows.Forms.ComboBox _cbSpellAura; private System.Windows.Forms.ComboBox _cbSpellFamily; + private System.Windows.Forms.Button buttonSearch; } } \ No newline at end of file diff --git a/SpellWork/Forms/FormSearch.cs b/SpellWork/Forms/FormSearch.cs index 2e49a31e..cad59b93 100644 --- a/SpellWork/Forms/FormSearch.cs +++ b/SpellWork/Forms/FormSearch.cs @@ -2,11 +2,15 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; +using SpellWork.Extensions; +using SpellWork.Spell; -namespace SpellWork +namespace SpellWork.Forms { public partial class FormSearch : Form { + private List _spellList = new List(); + public FormSearch() { InitializeComponent(); @@ -18,113 +22,103 @@ public FormSearch() _cbTarget2.SetEnumValues("Target B"); } - public SpellEntry Spell { get; private set; } - - private List _spellList = new List(); + public SpellInfoHelper Spell { get; private set; } - private void IdName_KeyDown(object sender, KeyEventArgs e) + private void IdNameKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) - { - string name = _tbIdName.Text; - uint id = name.ToUInt32(); - uint ic = _tbIcon.Text.ToUInt32(); - uint at = _tbAttribute.Text.ToUInt32(); - - _spellList = (from spell in DBC.Spell.Values - - where ((id == 0 || spell.ID == id) - - && (ic == 0 || spell.SpellIconID == ic) - - && (at == 0 || (spell.Attributes & at) != 0 - || (spell.AttributesEx & at) != 0 - || (spell.AttributesEx2 & at) != 0 - || (spell.AttributesEx3 & at) != 0 - || (spell.AttributesEx4 & at) != 0 - || (spell.AttributesEx5 & at) != 0 - || (spell.AttributesEx6 & at) != 0 - || (spell.AttributesExG & at) != 0)) - - && (id != 0 || ic != 0 && at != 0) || spell.SpellName.ContainsText(name) + AdvancedSearch(); + } - select spell).ToList(); + private void AdvancedSearch() + { + var name = _tbIdName.Text; + var id = name.ToUInt32(); + var ic = _tbIcon.Text.ToUInt32(); + var at = _tbAttribute.Text.ToUInt32(); + + _spellList = (from spell in DBC.DBC.SpellInfoStore.Values + where + ((id == 0 || spell.ID == id) && (ic == 0 || spell.SpellIconID == ic) && + (at == 0 || (spell.Attributes & at) != 0 || (spell.AttributesEx & at) != 0 || + (spell.AttributesEx2 & at) != 0 || (spell.AttributesEx3 & at) != 0 || + (spell.AttributesEx4 & at) != 0 || (spell.AttributesEx5 & at) != 0 || + (spell.AttributesEx6 & at) != 0 || (spell.AttributesEx7 & at) != 0 || (spell.AttributesEx8 & at) != 0)) && + (id != 0 || ic != 0 && at != 0) || spell.SpellName.ContainsText(name) + select spell).ToList(); + + _lvSpellList.VirtualListSize = _spellList.Count(); + groupBox1.Text = @"Spell Search count: " + _spellList.Count(); - _lvSpellList.VirtualListSize = _spellList.Count(); - groupBox1.Text = "Spell Search count: " + _spellList.Count(); - - if (_lvSpellList.SelectedIndices.Count > 0) - _lvSpellList.Items[_lvSpellList.SelectedIndices[0]].Selected = false; - } + if (_lvSpellList.SelectedIndices.Count > 0) + _lvSpellList.Items[_lvSpellList.SelectedIndices[0]].Selected = false; } - private void SpellFamily_SelectedIndexChanged(object sender, EventArgs e) + private void SpellFamilySelectedIndexChanged(object sender, EventArgs e) { - if (((ComboBox)sender).SelectedIndex != 0) - { - var bFamilyNames = _cbSpellFamily.SelectedIndex != 0; - var fFamilyNames = _cbSpellFamily.SelectedValue.ToInt32(); + if (((ComboBox)sender).SelectedIndex == 0) + return; - var bSpellAura = _cbSpellAura.SelectedIndex != 0; - var fSpellAura = _cbSpellAura.SelectedValue.ToInt32(); + var bFamilyNames = _cbSpellFamily.SelectedIndex != 0; + var fFamilyNames = _cbSpellFamily.SelectedValue.ToInt32(); - var bSpellEffect = _cbSpellEffect.SelectedIndex != 0; - var fSpellEffect = _cbSpellEffect.SelectedValue.ToInt32(); + var bSpellAura = _cbSpellAura.SelectedIndex != 0; + var fSpellAura = _cbSpellAura.SelectedValue.ToInt32(); - var bTarget1 = _cbTarget1.SelectedIndex != 0; - var fTarget1 = _cbTarget1.SelectedValue.ToInt32(); + var bSpellEffect = _cbSpellEffect.SelectedIndex != 0; + var fSpellEffect = _cbSpellEffect.SelectedValue.ToInt32(); - var bTarget2 = _cbTarget2.SelectedIndex != 0; - var fTarget2 = _cbTarget2.SelectedValue.ToInt32(); + var bTarget1 = _cbTarget1.SelectedIndex != 0; + var fTarget1 = _cbTarget1.SelectedValue.ToInt32(); - _spellList = (from spell in DBC.Spell.Values + var bTarget2 = _cbTarget2.SelectedIndex != 0; + var fTarget2 = _cbTarget2.SelectedValue.ToInt32(); - where (!bFamilyNames || spell.SpellFamilyName == fFamilyNames) - && (!bSpellEffect || spell.Effect.ContainsElement((uint)fSpellEffect)) - && (!bSpellAura || spell.EffectApplyAuraName.ContainsElement((uint)fSpellAura)) - && (!bTarget1 || spell.EffectImplicitTargetA.ContainsElement((uint)fTarget1)) - && (!bTarget2 || spell.EffectImplicitTargetB.ContainsElement((uint)fTarget2)) + _spellList = (from spell in DBC.DBC.SpellInfoStore.Values + where + (!bFamilyNames || spell.SpellFamilyName == fFamilyNames) && + (!bSpellEffect || spell.HasEffect((SpellEffects)fSpellEffect)) && + (!bSpellAura || spell.HasAura((AuraType)fSpellAura)) && + (!bTarget1 || spell.HasTargetA((Targets)fTarget1)) && + (!bTarget2 || spell.HasTargetB((Targets)fTarget2)) + select spell).ToList(); - select spell).ToList(); + _lvSpellList.VirtualListSize = _spellList.Count(); + groupBox2.Text = @"Spell Filter " + @"count: " + _spellList.Count(); - _lvSpellList.VirtualListSize = _spellList.Count(); - groupBox2.Text = "Spell Filter " + "count: " + _spellList.Count(); - - if (_lvSpellList.SelectedIndices.Count > 0) - _lvSpellList.Items[_lvSpellList.SelectedIndices[0]].Selected = false; - } + if (_lvSpellList.SelectedIndices.Count > 0) + _lvSpellList.Items[_lvSpellList.SelectedIndices[0]].Selected = false; } - private void SpellList_SelectedIndexChanged(object sender, EventArgs e) + private void SpellListSelectedIndexChanged(object sender, EventArgs e) { if (_lvSpellList.SelectedIndices.Count > 0) new SpellInfo(_rtbSpellInfo, _spellList[_lvSpellList.SelectedIndices[0]]); } - private void Ok_Click(object sender, EventArgs e) + private void OkClick(object sender, EventArgs e) { - if (_lvSpellList.SelectedIndices.Count > 0) - { - Spell = _spellList[_lvSpellList.SelectedIndices[0]]; - this.DialogResult = DialogResult.OK; - this.Close(); - } + if (_lvSpellList.SelectedIndices.Count <= 0) + return; + + Spell = _spellList[_lvSpellList.SelectedIndices[0]]; + DialogResult = DialogResult.OK; + Close(); } - private void TextBox_KeyPress(object sender, KeyPressEventArgs e) + private void CancelClick(object sender, EventArgs e) { - if (!((Char.IsDigit(e.KeyChar) || e.KeyChar == (char)Keys.Back))) - e.Handled = true; + Close(); } - private void Cencel_Click(object sender, EventArgs e) + private void SpellListRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { - this.Close(); + e.Item = new ListViewItem(new[] {_spellList[e.ItemIndex].ID.ToString(), _spellList[e.ItemIndex].SpellNameRank}); } - private void SpellList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) + private void buttonSearch_Click(object sender, EventArgs e) { - e.Item = new ListViewItem(new[] { _spellList[e.ItemIndex].ID.ToString(), _spellList[e.ItemIndex].SpellNameRank }); + AdvancedSearch(); } } } diff --git a/SpellWork/Forms/FormSearch.resx b/SpellWork/Forms/FormSearch.resx index b7c68a44..375bc49d 100644 --- a/SpellWork/Forms/FormSearch.resx +++ b/SpellWork/Forms/FormSearch.resx @@ -112,12 +112,12 @@ 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 - + AAABAAUAICAAAAEACACoCAAAVgAAADAwAAABACAAqCUAAP4IAAAQEBAAAQAEACgBAACmLgAAEBAAAAEA diff --git a/SpellWork/Forms/FormSettings.Designer.cs b/SpellWork/Forms/FormSettings.Designer.cs index 4c8f6328..bb176aaa 100644 --- a/SpellWork/Forms/FormSettings.Designer.cs +++ b/SpellWork/Forms/FormSettings.Designer.cs @@ -1,4 +1,4 @@ -namespace SpellWork +namespace SpellWork.Forms { partial class FormSettings { @@ -42,12 +42,16 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this._cbUseDBConnect = new System.Windows.Forms.CheckBox(); this._bTestConnect = new System.Windows.Forms.Button(); + this._tbPath = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); this._bSaveSettings = new System.Windows.Forms.Button(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this._gbDbSetting.SuspendLayout(); this.SuspendLayout(); - // + // // _gbDbSetting - // + // this._gbDbSetting.Controls.Add(this._tbBase); this._gbDbSetting.Controls.Add(this.label5); this._gbDbSetting.Controls.Add(this._tbPass); @@ -60,85 +64,85 @@ private void InitializeComponent() this._gbDbSetting.Controls.Add(this.label1); this._gbDbSetting.Location = new System.Drawing.Point(12, 12); this._gbDbSetting.Name = "_gbDbSetting"; - this._gbDbSetting.Size = new System.Drawing.Size(217, 158); + this._gbDbSetting.Size = new System.Drawing.Size(217, 149); this._gbDbSetting.TabIndex = 0; this._gbDbSetting.TabStop = false; this._gbDbSetting.Text = "Date Base Connect Settings"; - // + // // _tbBase - // + // this._tbBase.Location = new System.Drawing.Point(54, 126); this._tbBase.Name = "_tbBase"; this._tbBase.Size = new System.Drawing.Size(152, 20); this._tbBase.TabIndex = 4; - // + // // label5 - // + // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(6, 129); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(31, 13); this.label5.TabIndex = 0; this.label5.Text = "Base"; - // + // // _tbPass - // + // this._tbPass.Location = new System.Drawing.Point(54, 100); this._tbPass.Name = "_tbPass"; this._tbPass.Size = new System.Drawing.Size(152, 20); this._tbPass.TabIndex = 3; this._tbPass.UseSystemPasswordChar = true; - // + // // label4 - // + // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(6, 103); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(30, 13); this.label4.TabIndex = 0; this.label4.Text = "Pass"; - // + // // _tbUser - // + // this._tbUser.Location = new System.Drawing.Point(54, 74); this._tbUser.Name = "_tbUser"; this._tbUser.Size = new System.Drawing.Size(152, 20); this._tbUser.TabIndex = 2; - // + // // label3 - // + // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(6, 77); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(29, 13); this.label3.TabIndex = 0; this.label3.Text = "User"; - // + // // _tbPort - // + // this._tbPort.Location = new System.Drawing.Point(54, 48); this._tbPort.Name = "_tbPort"; this._tbPort.Size = new System.Drawing.Size(152, 20); this._tbPort.TabIndex = 1; - // + // // label2 - // + // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(6, 51); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(26, 13); + this.label2.Size = new System.Drawing.Size(52, 13); this.label2.TabIndex = 0; - this.label2.Text = "Port"; - // + this.label2.Text = "Port/Pipe"; + // // _tbHost - // + // this._tbHost.Location = new System.Drawing.Point(54, 22); this._tbHost.Name = "_tbHost"; this._tbHost.Size = new System.Drawing.Size(152, 20); this._tbHost.TabIndex = 0; - // + // // label1 - // + // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(6, 25); this.label1.Name = "label1"; @@ -146,56 +150,90 @@ private void InitializeComponent() this.label1.TabIndex = 0; this.label1.Text = "Host"; // - // _cbUseDBConnect + // _tbPath + // + this._tbPath.Location = new System.Drawing.Point(66, 196); + this._tbPath.Name = "_tbPath"; + this._tbPath.Size = new System.Drawing.Size(152, 20); + this._tbPath.TabIndex = 6; + this._tbPath.Click += new System.EventHandler(this._tbPathClick); + this._tbPath.MouseHover += new System.EventHandler(this._tbPathMouseHover); // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(9, 199); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(54, 13); + this.label6.TabIndex = 5; + this.label6.Text = "DBC Path"; + // + // _cbUseDBConnect + // this._cbUseDBConnect.AutoSize = true; - this._cbUseDBConnect.Location = new System.Drawing.Point(21, 176); + this._cbUseDBConnect.Location = new System.Drawing.Point(11, 171); this._cbUseDBConnect.Name = "_cbUseDBConnect"; this._cbUseDBConnect.Size = new System.Drawing.Size(106, 17); this._cbUseDBConnect.TabIndex = 5; this._cbUseDBConnect.Text = "Use DB Connect"; this._cbUseDBConnect.UseVisualStyleBackColor = true; - this._cbUseDBConnect.CheckedChanged += new System.EventHandler(this._cbUseDBConnect_CheckedChanged); - // + this._cbUseDBConnect.CheckedChanged += new System.EventHandler(this.CbUseDbConnectCheckedChanged); + // // _bTestConnect - // - this._bTestConnect.Location = new System.Drawing.Point(12, 199); + // + this._bTestConnect.Location = new System.Drawing.Point(123, 167); this._bTestConnect.Name = "_bTestConnect"; this._bTestConnect.Size = new System.Drawing.Size(95, 23); this._bTestConnect.TabIndex = 6; this._bTestConnect.Text = "Test connect"; this._bTestConnect.UseVisualStyleBackColor = true; - this._bTestConnect.Click += new System.EventHandler(this._bSaveSettings_Click); - // + this._bTestConnect.Click += new System.EventHandler(this.BSaveSettingsClick); + // // _bSaveSettings - // - this._bSaveSettings.Location = new System.Drawing.Point(134, 199); + // + this._bSaveSettings.Location = new System.Drawing.Point(66, 222); this._bSaveSettings.Name = "_bSaveSettings"; this._bSaveSettings.Size = new System.Drawing.Size(95, 23); this._bSaveSettings.TabIndex = 7; this._bSaveSettings.Text = "Save"; this._bSaveSettings.UseVisualStyleBackColor = true; - this._bSaveSettings.Click += new System.EventHandler(this._bSaveSettings_Click); + this._bSaveSettings.Click += new System.EventHandler(this.BSaveSettingsClick); + // + // folderBrowserDialog1 // - // FormSettings + this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.DesktopDirectory; + this.folderBrowserDialog1.SelectedPath = "."; + this.folderBrowserDialog1.ShowNewFolderButton = false; + // + // toolTip1 // + this.toolTip1.AutoPopDelay = 5000; + this.toolTip1.InitialDelay = 0; + this.toolTip1.ReshowDelay = 0; + // + // FormSettings + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(242, 234); + this.ClientSize = new System.Drawing.Size(234, 250); this.Controls.Add(this._bSaveSettings); this.Controls.Add(this._bTestConnect); this.Controls.Add(this._cbUseDBConnect); + this.Controls.Add(this._tbPath); + this.Controls.Add(this.label6); this.Controls.Add(this._gbDbSetting); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(250, 268); + this.MaximumSize = new System.Drawing.Size(250, 288); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(250, 268); + this.MinimumSize = new System.Drawing.Size(250, 288); this.Name = "FormSettings"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "SpellWork Settings"; - this.Load += new System.EventHandler(this.SettingsForm_Load); + this.Load += new System.EventHandler(this.SettingsFormLoad); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormSettings_KeyDown); this._gbDbSetting.ResumeLayout(false); this._gbDbSetting.PerformLayout(); this.ResumeLayout(false); @@ -219,5 +257,9 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox _cbUseDBConnect; private System.Windows.Forms.Button _bTestConnect; private System.Windows.Forms.Button _bSaveSettings; + private System.Windows.Forms.TextBox _tbPath; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private System.Windows.Forms.ToolTip toolTip1; } } \ No newline at end of file diff --git a/SpellWork/Forms/FormSettings.cs b/SpellWork/Forms/FormSettings.cs index c4121824..1f856aa0 100644 --- a/SpellWork/Forms/FormSettings.cs +++ b/SpellWork/Forms/FormSettings.cs @@ -1,14 +1,9 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; +using SpellWork.Database; using SpellWork.Properties; -namespace SpellWork +namespace SpellWork.Forms { public partial class FormSettings : Form { @@ -17,51 +12,64 @@ public FormSettings() InitializeComponent(); } - private void _cbUseDBConnect_CheckedChanged(object sender, EventArgs e) + private void CbUseDbConnectCheckedChanged(object sender, EventArgs e) { _gbDbSetting.Enabled = ((CheckBox)sender).Checked; + this._bTestConnect.Enabled = _gbDbSetting.Enabled; } - private void _bSaveSettings_Click(object sender, EventArgs e) + private void BSaveSettingsClick(object sender, EventArgs e) { Settings.Default.Host = _tbHost.Text; - Settings.Default.Port = _tbPort.Text; + Settings.Default.PortOrPipe = _tbPort.Text; Settings.Default.User = _tbUser.Text; Settings.Default.Pass = _tbPass.Text; - Settings.Default.Db_mangos = _tbBase.Text; + Settings.Default.WorldDbName = _tbBase.Text; Settings.Default.UseDbConnect = _cbUseDBConnect.Checked; + Settings.Default.DbcPath = _tbPath.Text; - MySQLConnect.TestConnect(); - - if (((Button)sender).Text != "Save") - { - if (MySQLConnect.Connected) - { - MessageBox.Show("Connection is successfully!", "MySQL Connections!", - MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - MessageBox.Show("Connection is failed!", "ERROR!", - MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } + MySqlConnection.TestConnect(); - if (((Button)sender).Text == "Save") - { - Settings.Default.Save(); - this.Close(); - } + if (((Button)sender).Text != @"Save") + if (MySqlConnection.Connected) + MessageBox.Show(@"Connection successful!", @"MySQL Connections!", MessageBoxButtons.OK, MessageBoxIcon.Information); + + if (((Button)sender).Text != @"Save") + return; + + Settings.Default.Save(); + Close(); } - private void SettingsForm_Load(object sender, EventArgs e) + private void SettingsFormLoad(object sender, EventArgs e) { _tbHost.Text = Settings.Default.Host; - _tbPort.Text = Settings.Default.Port; + _tbPort.Text = Settings.Default.PortOrPipe; _tbUser.Text = Settings.Default.User; _tbPass.Text = Settings.Default.Pass; - _tbBase.Text = Settings.Default.Db_mangos; + _tbBase.Text = Settings.Default.WorldDbName; _gbDbSetting.Enabled = _cbUseDBConnect.Checked = Settings.Default.UseDbConnect; + _tbPath.Text = Settings.Default.DbcPath; + } + + private void FormSettings_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Escape) + Close(); + } + + private void _tbPathClick(object sender, EventArgs e) + { + if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + Settings.Default.DbcPath = folderBrowserDialog1.SelectedPath; + Settings.Default.Save(); + } + } + + private void _tbPathMouseHover(object sender, EventArgs e) + { + toolTip1.Show("Click to select folder path of dbcs", _tbPath); } } } diff --git a/SpellWork/Forms/FormSpellScaling.Designer.cs b/SpellWork/Forms/FormSpellScaling.Designer.cs new file mode 100644 index 00000000..bd8d4b32 --- /dev/null +++ b/SpellWork/Forms/FormSpellScaling.Designer.cs @@ -0,0 +1,119 @@ +namespace SpellWork.Forms +{ + partial class FormSpellScaling + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this._bOk = new System.Windows.Forms.Button(); + this._bCancel = new System.Windows.Forms.Button(); + this._tbxLevel = new System.Windows.Forms.TextBox(); + this._tbLevel = new System.Windows.Forms.TrackBar(); + this._lInfo = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this._tbLevel)).BeginInit(); + this.SuspendLayout(); + // + // _bOk + // + this._bOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this._bOk.Location = new System.Drawing.Point(116, 76); + 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.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 = 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; + this._tbLevel.Name = "_tbLevel"; + this._tbLevel.Size = new System.Drawing.Size(226, 45); + this._tbLevel.TabIndex = 3; + this._tbLevel.TickFrequency = 5; + 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"; + // + // 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.Controls.Add(this._lInfo); + this.Controls.Add(this._tbLevel); + this.Controls.Add(this._tbxLevel); + this.Controls.Add(this._bCancel); + this.Controls.Add(this._bOk); + this.Name = "FormSpellScaling"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Spell scaler"; + ((System.ComponentModel.ISupportInitialize)(this._tbLevel)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button _bOk; + private System.Windows.Forms.Button _bCancel; + private System.Windows.Forms.TextBox _tbxLevel; + private System.Windows.Forms.TrackBar _tbLevel; + private System.Windows.Forms.Label _lInfo; + } +} \ No newline at end of file diff --git a/SpellWork/Forms/FormSpellScaling.cs b/SpellWork/Forms/FormSpellScaling.cs new file mode 100644 index 00000000..50f4c083 --- /dev/null +++ b/SpellWork/Forms/FormSpellScaling.cs @@ -0,0 +1,48 @@ +using System; +using System.Windows.Forms; + +namespace SpellWork.Forms +{ + public partial class FormSpellScaling : Form + { + public FormSpellScaling() + { + InitializeComponent(); + } + + private void LevelValueChanged(object sender, System.EventArgs e) + { + SelectedLevel = (uint)((TrackBar)sender).Value; + _tbxLevel.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) + e.Handled = true; + } + + private void LevelTextChanged(object sender, EventArgs e) + { + var tb = (TextBox)sender; + if (tb.Text.Length <= 0) + { + SelectedLevel = 1; + tb.Text = "1"; + return; + } + + var val = int.Parse(tb.Text); + if (val > 100) + tb.Text = "100"; + else if (val <= 0) + tb.Text = "1"; + + val = int.Parse(tb.Text); + _tbLevel.Value = val; + SelectedLevel = (uint)val; + } + + public uint SelectedLevel; + } +} diff --git a/SpellWork/Forms/FormSpellScaling.resx b/SpellWork/Forms/FormSpellScaling.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/SpellWork/Forms/FormSpellScaling.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.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/Loader.cs b/SpellWork/Loader.cs deleted file mode 100644 index c8462c05..00000000 --- a/SpellWork/Loader.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace SpellWork -{ - class Loader - { - public Loader() - { - DBC.Spell = DBCReader.ReadDBC(DBC.SpellStrings); - DBC.SkillLine = DBCReader.ReadDBC(DBC.SkillLineStrings); - DBC.SpellRange = DBCReader.ReadDBC(DBC.SpellRangeStrings); - DBC.ScreenEffect = DBCReader.ReadDBC(DBC.ScreenEffectStrings); - - DBC.SpellDuration = DBCReader.ReadDBC(null); - DBC.SkillLineAbility = DBCReader.ReadDBC(null); - DBC.SpellRadius = DBCReader.ReadDBC(null); - DBC.SpellCastTimes = DBCReader.ReadDBC(null); - DBC.SpellDifficulty = DBCReader.ReadDBC(null); - - DBC.OverrideSpellData = DBCReader.ReadDBC(null); - - - DBC.Locale = DetectedLocale; - } - - private LocalesDBC DetectedLocale - { - get - { - byte locale = 0; - while (DBC.Spell[DBC.SPELL_ENTRY_FOR_DETECT_LOCALE].GetName(locale) == String.Empty) - { - ++locale; - - if (locale >= DBC.MAX_DBC_LOCALE) - throw new Exception("Detected unknown locale index " + locale); - } - return (LocalesDBC)locale; - } - } - } -} diff --git a/SpellWork/New Icon.ico b/SpellWork/New Icon.ico index 7ef1f929..75d75c4a 100644 Binary files a/SpellWork/New Icon.ico and b/SpellWork/New Icon.ico differ diff --git a/SpellWork/Program.cs b/SpellWork/Program.cs index 4b22f497..0bff5fb5 100644 --- a/SpellWork/Program.cs +++ b/SpellWork/Program.cs @@ -1,8 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; using System.IO; +using System.Windows.Forms; +using SpellWork.Forms; namespace SpellWork { @@ -12,20 +11,29 @@ static class Program /// The main entry point for the application. /// [STAThread] - static void Main(string[] args) + static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { - new Loader(); + DBC.DBC.Load(); Application.Run(new FormMain()); } - catch (Exception ex) + catch (DirectoryNotFoundException dnfe) + { + MessageBox.Show(dnfe.Message, @"Missing required DBC file!", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (ArgumentException ae) { - MessageBox.Show(ex.Message, "SpellWork Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(ae.Message, @"DBC file has wrong structure!", MessageBoxButtons.OK, MessageBoxIcon.Error); } + //catch (Exception ex) + //{ + // MessageBox.Show(ex.Message, @"SpellWork Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); + // MessageBox.Show(ex.ToString()); + //} } } } diff --git a/SpellWork/Properties/AssemblyInfo.cs b/SpellWork/Properties/AssemblyInfo.cs index efd6526e..618dd1ca 100644 --- a/SpellWork/Properties/AssemblyInfo.cs +++ b/SpellWork/Properties/AssemblyInfo.cs @@ -1,21 +1,20 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SpellWork")] [assembly: AssemblyDescription("SpellWork")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MaNGOS")] +[assembly: AssemblyCompany("Trinity")] [assembly: AssemblyProduct("SpellWork")] [assembly: AssemblyCopyright("Copyright © LordJZ and Konctantin 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,11 +24,11 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/SpellWork/Properties/Resources.Designer.cs b/SpellWork/Properties/Resources.Designer.cs index 2d83977d..ef2b3c00 100644 --- a/SpellWork/Properties/Resources.Designer.cs +++ b/SpellWork/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.269 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/SpellWork/Properties/Settings.Designer.cs b/SpellWork/Properties/Settings.Designer.cs index 83e2be7c..c1ace11f 100644 --- a/SpellWork/Properties/Settings.Designer.cs +++ b/SpellWork/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Этот код создан программой. -// Исполняемая версия:2.0.50727.3603 +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 // -// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае -// повторной генерации кода. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace SpellWork.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -38,18 +38,18 @@ public string Host { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("3306")] - public string Port { + public string PortOrPipe { get { - return ((string)(this["Port"])); + return ((string)(this["PortOrPipe"])); } set { - this["Port"] = value; + this["PortOrPipe"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("root")] + [global::System.Configuration.DefaultSettingValueAttribute("trinity")] public string User { get { return ((string)(this["User"])); @@ -61,7 +61,7 @@ public string User { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] + [global::System.Configuration.DefaultSettingValueAttribute("trinity")] public string Pass { get { return ((string)(this["Pass"])); @@ -73,13 +73,13 @@ public string Pass { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("mangos")] - public string Db_mangos { + [global::System.Configuration.DefaultSettingValueAttribute("world")] + public string WorldDbName { get { - return ((string)(this["Db_mangos"])); + return ((string)(this["WorldDbName"])); } set { - this["Db_mangos"] = value; + this["WorldDbName"] = value; } } @@ -94,5 +94,17 @@ public bool UseDbConnect { this["UseDbConnect"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("dbc")] + public string DbcPath { + get { + return ((string)(this["DbcPath"])); + } + set { + this["DbcPath"] = value; + } + } } } diff --git a/SpellWork/Properties/Settings.settings b/SpellWork/Properties/Settings.settings index 1554f570..1c53113c 100644 --- a/SpellWork/Properties/Settings.settings +++ b/SpellWork/Properties/Settings.settings @@ -5,20 +5,23 @@ localhost - + 3306 - root + trinity - + trinity - - mangos + + world False + + dbc + \ No newline at end of file diff --git a/SpellWork/Spell/ProcInfo.cs b/SpellWork/Spell/ProcInfo.cs index abaa43e1..f2b12384 100644 --- a/SpellWork/Spell/ProcInfo.cs +++ b/SpellWork/Spell/ProcInfo.cs @@ -1,36 +1,38 @@ using System; +using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; -using System.Drawing; +using SpellWork.DBC.Structures; +using SpellWork.Extensions; -namespace SpellWork +namespace SpellWork.Spell { public class ProcInfo { - public static SpellEntry SpellProc { get; set; } + public static SpellInfoHelper SpellProc { get; set; } public static bool Update = true; public ProcInfo(TreeView familyTree, SpellFamilyNames spellfamily) { familyTree.Nodes.Clear(); - var spells = from Spell in DBC.Spell - where Spell.Value.SpellFamilyName == (uint)spellfamily - join sk in DBC.SkillLineAbility on Spell.Key equals sk.Value.SpellId into temp1 - from Skill in temp1.DefaultIfEmpty() - join skl in DBC.SkillLine on Skill.Value.SkillId equals skl.Key into temp2 - from SkillLine in temp2.DefaultIfEmpty() + 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 + from skill in temp1.DefaultIfEmpty(new SkillLineAbilityEntry()) + join skl in DBC.DBC.SkillLine.Values on skill.SkillId equals skl.Id into temp2 + from skillLine in temp2.DefaultIfEmpty(new SkillLineEntry()) select new { - Spell, - Skill.Value.SkillId, - SkillLine.Value + spell, + skill.SkillId, + skillLine }; - for (int i = 0; i < 96; i++) + for (var i = 0; i < 96; ++i) { - uint[] mask = new uint[3]; + var mask = new uint[3]; if (i < 32) mask[0] = 1U << i; @@ -39,40 +41,42 @@ from SkillLine in temp2.DefaultIfEmpty() else mask[2] = 1U << (i - 64); - TreeNode node = new TreeNode(); - node.Text = String.Format("0x{0:X8} {1:X8} {2:X8}", mask[2], mask[1], mask[0]); - node.ImageKey = "family.ico"; + var node = new TreeNode + { + Text = String.Format("0x{0:X8} {1:X8} {2:X8}", mask[2], mask[1], mask[0]), + ImageKey = @"family.ico" + }; familyTree.Nodes.Add(node); } foreach (var elem in spells) { - SpellEntry spell = elem.Spell.Value; - bool IsSkill = elem.SkillId != 0; + var spell = elem.spell; + var isSkill = elem.SkillId != 0; - StringBuilder name = new StringBuilder(); - StringBuilder toolTip = new StringBuilder(); + var name = new StringBuilder(); + var toolTip = new StringBuilder(); name.AppendFormat("{0} - {1} ", spell.ID, spell.SpellNameRank); - + toolTip.AppendFormatLine("Spell Name: {0}", spell.SpellNameRank); toolTip.AppendFormatLine("Description: {0}", spell.Description); toolTip.AppendFormatLine("ToolTip: {0}", spell.ToolTip); - if (IsSkill) + if (isSkill) { - name.AppendFormat("(Skill: ({0}) {1}) ", elem.SkillId, elem.Value.Name); + name.AppendFormat("(Skill: ({0}) {1}) ", elem.SkillId, elem.skillLine.Name); toolTip.AppendLine(); - toolTip.AppendFormatLine("Skill Name: {0}", elem.Value.Name); - toolTip.AppendFormatLine("Description: {0}", elem.Value.Description); + toolTip.AppendFormatLine("Skill Name: {0}", elem.skillLine.Name); + toolTip.AppendFormatLine("Description: {0}", elem.skillLine.Description); } - name.AppendFormat("({0})", spell.School.ToString().NormaliseString("MASK_")); - + name.AppendFormat("({0})", spell.School.ToString().NormalizeString("MASK_")); + foreach (TreeNode node in familyTree.Nodes) { - uint[] mask = new uint[3]; + var mask = new uint[3]; if (node.Index < 32) mask[0] = 1U << node.Index; @@ -81,15 +85,14 @@ from SkillLine in temp2.DefaultIfEmpty() else mask[2] = 1U << (node.Index - 64); - if ((spell.SpellFamilyFlags.ContainsElement(mask))) - { - TreeNode child = new TreeNode(); - child = node.Nodes.Add(name.ToString()); - child.Name = spell.ID.ToString(); - child.ImageKey = IsSkill ? "plus.ico" : "munus.ico"; - child.ForeColor = IsSkill ? Color.Blue : Color.Red; - child.ToolTipText = toolTip.ToString(); - } + if ((!spell.SpellFamilyFlags.ContainsElement(mask))) + continue; + + var child = node.Nodes.Add(name.ToString()); + child.Name = spell.ID.ToString(); + child.ImageKey = isSkill ? "plus.ico" : "munus.ico"; + child.ForeColor = isSkill ? Color.Blue : Color.Red; + child.ToolTipText = toolTip.ToString(); } } } diff --git a/SpellWork/Spell/SpellCompare.cs b/SpellWork/Spell/SpellCompare.cs index fd0793cd..44428025 100644 --- a/SpellWork/Spell/SpellCompare.cs +++ b/SpellWork/Spell/SpellCompare.cs @@ -1,7 +1,8 @@ -using System.Windows.Forms; -using System.Drawing; +using System.Drawing; +using System.Windows.Forms; +using SpellWork.Extensions; -namespace SpellWork +namespace SpellWork.Spell { /// /// Compares two spells @@ -11,7 +12,7 @@ class SpellCompare /// /// Search terms /// - string[] words = new[] { "=====" };// todo: more wodrs + readonly string[] _words = new[] { "=====" }; /// /// Compares two spells @@ -20,58 +21,36 @@ class SpellCompare /// RichTextBox 2 in right /// Compare Spell 1 /// Compare Spell 2 - public SpellCompare(RichTextBox rtb1, RichTextBox rtb2, SpellEntry spell1, SpellEntry spell2) + public SpellCompare(RichTextBox rtb1, RichTextBox rtb2, SpellInfoHelper spell1, SpellInfoHelper spell2) { new SpellInfo(rtb1, spell1); new SpellInfo(rtb2, spell2); - string[] strsl = rtb1.Text.Split('\n'); - string[] strsr = rtb2.Text.Split('\n'); - - int pos = 0; - foreach (string str in strsl) + var strsl = rtb1.Text.Split('\n'); + var strsr = rtb2.Text.Split('\n'); + + var pos = 0; + foreach (var str in strsl) { pos += str.Length + 1; rtb1.Select(pos - str.Length - 1, pos - 1); if (rtb2.Find(str, RichTextBoxFinds.WholeWord) != -1) - { - if (str.ContainsText(words)) - { - rtb1.SelectionBackColor = rtb1.BackColor; - } - else - { - rtb1.SelectionBackColor = Color.Cyan; - } - } + rtb1.SelectionBackColor = str.ContainsText(_words) ? rtb1.BackColor : Color.Cyan; else - { rtb1.SelectionBackColor = Color.Salmon; - } } pos = 0; - foreach (string str in strsr) + foreach (var str in strsr) { pos += str.Length + 1; rtb2.Select(pos - str.Length - 1, pos - 1); if (rtb1.Find(str, RichTextBoxFinds.WholeWord) != -1) - { - if (str.ContainsText(words)) - { - rtb2.SelectionBackColor = rtb2.BackColor; - } - else - { - rtb2.SelectionBackColor = Color.Cyan; - } - } + rtb2.SelectionBackColor = str.ContainsText(_words) ? rtb2.BackColor : Color.Cyan; else - { rtb2.SelectionBackColor = Color.Salmon; - } } } } diff --git a/SpellWork/Spell/SpellEnums.cs b/SpellWork/Spell/SpellEnums.cs index 85453653..2f10c490 100644 --- a/SpellWork/Spell/SpellEnums.cs +++ b/SpellWork/Spell/SpellEnums.cs @@ -1,20 +1,8 @@ using System; -namespace SpellWork +namespace SpellWork.Spell { - public enum LocalesDBC - { - enUS, - koKR, - frFR, - deDE, - zhCN, - zhTW, - esES, - esMX, - ruRU - }; - + // ReSharper disable InconsistentNaming /// /// /// @@ -45,29 +33,30 @@ public enum SpellFamilyNames /// public enum SpellSpecific { - SPELL_NORMAL = 0, - SPELL_SEAL = 1, - SPELL_BLESSING = 2, - SPELL_AURA = 3, - SPELL_STING = 4, - SPELL_CURSE = 5, - SPELL_ASPECT = 6, - SPELL_TRACKER = 7, - SPELL_WARLOCK_ARMOR = 8, - SPELL_MAGE_ARMOR = 9, - SPELL_ELEMENTAL_SHIELD = 10, - SPELL_MAGE_POLYMORPH = 11, - SPELL_POSITIVE_SHOUT = 12, - SPELL_JUDGEMENT = 13, - SPELL_BATTLE_ELIXIR = 14, - SPELL_GUARDIAN_ELIXIR = 15, - SPELL_FLASK_ELIXIR = 16, - SPELL_PRESENCE = 17, - SPELL_HAND = 18, - SPELL_WELL_FED = 19, - SPELL_FOOD = 20, - SPELL_DRINK = 21, - SPELL_FOOD_AND_DRINK = 22, + SPELL_SPECIFIC_NORMAL = 0, + SPELL_SPECIFIC_SEAL = 1, + SPELL_SPECIFIC_AURA = 3, + SPELL_SPECIFIC_STING = 4, + SPELL_SPECIFIC_CURSE = 5, + SPELL_SPECIFIC_ASPECT = 6, + SPELL_SPECIFIC_TRACKER = 7, + SPELL_SPECIFIC_WARLOCK_ARMOR = 8, + SPELL_SPECIFIC_MAGE_ARMOR = 9, + SPELL_SPECIFIC_ELEMENTAL_SHIELD = 10, + SPELL_SPECIFIC_MAGE_POLYMORPH = 11, + SPELL_SPECIFIC_JUDGEMENT = 13, + SPELL_SPECIFIC_WARLOCK_CORRUPTION = 17, + SPELL_SPECIFIC_FOOD = 19, + SPELL_SPECIFIC_DRINK = 20, + SPELL_SPECIFIC_FOOD_AND_DRINK = 21, + SPELL_SPECIFIC_PRESENCE = 22, + SPELL_SPECIFIC_CHARM = 23, + SPELL_SPECIFIC_SCROLL = 24, + SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE = 25, + SPELL_SPECIFIC_WARRIOR_ENRAGE = 26, + SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT = 27, + SPELL_SPECIFIC_HAND = 28, + SPELL_SPECIFIC_PHASE = 29, }; /// @@ -75,173 +64,190 @@ public enum SpellSpecific /// public enum SpellEffects { - NO_SPELL_EFFECT = 0, - SPELL_EFFECT_INSTAKILL = 1, - SPELL_EFFECT_SCHOOL_DAMAGE = 2, - SPELL_EFFECT_DUMMY = 3, - SPELL_EFFECT_PORTAL_TELEPORT = 4, - SPELL_EFFECT_TELEPORT_UNITS = 5, - SPELL_EFFECT_APPLY_AURA = 6, - SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 7, - SPELL_EFFECT_POWER_DRAIN = 8, - SPELL_EFFECT_HEALTH_LEECH = 9, - SPELL_EFFECT_HEAL = 10, - SPELL_EFFECT_BIND = 11, - SPELL_EFFECT_PORTAL = 12, - SPELL_EFFECT_RITUAL_BASE = 13, - SPELL_EFFECT_RITUAL_SPECIALIZE = 14, - SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15, - SPELL_EFFECT_QUEST_COMPLETE = 16, - SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 17, - SPELL_EFFECT_RESURRECT = 18, - SPELL_EFFECT_ADD_EXTRA_ATTACKS = 19, - SPELL_EFFECT_DODGE = 20, - SPELL_EFFECT_EVADE = 21, - SPELL_EFFECT_PARRY = 22, - SPELL_EFFECT_BLOCK = 23, - SPELL_EFFECT_CREATE_ITEM = 24, - SPELL_EFFECT_WEAPON = 25, - SPELL_EFFECT_DEFENSE = 26, - SPELL_EFFECT_PERSISTENT_AREA_AURA = 27, - SPELL_EFFECT_SUMMON = 28, - SPELL_EFFECT_LEAP = 29, - SPELL_EFFECT_ENERGIZE = 30, - SPELL_EFFECT_WEAPON_PERCENT_DAMAGE = 31, - SPELL_EFFECT_TRIGGER_MISSILE = 32, - SPELL_EFFECT_OPEN_LOCK = 33, - SPELL_EFFECT_SUMMON_CHANGE_ITEM = 34, - SPELL_EFFECT_APPLY_AREA_AURA_PARTY = 35, - SPELL_EFFECT_LEARN_SPELL = 36, - SPELL_EFFECT_SPELL_DEFENSE = 37, - SPELL_EFFECT_DISPEL = 38, - SPELL_EFFECT_LANGUAGE = 39, - SPELL_EFFECT_DUAL_WIELD = 40, - SPELL_EFFECT_JUMP = 41, - SPELL_EFFECT_JUMP2 = 42, - SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 43, - SPELL_EFFECT_SKILL_STEP = 44, - SPELL_EFFECT_ADD_HONOR = 45, - SPELL_EFFECT_SPAWN = 46, - SPELL_EFFECT_TRADE_SKILL = 47, - SPELL_EFFECT_STEALTH = 48, - SPELL_EFFECT_DETECT = 49, - SPELL_EFFECT_TRANS_DOOR = 50, - SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, - SPELL_EFFECT_GUARANTEE_HIT = 52, - SPELL_EFFECT_ENCHANT_ITEM = 53, - SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 54, - SPELL_EFFECT_TAMECREATURE = 55, - SPELL_EFFECT_SUMMON_PET = 56, - SPELL_EFFECT_LEARN_PET_SPELL = 57, - SPELL_EFFECT_WEAPON_DAMAGE = 58, - SPELL_EFFECT_CREATE_RANDOM_ITEM = 59, - SPELL_EFFECT_PROFICIENCY = 60, - SPELL_EFFECT_SEND_EVENT = 61, - SPELL_EFFECT_POWER_BURN = 62, - SPELL_EFFECT_THREAT = 63, - SPELL_EFFECT_TRIGGER_SPELL = 64, - SPELL_EFFECT_APPLY_AREA_AURA_RAID = 65, - SPELL_EFFECT_CREATE_MANA_GEM = 66, - SPELL_EFFECT_HEAL_MAX_HEALTH = 67, - SPELL_EFFECT_INTERRUPT_CAST = 68, - SPELL_EFFECT_DISTRACT = 69, - SPELL_EFFECT_PULL = 70, - SPELL_EFFECT_PICKPOCKET = 71, - SPELL_EFFECT_ADD_FARSIGHT = 72, - SPELL_EFFECT_UNTRAIN_TALENTS = 73, - SPELL_EFFECT_APPLY_GLYPH = 74, - SPELL_EFFECT_HEAL_MECHANICAL = 75, - SPELL_EFFECT_SUMMON_OBJECT_WILD = 76, - SPELL_EFFECT_SCRIPT_EFFECT = 77, - SPELL_EFFECT_ATTACK = 78, - SPELL_EFFECT_SANCTUARY = 79, - SPELL_EFFECT_ADD_COMBO_POINTS = 80, - SPELL_EFFECT_CREATE_HOUSE = 81, - SPELL_EFFECT_BIND_SIGHT = 82, - SPELL_EFFECT_DUEL = 83, - SPELL_EFFECT_STUCK = 84, - SPELL_EFFECT_SUMMON_PLAYER = 85, - SPELL_EFFECT_ACTIVATE_OBJECT = 86, - SPELL_EFFECT_WMO_DAMAGE = 87, - SPELL_EFFECT_WMO_REPAIR = 88, - SPELL_EFFECT_WMO_CHANGE = 89, - SPELL_EFFECT_KILL_CREDIT = 90, - SPELL_EFFECT_THREAT_ALL = 91, - SPELL_EFFECT_ENCHANT_HELD_ITEM = 92, - SPELL_EFFECT_BREAK_PLAYER_TARGETING = 93, - SPELL_EFFECT_SELF_RESURRECT = 94, - SPELL_EFFECT_SKINNING = 95, - SPELL_EFFECT_CHARGE = 96, - SPELL_EFFECT_SUMMON_ALL_TOTEMS = 97, - SPELL_EFFECT_KNOCK_BACK = 98, - SPELL_EFFECT_DISENCHANT = 99, - SPELL_EFFECT_INEBRIATE = 100, - SPELL_EFFECT_FEED_PET = 101, - SPELL_EFFECT_DISMISS_PET = 102, - SPELL_EFFECT_REPUTATION = 103, - SPELL_EFFECT_SUMMON_OBJECT_SLOT1 = 104, - SPELL_EFFECT_SUMMON_OBJECT_SLOT2 = 105, - SPELL_EFFECT_SUMMON_OBJECT_SLOT3 = 106, - SPELL_EFFECT_SUMMON_OBJECT_SLOT4 = 107, - SPELL_EFFECT_DISPEL_MECHANIC = 108, - SPELL_EFFECT_SUMMON_DEAD_PET = 109, - SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110, - SPELL_EFFECT_DURABILITY_DAMAGE = 111, - SPELL_EFFECT_112 = 112, - SPELL_EFFECT_RESURRECT_NEW = 113, - SPELL_EFFECT_ATTACK_ME = 114, - SPELL_EFFECT_DURABILITY_DAMAGE_PCT = 115, - SPELL_EFFECT_SKIN_PLAYER_CORPSE = 116, - SPELL_EFFECT_SPIRIT_HEAL = 117, - SPELL_EFFECT_SKILL = 118, - SPELL_EFFECT_APPLY_AREA_AURA_PET = 119, - SPELL_EFFECT_TELEPORT_GRAVEYARD = 120, - SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 121, - SPELL_EFFECT_122 = 122, - SPELL_EFFECT_SEND_TAXI = 123, - SPELL_EFFECT_PLAYER_PULL = 124, - SPELL_EFFECT_MODIFY_THREAT_PERCENT = 125, - SPELL_EFFECT_STEAL_BENEFICIAL_BUFF = 126, - SPELL_EFFECT_PROSPECTING = 127, - SPELL_EFFECT_APPLY_AREA_AURA_FRIEND = 128, - SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129, - SPELL_EFFECT_REDIRECT_THREAT = 130, - SPELL_EFFECT_131 = 131, - SPELL_EFFECT_PLAY_MUSIC = 132, - SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133, - SPELL_EFFECT_KILL_CREDIT2 = 134, - SPELL_EFFECT_CALL_PET = 135, - SPELL_EFFECT_HEAL_PCT = 136, - SPELL_EFFECT_ENERGIZE_PCT = 137, - SPELL_EFFECT_LEAP_BACK = 138, - SPELL_EFFECT_CLEAR_QUEST = 139, - SPELL_EFFECT_FORCE_CAST = 140, - SPELL_EFFECT_141 = 141, - SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142, - SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143, - SPELL_EFFECT_144 = 144, - SPELL_EFFECT_145 = 145, - SPELL_EFFECT_ACTIVATE_RUNE = 146, - SPELL_EFFECT_QUEST_FAIL = 147, - SPELL_EFFECT_148 = 148, - SPELL_EFFECT_CHARGE2 = 149, - SPELL_EFFECT_150 = 150, - SPELL_EFFECT_TRIGGER_SPELL_2 = 151, - SPELL_EFFECT_152 = 152, - SPELL_EFFECT_CREATE_PET = 153, - SPELL_EFFECT_TEACH_TAXI_NODE = 154, - SPELL_EFFECT_TITAN_GRIP = 155, - SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC = 156, - SPELL_EFFECT_CREATE_ITEM_2 = 157, - SPELL_EFFECT_MILLING = 158, - SPELL_EFFECT_ALLOW_RENAME_PET = 159, - SPELL_EFFECT_160 = 160, - SPELL_EFFECT_TALENT_SPEC_COUNT = 161, - SPELL_EFFECT_TALENT_SPEC_SELECT = 162, - SPELL_EFFECT_163 = 163, - SPELL_EFFECT_CANCEL_AURA = 164, - - TOTAL_SPELL_EFFECTS + NO_SPELL_EFFECT = 0, + SPELL_EFFECT_INSTAKILL = 1, + SPELL_EFFECT_SCHOOL_DAMAGE = 2, + SPELL_EFFECT_DUMMY = 3, + SPELL_EFFECT_PORTAL_TELEPORT = 4, // Unused (4.3.4) + SPELL_EFFECT_TELEPORT_UNITS = 5, + SPELL_EFFECT_APPLY_AURA = 6, + SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 7, + SPELL_EFFECT_POWER_DRAIN = 8, + SPELL_EFFECT_HEALTH_LEECH = 9, + SPELL_EFFECT_HEAL = 10, + SPELL_EFFECT_BIND = 11, + SPELL_EFFECT_PORTAL = 12, + SPELL_EFFECT_RITUAL_BASE = 13, // Unused (4.3.4) + SPELL_EFFECT_RITUAL_SPECIALIZE = 14, // Unused (4.3.4) + SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15, // Unused (4.3.4) + SPELL_EFFECT_QUEST_COMPLETE = 16, + SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 17, + SPELL_EFFECT_RESURRECT = 18, + SPELL_EFFECT_ADD_EXTRA_ATTACKS = 19, + SPELL_EFFECT_DODGE = 20, + SPELL_EFFECT_EVADE = 21, + SPELL_EFFECT_PARRY = 22, + SPELL_EFFECT_BLOCK = 23, + SPELL_EFFECT_CREATE_ITEM = 24, + SPELL_EFFECT_WEAPON = 25, + SPELL_EFFECT_DEFENSE = 26, + SPELL_EFFECT_PERSISTENT_AREA_AURA = 27, + SPELL_EFFECT_SUMMON = 28, + SPELL_EFFECT_LEAP = 29, + SPELL_EFFECT_ENERGIZE = 30, + SPELL_EFFECT_WEAPON_PERCENT_DAMAGE = 31, + SPELL_EFFECT_TRIGGER_MISSILE = 32, + SPELL_EFFECT_OPEN_LOCK = 33, + SPELL_EFFECT_SUMMON_CHANGE_ITEM = 34, + SPELL_EFFECT_APPLY_AREA_AURA_PARTY = 35, + SPELL_EFFECT_LEARN_SPELL = 36, + SPELL_EFFECT_SPELL_DEFENSE = 37, + SPELL_EFFECT_DISPEL = 38, + SPELL_EFFECT_LANGUAGE = 39, + SPELL_EFFECT_DUAL_WIELD = 40, + SPELL_EFFECT_JUMP = 41, + SPELL_EFFECT_JUMP_DEST = 42, + SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 43, + SPELL_EFFECT_SKILL_STEP = 44, + SPELL_EFFECT_PLAY_MOVIE = 45, + SPELL_EFFECT_SPAWN = 46, + SPELL_EFFECT_TRADE_SKILL = 47, + SPELL_EFFECT_STEALTH = 48, + SPELL_EFFECT_DETECT = 49, + SPELL_EFFECT_TRANS_DOOR = 50, + SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, // Unused (4.3.4) + SPELL_EFFECT_GUARANTEE_HIT = 52, // Unused (4.3.4) + SPELL_EFFECT_ENCHANT_ITEM = 53, + SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 54, + SPELL_EFFECT_TAMECREATURE = 55, + SPELL_EFFECT_SUMMON_PET = 56, + SPELL_EFFECT_LEARN_PET_SPELL = 57, + SPELL_EFFECT_WEAPON_DAMAGE = 58, + SPELL_EFFECT_CREATE_RANDOM_ITEM = 59, + SPELL_EFFECT_PROFICIENCY = 60, + SPELL_EFFECT_SEND_EVENT = 61, + SPELL_EFFECT_POWER_BURN = 62, + SPELL_EFFECT_THREAT = 63, + SPELL_EFFECT_TRIGGER_SPELL = 64, + SPELL_EFFECT_APPLY_AREA_AURA_RAID = 65, + SPELL_EFFECT_CREATE_MANA_GEM = 66, + SPELL_EFFECT_HEAL_MAX_HEALTH = 67, + SPELL_EFFECT_INTERRUPT_CAST = 68, + SPELL_EFFECT_DISTRACT = 69, + SPELL_EFFECT_PULL = 70, + SPELL_EFFECT_PICKPOCKET = 71, + SPELL_EFFECT_ADD_FARSIGHT = 72, + SPELL_EFFECT_UNTRAIN_TALENTS = 73, + SPELL_EFFECT_APPLY_GLYPH = 74, + SPELL_EFFECT_HEAL_MECHANICAL = 75, + SPELL_EFFECT_SUMMON_OBJECT_WILD = 76, + SPELL_EFFECT_SCRIPT_EFFECT = 77, + SPELL_EFFECT_ATTACK = 78, + SPELL_EFFECT_SANCTUARY = 79, + SPELL_EFFECT_ADD_COMBO_POINTS = 80, + SPELL_EFFECT_CREATE_HOUSE = 81, + SPELL_EFFECT_BIND_SIGHT = 82, + SPELL_EFFECT_DUEL = 83, + SPELL_EFFECT_STUCK = 84, + SPELL_EFFECT_SUMMON_PLAYER = 85, + SPELL_EFFECT_ACTIVATE_OBJECT = 86, + SPELL_EFFECT_GAMEOBJECT_DAMAGE = 87, + SPELL_EFFECT_GAMEOBJECT_REPAIR = 88, + SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE = 89, + SPELL_EFFECT_KILL_CREDIT = 90, + SPELL_EFFECT_THREAT_ALL = 91, + SPELL_EFFECT_ENCHANT_HELD_ITEM = 92, + SPELL_EFFECT_FORCE_DESELECT = 93, + SPELL_EFFECT_SELF_RESURRECT = 94, + SPELL_EFFECT_SKINNING = 95, + SPELL_EFFECT_CHARGE = 96, + SPELL_EFFECT_CAST_BUTTON = 97, + SPELL_EFFECT_KNOCK_BACK = 98, + SPELL_EFFECT_DISENCHANT = 99, + SPELL_EFFECT_INEBRIATE = 100, + SPELL_EFFECT_FEED_PET = 101, + SPELL_EFFECT_DISMISS_PET = 102, + SPELL_EFFECT_REPUTATION = 103, + SPELL_EFFECT_SUMMON_OBJECT_SLOT1 = 104, + SPELL_EFFECT_SUMMON_OBJECT_SLOT2 = 105, + SPELL_EFFECT_SUMMON_OBJECT_SLOT3 = 106, + SPELL_EFFECT_SUMMON_OBJECT_SLOT4 = 107, + SPELL_EFFECT_DISPEL_MECHANIC = 108, + SPELL_EFFECT_RESURRECT_PET = 109, + SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110, + SPELL_EFFECT_DURABILITY_DAMAGE = 111, + SPELL_EFFECT_112 = 112, + SPELL_EFFECT_RESURRECT_NEW = 113, + SPELL_EFFECT_ATTACK_ME = 114, + SPELL_EFFECT_DURABILITY_DAMAGE_PCT = 115, + SPELL_EFFECT_SKIN_PLAYER_CORPSE = 116, + SPELL_EFFECT_SPIRIT_HEAL = 117, + SPELL_EFFECT_SKILL = 118, + SPELL_EFFECT_APPLY_AREA_AURA_PET = 119, + SPELL_EFFECT_TELEPORT_GRAVEYARD = 120, + SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 121, + SPELL_EFFECT_122 = 122, // Unused (4.3.4) + SPELL_EFFECT_SEND_TAXI = 123, + SPELL_EFFECT_PULL_TOWARDS = 124, + SPELL_EFFECT_MODIFY_THREAT_PERCENT = 125, + SPELL_EFFECT_STEAL_BENEFICIAL_BUFF = 126, + SPELL_EFFECT_PROSPECTING = 127, + SPELL_EFFECT_APPLY_AREA_AURA_FRIEND = 128, + SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129, + SPELL_EFFECT_REDIRECT_THREAT = 130, + SPELL_EFFECT_PLAY_SOUND = 131, + SPELL_EFFECT_PLAY_MUSIC = 132, + SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133, + SPELL_EFFECT_KILL_CREDIT2 = 134, + SPELL_EFFECT_CALL_PET = 135, + SPELL_EFFECT_HEAL_PCT = 136, + SPELL_EFFECT_ENERGIZE_PCT = 137, + SPELL_EFFECT_LEAP_BACK = 138, + SPELL_EFFECT_CLEAR_QUEST = 139, + SPELL_EFFECT_FORCE_CAST = 140, + SPELL_EFFECT_FORCE_CAST_WITH_VALUE = 141, + SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142, + SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143, + SPELL_EFFECT_KNOCK_BACK_DEST = 144, + SPELL_EFFECT_PULL_TOWARDS_DEST = 145, + SPELL_EFFECT_ACTIVATE_RUNE = 146, + SPELL_EFFECT_QUEST_FAIL = 147, + SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE = 148, + SPELL_EFFECT_CHARGE_DEST = 149, + SPELL_EFFECT_QUEST_START = 150, + SPELL_EFFECT_TRIGGER_SPELL_2 = 151, + SPELL_EFFECT_SUMMON_RAF_FRIEND = 152, + SPELL_EFFECT_CREATE_TAMED_PET = 153, + SPELL_EFFECT_DISCOVER_TAXI = 154, + SPELL_EFFECT_TITAN_GRIP = 155, + SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC = 156, + SPELL_EFFECT_CREATE_ITEM_2 = 157, + SPELL_EFFECT_MILLING = 158, + SPELL_EFFECT_ALLOW_RENAME_PET = 159, + SPELL_EFFECT_160 = 160, + SPELL_EFFECT_TALENT_SPEC_COUNT = 161, + SPELL_EFFECT_TALENT_SPEC_SELECT = 162, + SPELL_EFFECT_163 = 163, // Unused (4.3.4) + SPELL_EFFECT_REMOVE_AURA = 164, + SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT = 165, + SPELL_EFFECT_GIVE_CURRENCY = 166, + SPELL_EFFECT_167 = 167, + SPELL_EFFECT_168 = 168, + SPELL_EFFECT_DESTROY_ITEM = 169, + SPELL_EFFECT_170 = 170, + SPELL_EFFECT_171 = 171, // Summons gameobject + SPELL_EFFECT_RESURRECT_WITH_AURA = 172, + SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk) + SPELL_EFFECT_174 = 174, + SPELL_EFFECT_175 = 175, // Unused (4.3.4) + SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) + SPELL_EFFECT_177 = 177, + SPELL_EFFECT_178 = 178, // Unused (4.3.4) + SPELL_EFFECT_CREATE_AREATRIGGER = 179, + SPELL_EFFECT_180 = 180, // Unused (4.3.4) + SPELL_EFFECT_181 = 181, // Unused (4.3.4) + SPELL_EFFECT_182 = 182, + TOTAL_SPELL_EFFECTS = 183 }; /// @@ -268,9 +274,9 @@ public enum AuraType SPELL_AURA_MOD_STEALTH = 16, SPELL_AURA_MOD_STEALTH_DETECT = 17, SPELL_AURA_MOD_INVISIBILITY = 18, - SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19, - SPELL_AURA_OBS_MOD_HEALTH = 20, //20,21 unofficial - SPELL_AURA_OBS_MOD_MANA = 21, + SPELL_AURA_MOD_INVISIBILITY_DETECT = 19, + SPELL_AURA_OBS_MOD_HEALTH = 20, // 20, 21 unofficial + SPELL_AURA_OBS_MOD_POWER = 21, SPELL_AURA_MOD_RESISTANCE = 22, SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23, SPELL_AURA_PERIODIC_ENERGIZE = 24, @@ -295,13 +301,13 @@ public enum AuraType SPELL_AURA_PROC_TRIGGER_DAMAGE = 43, SPELL_AURA_TRACK_CREATURES = 44, SPELL_AURA_TRACK_RESOURCES = 45, - SPELL_AURA_46 = 46, // Ignore all Gear test spells + SPELL_AURA_46 = 46, // Ignore all Gear test spells SPELL_AURA_MOD_PARRY_PERCENT = 47, - SPELL_AURA_48 = 48, // One periodic spell + SPELL_AURA_48 = 48, // One periodic spell SPELL_AURA_MOD_DODGE_PERCENT = 49, SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50, SPELL_AURA_MOD_BLOCK_PERCENT = 51, - SPELL_AURA_MOD_CRIT_PERCENT = 52, + SPELL_AURA_MOD_WEAPON_CRIT_PERCENT = 52, SPELL_AURA_PERIODIC_LEECH = 53, SPELL_AURA_MOD_HIT_CHANCE = 54, SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55, @@ -312,7 +318,7 @@ public enum AuraType SPELL_AURA_MOD_PACIFY_SILENCE = 60, SPELL_AURA_MOD_SCALE = 61, SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62, - SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL + SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL SPELL_AURA_PERIODIC_MANA_LEECH = 64, SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65, SPELL_AURA_FEIGN_DEATH = 66, @@ -339,7 +345,7 @@ public enum AuraType SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87, SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88, SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89, - SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE + SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE SPELL_AURA_MOD_DETECT_RANGE = 91, SPELL_AURA_PREVENTS_FLEEING = 92, SPELL_AURA_MOD_UNATTACKABLE = 93, @@ -368,7 +374,7 @@ public enum AuraType SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116, SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117, SPELL_AURA_MOD_HEALING_PCT = 118, - SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING + SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING SPELL_AURA_UNTRACKABLE = 120, SPELL_AURA_EMPATHY = 121, SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122, @@ -387,10 +393,10 @@ public enum AuraType SPELL_AURA_MOD_HEALING_DONE = 135, SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137, - SPELL_AURA_MOD_HASTE = 138, + SPELL_AURA_MOD_MELEE_HASTE = 138, SPELL_AURA_FORCE_REACTION = 139, SPELL_AURA_MOD_RANGED_HASTE = 140, - SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141, + SPELL_AURA_141 = 141, // old SPELL_AURA_MOD_RANGED_AMMO_HASTE, unused now SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142, SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143, SPELL_AURA_SAFE_FALL = 144, @@ -398,39 +404,39 @@ public enum AuraType SPELL_AURA_ALLOW_TAME_PET_TYPE = 146, SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147, SPELL_AURA_RETAIN_COMBO_POINTS = 148, - SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback + SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150, - SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed - SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range - SPELL_AURA_SPLIT_DAMAGE_FLAT = 153, // Split Damage Flat - SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier - SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing - SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain - SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage + SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed + SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range + SPELL_AURA_153 = 153, // old SPELL_AURA_SPLIT_DAMAGE_FLAT. unused 4.3.4 + SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier + SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing + SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain + SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158, SPELL_AURA_NO_PVP_CREDIT = 159, - SPELL_AURA_MOD_AOE_AVOIDANCE = 160, + SPELL_AURA_160 = 160, // old SPELL_AURA_MOD_AOE_AVOIDANCE. Unused 4.3.4 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, - SPELL_AURA_POWER_BURN_MANA = 162, + SPELL_AURA_POWER_BURN = 162, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, SPELL_AURA_164 = 164, SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165, SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167, SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168, - SPELL_AURA_MOD_CRIT_PERCENT_VERSUS = 169, + SPELL_AURA_169 = 169, // old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS. unused 4.3.4 SPELL_AURA_DETECT_AMORE = 170, SPELL_AURA_MOD_SPEED_NOT_STACK = 171, SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172, - SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS - SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT + SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS + SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175, SPELL_AURA_SPIRIT_OF_REDEMPTION = 176, SPELL_AURA_AOE_CHARM = 177, - SPELL_AURA_MOD_DEBUFF_RESISTANCE = 178, + SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE, unused SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179, SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180, - SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus + SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182, SPELL_AURA_MOD_CRITICAL_THREAT = 183, SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184, @@ -441,48 +447,48 @@ public enum AuraType SPELL_AURA_MOD_RATING = 189, SPELL_AURA_MOD_FACTION_REPUTATION_GAIN = 190, SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191, - SPELL_AURA_HASTE_MELEE = 192, + SPELL_AURA_MOD_MELEE_RANGED_HASTE = 192, SPELL_AURA_MELEE_SLOW = 193, - SPELL_AURA_MOD_IGNORE_ABSORB_SCHOOL = 194, - SPELL_AURA_MOD_IGNORE_ABSORB_FOR_SPELL = 195, - SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath + SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL = 194, + SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL = 195, + SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE= 197, - SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS - SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT = 199, - SPELL_AURA_MOD_KILL_XP_PCT = 200, + SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS + SPELL_AURA_199 = 199, // old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT. unused 4.3.4 + SPELL_AURA_MOD_XP_PCT = 200, SPELL_AURA_FLY = 201, SPELL_AURA_IGNORE_COMBAT_RESULT = 202, SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE = 203, SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE = 204, - SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE = 205, - SPELL_AURA_MOD_SPEED_MOUNTED = 206, // ? used in strange spells - SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED = 207, - SPELL_AURA_MOD_SPEED_FLIGHT = 208, - SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS = 209, - SPELL_AURA_210 = 210, // unused + SPELL_AURA_MOD_SCHOOL_CRIT_DMG_TAKEN = 205, + SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED = 206, + SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED = 207, + SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED = 208, + SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS = 209, + SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS = 210, SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK = 211, - SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT = 212, + SPELL_AURA_212 = 212, // old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213, SPELL_AURA_214 = 214, SPELL_AURA_ARENA_PREPARATION = 215, SPELL_AURA_HASTE_SPELLS = 216, - SPELL_AURA_217 = 217, + SPELL_AURA_MOD_MELEE_HASTE_2 = 217, SPELL_AURA_HASTE_RANGED = 218, SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219, SPELL_AURA_MOD_RATING_FROM_STAT = 220, - SPELL_AURA_221 = 221, + SPELL_AURA_MOD_DETAUNT = 221, SPELL_AURA_222 = 222, - SPELL_AURA_223 = 223, + SPELL_AURA_RAID_PROC_FROM_CHARGE = 223, SPELL_AURA_224 = 224, - SPELL_AURA_PRAYER_OF_MENDING = 225, + SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE = 225, SPELL_AURA_PERIODIC_DUMMY = 226, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227, SPELL_AURA_DETECT_STEALTH = 228, SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229, - SPELL_AURA_230 = 230, + SPELL_AURA_MOD_MAX_HEALTH = 230, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231, SPELL_AURA_MECHANIC_DURATION_MOD = 232, - SPELL_AURA_233 = 233, + SPELL_AURA_CHANGE_MODEL_FOR_ALL_HUMANOIDS = 233, // client-side only SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234, SPELL_AURA_MOD_DISPEL_RESIST = 235, SPELL_AURA_CONTROL_VEHICLE = 236, @@ -492,81 +498,135 @@ public enum AuraType SPELL_AURA_MOD_EXPERTISE = 240, SPELL_AURA_FORCE_MOVE_FORWARD = 241, SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242, - SPELL_AURA_MOD_FACTION_TEMPLATE = 243, + SPELL_AURA_MOD_FACTION = 243, SPELL_AURA_COMPREHEND_LANGUAGE = 244, - SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS = 245, - SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL = 246, - SPELL_AURA_247 = 247, + SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245, + SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246, + SPELL_AURA_CLONE_CASTER = 247, SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248, SPELL_AURA_CONVERT_RUNE = 249, SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250, SPELL_AURA_MOD_ENEMY_DODGE = 251, - SPELL_AURA_252 = 252, + SPELL_AURA_MOD_SPEED_SLOW_ALL = 252, SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253, - SPELL_AURA_MOD_DISARM_SHIELD = 254, + SPELL_AURA_MOD_DISARM_OFFHAND = 254, SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255, SPELL_AURA_NO_REAGENT_USE = 256, SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257, SPELL_AURA_258 = 258, - SPELL_AURA_259 = 259, + SPELL_AURA_259 = 259, // old SPELL_AURA_MOD_HOT_PCT, unused 4.3.4 SPELL_AURA_SCREEN_EFFECT = 260, SPELL_AURA_PHASE = 261, - SPELL_AURA_262 = 262, + SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262, SPELL_AURA_ALLOW_ONLY_ABILITY = 263, SPELL_AURA_264 = 264, SPELL_AURA_265 = 265, SPELL_AURA_266 = 266, SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267, - SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268, - SPELL_AURA_MOD_IGNORE_DAMAGE_REDUCTION_SCHOOL = 269, - SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive + SPELL_AURA_268 = 268, // old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 + SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269, + SPELL_AURA_270 = 270, // old SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST, unused 4.3.4 SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271, - SPELL_AURA_MAELSTROM_WEAPON = 272, + SPELL_AURA_IGNORE_MELEE_RESET = 272, SPELL_AURA_X_RAY = 273, - SPELL_AURA_274 = 274, + SPELL_AURA_274 = 274, // old SPELL_AURA_ABILITY_CONSUME_NO_AMMO, unused 4.3.4 SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, - SPELL_AURA_276 = 276, // Only "Test Mod Damage % Mechanic" spell, possible mod damage done - SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277, + SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, + SPELL_AURA_277 = 277, // old SPELL_AURA_MOD_MAX_AFFECTED_TARGETS. unused 4.3.4 SPELL_AURA_MOD_DISARM_RANGED = 278, - SPELL_AURA_279 = 279, - SPELL_AURA_MOD_TARGET_ARMOR_PCT = 280, - SPELL_AURA_MOD_HONOR_GAIN = 281, + SPELL_AURA_INITIALIZE_IMAGES = 279, + SPELL_AURA_280 = 280, // old SPELL_AURA_MOD_ARMOR_PENETRATION_PCT unused 4.3.4 + SPELL_AURA_MOD_HONOR_GAIN_PCT = 281, SPELL_AURA_MOD_BASE_HEALTH_PCT = 282, - SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells - SPELL_AURA_LINKED_AURA = 284, + SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells + SPELL_AURA_LINKED = 284, SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, SPELL_AURA_ABILITY_PERIODIC_CRIT = 286, SPELL_AURA_DEFLECT_SPELLS = 287, - SPELL_AURA_288 = 288, // Deterrence - SPELL_AURA_289 = 289, // unused - SPELL_AURA_MOD_ALL_CRIT_CHANCE = 290, - SPELL_AURA_MOD_QUEST_XP_PCT = 291, + SPELL_AURA_IGNORE_HIT_DIRECTION = 288, + SPELL_AURA_289 = 289, + SPELL_AURA_MOD_CRIT_PCT = 290, + SPELL_AURA_MOD_XP_QUEST_PCT = 291, SPELL_AURA_OPEN_STABLE = 292, SPELL_AURA_OVERRIDE_SPELLS = 293, - SPELL_AURA_STOP_MANA_REGEN = 294, - SPELL_AURA_295 = 295, // unused - SPELL_AURA_296 = 296, // Emulates vehicle? - SPELL_AURA_ROOT_NO_FALL = 297, - SPELL_AURA_STUN_NO_FALL = 298, - SPELL_AURA_299 = 299, // unused + SPELL_AURA_PREVENT_REGENERATE_POWER = 294, + SPELL_AURA_295 = 295, + SPELL_AURA_SET_VEHICLE_ID = 296, + SPELL_AURA_BLOCK_SPELL_FAMILY = 297, + SPELL_AURA_STRANGULATE = 298, + SPELL_AURA_299 = 299, SPELL_AURA_SHARE_DAMAGE_PCT = 300, - SPELL_AURA_HEAL_ABSORB = 301, - SPELL_AURA_302 = 302, // unused - SPELL_AURA_MOD_DAMAGE_DONE_TO_AURA_STATE_PCT = 303, - SPELL_AURA_304 = 304, + SPELL_AURA_SCHOOL_HEAL_ABSORB = 301, + SPELL_AURA_302 = 302, + SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE = 303, + SPELL_AURA_MOD_FAKE_INEBRIATE = 304, SPELL_AURA_MOD_MINIMUM_SPEED = 305, SPELL_AURA_306 = 306, - SPELL_AURA_HEAL_ABSORB_2 = 307, - SPELL_AURA_308 = 308, - SPELL_AURA_309 = 309, - SPELL_AURA_MOD_AOE_DAMAGE = 310, - SPELL_AURA_311 = 311, // unused - SPELL_AURA_312 = 312, // unused - SPELL_AURA_313 = 313, // unused - SPELL_AURA_314 = 314, // Confused + SPELL_AURA_HEAL_ABSORB_TEST = 307, + SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, + SPELL_AURA_309 = 309, // Not used in 4.3.4 + SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, + SPELL_AURA_311 = 311, + SPELL_AURA_ANIM_REPLACEMENT_SET = 312, + SPELL_AURA_313 = 313, // Not used in 4.3.4 - related to mounts + SPELL_AURA_PREVENT_RESURRECTION = 314, SPELL_AURA_UNDERWATER_WALKING = 315, - SPELL_AURA_HASTE_AFFECT_DOT_TICK = 316, - TOTAL_AURAS = 317 + SPELL_AURA_PERIODIC_HASTE = 316, // Not used in 4.3.4 (name from 3.3.5a) + SPELL_AURA_MOD_SPELL_POWER_PCT = 317, + SPELL_AURA_MASTERY = 318, + SPELL_AURA_MOD_MELEE_HASTE_3 = 319, + SPELL_AURA_MOD_RANGED_HASTE_2 = 320, + SPELL_AURA_321 = 321, + SPELL_AURA_INTERFERE_TARGETTING = 322, // NYI + SPELL_AURA_323 = 323, // Not used in 4.3.4 + SPELL_AURA_324 = 324, // spell critical chance (probably by school mask) + SPELL_AURA_325 = 325, // Not used in 4.3.4 + SPELL_AURA_326 = 326, // phase related + SPELL_AURA_327 = 327, // Not used in 4.3.4 + SPELL_AURA_PROC_ON_POWER_AMOUNT = 328, + SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI + SPELL_AURA_CAST_WHILE_WALKING = 330, + SPELL_AURA_FORCE_WEATHER = 331, + SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, + SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, + SPELL_AURA_MOD_BLIND = 334, // NYI + SPELL_AURA_335 = 335, + SPELL_AURA_MOD_FLYING_RESTRICTIONS = 336, // NYI + SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, + SPELL_AURA_MOD_DURABILITY_LOSS = 338, + SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI + SPELL_AURA_MOD_RESURRECTED_HEALTH_BY_GUILD_MEMBER = 340, // Increases health gained when resurrected by a guild member by X + SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN = 341, // NYI + SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 = 342, + SPELL_AURA_343 = 343, + SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, // NYI + SPELL_AURA_BYPASS_ARMOR_FOR_CASTER = 345, + SPELL_AURA_ENABLE_ALT_POWER = 346, // NYI + SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI + SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT= 348, // NYI + SPELL_AURA_MOD_CURRENCY_GAIN = 349, + SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT = 350, // NYI + SPELL_AURA_351 = 351, + SPELL_AURA_352 = 352, + SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI + SPELL_AURA_354 = 354, // Restoration Shaman mastery - mod healing based on target's health (less = more healing) + SPELL_AURA_355 = 355, + SPELL_AURA_356 = 356, // Arcane Mage mastery - mod damage based on current mana + SPELL_AURA_ENABLE_BOSS1_UNIT_FRAME = 357, + SPELL_AURA_WORGEN_ALTERED_FORM = 358, + SPELL_AURA_359 = 359, + SPELL_AURA_PROC_TRIGGER_SPELL_COPY = 360, // Procs the same spell that caused this proc (Dragonwrath, Tarecgosa's Rest) + SPELL_AURA_PROC_TRIGGER_SPELL_2 = 361, + SPELL_AURA_362 = 362, // Not used in 4.3.4 + SPELL_AURA_MOD_NEXT_SPELL = 363, // Used by 101601 Throw Totem - causes the client to initialize spell cast with specified spell + SPELL_AURA_364 = 364, // Not used in 4.3.4 + SPELL_AURA_MAX_FAR_CLIP_PLANE = 365, // Overrides client's View Distance setting to max("Fair", current_setting) and turns off terrain display + SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT = 366, // NYI - Sets spellpower equal to % of attack power, discarding all other bonuses (from gear and buffs) + SPELL_AURA_367 = 367, + SPELL_AURA_368 = 368, // Not used in 4.3.4 + SPELL_AURA_ENABLE_POWER_BAR_TIMER = 369, + SPELL_AURA_SET_FAIR_FAR_CLIP = 370, // Overrides client's View Distance setting to max("Fair", current_setting) + TOTAL_AURAS = 371 } /// @@ -575,116 +635,134 @@ public enum AuraType public enum Targets { NO_TARGET = 0, - TARGET_SELF = 1, - TARGET_RANDOM_ENEMY_CHAIN_IN_AREA = 2, // only one spell has that, but regardless, it's a target type after all - TARGET_RANDOM_FRIEND_CHAIN_IN_AREA = 3, - TARGET_4 = 4, - TARGET_PET = 5, - TARGET_CHAIN_DAMAGE = 6, - TARGET_AREAEFFECT_INSTANT = 7, // targets around provided destination point - TARGET_AREAEFFECT_CUSTOM = 8, - TARGET_INNKEEPER_COORDINATES = 9, // uses in teleport to innkeeper spells + 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_11 = 11, + TARGET_UNIT_SRC_AREA_UNK_11 = 11, // teleport target to caster TARGET_12 = 12, TARGET_13 = 13, TARGET_14 = 14, - TARGET_ALL_ENEMY_IN_AREA = 15, - TARGET_ALL_ENEMY_IN_AREA_INSTANT = 16, - TARGET_TABLE_X_Y_Z_COORDINATES = 17, // uses in teleport spells and some other - TARGET_EFFECT_SELECT = 18, // highly depends on the spell effect + TARGET_UNIT_SRC_AREA_ENEMY = 15, + TARGET_UNIT_DEST_AREA_ENEMY = 16, + TARGET_DEST_DB = 17, + TARGET_DEST_CASTER = 18, TARGET_19 = 19, - TARGET_ALL_PARTY_AROUND_CASTER = 20, - TARGET_SINGLE_FRIEND = 21, - TARGET_CASTER_COORDINATES = 22, // used only in TargetA, target selection dependent from TargetB - TARGET_GAMEOBJECT = 23, - TARGET_IN_FRONT_OF_CASTER = 24, - TARGET_DUELVSPLAYER = 25, - TARGET_GAMEOBJECT_ITEM = 26, - TARGET_MASTER = 27, - TARGET_ALL_ENEMY_IN_AREA_CHANNELED = 28, - TARGET_29 = 29, - TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER = 30, // in TargetB used only with TARGET_ALL_AROUND_CASTER and in self casting range in TargetA - TARGET_ALL_FRIENDLY_UNITS_IN_AREA = 31, - TARGET_MINION = 32, - TARGET_ALL_PARTY = 33, - TARGET_ALL_PARTY_AROUND_CASTER_2 = 34, // used in Tranquility - TARGET_SINGLE_PARTY = 35, - TARGET_ALL_HOSTILE_UNITS_AROUND_CASTER = 36, - TARGET_AREAEFFECT_PARTY = 37, - TARGET_SCRIPT = 38, - TARGET_SELF_FISHING = 39, - TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT = 40, - TARGET_TOTEM_EARTH = 41, - TARGET_TOTEM_WATER = 42, - TARGET_TOTEM_AIR = 43, - TARGET_TOTEM_FIRE = 44, - TARGET_CHAIN_HEAL = 45, - TARGET_SCRIPT_COORDINATES = 46, - TARGET_DYNAMIC_OBJECT_FRONT = 47, - TARGET_DYNAMIC_OBJECT_BEHIND = 48, - TARGET_DYNAMIC_OBJECT_LEFT_SIDE = 49, - TARGET_DYNAMIC_OBJECT_RIGHT_SIDE = 50, - TARGET_51 = 51, - TARGET_AREAEFFECT_CUSTOM_2 = 52, - TARGET_CURRENT_ENEMY_COORDINATES = 53, // set unit coordinates as dest, only 16 target B imlemented - TARGET_LARGE_FRONTAL_CONE = 54, - TARGET_55 = 55, - TARGET_ALL_RAID_AROUND_CASTER = 56, - TARGET_SINGLE_FRIEND_2 = 57, - TARGET_58 = 58, - TARGET_59 = 59, - TARGET_NARROW_FRONTAL_CONE = 60, - TARGET_AREAEFFECT_PARTY_AND_CLASS = 61, - TARGET_62 = 62, - TARGET_DUELVSPLAYER_COORDINATES = 63, - TARGET_INFRONT_OF_VICTIM = 64, - TARGET_BEHIND_VICTIM = 65, // used in teleport behind spells, caster/target dependent from spell effect - TARGET_RIGHT_FROM_VICTIM = 66, - TARGET_LEFT_FROM_VICTIM = 67, - TARGET_68 = 68, - TARGET_69 = 69, - TARGET_70 = 70, - TARGET_71 = 71, - TARGET_RANDOM_NEARBY_LOC = 72, // used in teleport onto nearby locations - TARGET_RANDOM_CIRCUMFERENCE_POINT = 73, - TARGET_74 = 74, - TARGET_75 = 75, - TARGET_DYNAMIC_OBJECT_COORDINATES = 76, - TARGET_SINGLE_ENEMY = 77, - TARGET_POINT_AT_NORTH = 78, // 78-85 possible _COORDINATES at radius with pi/4 step around target in unknown order, N? - TARGET_POINT_AT_SOUTH = 79, // S? - TARGET_POINT_AT_EAST = 80, // 80/81 must be symmetric from line caster->target, E (base at 82/83, 84/85 order) ? - TARGET_POINT_AT_WEST = 81, // 80/81 must be symmetric from line caster->target, W (base at 82/83, 84/85 order) ? - TARGET_POINT_AT_NE = 82, // from spell desc: "(NE)" - TARGET_POINT_AT_NW = 83, // from spell desc: "(NW)" - TARGET_POINT_AT_SE = 84, // from spell desc: "(SE)" - TARGET_POINT_AT_SW = 85, // from spell desc: "(SW)" - TARGET_RANDOM_NEARBY_DEST = 86, // "Test Nearby Dest Random" - random around selected destination - TARGET_SELF2 = 87, - TARGET_88 = 88, - TARGET_DIRECTLY_FORWARD = 89, - TARGET_NONCOMBAT_PET = 90, - TARGET_91 = 91, - TARGET_92 = 92, - TARGET_93 = 93, - TARGET_94 = 94, - TARGET_95 = 95, - TARGET_96 = 96, - TARGET_97 = 97, - TARGET_98 = 98, - TARGET_99 = 99, - TARGET_100 = 100, - TARGET_101 = 101, - TARGET_102 = 102, - TARGET_103 = 103, - TARGET_IN_FRONT_OF_CASTER_30 = 104, - TARGET_105 = 105, - TARGET_106 = 106, - TARGET_107 = 107, - TARGET_108 = 108, + 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_110 = 110, + 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, + TOTAL_SPELL_TARGETS, }; /// @@ -693,109 +771,103 @@ public enum Targets [Flags] public enum ProcFlags { - PROC_FLAG_NONE = 0x00000000, - - PROC_FLAG_KILLED = 0x00000001, // 00 Killed by aggressor + 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_SUCCESSFUL_MELEE_HIT = 0x00000004, // 02 Successful melee auto attack - PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee auto attack hit + 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_SUCCESSFUL_MELEE_SPELL_HIT = 0x00000010, // 04 Successful attack by Spell that use melee weapon - PROC_FLAG_TAKEN_MELEE_SPELL_HIT = 0x00000020, // 05 Taken damage by Spell that use melee weapon + 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_SUCCESSFUL_RANGED_HIT = 0x00000040, // 06 Successful Ranged auto attack - PROC_FLAG_TAKEN_RANGED_HIT = 0x00000080, // 07 Taken damage from ranged auto attack + 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_SUCCESSFUL_RANGED_SPELL_HIT = 0x00000100, // 08 Successful Ranged attack by Spell that use ranged weapon - PROC_FLAG_TAKEN_RANGED_SPELL_HIT = 0x00000200, // 09 Taken damage by Spell that use ranged weapon + 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_SUCCESSFUL_POSITIVE_AOE_HIT = 0x00000400, // 10 Successful AoE (not 100% sure unused) - PROC_FLAG_TAKEN_POSITIVE_AOE = 0x00000800, // 11 Taken AoE (not 100% sure unused) + 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_SUCCESSFUL_AOE_SPELL_HIT = 0x00001000, // 12 Successful AoE damage spell hit (not 100% sure unused) - PROC_FLAG_TAKEN_AOE_SPELL_HIT = 0x00002000, // 13 Taken AoE damage spell hit (not 100% sure unused) + 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_SUCCESSFUL_POSITIVE_SPELL = 0x00004000, // 14 Successful cast positive spell (by default only on healing) - PROC_FLAG_TAKEN_POSITIVE_SPELL = 0x00008000, // 15 Taken positive spell hit (by default only on healing) + 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_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00010000, // 16 Successful negative spell cast (by default only on damage) - PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00020000, // 17 Taken negative spell (by default only on damage) + 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_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14-17 flags) - PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 14-17 flags) + PROC_FLAG_DONE_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing) + PROC_FLAG_TAKEN_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing) - PROC_FLAG_TAKEN_ANY_DAMAGE = 0x00100000, // 20 Taken any damage - PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation + 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_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used) - PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000 // 23 Successful off-hand melee attacks + 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_DEATH = 0x01000000 // 24 Died in any way }; [Flags] public enum ProcFlagsEx { - PROC_EX_NONE = 0x0000000, // If none can trigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag) - + // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag) PROC_EX_NORMAL_HIT = 0x0000001, // If set only from normal hit (only damage spells) PROC_EX_CRITICAL_HIT = 0x0000002, - PROC_EX_MISS = 0x0000004, PROC_EX_RESIST = 0x0000008, - PROC_EX_DODGE = 0x0000010, PROC_EX_PARRY = 0x0000020, - PROC_EX_BLOCK = 0x0000040, PROC_EX_EVADE = 0x0000080, - PROC_EX_IMMUNE = 0x0000100, PROC_EX_DEFLECT = 0x0000200, - PROC_EX_ABSORB = 0x0000400, PROC_EX_REFLECT = 0x0000800, - PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used) PROC_EX_FULL_BLOCK = 0x0002000, // block al attack damage - PROC_EX_RESERVED2 = 0x0004000, - PROC_EX_RESERVED3 = 0x0008000, - - PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges - PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time (not used) + PROC_EX_NOT_ACTIVE_SPELL = 0x0008000, // Spell mustn't do damage/heal to proc + PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always no matter of hit result + PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000, // If set trigger always but only one time (not implemented yet) + PROC_EX_ONLY_ACTIVE_SPELL = 0x0040000, // Spell has to do damage/heal to proc }; public enum SpellSchools { - PHYSICAL = 0, - HOLY = 1, - FIRE = 2, - NATURE = 3, - FROST = 4, - SHADOW = 5, - ARCANE = 6 + SPELL_SCHOOL_NORMAL = 0, + SPELL_SCHOOL_HOLY = 1, + SPELL_SCHOOL_FIRE = 2, + SPELL_SCHOOL_NATURE = 3, + SPELL_SCHOOL_FROST = 4, + SPELL_SCHOOL_SHADOW = 5, + SPELL_SCHOOL_ARCANE = 6 }; [Flags] public enum SpellSchoolMask { - MASK_NONE = 0x00, // not exist - MASK_PHYSICAL = (1 << SpellSchools.PHYSICAL), // PHYSICAL (Armor) - MASK_HOLY = (1 << SpellSchools.HOLY), - MASK_FIRE = (1 << SpellSchools.FIRE), - MASK_NATURE = (1 << SpellSchools.NATURE), - MASK_FROST = (1 << SpellSchools.FROST), - MASK_SHADOW = (1 << SpellSchools.SHADOW), - MASK_ARCANE = (1 << SpellSchools.ARCANE), + SPELL_SCHOOL_MASK_NONE = 0x00, // not exist + SPELL_SCHOOL_MASK_NORMAL = (1 << SpellSchools.SPELL_SCHOOL_NORMAL), // PHYSICAL (Armor) + SPELL_SCHOOL_MASK_HOLY = (1 << SpellSchools.SPELL_SCHOOL_HOLY), + SPELL_SCHOOL_MASK_FIRE = (1 << SpellSchools.SPELL_SCHOOL_FIRE), + SPELL_SCHOOL_MASK_NATURE = (1 << SpellSchools.SPELL_SCHOOL_NATURE), + SPELL_SCHOOL_MASK_FROST = (1 << SpellSchools.SPELL_SCHOOL_FROST), + SPELL_SCHOOL_MASK_SHADOW = (1 << SpellSchools.SPELL_SCHOOL_SHADOW), + SPELL_SCHOOL_MASK_ARCANE = (1 << SpellSchools.SPELL_SCHOOL_ARCANE), // unions // 124, not include normal and holy damage - MASK_SPELL = (MASK_FIRE | MASK_NATURE | MASK_FROST | MASK_SHADOW | MASK_ARCANE), + SPELL_SCHOOL_MASK_SPELL = (SPELL_SCHOOL_MASK_FIRE | + SPELL_SCHOOL_MASK_NATURE | SPELL_SCHOOL_MASK_FROST | + SPELL_SCHOOL_MASK_SHADOW | SPELL_SCHOOL_MASK_ARCANE), // 126 - MASK_MAGIC = (MASK_HOLY | MASK_SPELL), + SPELL_SCHOOL_MASK_MAGIC = (SPELL_SCHOOL_MASK_HOLY | SPELL_SCHOOL_MASK_SPELL), // 127 - MASK_ALL = (MASK_PHYSICAL | MASK_MAGIC) + SPELL_SCHOOL_MASK_ALL = (SPELL_SCHOOL_MASK_NORMAL | SPELL_SCHOOL_MASK_MAGIC) }; public enum Mechanics @@ -808,7 +880,7 @@ public enum Mechanics MECHANIC_FEAR = 5, MECHANIC_GRIP = 6, MECHANIC_ROOT = 7, - MECHANIC_PACIFY = 8, //0 spells use this mechanic + MECHANIC_SLOW_ATTACK = 8, MECHANIC_SILENCE = 9, MECHANIC_SLEEP = 10, MECHANIC_SNARE = 11, @@ -844,7 +916,7 @@ public enum SpellMissInfo SPELL_MISS_BLOCK = 5, SPELL_MISS_EVADE = 6, SPELL_MISS_IMMUNE = 7, - SPELL_MISS_IMMUNE2 = 8, + SPELL_MISS_IMMUNE2 = 8, // one of these 2 is MISS_TEMPIMMUNE SPELL_MISS_DEFLECT = 9, SPELL_MISS_ABSORB = 10, SPELL_MISS_REFLECT = 11 @@ -877,42 +949,42 @@ public enum SpellPreventionType }; [Flags] - public enum ShapeshiftFormMask + public enum ShapeshiftFormMask : uint { - FORM_ALL = -1, - FORM_NONE = 0, - FORM_CAT = 1 << 0x00, // 1 - FORM_TREE = 1 << 0x01, // 2 - FORM_TRAVEL = 1 << 0x02, // 3 - FORM_AQUA = 1 << 0x03, // 4 - FORM_BEAR = 1 << 0x04, // 5 - FORM_AMBIENT = 1 << 0x05, // 6 - FORM_GHOUL = 1 << 0x06, // 7 - FORM_DIREBEAR = 1 << 0x07, // 8 - FORM_STEVES_GHOUL = 1 << 0x08, // 9 - FORM_THARONJA_SKELETON = 1 << 0x09, // 10 - FORM_TEST_OF_STRENGTH = 1 << 0x0A, // 11 - FORM_BLB_PLAYER = 1 << 0x0B, // 12 - FORM_SHADOW_DANCE = 1 << 0x0C, // 13 - FORM_CREATUREBEAR = 1 << 0x0D, // 14 - FORM_CREATURECAT = 1 << 0x0E, // 15 - FORM_GHOSTWOLF = 1 << 0x0F, // 16 - FORM_BATTLESTANCE = 1 << 0x10, // 17 - FORM_DEFENSIVESTANCE = 1 << 0x11, // 18 - FORM_BERSERKERSTANCE = 1 << 0x12, // 19 - FORM_TEST = 1 << 0x13, // 20 - FORM_ZOMBIE = 1 << 0x14, // 21 - FORM_METAMORPHOSIS = 1 << 0x15, // 22 - FORM_UNK1 = 1 << 0x16, // 23 - FORM_UNK2 = 1 << 0x17, // 24 - FORM_UNDEAD = 1 << 0x18, // 25 - FORM_FRENZY = 1 << 0x19, // 26 - FORM_FLIGHT_EPIC = 1 << 0x1A, // 27 - FORM_SHADOW = 1 << 0x1B, // 28 - FORM_FLIGHT = 1 << 0x1C, // 29 - FORM_STEALTH = 1 << 0x1D, // 30 - FORM_MOONKIN = 1 << 0x1E, // 31 - FORM_SPIRITOFREDEMPTION = 1 << 0x1F, // 32 + FORM_ALL = 0xFFFFFFFF, + FORM_NONE = 0x00000000, + FORM_CAT = 0x00000001, // 1 + FORM_TREE = 0x00000002, // 2 + FORM_TRAVEL = 0x00000004, // 3 + FORM_AQUA = 0x00000008, // 4 + FORM_BEAR = 0x00000010, // 5 + FORM_AMBIENT = 0x00000020, // 6 + FORM_GHOUL = 0x00000040, // 7 + FORM_DIREBEAR = 0x00000080, // 8 + FORM_STEVES_GHOUL = 0x00000100, // 9 + FORM_THARONJA_SKELETON = 0x00000200, // 10 + FORM_TEST_OF_STRENGTH = 0x00000400, // 11 + FORM_BLB_PLAYER = 0x00000800, // 12 + FORM_SHADOW_DANCE = 0x00001000, // 13 + FORM_CREATUREBEAR = 0x00002000, // 14 + FORM_CREATURECAT = 0x00004000, // 15 + FORM_GHOSTWOLF = 0x00008000, // 16 + FORM_BATTLESTANCE = 0x00010000, // 17 + FORM_DEFENSIVESTANCE = 0x00020000, // 18 + FORM_BERSERKERSTANCE = 0x00040000, // 19 + FORM_TEST = 0x00080000, // 20 + FORM_ZOMBIE = 0x00100000, // 21 + FORM_METAMORPHOSIS = 0x00200000, // 22 + FORM_UNK1 = 0x00400000, // 23 + FORM_UNK2 = 0x00800000, // 24 + FORM_UNDEAD = 0x01000000, // 25 + FORM_MASTER_ANGLER = 0x02000000, // 26 + FORM_FLIGHT_EPIC = 0x04000000, // 27 + FORM_SHADOW = 0x08000000, // 28 + FORM_FLIGHT = 0x10000000, // 29 + FORM_STEALTH = 0x20000000, // 30 + FORM_MOONKIN = 0x40000000, // 31 + FORM_SPIRITOFREDEMPTION = 0x80000000, // 32 }; public enum DispelType @@ -946,60 +1018,67 @@ public enum SpellModOp SPELLMOD_CASTING_TIME = 10, SPELLMOD_COOLDOWN = 11, SPELLMOD_EFFECT2 = 12, - // spellmod 13 unused + SPELLMOD_IGNORE_ARMOR = 13, SPELLMOD_COST = 14, SPELLMOD_CRIT_DAMAGE_BONUS = 15, SPELLMOD_RESIST_MISS_CHANCE = 16, SPELLMOD_JUMP_TARGETS = 17, - SPELLMOD_CHANCE_OF_SUCCESS = 18, // Only used with SPELL_AURA_ADD_FLAT_MODIFIER and affects proc spells + SPELLMOD_CHANCE_OF_SUCCESS = 18, SPELLMOD_ACTIVATION_TIME = 19, - SPELLMOD_EFFECT_PAST_FIRST = 20, - SPELLMOD_CASTING_TIME_OLD = 21, + SPELLMOD_DAMAGE_MULTIPLIER = 20, + SPELLMOD_GLOBAL_COOLDOWN = 21, SPELLMOD_DOT = 22, SPELLMOD_EFFECT3 = 23, - SPELLMOD_SPELL_BONUS_DAMAGE = 24, - // spellmod 25 unused - SPELLMOD_FREQUENCY_OF_SUCCESS = 26, // Only used with SPELL_AURA_ADD_PCT_MODIFIER and affects used on proc spells - SPELLMOD_MULTIPLE_VALUE = 27, - SPELLMOD_RESIST_DISPEL_CHANCE = 28 + SPELLMOD_BONUS_MULTIPLIER = 24, + // spellmod 25 + SPELLMOD_PROC_PER_MINUTE = 26, + SPELLMOD_VALUE_MULTIPLIER = 27, + SPELLMOD_RESIST_DISPEL_CHANCE = 28, + SPELLMOD_CRIT_DAMAGE_BONUS_2 = 29, //one not used spell + SPELLMOD_SPELL_COST_REFUND_ON_FAIL = 30 }; [Flags] public enum SpellCastTargetFlags { TARGET_FLAG_SELF = 0x00000000, - TARGET_FLAG_UNUSED1 = 0x00000001, // not used in any spells as of 3.0.3 (can be set dynamically) + TARGET_FLAG_UNUSED_1 = 0x00000001, // not used TARGET_FLAG_UNIT = 0x00000002, // pguid - TARGET_FLAG_UNUSED2 = 0x00000004, // not used in any spells as of 3.0.3 (can be set dynamically) - TARGET_FLAG_UNUSED3 = 0x00000008, // not used in any spells as of 3.0.3 (can be set dynamically) + TARGET_FLAG_UNIT_RAID = 0x00000004, // not sent, used to validate target (if raid member) + TARGET_FLAG_UNIT_PARTY = 0x00000008, // not sent, used to validate target (if party member) TARGET_FLAG_ITEM = 0x00000010, // pguid - TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // 3 float - TARGET_FLAG_DEST_LOCATION = 0x00000040, // 3 float - TARGET_FLAG_OBJECT_UNK = 0x00000080, // used in 7 spells only - TARGET_FLAG_UNIT_UNK = 0x00000100, // looks like self target (480 spells) - TARGET_FLAG_PVP_CORPSE = 0x00000200, // pguid - TARGET_FLAG_UNIT_CORPSE = 0x00000400, // 10 spells (gathering professions) - TARGET_FLAG_OBJECT = 0x00000800, // pguid, 2 spells - TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid, 0 spells - TARGET_FLAG_STRING = 0x00002000, // string, 0 spells - TARGET_FLAG_UNK1 = 0x00004000, // 199 spells, opening object/lock - TARGET_FLAG_CORPSE = 0x00008000, // pguid, resurrection spells - TARGET_FLAG_UNK2 = 0x00010000, // pguid, not used in any spells as of 3.0.3 (can be set dynamically) - TARGET_FLAG_GLYPH = 0x00020000, // used in glyph spells - TARGET_FLAG_UNK3 = 0x00040000, // - TARGET_FLAG_UNK4 = 0x00080000 // uint32, loop { vec3, guid -> if guid == 0 break } + TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // pguid, 3 float + TARGET_FLAG_DEST_LOCATION = 0x00000040, // pguid, 3 float + TARGET_FLAG_UNIT_ENEMY = 0x00000080, // not sent, used to validate target (if enemy) + TARGET_FLAG_UNIT_ALLY = 0x00000100, // not sent, used to validate target (if ally) + TARGET_FLAG_CORPSE_ENEMY = 0x00000200, // pguid + TARGET_FLAG_UNIT_DEAD = 0x00000400, // not sent, used to validate target (if dead creature) + TARGET_FLAG_GAMEOBJECT = 0x00000800, // pguid, used with TARGET_GAMEOBJECT + TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid + TARGET_FLAG_STRING = 0x00002000, // string + TARGET_FLAG_GAMEOBJECT_ITEM = 0x00004000, // not sent, used with TARGET_GAMEOBJECT_ITEM + TARGET_FLAG_CORPSE_ALLY = 0x00008000, // pguid + TARGET_FLAG_UNIT_MINIPET = 0x00010000, // pguid, used to validate target (if non combat pet) + TARGET_FLAG_GLYPH_SLOT = 0x00020000, // used in glyph spells + TARGET_FLAG_UNK19 = 0x00040000, // sometimes appears with DEST_TARGET spells (may appear or not for a given spell) + TARGET_FLAG_UNUSED20 = 0x00080000, // uint32 counter, loop { vec3 - screen position (?), guid }, not used so far + TARGET_FLAG_UNIT_PASSENGER = 0x00100000, // guessed, used to validate target (if vehicle passenger) }; public enum Powers : uint { - POWER_MANA = 0, - POWER_RAGE = 1, - POWER_FOCUS = 2, - POWER_ENERGY = 3, - POWER_HAPPINESS = 4, - POWER_RUNE = 5, - POWER_RUNIC_POWER = 6, - POWER_HEALTH = 0xFFFFFFFE, // (-2 as signed value) + POWER_MANA = 0, + POWER_RAGE = 1, + POWER_FOCUS = 2, + POWER_ENERGY = 3, + POWER_HAPPINESS = 4, + POWER_RUNE = 5, + POWER_RUNIC_POWER = 6, + POWER_SOUL_SHARDS = 7, + POWER_ECLIPSE = 8, + POWER_HOLY_POWER = 9, + POWER_ALTERNATE_POWER = 10, // Used in some quests + POWER_HEALTH = 0xFFFFFFFE, // (-2 as signed value) }; public enum AuraState @@ -1025,7 +1104,7 @@ public enum AuraState AURA_STATE_SWIFTMEND = 15, // T | AURA_STATE_DEADLY_POISON = 16, // T | AURA_STATE_ENRAGE = 17, // C | - AURA_STATE_UNKNOWN18 = 18, // C t| + AURA_STATE_BLEEDING = 18, // C t| AURA_STATE_UNKNOWN19 = 19, // | not used AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide) AURA_STATE_UNKNOWN21 = 21, // | not used @@ -1103,7 +1182,7 @@ public enum ItemSubClassWeaponMask POLEARM = 1 << 6, SWORD = 1 << 7, SWORD2 = 1 << 8, - obsolete = 1 << 9, + OBSOLETE = 1 << 9, STAFF = 1 << 10, EXOTIC = 1 << 11, EXOTIC2 = 1 << 12, @@ -1165,317 +1244,427 @@ public enum CreatureTypeMask NON_COMBAT_PET = 1 << 11, GAS_CLOUD = 1 << 12 }; - + [Flags] - public enum SpellAtribute + public enum SpellAtribute : uint { - SPELL_ATTR_ALL = -1, - SPELL_ATTR_NONE = 0x00, - SPELL_ATTR_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_RANGED = 1 << 0x01, // 1 All ranged abilites have this flag - SPELL_ATTR_ON_NEXT_SWING_1 = 1 << 0x02, // 2 on next swing - SPELL_ATTR_UNK3 = 1 << 0x03, // 3 not set in 3.0.3 - SPELL_ATTR_UNK4 = 1 << 0x04, // 4 isAbility - SPELL_ATTR_TRADESPELL = 1 << 0x05, // 5 trade spells, will be added by client to a sublist of profession spell - SPELL_ATTR_PASSIVE = 1 << 0x06, // 6 Passive spell - SPELL_ATTR_UNK7 = 1 << 0x07, // 7 can't be linked in chat? - SPELL_ATTR_UNK8 = 1 << 0x08, // 8 hide created item in tooltip (for effect=24) - SPELL_ATTR_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_ON_NEXT_SWING_2 = 1 << 0x0A, // 10 on next swing 2 - SPELL_ATTR_UNK11 = 1 << 0x0B, // 11 - SPELL_ATTR_DAYTIME_ONLY = 1 << 0x0C, // 12 only useable at daytime, not set in 2.4.2 - SPELL_ATTR_NIGHT_ONLY = 1 << 0x0D, // 13 only useable at night, not set in 2.4.2 - SPELL_ATTR_INDOORS_ONLY = 1 << 0x0E, // 14 only useable indoors, not set in 2.4.2 - SPELL_ATTR_OUTDOORS_ONLY = 1 << 0x0F, // 15 Only useable outdoors. - SPELL_ATTR_NOT_SHAPESHIFT = 1 << 0x10, // 16 Not while shapeshifted - SPELL_ATTR_ONLY_STEALTHED = 1 << 0x11, // 17 Must be in stealth - SPELL_ATTR_UNK18 = 1 << 0x12, // 18 - SPELL_ATTR_LEVEL_DAMAGE_CALCULATION = 1 << 0x13, // 19 spelldamage depends on caster level - SPELL_ATTR_STOP_ATTACK_TARGET = 1 << 0x14, // 20 Stop attack after use this spell (and not begin attack if use) - SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK = 1 << 0x15, // 21 Cannot be dodged/parried/blocked - SPELL_ATTR_UNK22 = 1 << 0x16, // 22 - SPELL_ATTR_UNK23 = 1 << 0x17, // 23 castable while dead? - SPELL_ATTR_CASTABLE_WHILE_MOUNTED = 1 << 0x18, // 24 castable while mounted - SPELL_ATTR_DISABLED_WHILE_ACTIVE = 1 << 0x19, // 25 Activate and start cooldown after aura fade or remove summoned creature or go - SPELL_ATTR_UNK26 = 1 << 0x1A, // 26 - SPELL_ATTR_CASTABLE_WHILE_SITTING = 1 << 0x1B, // 27 castable while sitting - SPELL_ATTR_CANT_USED_IN_COMBAT = 1 << 0x1C, // 28 Cannot be used in combat - SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY = 1 << 0x1D, // 29 unaffected by invulnerability (hmm possible not...) - SPELL_ATTR_UNK30 = 1 << 0x1E, // 30 breakable by damage? - SPELL_ATTR_CANT_CANCEL = 1 << 0x1F, // 31 positive aura can't be canceled + SPELL_ATTR0_ALL = 0xFFFFFFFF, + SPELL_ATTR0_NONE = 0x00000000, + SPELL_ATTR0_UNK0 = 0x00000001, // 0 + SPELL_ATTR0_REQ_AMMO = 0x00000002, // 1 on next ranged + SPELL_ATTR0_ON_NEXT_SWING = 0x00000004, // 2 + SPELL_ATTR0_IS_REPLENISHMENT = 0x00000008, // 3 not set in 3.0.3 + SPELL_ATTR0_ABILITY = 0x00000010, // 4 client puts 'ability' instead of 'spell' in game strings for these spells + SPELL_ATTR0_TRADESPELL = 0x00000020, // 5 trade spells (recipes), will be added by client to a sublist of profession spell + SPELL_ATTR0_PASSIVE = 0x00000040, // 6 Passive spell + SPELL_ATTR0_HIDDEN_CLIENTSIDE = 0x00000080, // 7 Spells with this attribute are not visible in spellbook or aura bar + SPELL_ATTR0_HIDE_IN_COMBAT_LOG = 0x00000100, // 8 This attribite controls whether spell appears in combat logs + SPELL_ATTR0_TARGET_MAINHAND_ITEM = 0x00000200, // 9 Client automatically selects item from mainhand slot as a cast target + SPELL_ATTR0_ON_NEXT_SWING_2 = 0x00000400, // 10 + SPELL_ATTR0_UNK11 = 0x00000800, // 11 + SPELL_ATTR0_DAYTIME_ONLY = 0x00001000, // 12 only useable at daytime, not set in 2.4.2 + SPELL_ATTR0_NIGHT_ONLY = 0x00002000, // 13 only useable at night, not set in 2.4.2 + SPELL_ATTR0_INDOORS_ONLY = 0x00004000, // 14 only useable indoors, not set in 2.4.2 + SPELL_ATTR0_OUTDOORS_ONLY = 0x00008000, // 15 Only useable outdoors. + SPELL_ATTR0_NOT_SHAPESHIFT = 0x00010000, // 16 Not while shapeshifted + SPELL_ATTR0_ONLY_STEALTHED = 0x00020000, // 17 Must be in stealth + SPELL_ATTR0_DONT_AFFECT_SHEATH_STATE = 0x00040000, // 18 client won't hide unit weapons in sheath on cast/channel + SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION = 0x00080000, // 19 spelldamage depends on caster level + SPELL_ATTR0_STOP_ATTACK_TARGET = 0x00100000, // 20 Stop attack after use this spell (and not begin attack if use) + SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK = 0x00200000, // 21 Cannot be dodged/parried/blocked + SPELL_ATTR0_CAST_TRACK_TARGET = 0x00400000, // 22 Client automatically forces player to face target when casting + SPELL_ATTR0_CASTABLE_WHILE_DEAD = 0x00800000, // 23 castable while dead? + SPELL_ATTR0_CASTABLE_WHILE_MOUNTED = 0x01000000, // 24 castable while mounted + SPELL_ATTR0_DISABLED_WHILE_ACTIVE = 0x02000000, // 25 Activate and start cooldown after aura fade or remove summoned creature or go + SPELL_ATTR0_NEGATIVE_1 = 0x04000000, // 26 Many negative spells have this attr + SPELL_ATTR0_CASTABLE_WHILE_SITTING = 0x08000000, // 27 castable while sitting + SPELL_ATTR0_CANT_USED_IN_COMBAT = 0x10000000, // 28 Cannot be used in combat + SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY = 0x20000000, // 29 unaffected by invulnerability (hmm possible not...) + SPELL_ATTR0_HEARTBEAT_RESIST_CHECK = 0x40000000, // 30 random chance the effect will end TODO: implement core support + SPELL_ATTR0_CANT_CANCEL = 0x80000000 // 31 positive aura can't be canceled }; [Flags] - public enum SpellAtributeEx + public enum SpellAtributeEx : uint { - SPELL_ATTR_EX_ALL = -1, - SPELL_ATTR_EX_NONE = 0x00, - SPELL_ATTR_EX_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_EX_DRAIN_ALL_POWER = 1 << 0x01, // 1 use all power (Only paladin Lay of Hands and Bunyanize) - SPELL_ATTR_EX_CHANNELED_1 = 1 << 0x02, // 2 channeled 1 - SPELL_ATTR_EX_UNK3 = 1 << 0x03, // 3 - SPELL_ATTR_EX_UNK4 = 1 << 0x04, // 4 - SPELL_ATTR_EX_NOT_BREAK_STEALTH = 1 << 0x05, // 5 Not break stealth - SPELL_ATTR_EX_CHANNELED_2 = 1 << 0x06, // 6 channeled 2 - SPELL_ATTR_EX_NEGATIVE = 1 << 0x07, // 7 - SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET = 1 << 0x08, // 8 Spell req target not to be in combat state - SPELL_ATTR_EX_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_EX_NO_INITIAL_AGGRO = 1 << 0x0A, // 10 no generates threat on cast 100% - SPELL_ATTR_EX_UNK11 = 1 << 0x0B, // 11 - SPELL_ATTR_EX_UNK12 = 1 << 0x0C, // 12 - SPELL_ATTR_EX_UNK13 = 1 << 0x0D, // 13 - SPELL_ATTR_EX_UNK14 = 1 << 0x0E, // 14 - SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY = 1 << 0x0F, // 15 remove auras on immunity - SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 1 << 0x10, // 16 unaffected by school immunity - SPELL_ATTR_EX_UNK17 = 1 << 0x11, // 17 - SPELL_ATTR_EX_UNK18 = 1 << 0x12, // 18 - SPELL_ATTR_EX_UNK19 = 1 << 0x13, // 19 - SPELL_ATTR_EX_REQ_COMBO_POINTS1 = 1 << 0x14, // 20 Req combo points on target - SPELL_ATTR_EX_UNK21 = 1 << 0x15, // 21 - SPELL_ATTR_EX_REQ_COMBO_POINTS2 = 1 << 0x16, // 22 Req combo points on target - SPELL_ATTR_EX_UNK23 = 1 << 0x17, // 23 - SPELL_ATTR_EX_UNK24 = 1 << 0x18, // 24 Req fishing pole?? - SPELL_ATTR_EX_UNK25 = 1 << 0x19, // 25 - SPELL_ATTR_EX_UNK26 = 1 << 0x1A, // 26 - SPELL_ATTR_EX_UNK27 = 1 << 0x1B, // 27 - SPELL_ATTR_EX_UNK28 = 1 << 0x1C, // 28 - SPELL_ATTR_EX_UNK29 = 1 << 0x1D, // 29 - SPELL_ATTR_EX_UNK30 = 1 << 0x1E, // 30 overpower - SPELL_ATTR_EX_UNK31 = 1 << 0x1F, // 31 + SPELL_ATTR1_ALL = 0xFFFFFFFF, + SPELL_ATTR1_NONE = 0x00000000, + SPELL_ATTR1_DISMISS_PET = 0x00000001, // 0 for spells without this flag client doesn't allow to summon pet if caster has a pet + SPELL_ATTR1_DRAIN_ALL_POWER = 0x00000002, // 1 use all power (Only paladin Lay of Hands and Bunyanize) + SPELL_ATTR1_CHANNELED_1 = 0x00000004, // 2 clientside checked? cancelable? + SPELL_ATTR1_CANT_BE_REDIRECTED = 0x00000008, // 3 + SPELL_ATTR1_UNK4 = 0x00000010, // 4 stealth and whirlwind + SPELL_ATTR1_NOT_BREAK_STEALTH = 0x00000020, // 5 Not break stealth + SPELL_ATTR1_CHANNELED_2 = 0x00000040, // 6 + SPELL_ATTR1_CANT_BE_REFLECTED = 0x00000080, // 7 + SPELL_ATTR1_CANT_TARGET_IN_COMBAT = 0x00000100, // 8 can target only out of combat units + SPELL_ATTR1_MELEE_COMBAT_START = 0x00000200, // 9 player starts melee combat after this spell is cast + SPELL_ATTR1_NO_THREAT = 0x00000400, // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO) + SPELL_ATTR1_UNK11 = 0x00000800, // 11 aura + SPELL_ATTR1_IS_PICKPOCKET = 0x00001000, // 12 Pickpocket + SPELL_ATTR1_FARSIGHT = 0x00002000, // 13 Client removes farsight on aura loss + SPELL_ATTR1_CHANNEL_TRACK_TARGET = 0x00004000, // 14 Client automatically forces player to face target when channeling + SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY = 0x00008000, // 15 remove auras on immunity + SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000, // 16 on immuniy + SPELL_ATTR1_UNAUTOCASTABLE_BY_PET = 0x00020000, // 17 + SPELL_ATTR1_UNK18 = 0x00040000, // 18 stun, polymorph, daze, hex + SPELL_ATTR1_CANT_TARGET_SELF = 0x00080000, // 19 + SPELL_ATTR1_REQ_COMBO_POINTS1 = 0x00100000, // 20 Req combo points on target + SPELL_ATTR1_UNK21 = 0x00200000, // 21 + SPELL_ATTR1_REQ_COMBO_POINTS2 = 0x00400000, // 22 Req combo points on target + SPELL_ATTR1_UNK23 = 0x00800000, // 23 + SPELL_ATTR1_IS_FISHING = 0x01000000, // 24 only fishing spells + SPELL_ATTR1_UNK25 = 0x02000000, // 25 + SPELL_ATTR1_UNK26 = 0x04000000, // 26 works correctly with [target=focus] and [target=mouseover] macros? + SPELL_ATTR1_UNK27 = 0x08000000, // 27 melee spell? + SPELL_ATTR1_DONT_DISPLAY_IN_AURA_BAR = 0x10000000, // 28 client doesn't display these spells in aura bar + SPELL_ATTR1_CHANNEL_DISPLAY_SPELL_NAME = 0x20000000, // 29 spell name is displayed in cast bar instead of 'channeling' text + SPELL_ATTR1_ENABLE_AT_DODGE = 0x40000000, // 30 Overpower + SPELL_ATTR1_UNK31 = 0x80000000 // 31 }; [Flags] - public enum SpellAtributeEx2 + public enum SpellAtributeEx2 : uint { - SPELL_ATTR_EX2_ALL = -1, - SPELL_ATTR_EX2_NONE = 0x00, - SPELL_ATTR_EX2_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_EX2_UNK1 = 1 << 0x01, // 1 - SPELL_ATTR_EX2_CANT_REFLECTED = 1 << 0x02, // 2 ? used for detect can or not spell reflected // do not need LOS (e.g. 18220 since 3.3.3) - SPELL_ATTR_EX2_UNK3 = 1 << 0x03, // 3 auto targeting? (e.g. fishing skill enhancement items since 3.3.3) - SPELL_ATTR_EX2_UNK4 = 1 << 0x04, // 4 - SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 1 << 0x05, // 5 - SPELL_ATTR_EX2_UNK6 = 1 << 0x06, // 6 only usable on tabbed by yourself - SPELL_ATTR_EX2_UNK7 = 1 << 0x07, // 7 - SPELL_ATTR_EX2_UNK8 = 1 << 0x08, // 8 not set in 3.0.3 - SPELL_ATTR_EX2_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_EX2_UNK10 = 1 << 0x0A, // 10 - SPELL_ATTR_EX2_HEALTH_FUNNEL = 1 << 0x0B, // 11 - SPELL_ATTR_EX2_UNK12 = 1 << 0x0C, // 12 - SPELL_ATTR_EX2_UNK13 = 1 << 0x0D, // 13 - SPELL_ATTR_EX2_UNK14 = 1 << 0x0E, // 14 - SPELL_ATTR_EX2_UNK15 = 1 << 0x0F, // 15 not set in 3.0.3 - SPELL_ATTR_EX2_UNK16 = 1 << 0x10, // 16 - SPELL_ATTR_EX2_UNK17 = 1 << 0x11, // 17 suspend weapon timer instead of resetting it, (?Hunters Shot and Stings only have this flag?) - SPELL_ATTR_EX2_UNK18 = 1 << 0x12, // 18 Only Revive pet - possible req dead pet - SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT = 1 << 0x13, // 19 does not necessarly need shapeshift - SPELL_ATTR_EX2_UNK20 = 1 << 0x14, // 20 - SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD = 1 << 0x15, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! - SPELL_ATTR_EX2_UNK22 = 1 << 0x16, // 22 - SPELL_ATTR_EX2_UNK23 = 1 << 0x17, // 23 Only mage Arcane Concentration have this flag - SPELL_ATTR_EX2_UNK24 = 1 << 0x18, // 24 - SPELL_ATTR_EX2_UNK25 = 1 << 0x19, // 25 - SPELL_ATTR_EX2_UNK26 = 1 << 0x1A, // 26 unaffected by school immunity - SPELL_ATTR_EX2_UNK27 = 1 << 0x1B, // 27 - SPELL_ATTR_EX2_UNK28 = 1 << 0x1C, // 28 no breaks stealth if it fails?? - SPELL_ATTR_EX2_CANT_CRIT = 1 << 0x1D, // 29 Spell can't crit - SPELL_ATTR_EX2_UNK30 = 1 << 0x1E, // 30 - SPELL_ATTR_EX2_FOOD_BUFF = 1 << 0x1F, // 31 Food or Drink Buff (like Well Fed) + SPELL_ATTR2_ALL = 0xFFFFFFFF, + SPELL_ATTR2_NONE = 0x00000000, + SPELL_ATTR2_CAN_TARGET_DEAD = 0x00000001, // 0 can target dead unit or corpse + SPELL_ATTR2_UNK1 = 0x00000002, // 1 vanish, shadowform, Ghost Wolf and other + SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS = 0x00000004, // 2 26368 4.0.1 dbc change + SPELL_ATTR2_UNK3 = 0x00000008, // 3 + SPELL_ATTR2_DISPLAY_IN_STANCE_BAR = 0x00000010, // 4 client displays icon in stance bar when learned, even if not shapeshift + SPELL_ATTR2_AUTOREPEAT_FLAG = 0x00000020, // 5 + SPELL_ATTR2_CANT_TARGET_TAPPED = 0x00000040, // 6 target must be tapped by caster + SPELL_ATTR2_UNK7 = 0x00000080, // 7 + SPELL_ATTR2_UNK8 = 0x00000100, // 8 not set in 3.0.3 + SPELL_ATTR2_UNK9 = 0x00000200, // 9 + SPELL_ATTR2_UNK10 = 0x00000400, // 10 related to tame + SPELL_ATTR2_HEALTH_FUNNEL = 0x00000800, // 11 + SPELL_ATTR2_UNK12 = 0x00001000, // 12 Cleave, Heart Strike, Maul, Sunder Armor, Swipe + SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA = 0x00002000, // 13 Items enchanted by spells with this flag preserve the enchant to arenas + SPELL_ATTR2_UNK14 = 0x00004000, // 14 + SPELL_ATTR2_UNK15 = 0x00008000, // 15 not set in 3.0.3 + SPELL_ATTR2_TAME_BEAST = 0x00010000, // 16 + SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS = 0x00020000, // 17 don't reset timers for melee autoattacks (swings) or ranged autoattacks (autoshoots) + SPELL_ATTR2_REQ_DEAD_PET = 0x00040000, // 18 Only Revive pet and Heart of the Pheonix + SPELL_ATTR2_NOT_NEED_SHAPESHIFT = 0x00080000, // 19 does not necessarly need shapeshift + SPELL_ATTR2_UNK20 = 0x00100000, // 20 + SPELL_ATTR2_DAMAGE_REDUCED_SHIELD = 0x00200000, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! + SPELL_ATTR2_UNK22 = 0x00400000, // 22 Ambush, Backstab, Cheap Shot, Death Grip, Garrote, Judgements, Mutilate, Pounce, Ravage, Shiv, Shred + SPELL_ATTR2_IS_ARCANE_CONCENTRATION = 0x00800000, // 23 Only mage Arcane Concentration have this flag + SPELL_ATTR2_UNK24 = 0x01000000, // 24 + SPELL_ATTR2_UNK25 = 0x02000000, // 25 + SPELL_ATTR2_UNK26 = 0x04000000, // 26 unaffected by school immunity + SPELL_ATTR2_UNK27 = 0x08000000, // 27 + SPELL_ATTR2_UNK28 = 0x10000000, // 28 + SPELL_ATTR2_CANT_CRIT = 0x20000000, // 29 Spell can't crit + SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC = 0x40000000, // 30 spell can trigger even if triggered + SPELL_ATTR2_FOOD_BUFF = 0x80000000 // 31 Food or Drink Buff (like Well Fed) }; [Flags] - public enum SpellAtributeEx3 + public enum SpellAtributeEx3 : uint { - SPELL_ATTR_EX3_ALL = -1, - SPELL_ATTR_EX3_NONE = 0x00, - SPELL_ATTR_EX3_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_EX3_UNK1 = 1 << 0x01, // 1 - SPELL_ATTR_EX3_UNK2 = 1 << 0x02, // 2 - SPELL_ATTR_EX3_UNK3 = 1 << 0x03, // 3 - SPELL_ATTR_EX3_UNK4 = 1 << 0x04, // 4 Druid Rebirth only this spell have this flag - SPELL_ATTR_EX3_UNK5 = 1 << 0x05, // 5 - SPELL_ATTR_EX3_UNK6 = 1 << 0x06, // 6 - SPELL_ATTR_EX3_UNK7 = 1 << 0x07, // 7 create a separate (de)buff stack for each caster - SPELL_ATTR_EX3_UNK8 = 1 << 0x08, // 8 - SPELL_ATTR_EX3_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_EX3_MAIN_HAND = 1 << 0x0A, // 10 Main hand weapon required - SPELL_ATTR_EX3_BATTLEGROUND = 1 << 0x0B, // 11 Can casted only on battleground - SPELL_ATTR_EX3_CAST_ON_DEAD = 1 << 0x0C, // 12 target is a dead player (not every spell has this flag) - SPELL_ATTR_EX3_UNK13 = 1 << 0x0D, // 13 - SPELL_ATTR_EX3_UNK14 = 1 << 0x0E, // 14 "Honorless Target" only this spells have this flag - SPELL_ATTR_EX3_UNK15 = 1 << 0x0F, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag - SPELL_ATTR_EX3_UNK16 = 1 << 0x10, // 16 no triggers effects that trigger on casting a spell?? - SPELL_ATTR_EX3_UNK17 = 1 << 0x11, // 17 no triggers effects that trigger on casting a spell?? - SPELL_ATTR_EX3_UNK18 = 1 << 0x12, // 18 - SPELL_ATTR_EX3_UNK19 = 1 << 0x13, // 19 - SPELL_ATTR_EX3_DEATH_PERSISTENT = 1 << 0x14, // 20 Death persistent spells - SPELL_ATTR_EX3_UNK21 = 1 << 0x15, // 21 - SPELL_ATTR_EX3_REQ_WAND = 1 << 0x16, // 22 Req wand - SPELL_ATTR_EX3_UNK23 = 1 << 0x17, // 23 - SPELL_ATTR_EX3_REQ_OFFHAND = 1 << 0x18, // 24 Req offhand weapon - SPELL_ATTR_EX3_UNK25 = 1 << 0x19, // 25 no cause spell pushback ? - SPELL_ATTR_EX3_UNK26 = 1 << 0x1A, // 26 - SPELL_ATTR_EX3_UNK27 = 1 << 0x1B, // 27 - SPELL_ATTR_EX3_UNK28 = 1 << 0x1C, // 28 - SPELL_ATTR_EX3_UNK29 = 1 << 0x1D, // 29 - SPELL_ATTR_EX3_UNK30 = 1 << 0x1E, // 30 - SPELL_ATTR_EX3_UNK31 = 1 << 0x1F, // 31 + SPELL_ATTR3_ALL = 0xFFFFFFFF, + SPELL_ATTR3_NONE = 0x00000000, + SPELL_ATTR3_UNK0 = 0x00000001, // 0 + SPELL_ATTR3_UNK1 = 0x00000002, // 1 + SPELL_ATTR3_UNK2 = 0x00000004, // 2 + SPELL_ATTR3_BLOCKABLE_SPELL = 0x00000008, // 3 Only dmg class melee in 3.1.3 + SPELL_ATTR3_IGNORE_RESURRECTION_TIMER = 0x00000010, // 4 you don't have to wait to be resurrected with these spells + SPELL_ATTR3_UNK5 = 0x00000020, // 5 + SPELL_ATTR3_UNK6 = 0x00000040, // 6 + SPELL_ATTR3_STACK_FOR_DIFF_CASTERS = 0x00000080, // 7 separate stack for every caster + SPELL_ATTR3_ONLY_TARGET_PLAYERS = 0x00000100, // 8 can only target players + SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2 = 0x00000200, // 9 triggered from effect? + SPELL_ATTR3_MAIN_HAND = 0x00000400, // 10 Main hand weapon required + SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground + SPELL_ATTR3_ONLY_TARGET_GHOSTS = 0x00001000, // 12 + SPELL_ATTR3_DONT_DISPLAY_CHANNEL_BAR = 0x00002000, // 13 Clientside attribute - will not display channeling bar + SPELL_ATTR3_IS_HONORLESS_TARGET = 0x00004000, // 14 "Honorless Target" only this spells have this flag + SPELL_ATTR3_UNK15 = 0x00008000, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag + SPELL_ATTR3_CANT_TRIGGER_PROC = 0x00010000, // 16 confirmed with many patchnotes + SPELL_ATTR3_NO_INITIAL_AGGRO = 0x00020000, // 17 Soothe Animal, 39758, Mind Soothe + SPELL_ATTR3_IGNORE_HIT_RESULT = 0x00040000, // 18 Spell should always hit its target + SPELL_ATTR3_DISABLE_PROC = 0x00080000, // 19 during aura proc no spells can trigger (20178, 20375) + SPELL_ATTR3_DEATH_PERSISTENT = 0x00100000, // 20 Death persistent spells + SPELL_ATTR3_UNK21 = 0x00200000, // 21 unused + SPELL_ATTR3_REQ_WAND = 0x00400000, // 22 Req wand + SPELL_ATTR3_UNK23 = 0x00800000, // 23 + SPELL_ATTR3_REQ_OFFHAND = 0x01000000, // 24 Req offhand weapon + SPELL_ATTR3_UNK25 = 0x02000000, // 25 no cause spell pushback ? + SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED = 0x04000000, // 26 auras with this attribute can proc from triggered spell casts with SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2 (67736 + 52999) + SPELL_ATTR3_DRAIN_SOUL = 0x08000000, // 27 only drain soul has this flag + SPELL_ATTR3_UNK28 = 0x10000000, // 28 + SPELL_ATTR3_NO_DONE_BONUS = 0x20000000, // 29 Ignore caster spellpower and done damage mods? client doesn't apply spellmods for those spells + SPELL_ATTR3_DONT_DISPLAY_RANGE = 0x40000000, // 30 client doesn't display range in tooltip for those spells + SPELL_ATTR3_UNK31 = 0x80000000 // 31 }; [Flags] - public enum SpellAtributeEx4 + public enum SpellAtributeEx4 : uint { - SPELL_ATTR_EX4_ALL = -1, - SPELL_ATTR_EX4_NONE = 0x00, - SPELL_ATTR_EX4_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_EX4_UNK1 = 1 << 0x01, // 1 proc on finishing move? - SPELL_ATTR_EX4_UNK2 = 1 << 0x02, // 2 - SPELL_ATTR_EX4_UNK3 = 1 << 0x03, // 3 - SPELL_ATTR_EX4_UNK4 = 1 << 0x04, // 4 This will no longer cause guards to attack on use?? - SPELL_ATTR_EX4_UNK5 = 1 << 0x05, // 5 - SPELL_ATTR_EX4_NOT_STEALABLE = 1 << 0x06, // 6 although such auras might be dispellable, they cannot be stolen - SPELL_ATTR_EX4_UNK7 = 1 << 0x07, // 7 - SPELL_ATTR_EX4_STACK_DOT_MODIFIER = 1 << 0x08, // 8 no effect on non DoTs? - SPELL_ATTR_EX4_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST = 1 << 0x0A, // 10 Rogue Shiv have this flag - SPELL_ATTR_EX4_UNK11 = 1 << 0x0B, // 11 - SPELL_ATTR_EX4_UNK12 = 1 << 0x0C, // 12 - SPELL_ATTR_EX4_UNK13 = 1 << 0x0D, // 13 - SPELL_ATTR_EX4_UNK14 = 1 << 0x0E, // 14 - SPELL_ATTR_EX4_UNK15 = 1 << 0x0F, // 15 - SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA = 1 << 0x10, // 16 not usable in arena - SPELL_ATTR_EX4_USABLE_IN_ARENA = 1 << 0x11, // 17 usable in arena - SPELL_ATTR_EX4_UNK18 = 1 << 0x12, // 18 - SPELL_ATTR_EX4_UNK19 = 1 << 0x13, // 19 - SPELL_ATTR_EX4_UNK20 = 1 << 0x14, // 20 do not give "more powerful spell" error message - SPELL_ATTR_EX4_UNK21 = 1 << 0x15, // 21 - SPELL_ATTR_EX4_UNK22 = 1 << 0x16, // 22 - SPELL_ATTR_EX4_UNK23 = 1 << 0x17, // 23 - SPELL_ATTR_EX4_UNK24 = 1 << 0x18, // 24 - SPELL_ATTR_EX4_UNK25 = 1 << 0x19, // 25 pet scaling auras - SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND = 1 << 0x1A, // 26 Can only be used in Outland. - SPELL_ATTR_EX4_UNK27 = 1 << 0x1B, // 27 - SPELL_ATTR_EX4_UNK28 = 1 << 0x1C, // 28 - SPELL_ATTR_EX4_UNK29 = 1 << 0x1D, // 29 - SPELL_ATTR_EX4_UNK30 = 1 << 0x1E, // 30 - SPELL_ATTR_EX4_UNK31 = 1 << 0x1F, // 31 + SPELL_ATTR4_ALL = 0xFFFFFFFF, + SPELL_ATTR4_NONE = 0x00000000, + SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target's resistance (these spells can't be resisted) + SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER? + SPELL_ATTR4_UNK2 = 0x00000004, // 2 + SPELL_ATTR4_UNK3 = 0x00000008, // 3 + SPELL_ATTR4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use?? + SPELL_ATTR4_UNK5 = 0x00000020, // 5 + SPELL_ATTR4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen + SPELL_ATTR4_TRIGGERED = 0x00000080, // 7 spells forced to be triggered + SPELL_ATTR4_FIXED_DAMAGE = 0x00000100, // 8 ignores taken percent damage mods? + SPELL_ATTR4_TRIGGER_ACTIVATE = 0x00000200, // 9 initially disabled / trigger activate from event (Execute, Riposte, Deep Freeze end other) + SPELL_ATTR4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag + SPELL_ATTR4_UNK11 = 0x00000800, // 11 + SPELL_ATTR4_UNK12 = 0x00001000, // 12 + SPELL_ATTR4_UNK13 = 0x00002000, // 13 + SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS = 0x00004000, // 14 doesn't break auras by damage from these spells + SPELL_ATTR4_UNK15 = 0x00008000, // 15 + SPELL_ATTR4_NOT_USABLE_IN_ARENA_OR_RATED_BG = 0x00010000, // 16 Cannot be used in both Arenas or Rated Battlegrounds + SPELL_ATTR4_USABLE_IN_ARENA = 0x00020000, // 17 + SPELL_ATTR4_AREA_TARGET_CHAIN = 0x00040000, // 18 (NYI)hits area targets one after another instead of all at once + SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb? + SPELL_ATTR4_NOT_CHECK_SELFCAST_POWER = 0x00100000, // 20 supersedes message "More powerful spell applied" for self casts. + SPELL_ATTR4_UNK21 = 0x00200000, // 21 Pally aura, dk presence, dudu form, warrior stance, shadowform, hunter track + SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058, 57770) and Gymer's Smash 55426 + SPELL_ATTR4_UNK23 = 0x00800000, // 23 + SPELL_ATTR4_UNK24 = 0x01000000, // 24 some shoot spell + SPELL_ATTR4_IS_PET_SCALING = 0x02000000, // 25 pet scaling auras + SPELL_ATTR4_CAST_ONLY_IN_OUTLAND = 0x04000000, // 26 Can only be used in Outland. + SPELL_ATTR4_UNK27 = 0x08000000, // 27 + SPELL_ATTR4_UNK28 = 0x10000000, // 28 Aimed Shot + SPELL_ATTR4_UNK29 = 0x20000000, // 29 + SPELL_ATTR4_UNK30 = 0x40000000, // 30 + SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052, 38488) }; [Flags] - public enum SpellAtributeEx5 + public enum SpellAtributeEx5 : uint { - SPELL_ATTR_EX5_ALL = -1, - SPELL_ATTR_EX5_NONE = 0x00, - SPELL_ATTR_EX5_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP = 1 << 0x01, // 1 not need reagents if UNIT_FLAG_PREPARATION - SPELL_ATTR_EX5_UNK2 = 1 << 0x02, // 2 removed at enter arena (e.g. 31850 since 3.3.3) - SPELL_ATTR_EX5_USABLE_WHILE_STUNNED = 1 << 0x03, // 3 usable while stunned - SPELL_ATTR_EX5_UNK4 = 1 << 0x04, // 4 - SPELL_ATTR_EX5_SINGLE_TARGET_SPELL = 1 << 0x05, // 5 Only one target can be apply at a time - SPELL_ATTR_EX5_UNK6 = 1 << 0x06, // 6 - SPELL_ATTR_EX5_UNK7 = 1 << 0x07, // 7 - SPELL_ATTR_EX5_UNK8 = 1 << 0x08, // 8 - SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY = 1 << 0x09, // 9 begin periodic tick at aura apply - SPELL_ATTR_EX5_UNK10 = 1 << 0x0A, // 10 - SPELL_ATTR_EX5_UNK11 = 1 << 0x0B, // 11 - SPELL_ATTR_EX5_UNK12 = 1 << 0x0C, // 12 - SPELL_ATTR_EX5_UNK13 = 1 << 0x0D, // 13 haste affects duration (e.g. 8050 since 3.3.3) - SPELL_ATTR_EX5_UNK14 = 1 << 0x0E, // 14 - SPELL_ATTR_EX5_UNK15 = 1 << 0x0F, // 15 - SPELL_ATTR_EX5_UNK16 = 1 << 0x10, // 16 - SPELL_ATTR_EX5_USABLE_WHILE_FEARED = 1 << 0x11, // 17 usable while feared - SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED = 1 << 0x12, // 18 usable while confused - SPELL_ATTR_EX5_UNK19 = 1 << 0x13, // 19 - SPELL_ATTR_EX5_UNK20 = 1 << 0x14, // 20 - SPELL_ATTR_EX5_UNK21 = 1 << 0x15, // 21 - SPELL_ATTR_EX5_UNK22 = 1 << 0x16, // 22 - SPELL_ATTR_EX5_UNK23 = 1 << 0x17, // 23 - SPELL_ATTR_EX5_UNK24 = 1 << 0x18, // 24 - SPELL_ATTR_EX5_UNK25 = 1 << 0x19, // 25 - SPELL_ATTR_EX5_UNK26 = 1 << 0x1A, // 26 - SPELL_ATTR_EX5_UNK27 = 1 << 0x1B, // 27 - SPELL_ATTR_EX5_UNK28 = 1 << 0x1C, // 28 - SPELL_ATTR_EX5_UNK29 = 1 << 0x1D, // 29 - SPELL_ATTR_EX5_UNK30 = 1 << 0x1E, // 30 - SPELL_ATTR_EX5_UNK31 = 1 << 0x1F, // 31 Forces all nearby enemies to focus attacks caster + SPELL_ATTR5_ALL = 0xFFFFFFFF, + SPELL_ATTR5_NONE = 0x00000000, + SPELL_ATTR5_UNK0 = 0x00000001, // 0 + SPELL_ATTR5_NO_REAGENT_WHILE_PREP = 0x00000002, // 1 not need reagents if UNIT_FLAG_PREPARATION + SPELL_ATTR5_UNK2 = 0x00000004, // 2 + SPELL_ATTR5_USABLE_WHILE_STUNNED = 0x00000008, // 3 usable while stunned + SPELL_ATTR5_UNK4 = 0x00000010, // 4 + SPELL_ATTR5_SINGLE_TARGET_SPELL = 0x00000020, // 5 Only one target can be apply at a time + SPELL_ATTR5_UNK6 = 0x00000040, // 6 + SPELL_ATTR5_UNK7 = 0x00000080, // 7 + SPELL_ATTR5_UNK8 = 0x00000100, // 8 + SPELL_ATTR5_START_PERIODIC_AT_APPLY = 0x00000200, // 9 begin periodic tick at aura apply + SPELL_ATTR5_HIDE_DURATION = 0x00000400, // 10 do not send duration to client + SPELL_ATTR5_ALLOW_TARGET_OF_TARGET_AS_TARGET = 0x00000800, // 11 (NYI) uses target's target as target if original target not valid (intervene for example) + SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related? + SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this + SPELL_ATTR5_UNK14 = 0x00004000, // 14 + SPELL_ATTR5_UNK15 = 0x00008000, // 15 Inflits on multiple targets? + SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK = 0x00010000, // 16 this allows spells with EquippedItemClass to affect spells from other items if the required item is equipped + SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared + SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused + SPELL_ATTR5_DONT_TURN_DURING_CAST = 0x00080000, // 19 Blocks caster's turning when casting (client does not automatically turn caster's model to face UNIT_FIELD_TARGET) + SPELL_ATTR5_UNK20 = 0x00100000, // 20 + SPELL_ATTR5_UNK21 = 0x00200000, // 21 + SPELL_ATTR5_UNK22 = 0x00400000, // 22 + SPELL_ATTR5_UNK23 = 0x00800000, // 23 + SPELL_ATTR5_UNK24 = 0x01000000, // 24 + SPELL_ATTR5_UNK25 = 0x02000000, // 25 + SPELL_ATTR5_UNK26 = 0x04000000, // 26 aoe related - Boulder, Cannon, Corpse Explosion, Fire Nova, Flames, Frost Bomb, Living Bomb, Seed of Corruption, Starfall, Thunder Clap, Volley + SPELL_ATTR5_DONT_SHOW_AURA_IF_SELF_CAST = 0x08000000, // 27 Auras with this attribute are not visible on units that are the caster + SPELL_ATTR5_DONT_SHOW_AURA_IF_NOT_SELF_CAST = 0x10000000, // 28 Auras with this attribute are not visible on units that are not the caster + SPELL_ATTR5_UNK29 = 0x20000000, // 29 + SPELL_ATTR5_UNK30 = 0x40000000, // 30 + SPELL_ATTR5_UNK31 = 0x80000000 // 31 Forces all nearby enemies to focus attacks caster }; [Flags] - public enum SpellAtributeEx6 + public enum SpellAtributeEx6 : uint { - SPELL_ATTR_EX6_ALL = -1, - SPELL_ATTR_EX6_NONE = 0x00, - SPELL_ATTR_EX6_UNK0 = 1 << 0x00, // 0 Only Move spell have this flag - SPELL_ATTR_EX6_ONLY_IN_ARENA = 1 << 0x01, // 1 only usable in arena, not used in 3.2.0a and early - SPELL_ATTR_EX6_UNK2 = 1 << 0x02, // 2 - SPELL_ATTR_EX6_UNK3 = 1 << 0x03, // 3 - SPELL_ATTR_EX6_UNK4 = 1 << 0x04, // 4 - SPELL_ATTR_EX6_UNK5 = 1 << 0x05, // 5 - SPELL_ATTR_EX6_UNK6 = 1 << 0x06, // 6 - SPELL_ATTR_EX6_UNK7 = 1 << 0x07, // 7 - SPELL_ATTR_EX6_UNK8 = 1 << 0x08, // 8 - SPELL_ATTR_EX6_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_EX6_UNK10 = 1 << 0x0A, // 10 - SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE = 1 << 0x0B, // 11 not usable in raid instance - SPELL_ATTR_EX6_UNK12 = 1 << 0x0C, // 12 - SPELL_ATTR_EX6_UNK13 = 1 << 0x0D, // 13 - SPELL_ATTR_EX6_UNK14 = 1 << 0x0E, // 14 - SPELL_ATTR_EX6_UNK15 = 1 << 0x0F, // 15 not set in 3.0.3 - SPELL_ATTR_EX6_UNK16 = 1 << 0x10, // 16 - SPELL_ATTR_EX6_UNK17 = 1 << 0x11, // 17 - SPELL_ATTR_EX6_UNK18 = 1 << 0x12, // 18 - SPELL_ATTR_EX6_UNK19 = 1 << 0x13, // 19 - SPELL_ATTR_EX6_UNK20 = 1 << 0x14, // 20 - SPELL_ATTR_EX6_UNK21 = 1 << 0x15, // 21 - SPELL_ATTR_EX6_UNK22 = 1 << 0x16, // 22 - SPELL_ATTR_EX6_UNK23 = 1 << 0x17, // 23 not set in 3.0.3 - SPELL_ATTR_EX6_UNK24 = 1 << 0x18, // 24 not set in 3.0.3 - SPELL_ATTR_EX6_UNK25 = 1 << 0x19, // 25 not set in 3.0.3 - SPELL_ATTR_EX6_UNK26 = 1 << 0x1A, // 26 not set in 3.0.3 - SPELL_ATTR_EX6_UNK27 = 1 << 0x1B, // 27 not set in 3.0.3 - SPELL_ATTR_EX6_UNK28 = 1 << 0x1C, // 28 not set in 3.0.3 - SPELL_ATTR_EX6_NO_DMG_PERCENT_MODS = 1 << 0x1D, // 29 do not apply damage percent mods (usually in cases where it has already been applied) - SPELL_ATTR_EX6_UNK30 = 1 << 0x1E, // 30 not set in 3.0.3 - SPELL_ATTR_EX6_UNK31 = 1 << 0x1F, // 31 not set in 3.0.3 + SPELL_ATTR6_ALL = 0xFFFFFFFF, + SPELL_ATTR6_NONE = 0x00000000, + SPELL_ATTR6_DONT_DISPLAY_COOLDOWN = 0x00000001, // 0 client doesn't display cooldown in tooltip for these spells + SPELL_ATTR6_ONLY_IN_ARENA = 0x00000002, // 1 only usable in arena + SPELL_ATTR6_IGNORE_CASTER_AURAS = 0x00000004, // 2 + SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG = 0x00000008, // 3 skips checking UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC flags on assist + SPELL_ATTR6_UNK4 = 0x00000010, // 4 + SPELL_ATTR6_UNK5 = 0x00000020, // 5 + SPELL_ATTR6_USE_SPELL_CAST_EVENT = 0x00000040, // 6 Auras with this attribute trigger SPELL_CAST combat log event instead of SPELL_AURA_START (clientside attribute) + SPELL_ATTR6_UNK7 = 0x00000080, // 7 + SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED = 0x00000100, // 8 + SPELL_ATTR6_UNK9 = 0x00000200, // 9 + SPELL_ATTR6_CAN_TARGET_POSSESSED_FRIENDS = 0x00000400, // 10 NYI! + SPELL_ATTR6_NOT_IN_RAID_INSTANCE = 0x00000800, // 11 not usable in raid instance + SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE = 0x00001000, // 12 castable while caster is on vehicle + SPELL_ATTR6_CAN_TARGET_INVISIBLE = 0x00002000, // 13 ignore visibility requirement for spell target (phases, invisibility, etc.) + SPELL_ATTR6_UNK14 = 0x00004000, // 14 + SPELL_ATTR6_UNK15 = 0x00008000, // 15 only 54368, 67892 + SPELL_ATTR6_UNK16 = 0x00010000, // 16 + SPELL_ATTR6_UNK17 = 0x00020000, // 17 Mount spell + SPELL_ATTR6_CAST_BY_CHARMER = 0x00040000, // 18 client won't allow to cast these spells when unit is not possessed && charmer of caster will be original caster + SPELL_ATTR6_UNK19 = 0x00080000, // 19 only 47488, 50782 + SPELL_ATTR6_ONLY_VISIBLE_TO_CASTER = 0x00100000, // 20 Auras with this attribute are only visible to their caster (or pet's owner) + SPELL_ATTR6_CLIENT_UI_TARGET_EFFECTS = 0x00200000, // 21 it's only client-side attribute + SPELL_ATTR6_UNK22 = 0x00400000, // 22 only 72054 + SPELL_ATTR6_UNK23 = 0x00800000, // 23 + SPELL_ATTR6_CAN_TARGET_UNTARGETABLE = 0x01000000, // 24 + SPELL_ATTR6_UNK25 = 0x02000000, // 25 Exorcism, Flash of Light + SPELL_ATTR6_UNK26 = 0x04000000, // 26 related to player castable positive buff + SPELL_ATTR6_UNK27 = 0x08000000, // 27 + SPELL_ATTR6_UNK28 = 0x10000000, // 28 Death Grip + SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS = 0x20000000, // 29 ignores done percent damage mods? + SPELL_ATTR6_UNK30 = 0x40000000, // 30 + SPELL_ATTR6_IGNORE_CATEGORY_COOLDOWN_MODS = 0x80000000 // 31 Spells with this attribute skip applying modifiers to category cooldowns }; - + + [Flags] + public enum SpellAtributeEx7 : uint + { + SPELL_ATTR7_ALL = 0xFFFFFFFF, + SPELL_ATTR7_NONE = 0x00000000, + SPELL_ATTR7_UNK1 = 0x00000002, // 1 Not set in 3.2.2a. + SPELL_ATTR7_REACTIVATE_AT_RESURRECT = 0x00000004, // 2 Paladin's auras and 65607 only. + SPELL_ATTR7_IS_CHEAT_SPELL = 0x00000008, // 3 Cannot cast if caster doesn't have UnitFlag2 & UNIT_FLAG2_ALLOW_CHEAT_SPELLS + SPELL_ATTR7_UNK4 = 0x00000010, // 4 Only 47883 (Soulstone Resurrection) and test spell. + SPELL_ATTR7_SUMMON_TOTEM = 0x00000020, // 5 Only Shaman totems. + SPELL_ATTR7_NO_PUSHBACK_ON_DAMAGE = 0x00000040, // 6 Does not cause spell pushback on damage + SPELL_ATTR7_UNK7 = 0x00000080, // 7 66218 (Launch) spell. + SPELL_ATTR7_HORDE_ONLY = 0x00000100, // 8 Teleports, mounts and other spells. + SPELL_ATTR7_ALLIANCE_ONLY = 0x00000200, // 9 Teleports, mounts and other spells. + SPELL_ATTR7_DISPEL_CHARGES = 0x00000400, // 10 Dispel and Spellsteal individual charges instead of whole aura. + SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER = 0x00000800, // 11 Only non-player casts interrupt, though Feral Charge - Bear has it. + SPELL_ATTR7_UNK12 = 0x00001000, // 12 Not set in 3.2.2a. + SPELL_ATTR7_UNK13 = 0x00002000, // 13 Not set in 3.2.2a. + SPELL_ATTR7_UNK14 = 0x00004000, // 14 Only 52150 (Raise Dead - Pet) spell. + SPELL_ATTR7_UNK15 = 0x00008000, // 15 Exorcism. Usable on players? 100% crit chance on undead and demons? + SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER = 0x00010000, // 16 These spells can replenish a powertype, which is not the current powertype + SPELL_ATTR7_UNK17 = 0x00020000, // 17 Only 27965 (Suicide) spell. + SPELL_ATTR7_HAS_CHARGE_EFFECT = 0x00040000, // 18 Only spells that have Charge among effects. + SPELL_ATTR7_ZONE_TELEPORT = 0x00080000, // 19 Teleports to specific zones. + SPELL_ATTR7_UNK20 = 0x00100000, // 20 Blink, Divine Shield, Ice Block + SPELL_ATTR7_UNK21 = 0x00200000, // 21 Not set + SPELL_ATTR7_UNK22 = 0x00400000, // 22 + SPELL_ATTR7_UNK23 = 0x00800000, // 23 Motivate, Mutilate, Shattering Throw + SPELL_ATTR7_UNK24 = 0x01000000, // 24 Motivate, Mutilate, Perform Speech, Shattering Throw + SPELL_ATTR7_UNK25 = 0x02000000, // 25 + SPELL_ATTR7_UNK26 = 0x04000000, // 26 + SPELL_ATTR7_UNK27 = 0x08000000, // 27 Not set + SPELL_ATTR7_CONSOLIDATED_RAID_BUFF = 0x10000000, // 28 May be collapsed in raid buff frame (clientside attribute) + SPELL_ATTR7_UNK29 = 0x20000000, // 29 only 69028, 71237 + SPELL_ATTR7_UNK30 = 0x40000000, // 30 Burning Determination, Divine Sacrifice, Earth Shield, Prayer of Mending + SPELL_ATTR7_CLIENT_INDICATOR = 0x80000000 // 31 + }; + + [Flags] + public enum SpellAtributeEx8 : uint + { + SPELL_ATTR8_CANT_MISS = 0x00000001, // 0 + SPELL_ATTR8_UNK1 = 0x00000002, // 1 + SPELL_ATTR8_UNK2 = 0x00000004, // 2 + SPELL_ATTR8_UNK3 = 0x00000008, // 3 + SPELL_ATTR8_UNK4 = 0x00000010, // 4 + SPELL_ATTR8_UNK5 = 0x00000020, // 5 + SPELL_ATTR8_UNK6 = 0x00000040, // 6 + SPELL_ATTR8_UNK7 = 0x00000080, // 7 + SPELL_ATTR8_AFFECT_PARTY_AND_RAID = 0x00000100, // 8 Nearly all spells have "all party and raid" in description + SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping) + SPELL_ATTR8_NAME_CHANGED_DURING_TRANSFORM = 0x00000400, // 10 according to wowhead comments, name changes, title remains + SPELL_ATTR8_UNK11 = 0x00000800, // 11 + SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount + SPELL_ATTR8_UNK13 = 0x00002000, // 13 + SPELL_ATTR8_UNK14 = 0x00004000, // 14 + SPELL_ATTR8_WATER_MOUNT = 0x00008000, // 15 only one River Boat used in Thousand Needles + SPELL_ATTR8_UNK16 = 0x00010000, // 16 + SPELL_ATTR8_UNK17 = 0x00020000, // 17 + SPELL_ATTR8_REMEMBER_SPELLS = 0x00040000, // 18 at some point in time, these auras remember spells and allow to cast them later + SPELL_ATTR8_USE_COMBO_POINTS_ON_ANY_TARGET = 0x00080000, // 19 allows to consume combo points from dead targets + SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20 + SPELL_ATTR8_UNK21 = 0x00200000, // 21 + SPELL_ATTR8_UNK22 = 0x00400000, // 22 + SPELL_ATTR8_UNK23 = 0x00800000, // 23 + SPELL_ATTR8_HEALING_SPELL = 0x01000000, // 24 + SPELL_ATTR8_UNK25 = 0x02000000, // 25 + SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast + SPELL_ATTR8_UNK27 = 0x08000000, // 27 + SPELL_ATTR8_NOT_IN_BG_OR_ARENA = 0x10000000, // 28 not allow to cast or deactivate currently active effect, not sure about Fast Track + SPELL_ATTR8_MASTERY_SPECIALIZATION = 0x20000000, // 29 + SPELL_ATTR8_UNK30 = 0x40000000, // 30 + SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG = 0x80000000 // 31 Do not check UNIT_FLAG_IMMUNE_TO_PC in IsValidAttackTarget + }; + [Flags] - public enum SpellAtributeExG + public enum SpellAtributeEx9 : uint { - SPELL_ATTR_EXG_ALL = -1, - SPELL_ATTR_EXG_NONE = 0x00, - SPELL_ATTR_EXG_UNK0 = 1 << 0x00, // 0 - SPELL_ATTR_EXG_UNK1 = 1 << 0x01, // 1 - SPELL_ATTR_EXG_UNK2 = 1 << 0x02, // 2 - SPELL_ATTR_EXG_UNK3 = 1 << 0x03, // 3 - SPELL_ATTR_EXG_UNK4 = 1 << 0x04, // 4 - SPELL_ATTR_EXG_UNK5 = 1 << 0x05, // 5 - SPELL_ATTR_EXG_UNK6 = 1 << 0x06, // 6 - SPELL_ATTR_EXG_UNK7 = 1 << 0x07, // 7 - SPELL_ATTR_EXG_UNK8 = 1 << 0x08, // 8 - SPELL_ATTR_EXG_UNK9 = 1 << 0x09, // 9 - SPELL_ATTR_EXG_UNK10 = 1 << 0x0A, // 10 - SPELL_ATTR_EXG_UNK11 = 1 << 0x0B, // 11 - SPELL_ATTR_EXG_UNK12 = 1 << 0x0C, // 12 - SPELL_ATTR_EXG_UNK13 = 1 << 0x0D, // 13 - SPELL_ATTR_EXG_UNK14 = 1 << 0x0E, // 14 - SPELL_ATTR_EXG_UNK15 = 1 << 0x0F, // 15 - SPELL_ATTR_EXG_UNK16 = 1 << 0x10, // 16 - SPELL_ATTR_EXG_UNK17 = 1 << 0x11, // 17 - SPELL_ATTR_EXG_UNK18 = 1 << 0x12, // 18 - SPELL_ATTR_EXG_UNK19 = 1 << 0x13, // 19 - SPELL_ATTR_EXG_UNK20 = 1 << 0x14, // 20 - SPELL_ATTR_EXG_UNK21 = 1 << 0x15, // 21 - SPELL_ATTR_EXG_UNK22 = 1 << 0x16, // 22 - SPELL_ATTR_EXG_UNK23 = 1 << 0x17, // 23 - SPELL_ATTR_EXG_UNK24 = 1 << 0x18, // 24 - SPELL_ATTR_EXG_UNK25 = 1 << 0x19, // 25 - SPELL_ATTR_EXG_UNK26 = 1 << 0x1A, // 26 - SPELL_ATTR_EXG_UNK27 = 1 << 0x1B, // 27 - SPELL_ATTR_EXG_UNK28 = 1 << 0x1C, // 28 - SPELL_ATTR_EXG_UNK29 = 1 << 0x1D, // 29 - SPELL_ATTR_EXG_UNK30 = 1 << 0x1E, // 30 - SPELL_ATTR_EXG_UNK31 = 1 << 0x1F, // 31 + SPELL_ATTR9_UNK0 = 0x00000001, // 0 + SPELL_ATTR9_UNK1 = 0x00000002, // 1 + SPELL_ATTR9_RESTRICTED_FLIGHT_AREA = 0x00000004, // 2 Dalaran and Wintergrasp flight area auras have it + SPELL_ATTR9_UNK3 = 0x00000008, // 3 + SPELL_ATTR9_SPECIAL_DELAY_CALCULATION = 0x00000010, // 4 + SPELL_ATTR9_SUMMON_PLAYER_TOTEM = 0x00000020, // 5 + SPELL_ATTR9_UNK6 = 0x00000040, // 6 + SPELL_ATTR9_UNK7 = 0x00000080, // 7 + SPELL_ATTR9_AIMED_SHOT = 0x00000100, // 8 + SPELL_ATTR9_NOT_USABLE_IN_ARENA = 0x00000200, // 9 Cannot be used in arenas + SPELL_ATTR9_UNK10 = 0x00000400, // 10 + SPELL_ATTR9_UNK11 = 0x00000800, // 11 + SPELL_ATTR9_UNK12 = 0x00001000, // 12 + SPELL_ATTR9_SLAM = 0x00002000, // 13 + SPELL_ATTR9_USABLE_IN_RATED_BATTLEGROUNDS = 0x00004000, // 14 Can be used in Rated Battlegrounds + SPELL_ATTR9_UNK15 = 0x00008000, // 15 + SPELL_ATTR9_UNK16 = 0x00010000, // 16 + SPELL_ATTR9_UNK17 = 0x00020000, // 17 + SPELL_ATTR9_UNK18 = 0x00040000, // 18 + SPELL_ATTR9_UNK19 = 0x00080000, // 19 + SPELL_ATTR9_UNK20 = 0x00100000, // 20 + SPELL_ATTR9_UNK21 = 0x00200000, // 21 + SPELL_ATTR9_UNK22 = 0x00400000, // 22 + SPELL_ATTR9_UNK23 = 0x00800000, // 23 + SPELL_ATTR9_UNK24 = 0x01000000, // 24 + SPELL_ATTR9_UNK25 = 0x02000000, // 25 + SPELL_ATTR9_UNK26 = 0x04000000, // 26 + SPELL_ATTR9_UNK27 = 0x08000000, // 27 + SPELL_ATTR9_UNK28 = 0x10000000, // 28 + SPELL_ATTR9_UNK29 = 0x20000000, // 29 + SPELL_ATTR9_UNK30 = 0x40000000, // 30 + SPELL_ATTR9_UNK31 = 0x80000000 // 31 + }; + + [Flags] + public enum SpellAtributeEx10 : uint + { + SPELL_ATTR10_UNK0 = 0x00000001, // 0 + SPELL_ATTR10_UNK1 = 0x00000002, // 1 + SPELL_ATTR10_UNK2 = 0x00000004, // 2 + SPELL_ATTR10_UNK3 = 0x00000008, // 3 + SPELL_ATTR10_WATER_SPOUT = 0x00000010, // 4 + SPELL_ATTR10_UNK5 = 0x00000020, // 5 + SPELL_ATTR10_UNK6 = 0x00000040, // 6 + SPELL_ATTR10_TELEPORT_PLAYER = 0x00000080, // 7 4 Teleport Player spells + SPELL_ATTR10_UNK8 = 0x00000100, // 8 + SPELL_ATTR10_UNK9 = 0x00000200, // 9 + SPELL_ATTR10_UNK10 = 0x00000400, // 10 + SPELL_ATTR10_HERB_GATHERING_MINING = 0x00000800, // 11 Only Herb Gathering and Mining + SPELL_ATTR10_UNK12 = 0x00001000, // 12 + SPELL_ATTR10_UNK13 = 0x00002000, // 13 + SPELL_ATTR10_UNK14 = 0x00004000, // 14 + SPELL_ATTR10_UNK15 = 0x00008000, // 15 + SPELL_ATTR10_UNK16 = 0x00010000, // 16 + SPELL_ATTR10_UNK17 = 0x00020000, // 17 + SPELL_ATTR10_UNK18 = 0x00040000, // 18 + SPELL_ATTR10_UNK19 = 0x00080000, // 19 + SPELL_ATTR10_UNK20 = 0x00100000, // 20 + SPELL_ATTR10_UNK21 = 0x00200000, // 21 + SPELL_ATTR10_UNK22 = 0x00400000, // 22 + SPELL_ATTR10_UNK23 = 0x00800000, // 23 + SPELL_ATTR10_UNK24 = 0x01000000, // 24 + SPELL_ATTR10_UNK25 = 0x02000000, // 25 + SPELL_ATTR10_UNK26 = 0x04000000, // 26 + SPELL_ATTR10_UNK27 = 0x08000000, // 27 + SPELL_ATTR10_UNK28 = 0x10000000, // 28 + SPELL_ATTR10_UNK29 = 0x20000000, // 29 + SPELL_ATTR10_UNK30 = 0x40000000, // 30 + SPELL_ATTR10_UNK31 = 0x80000000 // 31 }; [Flags] @@ -1506,6 +1695,7 @@ public enum CombatRating CR_WEAPON_SKILL_RANGED = 1 << 0x15, CR_EXPERTISE = 1 << 0x16, CR_ARMOR_PENETRATION = 1 << 0x17, + CR_MASTERY = 1 << 0x18, }; public enum UnitMods @@ -1523,33 +1713,39 @@ public enum UnitMods UNIT_MOD_HAPPINESS = 10, UNIT_MOD_RUNE = 11, UNIT_MOD_RUNIC_POWER = 12, - UNIT_MOD_ARMOR = 13, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum. - UNIT_MOD_RESISTANCE_HOLY = 14, - UNIT_MOD_RESISTANCE_FIRE = 15, - UNIT_MOD_RESISTANCE_NATURE = 16, - UNIT_MOD_RESISTANCE_FROST = 17, - UNIT_MOD_RESISTANCE_SHADOW = 18, - UNIT_MOD_RESISTANCE_ARCANE = 19, - UNIT_MOD_ATTACK_POWER = 20, - UNIT_MOD_ATTACK_POWER_RANGED = 21, - UNIT_MOD_DAMAGE_MAINHAND = 22, - UNIT_MOD_DAMAGE_OFFHAND = 23, - UNIT_MOD_DAMAGE_RANGED = 24, - UNIT_MOD_END = 25, + UNIT_MOD_SOUL_SHARDS = 13, + UNIT_MOD_ECLIPSE = 14, + UNIT_MOD_HOLY_POWER = 15, + UNIT_MOD_ALTERNATIVE = 16, + UNIT_MOD_ARMOR = 17, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum. + UNIT_MOD_RESISTANCE_HOLY = 18, + UNIT_MOD_RESISTANCE_FIRE = 19, + UNIT_MOD_RESISTANCE_NATURE = 20, + UNIT_MOD_RESISTANCE_FROST = 21, + UNIT_MOD_RESISTANCE_SHADOW = 22, + UNIT_MOD_RESISTANCE_ARCANE = 23, + UNIT_MOD_ATTACK_POWER = 24, + UNIT_MOD_ATTACK_POWER_RANGED = 25, + UNIT_MOD_DAMAGE_MAINHAND = 26, + UNIT_MOD_DAMAGE_OFFHAND = 27, + UNIT_MOD_DAMAGE_RANGED = 28, + UNIT_MOD_END = 29, // synonyms UNIT_MOD_STAT_START = UNIT_MOD_STAT_STRENGTH, UNIT_MOD_STAT_END = UNIT_MOD_STAT_SPIRIT + 1, UNIT_MOD_RESISTANCE_START = UNIT_MOD_ARMOR, UNIT_MOD_RESISTANCE_END = UNIT_MOD_RESISTANCE_ARCANE + 1, UNIT_MOD_POWER_START = UNIT_MOD_MANA, - UNIT_MOD_POWER_END = UNIT_MOD_RUNIC_POWER + 1, + UNIT_MOD_POWER_END = UNIT_MOD_ALTERNATIVE + 1, }; +// ReSharper restore InconsistentNaming + public class SpellEnums { #region ProcFlagDesc - public static readonly string[] ProcFlagDesc = + public static readonly string[] ProcFlagDesc = { //00 0x00000001 000000000000000000000001 - "00 Killed by aggressor that receive experience or honor", @@ -1577,24 +1773,24 @@ public class SpellEnums "09 Taken damage by Spell that use ranged weapon", //10 0x00000400 000000000000010000000000 - - "10 Successful ??? spell hit", + "10 Successful positive spell hit", //11 0x00000800 000000000000100000000000 - - "11 Taken ??? spell hit", + "11 Taken positive spell hit", //12 0x00001000 000000000001000000000000 - - "12 Successful ??? spell cast", + "12 Successful negative spell cast", //13 0x00002000 000000000010000000000000 - - "13 Taken ??? spell hit", + "13 Taken negative spell hit", //14 0x00004000 000000000100000000000000 - - "14 Successful cast positive spell", + "14 Successful cast positive magic spell", //15 0x00008000 000000001000000000000000 - - "15 Taken positive spell hit", + "15 Taken positive magic spell hit", //16 0x00010000 000000010000000000000000 - - "16 Successful damage from harmful spell cast (каст дамажащего спелла)", + "16 Successful damage from harmful magic spell cast", //17 0x00020000 000000100000000000000000 - - "17 Taken spell damage", + "17 Taken magic spell damage", //18 0x00040000 000001000000000000000000 - "18 Deal periodic damage", @@ -1604,14 +1800,15 @@ public class SpellEnums //20 0x00100000 000100000000000000000000 - "20 Taken any damage", //21 0x00200000 001000000000000000000000 - - "21 On trap activation (При срабатывании ловушки)", + "21 On trap activation", //22 0x00800000 010000000000000000000000 - - "22 Taken off-hand melee attacks", + "22 Successful main-hand melee attacks", //23 0x00800000 100000000000000000000000 - "23 Successful off-hand melee attacks", - "24", + //24 0x01000000 + "24 On death", "25", "26", "27", diff --git a/SpellWork/Spell/SpellInfo.cs b/SpellWork/Spell/SpellInfo.cs index bb99fadb..1f07ba25 100644 --- a/SpellWork/Spell/SpellInfo.cs +++ b/SpellWork/Spell/SpellInfo.cs @@ -1,23 +1,25 @@ using System; -using System.Linq; using System.Drawing; +using System.Linq; using System.Windows.Forms; -using System.Text; +using SpellWork.Database; +using SpellWork.DBC.Structures; +using SpellWork.Extensions; -namespace SpellWork +namespace SpellWork.Spell { class SpellInfo { - private RichTextBox rtb; - private SpellEntry spell; + private readonly RichTextBox _rtb; + private SpellInfoHelper _spell; private const string _line = "================================================="; - public SpellInfo(RichTextBox rtb, SpellEntry spell) + public SpellInfo(RichTextBox rtb, SpellInfoHelper spell) { - this.rtb = rtb; - this.spell = spell; - + _rtb = rtb; + _spell = spell; + ProcInfo.SpellProc = spell; ViewSpellInfo(); @@ -25,473 +27,618 @@ public SpellInfo(RichTextBox rtb, SpellEntry spell) private void ViewSpellInfo() { - rtb.Clear(); - rtb.SetBold(); - rtb.AppendFormatLine("ID - {0} {1}", spell.ID, spell.SpellNameRank); - rtb.SetDefaultStyle(); - - rtb.AppendFormatLine(_line); - rtb.AppendFormatLineIfNotNull("Description: {0}", spell.Description); - rtb.AppendFormatLineIfNotNull("ToolTip: {0}", spell.ToolTip); - rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", spell.ModalNextSpell); - if (spell.Description != string.Empty && spell.ToolTip != string.Empty && spell.ModalNextSpell != 0) - rtb.AppendFormatLine(_line); - - rtb.AppendFormatLine("Category = {0}, SpellIconID = {1}, activeIconID = {2}, SpellVisual = ({3},{4})", - spell.Category, spell.SpellIconID, spell.ActiveIconID, spell.SpellVisual[0], spell.SpellVisual[1]); - - rtb.AppendFormatLine("Family {0}, flag 0x{1:X8} {2:X8} {3:X8}", - (SpellFamilyNames)spell.SpellFamilyName, spell.SpellFamilyFlags[2], spell.SpellFamilyFlags[1], spell.SpellFamilyFlags[0]); - - rtb.AppendLine(); - - rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", spell.SchoolMask, spell.School); - rtb.AppendFormatLine("DamageClass = {0} ({1})", spell.DmgClass, (SpellDmgClass)spell.DmgClass); - rtb.AppendFormatLine("PreventionType = {0} ({1})", spell.PreventionType, (SpellPreventionType)spell.PreventionType); - - if (spell.Attributes != 0 || spell.AttributesEx != 0 || spell.AttributesEx2 != 0 || spell.AttributesEx3 != 0 - || spell.AttributesEx4 != 0 || spell.AttributesEx5 != 0 || spell.AttributesEx6 != 0 || spell.AttributesExG != 0) - rtb.AppendLine(_line); - - if (spell.Attributes != 0) - rtb.AppendFormatLine("Attributes: 0x{0:X8} ({1})", spell.Attributes, (SpellAtribute)spell.Attributes); - if (spell.AttributesEx != 0) - rtb.AppendFormatLine("AttributesEx1: 0x{0:X8} ({1})", spell.AttributesEx, (SpellAtributeEx)spell.AttributesEx); - if (spell.AttributesEx2 != 0) - rtb.AppendFormatLine("AttributesEx2: 0x{0:X8} ({1})", spell.AttributesEx2, (SpellAtributeEx2)spell.AttributesEx2); - if (spell.AttributesEx3 != 0) - rtb.AppendFormatLine("AttributesEx3: 0x{0:X8} ({1})", spell.AttributesEx3, (SpellAtributeEx3)spell.AttributesEx3); - if (spell.AttributesEx4 != 0) - rtb.AppendFormatLine("AttributesEx4: 0x{0:X8} ({1})", spell.AttributesEx4, (SpellAtributeEx4)spell.AttributesEx4); - if (spell.AttributesEx5 != 0) - rtb.AppendFormatLine("AttributesEx5: 0x{0:X8} ({1})", spell.AttributesEx5, (SpellAtributeEx5)spell.AttributesEx5); - if (spell.AttributesEx6 != 0) - rtb.AppendFormatLine("AttributesEx6: 0x{0:X8} ({1})", spell.AttributesEx6, (SpellAtributeEx6)spell.AttributesEx6); - if (spell.AttributesExG != 0) - rtb.AppendFormatLine("AttributesExG: 0x{0:X8} ({1})", spell.AttributesExG, (SpellAtributeExG)spell.AttributesExG); - - rtb.AppendLine(_line); - - if (spell.Targets != 0) - rtb.AppendFormatLine("Targets Mask = 0x{0:X8} ({1})", spell.Targets, (SpellCastTargetFlags)spell.Targets); - - if (spell.TargetCreatureType != 0) - rtb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})", - spell.TargetCreatureType, (CreatureTypeMask)spell.TargetCreatureType); - - if (spell.Stances != 0) - rtb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)spell.Stances); - - if (spell.StancesNot != 0) - rtb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)spell.StancesNot); + _rtb.Clear(); + _rtb.SetBold(); + _rtb.AppendFormatLine("ID - {0} {1}{2}", _spell.ID, _spell.SpellNameRank, _spell.ScalingText); + _rtb.SetDefaultStyle(); + + _rtb.AppendFormatLine(_line); + + _rtb.AppendLine(_spell.Description); + _rtb.AppendFormatLineIfNotNull("ToolTip: {0}", _spell.ToolTip); + _rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", _spell.ModalNextSpell); + if (_spell.Description != string.Empty && _spell.ToolTip != string.Empty && _spell.ModalNextSpell != 0) + _rtb.AppendFormatLine(_line); + + _rtb.AppendFormatLine("Category = {0}, SpellIconID = {1}, activeIconID = {2}, SpellVisual = ({3},{4})", + _spell.Category, _spell.SpellIconID, _spell.ActiveIconID, _spell.SpellVisual[0], _spell.SpellVisual[1]); + + _rtb.AppendFormatLine("Family {0}, flag [0] 0x{1:X8} [1] 0x{2:X8} [2] 0x{3:X8}", + (SpellFamilyNames)_spell.SpellFamilyName, _spell.SpellFamilyFlags[0], _spell.SpellFamilyFlags[1], _spell.SpellFamilyFlags[2]); + + _rtb.AppendLine(); + + _rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", _spell.SchoolMask, _spell.School); + _rtb.AppendFormatLine("DamageClass = {0} ({1})", _spell.DmgClass, (SpellDmgClass)_spell.DmgClass); + _rtb.AppendFormatLine("PreventionType = {0} ({1})", _spell.PreventionType, (SpellPreventionType)_spell.PreventionType); + + if (_spell.Attributes != 0 || _spell.AttributesEx != 0 || _spell.AttributesEx2 != 0 || _spell.AttributesEx3 != 0 || _spell.AttributesEx4 != 0 + || _spell.AttributesEx5 != 0 || _spell.AttributesEx6 != 0 || _spell.AttributesEx7 != 0 || _spell.AttributesEx8 != 0) + _rtb.AppendLine(_line); + + if (_spell.Attributes != 0) + _rtb.AppendFormatLine("Attributes: 0x{0:X8} ({1})", _spell.Attributes, (SpellAtribute)_spell.Attributes); + if (_spell.AttributesEx != 0) + _rtb.AppendFormatLine("AttributesEx1: 0x{0:X8} ({1})", _spell.AttributesEx, (SpellAtributeEx)_spell.AttributesEx); + if (_spell.AttributesEx2 != 0) + _rtb.AppendFormatLine("AttributesEx2: 0x{0:X8} ({1})", _spell.AttributesEx2, (SpellAtributeEx2)_spell.AttributesEx2); + if (_spell.AttributesEx3 != 0) + _rtb.AppendFormatLine("AttributesEx3: 0x{0:X8} ({1})", _spell.AttributesEx3, (SpellAtributeEx3)_spell.AttributesEx3); + if (_spell.AttributesEx4 != 0) + _rtb.AppendFormatLine("AttributesEx4: 0x{0:X8} ({1})", _spell.AttributesEx4, (SpellAtributeEx4)_spell.AttributesEx4); + if (_spell.AttributesEx5 != 0) + _rtb.AppendFormatLine("AttributesEx5: 0x{0:X8} ({1})", _spell.AttributesEx5, (SpellAtributeEx5)_spell.AttributesEx5); + if (_spell.AttributesEx6 != 0) + _rtb.AppendFormatLine("AttributesEx6: 0x{0:X8} ({1})", _spell.AttributesEx6, (SpellAtributeEx6)_spell.AttributesEx6); + if (_spell.AttributesEx7 != 0) + _rtb.AppendFormatLine("AttributesEx7: 0x{0:X8} ({1})", _spell.AttributesEx7, (SpellAtributeEx7)_spell.AttributesEx7); + if (_spell.AttributesEx8 != 0) + _rtb.AppendFormatLine("AttributesEx8: 0x{0:X8} ({1})", _spell.AttributesEx8, (SpellAtributeEx8)_spell.AttributesEx8); + if (_spell.AttributesEx9 != 0) + _rtb.AppendFormatLine("AttributesEx9: 0x{0:X8} ({1})", _spell.AttributesEx9, (SpellAtributeEx9)_spell.AttributesEx9); + if (_spell.AttributesEx10 != 0) + _rtb.AppendFormatLine("AttributesEx10: 0x{0:X8} ({1})", _spell.AttributesEx10, (SpellAtributeEx10)_spell.AttributesEx10); + + _rtb.AppendLine(_line); + + if (_spell.Targets != 0) + _rtb.AppendFormatLine("Targets Mask = 0x{0:X8} ({1})", _spell.Targets, (SpellCastTargetFlags)_spell.Targets); + + if (_spell.TargetCreatureType != 0) + _rtb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})", + _spell.TargetCreatureType, (CreatureTypeMask)_spell.TargetCreatureType); + + if (_spell.Stances != 0) + _rtb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)_spell.Stances); + + if (_spell.StancesNot != 0) + _rtb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)_spell.StancesNot); AppendSkillLine(); // reagents { - bool printedHeader = false; - for (int i = 0; i < spell.Reagent.Length; ++i) + var printedHeader = false; + for (var i = 0; i < _spell.Reagent.Length; ++i) { - if (spell.Reagent[i] == 0) + if (_spell.Reagent[i] == 0) continue; if (!printedHeader) { - rtb.AppendLine(); - rtb.Append("Reagents:"); + _rtb.AppendLine(); + _rtb.Append("Reagents:"); printedHeader = true; } - rtb.AppendFormat(" {0}x{1}", spell.Reagent[i], spell.ReagentCount[i]); + _rtb.AppendFormat(" {0} x{1}", _spell.Reagent[i], _spell.ReagentCount[i]); } if (printedHeader) - rtb.AppendLine(); + _rtb.AppendLine(); } - rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, maxTarget {3}", - spell.SpellLevel, spell.BaseLevel, spell.MaxLevel, spell.MaxTargetLevel); + _rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, maxTarget {3}", + _spell.SpellLevel, _spell.BaseLevel, _spell.MaxLevel, _spell.MaxTargetLevel); - if (spell.EquippedItemClass != -1) + if (_spell.EquippedItemClass != 0) { - rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", spell.EquippedItemClass, (ItemClass)spell.EquippedItemClass); + _rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", _spell.EquippedItemClass, (ItemClass)_spell.EquippedItemClass); - if (spell.EquippedItemSubClassMask != 0) + if (_spell.EquippedItemSubClassMask != 0) { - switch ((ItemClass)spell.EquippedItemClass) + switch ((ItemClass)_spell.EquippedItemClass) { case ItemClass.WEAPON: - rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", - spell.EquippedItemSubClassMask, (ItemSubClassWeaponMask)spell.EquippedItemSubClassMask); + _rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", + _spell.EquippedItemSubClassMask, (ItemSubClassWeaponMask)_spell.EquippedItemSubClassMask); break; case ItemClass.ARMOR: - rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", - spell.EquippedItemSubClassMask, (ItemSubClassArmorMask)spell.EquippedItemSubClassMask); + _rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", + _spell.EquippedItemSubClassMask, (ItemSubClassArmorMask)_spell.EquippedItemSubClassMask); break; case ItemClass.MISC: - rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", - spell.EquippedItemSubClassMask, (ItemSubClassMiscMask)spell.EquippedItemSubClassMask); + _rtb.AppendFormatLine(" SubClass mask 0x{0:X8} ({1})", + _spell.EquippedItemSubClassMask, (ItemSubClassMiscMask)_spell.EquippedItemSubClassMask); break; } } - if (spell.EquippedItemInventoryTypeMask != 0) - rtb.AppendFormatLine(" InventoryType mask = 0x{0:X8} ({1})", - spell.EquippedItemInventoryTypeMask, (InventoryTypeMask)spell.EquippedItemInventoryTypeMask); + if (_spell.EquippedItemInventoryTypeMask != 0) + _rtb.AppendFormatLine(" InventoryType mask = 0x{0:X8} ({1})", + _spell.EquippedItemInventoryTypeMask, (InventoryTypeMask)_spell.EquippedItemInventoryTypeMask); } - rtb.AppendLine(); - rtb.AppendFormatLine("Category = {0}", spell.Category); - rtb.AppendFormatLine("DispelType = {0} ({1})", spell.Dispel, (DispelType)spell.Dispel); - rtb.AppendFormatLine("Mechanic = {0} ({1})", spell.Mechanic, (Mechanics)spell.Mechanic); + _rtb.AppendLine(); + _rtb.AppendFormatLine("Category = {0}", _spell.Category); + _rtb.AppendFormatLine("DispelType = {0} ({1})", _spell.Dispel, (DispelType)_spell.Dispel); + _rtb.AppendFormatLine("Mechanic = {0} ({1})", _spell.Mechanic, (Mechanics)_spell.Mechanic); - rtb.AppendLine(spell.Range); + _rtb.AppendLine(_spell.Range); - rtb.AppendFormatLineIfNotNull("Speed {0:F}", spell.Speed); - rtb.AppendFormatLineIfNotNull("Stackable up to {0}", spell.StackAmount); + _rtb.AppendFormatLineIfNotNull("Speed {0:F}", _spell.Speed); + _rtb.AppendFormatLineIfNotNull("Stackable up to {0}", _spell.StackAmount); - rtb.AppendLine(spell.CastTime); + _rtb.AppendLine(_spell.CastTime); - rtb.AppendLine(spell.SpellDifficulty); - - if (spell.RecoveryTime != 0 || spell.CategoryRecoveryTime != 0 || spell.StartRecoveryCategory != 0) + if (_spell.RecoveryTime != 0 || _spell.CategoryRecoveryTime != 0 || _spell.StartRecoveryCategory != 0) { - rtb.AppendFormatLine("RecoveryTime: {0} ms, CategoryRecoveryTime: {1} ms", spell.RecoveryTime, spell.CategoryRecoveryTime); - rtb.AppendFormatLine("StartRecoveryCategory = {0}, StartRecoveryTime = {1:F} ms", spell.StartRecoveryCategory, spell.StartRecoveryTime); + _rtb.AppendFormatLine("RecoveryTime: {0} ms, CategoryRecoveryTime: {1} ms", _spell.RecoveryTime, _spell.CategoryRecoveryTime); + _rtb.AppendFormatLine("StartRecoveryCategory = {0}, StartRecoveryTime = {1:F} ms", _spell.StartRecoveryCategory, _spell.StartRecoveryTime); } - rtb.AppendLine(spell.Duration); + _rtb.AppendLine(_spell.Duration); - if (spell.ManaCost != 0 || spell.ManaCostPercentage != 0) + if (_spell.ManaCost != 0 || _spell.ManaCostPercentage != 0 || _spell.PowerType != 0 || + _spell.ManaCostPerlevel != 0 || _spell.ManaPerSecond != 0) { - rtb.AppendFormat("Power {0}, Cost {1}", - (Powers)spell.PowerType, spell.ManaCost == 0 ? spell.ManaCostPercentage.ToString() + " %" : spell.ManaCost.ToString()); - rtb.AppendFormatIfNotNull(" + lvl * {0}", spell.ManaCostPerlevel); - rtb.AppendFormatIfNotNull(" + {0} Per Second", spell.ManaPerSecond); - rtb.AppendFormatIfNotNull(" + lvl * {0}", spell.ManaPerSecondPerLevel); - rtb.AppendLine(); + _rtb.AppendFormat("Power {0}, Cost {1}", + (Powers)_spell.PowerType, _spell.ManaCost == 0 ? _spell.ManaCostPercentage + " %" : _spell.ManaCost.ToString()); + _rtb.AppendFormatIfNotNull(" + lvl * {0}", _spell.ManaCostPerlevel); + _rtb.AppendFormatIfNotNull(" + {0} Per Second", _spell.ManaPerSecond); + _rtb.AppendLine(); } - rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8}, AuraIF 0x{1:X8}, ChannelIF 0x{2:X8}", - spell.InterruptFlags, spell.AuraInterruptFlags, spell.ChannelInterruptFlags); + _rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8}, AuraIF 0x{1:X8}, ChannelIF 0x{2:X8}", + _spell.InterruptFlags, _spell.AuraInterruptFlags, _spell.ChannelInterruptFlags); + + if (_spell.CasterAuraState != 0) + _rtb.AppendFormatLine("CasterAuraState = {0} ({1})", _spell.CasterAuraState, (AuraState)_spell.CasterAuraState); - if (spell.CasterAuraState != 0) - rtb.AppendFormatLine("CasterAuraState = {0} ({1})", spell.CasterAuraState, (AuraState)spell.CasterAuraState); + if (_spell.TargetAuraState != 0) + _rtb.AppendFormatLine("TargetAuraState = {0} ({1})", _spell.TargetAuraState, (AuraState)_spell.TargetAuraState); - if (spell.TargetAuraState != 0) - rtb.AppendFormatLine("TargetAuraState = {0} ({1})", spell.TargetAuraState, (AuraState)spell.TargetAuraState); + if (_spell.CasterAuraStateNot != 0) + _rtb.AppendFormatLine("CasterAuraStateNot = {0} ({1})", _spell.CasterAuraStateNot, (AuraState)_spell.CasterAuraStateNot); - if (spell.CasterAuraStateNot != 0) - rtb.AppendFormatLine("CasterAuraStateNot = {0} ({1})", spell.CasterAuraStateNot, (AuraState)spell.CasterAuraStateNot); + if (_spell.TargetAuraStateNot != 0) + _rtb.AppendFormatLine("TargetAuraStateNot = {0} ({1})", _spell.TargetAuraStateNot, (AuraState)_spell.TargetAuraStateNot); - if (spell.TargetAuraStateNot != 0) - rtb.AppendFormatLine("TargetAuraStateNot = {0} ({1})", spell.TargetAuraStateNot, (AuraState)spell.TargetAuraStateNot); + if (_spell.MaxAffectedTargets != 0) + _rtb.AppendFormatLine("MaxAffectedTargets = {0}", _spell.MaxAffectedTargets); AppendSpellAura(); - rtb.AppendFormatLineIfNotNull("Requires Spell Focus {0}", spell.RequiresSpellFocus); + AppendAreaInfo(); + + _rtb.AppendFormatLineIfNotNull("Requires Spell Focus {0}", _spell.RequiresSpellFocus); - if (spell.ProcFlags != 0) + if (_spell.ProcFlags != 0) { - rtb.SetBold(); - rtb.AppendFormatLine("Proc flag 0x{0:X8}, chance = {1}, charges - {2}", - spell.ProcFlags, spell.ProcChance, spell.ProcCharges); - rtb.SetDefaultStyle(); - rtb.AppendFormatLine(_line); - rtb.AppendText(spell.ProcInfo); + _rtb.SetBold(); + _rtb.AppendFormatLine("Proc flag 0x{0:X8}, chance = {1}, charges - {2}", + _spell.ProcFlags, _spell.ProcChance, _spell.ProcCharges); + _rtb.SetDefaultStyle(); + _rtb.AppendFormatLine(_line); + _rtb.AppendText(_spell.ProcInfo); } else { - rtb.AppendFormatLine("Chance = {0}, charges - {1}", spell.ProcChance, spell.ProcCharges); + _rtb.AppendFormatLine("Chance = {0}, charges - {1}", _spell.ProcChance, _spell.ProcCharges); } AppendSpellEffectInfo(); AppendItemInfo(); + AppendDifficultyInfo(); + + AppendSpellVisualInfo(); + } + + private void AppendSpellVisualInfo() + { + SpellVisualEntry visualData; + if (!DBC.DBC.SpellVisual.TryGetValue(_spell.SpellVisual[0], out visualData)) + return; + + SpellMissileEntry missileEntry; + SpellMissileMotionEntry missileMotionEntry; + var hasMissileEntry = DBC.DBC.SpellMissile.TryGetValue(visualData.MissileModel, out missileEntry); + var hasMissileMotion = DBC.DBC.SpellMissileMotion.TryGetValue(visualData.MissileMotionId, out missileMotionEntry); + + if (!hasMissileEntry && !hasMissileMotion) + return; + + _rtb.AppendLine(_line); + _rtb.SetBold(); + _rtb.AppendLine("Missile data"); + _rtb.SetDefaultStyle(); + + // Missile Model Data. + if (hasMissileEntry) + { + _rtb.AppendFormatLine("Missile Model ID: {0}", visualData.MissileModel); + _rtb.AppendFormatLine("Missile attachment: {0}", visualData.MissileAttachment); + _rtb.AppendFormatLine("Missile cast offset: X:{0} Y:{1} Z:{2}", visualData.MissileCastOffsetX, visualData.MissileCastOffsetY, visualData.MissileCastOffsetZ); + _rtb.AppendFormatLine("Missile impact offset: X:{0} Y:{1} Z:{2}", visualData.MissileImpactOffsetX, visualData.MissileImpactOffsetY, visualData.MissileImpactOffsetZ); + _rtb.AppendFormatLine("MissileEntry ID: {0}", missileEntry.Id); + _rtb.AppendFormatLine("Collision Radius: {0}", missileEntry.CollisionRadius); + _rtb.AppendFormatLine("Default Pitch: {0} - {1}", missileEntry.DefaultPitchMin, missileEntry.DefaultPitchMax); + _rtb.AppendFormatLine("Random Pitch: {0} - {1}", missileEntry.RandomizePitchMax, missileEntry.RandomizePitchMax); + _rtb.AppendFormatLine("Default Speed: {0} - {1}", missileEntry.DefaultSpeedMin, missileEntry.DefaultSpeedMax); + _rtb.AppendFormatLine("Randomize Speed: {0} - {1}", missileEntry.RandomizeSpeedMin, missileEntry.RandomizeSpeedMax); + _rtb.AppendFormatLine("Gravity: {0}", missileEntry.Gravity); + _rtb.AppendFormatLine("Maximum duration:", missileEntry.MaxDuration); + _rtb.AppendLine(""); + } + + // Missile Motion Data. + if (hasMissileMotion) + { + _rtb.AppendFormatLine("Missile motion: {0}", missileMotionEntry.Name); + _rtb.AppendFormatLine("Missile count: {0}", missileMotionEntry.MissileCount); + _rtb.AppendLine("Missile Script body:"); + _rtb.AppendText(missileMotionEntry.Script); + } } private void AppendSkillLine() { - var query = from skillLineAbility in DBC.SkillLineAbility - join skillLine in DBC.SkillLine - on skillLineAbility.Value.SkillId equals skillLine.Key - where skillLineAbility.Value.SpellId == spell.ID - select new - { - skillLineAbility, - skillLine + var query = from skillLineAbility in DBC.DBC.SkillLineAbility.Records + join skillLine in DBC.DBC.SkillLine.Records + on skillLineAbility.SkillId equals skillLine.Id + where skillLineAbility.SpellId == _spell.ID + select new + { + skillLineAbility, + skillLine }; if (query.Count() == 0) return; - var skill = query.First().skillLineAbility.Value; - var line = query.First().skillLine.Value; + var skill = query.First().skillLineAbility; + var line = query.First().skillLine; - rtb.AppendFormatLine("Skill (Id {0}) \"{1}\"", skill.SkillId, line.Name); - rtb.AppendFormat(" ReqSkillValue {0}", skill.Req_skill_value); + _rtb.AppendFormatLine("Skill (Id {0}) \"{1}\"", skill.SkillId, line.Name); + _rtb.AppendFormat(" ReqSkillValue {0}", skill.ReqSkillValue); - rtb.AppendFormat(", Forward Spell = {0}, MinMaxValue ({1}, {2})", skill.Forward_spellid, skill.Min_value, skill.Max_value); - rtb.AppendFormat(", CharacterPoints ({0}, {1})", skill.CharacterPoints[0], skill.CharacterPoints[1]); + _rtb.AppendFormat(", Forward Spell = {0}, MinMaxValue ({1}, {2})", skill.ForwardSpellid, skill.MinValue, skill.MaxValue); + _rtb.AppendFormat(", CharacterPoints ({0}, {1})", skill.CharacterPoints[0], skill.CharacterPoints[1]); } private void AppendSpellEffectInfo() { - rtb.AppendLine(_line); + _rtb.AppendLine(_line); - for (int EFFECT_INDEX = 0; EFFECT_INDEX < DBC.MAX_EFFECT_INDEX; EFFECT_INDEX++) + foreach (var effect in _spell.Effects) { - rtb.SetBold(); - if ((SpellEffects)spell.Effect[EFFECT_INDEX] == SpellEffects.NO_SPELL_EFFECT) - { - rtb.AppendFormatLine("Effect {0}: NO EFFECT", EFFECT_INDEX); - rtb.AppendLine(); + if (effect == null) continue; - } - rtb.AppendFormatLine("Effect {0}: Id {1} ({2})", EFFECT_INDEX, spell.Effect[EFFECT_INDEX], (SpellEffects)spell.Effect[EFFECT_INDEX]); - rtb.SetDefaultStyle(); - rtb.AppendFormat("BasePoints = {0}", spell.EffectBasePoints[EFFECT_INDEX] + 1); - - if (spell.EffectRealPointsPerLevel[EFFECT_INDEX] != 0) - rtb.AppendFormat(" + Level * {0:F}", spell.EffectRealPointsPerLevel[EFFECT_INDEX]); + _rtb.SetBold(); + _rtb.AppendFormatLine("Effect {0}: Id {1} ({2})", effect.Index, effect.Type, (SpellEffects)effect.Type); + _rtb.SetDefaultStyle(); - // WTF ? 1 = spell.EffectBaseDice[i] - if (1 < spell.EffectDieSides[EFFECT_INDEX]) + if (effect.ScalingMultiplier != 0.0f && _spell.Scaling != null && _spell.Scaling.PlayerClass != 0) { - if (spell.EffectRealPointsPerLevel[EFFECT_INDEX] != 0) - rtb.AppendFormat(" to {0} + lvl * {1:F}", - spell.EffectBasePoints[EFFECT_INDEX] + 1 + spell.EffectDieSides[EFFECT_INDEX], spell.EffectRealPointsPerLevel[EFFECT_INDEX]); + var gtEntry = (uint)((_spell.Scaling.PlayerClass != -1 ? _spell.Scaling.PlayerClass - 1 : 11) * 100) + DBC.DBC.SelectedLevel - 1; + var gtMultiplier = DBC.DBC.gtSpellScaling[gtEntry].Multiplier; + if (_spell.Scaling.MaxCastTime > 0 && _spell.Scaling.MaxCastTimeLevel > DBC.DBC.SelectedLevel) + gtMultiplier *= (float)(_spell.Scaling.MinCastTime + (DBC.DBC.SelectedLevel - 1) * (_spell.Scaling.MaxCastTime - _spell.Scaling.MinCastTime) / (_spell.Scaling.MaxCastTimeLevel - 1)) / (float)_spell.Scaling.MaxCastTime; + if (_spell.Scaling.CoefLevelBase > DBC.DBC.SelectedLevel) + gtMultiplier *= (1.0f - _spell.Scaling.CoefBase) * (float)(DBC.DBC.SelectedLevel - 1) / (float)(_spell.Scaling.CoefLevelBase - 1) + _spell.Scaling.CoefBase; + + if (effect.RandomPointsScalingMultiplier != 0.0f) + { + var avg = effect.ScalingMultiplier * gtMultiplier; + var delta = effect.RandomPointsScalingMultiplier * effect.ScalingMultiplier * gtMultiplier * 0.5; + _rtb.AppendFormat("BasePoints = {0:F} to {1:F}", avg - delta, avg + delta); + } else - rtb.AppendFormat(" to {0}", spell.EffectBasePoints[EFFECT_INDEX] + 1 + spell.EffectDieSides[EFFECT_INDEX]); + _rtb.AppendFormat("AveragePoints = {0:F}", effect.ScalingMultiplier * gtMultiplier); + + if (effect.ComboPointsScalingMultiplier != 0.0f) + _rtb.AppendFormatIfNotNull(" + combo * {0:F}", effect.ComboPointsScalingMultiplier * gtMultiplier); + else + _rtb.AppendFormatIfNotNull(" + combo * {0:F}", effect.PointsPerComboPoint); } + else + { + _rtb.AppendFormat("BasePoints = {0}", effect.BasePoints + ((effect.DieSides == 0) ? 0 : 1)); + + if (effect.RealPointsPerLevel != 0) + _rtb.AppendFormat(" + Level * {0:F}", effect.RealPointsPerLevel); - rtb.AppendFormatIfNotNull(" + combo * {0:F}", spell.EffectPointsPerComboPoint[EFFECT_INDEX]); + if (effect.DieSides > 1) + { + if (effect.RealPointsPerLevel != 0) + _rtb.AppendFormat(" to {0} + lvl * {1:F}", + effect.BasePoints + effect.DieSides, effect.RealPointsPerLevel); + else + _rtb.AppendFormat(" to {0}", effect.BasePoints + effect.DieSides); + } - if (spell.DmgMultiplier[EFFECT_INDEX] != 1.0f) - rtb.AppendFormat(" x {0:F}", spell.DmgMultiplier[EFFECT_INDEX]); + _rtb.AppendFormatIfNotNull(" + combo * {0:F}", effect.PointsPerComboPoint); + } - rtb.AppendFormatIfNotNull(" Multiple = {0:F}", spell.EffectMultipleValue[EFFECT_INDEX]); - rtb.AppendLine(); + if (effect.DamageMultiplier != 1.0f) + _rtb.AppendFormat(" x {0:F}", effect.DamageMultiplier); - rtb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})", - spell.EffectImplicitTargetA[EFFECT_INDEX], spell.EffectImplicitTargetB[EFFECT_INDEX], - (Targets)spell.EffectImplicitTargetA[EFFECT_INDEX], (Targets)spell.EffectImplicitTargetB[EFFECT_INDEX]); + _rtb.AppendFormatIfNotNull(" Multiple = {0:F}", effect.ValueMultiplier); + _rtb.AppendLine(); - AuraModTypeName(EFFECT_INDEX); + _rtb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})", + effect.ImplicitTargetA, effect.ImplicitTargetB, + (Targets)effect.ImplicitTargetA, (Targets)effect.ImplicitTargetB); - uint[] ClassMask = new uint[3]; - - switch (EFFECT_INDEX) - { - case 0: ClassMask = spell.EffectSpellClassMaskA; break; - case 1: ClassMask = spell.EffectSpellClassMaskB; break; - case 2: ClassMask = spell.EffectSpellClassMaskC; break; - } + AuraModTypeName(effect); + + var classMask = effect.SpellClassMask; - if (ClassMask[0] != 0 || ClassMask[1] != 0 || ClassMask[2] != 0) + if (classMask[0] != 0 || classMask[1] != 0 || classMask[2] != 0) { - rtb.AppendFormatLine("SpellClassMask = {0:X8} {1:X8} {2:X8}", ClassMask[2], ClassMask[1], ClassMask[0]); + _rtb.AppendFormatLine("SpellClassMask = {0:X8} {1:X8} {2:X8}", classMask[0], classMask[1], classMask[2]); - var query = from Spell in DBC.Spell.Values - where Spell.SpellFamilyName == spell.SpellFamilyName && Spell.SpellFamilyFlags.ContainsElement(ClassMask) - join sk in DBC.SkillLineAbility on Spell.ID equals sk.Value.SpellId into temp - from Skill in temp.DefaultIfEmpty() + var query = from spell in DBC.DBC.SpellInfoStore.Values + where spell.SpellFamilyName == _spell.SpellFamilyName && spell.SpellFamilyFlags.ContainsElement(classMask) + join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.SpellId into temp + from skill in temp.DefaultIfEmpty(new SkillLineAbilityEntry()) select new { - SpellID = Spell.ID, - SpellName = Spell.SpellNameRank, - SkillId = Skill.Value.SkillId + SpellID = spell.ID, + SpellName = spell.SpellNameRank, + SkillId = skill.SkillId }; foreach (var row in query) { if (row.SkillId > 0) { - rtb.SelectionColor = Color.Blue; - rtb.AppendFormatLine("\t+ {0} - {1}", row.SpellID, row.SpellName); + _rtb.SelectionColor = Color.Blue; + _rtb.AppendFormatLine("\t+ {0} - {1}", row.SpellID, row.SpellName); } else { - rtb.SelectionColor = Color.Red; - rtb.AppendFormatLine("\t- {0} - {1}", row.SpellID, row.SpellName); + _rtb.SelectionColor = Color.Red; + _rtb.AppendFormatLine("\t- {0} - {1}", row.SpellID, row.SpellName); } - rtb.SelectionColor = Color.Black; + _rtb.SelectionColor = Color.Black; } } - rtb.AppendFormatLineIfNotNull("{0}", spell.GetRadius(EFFECT_INDEX)); - + _rtb.AppendFormatLineIfNotNull("{0}", effect.Radius); + _rtb.AppendFormatLineIfNotNull("{0}", effect.MaxRadius); + // append trigger spell - uint trigger = spell.EffectTriggerSpell[EFFECT_INDEX]; + var trigger = effect.TriggerSpell; if (trigger != 0) { - if (DBC.Spell.ContainsKey(trigger)) + if (DBC.DBC.SpellInfoStore.ContainsKey(trigger)) { - SpellEntry triggerSpell = DBC.Spell[trigger]; - rtb.SetStyle(Color.Blue, FontStyle.Bold); - rtb.AppendFormatLine(" Trigger spell ({0}) {1}. Chance = {2}", trigger, triggerSpell.SpellNameRank, spell.ProcChance); - rtb.AppendFormatLineIfNotNull(" Description: {0}", triggerSpell.Description); - rtb.AppendFormatLineIfNotNull(" ToolTip: {0}", triggerSpell.ToolTip); - rtb.SetDefaultStyle(); + var triggerSpell = DBC.DBC.SpellInfoStore[trigger]; + _rtb.SetStyle(Color.Blue, FontStyle.Bold); + _rtb.AppendFormatLine(" Trigger spell ({0}) {1}. Chance = {2}", trigger, triggerSpell.SpellNameRank, _spell.ProcChance); + _rtb.AppendFormatLineIfNotNull(" Description: {0}", triggerSpell.Description); + _rtb.AppendFormatLineIfNotNull(" ToolTip: {0}", triggerSpell.ToolTip); + _rtb.SetDefaultStyle(); if (triggerSpell.ProcFlags != 0) { - rtb.AppendFormatLine("Charges - {0}", triggerSpell.ProcCharges); - rtb.AppendLine(_line); - rtb.AppendLine(triggerSpell.ProcInfo); - rtb.AppendLine(_line); + _rtb.AppendFormatLine("Charges - {0}", triggerSpell.ProcCharges); + _rtb.AppendLine(_line); + _rtb.AppendLine(triggerSpell.ProcInfo); + _rtb.AppendLine(_line); } } else - { - rtb.AppendFormatLine("Trigger spell ({0}) Not found, Chance = {1}", trigger, spell.ProcChance); - } + _rtb.AppendFormatLine("Trigger spell ({0}) Not found, Chance = {1}", trigger, _spell.ProcChance); } - rtb.AppendFormatLineIfNotNull("EffectChainTarget = {0}", spell.EffectChainTarget[EFFECT_INDEX]); - rtb.AppendFormatLineIfNotNull("EffectItemType = {0}", spell.EffectItemType[EFFECT_INDEX]); + _rtb.AppendFormatLineIfNotNull("EffectChainTarget = {0}", effect.ChainTarget); + _rtb.AppendFormatLineIfNotNull("EffectItemType = {0}", effect.ItemType); - if((Mechanics)spell.EffectMechanic[EFFECT_INDEX] != Mechanics.MECHANIC_NONE) - rtb.AppendFormatLine("Effect Mechanic = {0} ({1})", spell.EffectMechanic[EFFECT_INDEX], (Mechanics)spell.EffectMechanic[EFFECT_INDEX]); + if ((Mechanics)effect.Mechanic != Mechanics.MECHANIC_NONE) + _rtb.AppendFormatLine("Effect Mechanic = {0} ({1})", effect.Mechanic, (Mechanics)effect.Mechanic); - rtb.AppendLine(); + _rtb.AppendLine(); } } private void AppendSpellAura() { - if (spell.CasterAuraSpell != 0) + if (_spell.CasterAuraSpell != 0) { - if(DBC.Spell.ContainsKey(spell.CasterAuraSpell)) - rtb.AppendFormatLine(" Caster Aura Spell ({0}) {1}", spell.CasterAuraSpell, DBC.Spell[spell.CasterAuraSpell].SpellName); + if (DBC.DBC.SpellInfoStore.ContainsKey(_spell.CasterAuraSpell)) + _rtb.AppendFormatLine(" Caster Aura Spell ({0}) {1}", _spell.CasterAuraSpell, DBC.DBC.SpellInfoStore[_spell.CasterAuraSpell].SpellName); else - rtb.AppendFormatLine(" Caster Aura Spell ({0}) ?????", spell.CasterAuraSpell); + _rtb.AppendFormatLine(" Caster Aura Spell ({0}) ?????", _spell.CasterAuraSpell); } - if (spell.TargetAuraSpell != 0) + if (_spell.TargetAuraSpell != 0) { - if(DBC.Spell.ContainsKey(spell.TargetAuraSpell)) - rtb.AppendFormatLine(" Target Aura Spell ({0}) {1}", spell.TargetAuraSpell, DBC.Spell[spell.TargetAuraSpell].SpellName); + if (DBC.DBC.SpellInfoStore.ContainsKey(_spell.TargetAuraSpell)) + _rtb.AppendFormatLine(" Target Aura Spell ({0}) {1}", _spell.TargetAuraSpell, DBC.DBC.SpellInfoStore[_spell.TargetAuraSpell].SpellName); else - rtb.AppendFormatLine(" Target Aura Spell ({0}) ?????", spell.TargetAuraSpell); + _rtb.AppendFormatLine(" Target Aura Spell ({0}) ?????", _spell.TargetAuraSpell); } - if (spell.ExcludeCasterAuraSpell != 0) + if (_spell.ExcludeCasterAuraSpell != 0) { - if(DBC.Spell.ContainsKey(spell.ExcludeCasterAuraSpell)) - rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) {1}", spell.ExcludeCasterAuraSpell, DBC.Spell[spell.ExcludeCasterAuraSpell].SpellName); + if (DBC.DBC.SpellInfoStore.ContainsKey(_spell.ExcludeCasterAuraSpell)) + _rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) {1}", _spell.ExcludeCasterAuraSpell, DBC.DBC.SpellInfoStore[_spell.ExcludeCasterAuraSpell].SpellName); else - rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) ?????", spell.ExcludeCasterAuraSpell); + _rtb.AppendFormatLine(" Ex Caster Aura Spell ({0}) ?????", _spell.ExcludeCasterAuraSpell); } - if (spell.ExcludeTargetAuraSpell != 0) + // ReSharper disable InvertIf + if (_spell.ExcludeTargetAuraSpell != 0) { - if(DBC.Spell.ContainsKey(spell.ExcludeTargetAuraSpell)) - rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) {1}", spell.ExcludeTargetAuraSpell, DBC.Spell[spell.ExcludeTargetAuraSpell].SpellName); + if (DBC.DBC.SpellInfoStore.ContainsKey(_spell.ExcludeTargetAuraSpell)) + _rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) {1}", _spell.ExcludeTargetAuraSpell, DBC.DBC.SpellInfoStore[_spell.ExcludeTargetAuraSpell].SpellName); else - rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) ?????", spell.ExcludeTargetAuraSpell); + _rtb.AppendFormatLine(" Ex Target Aura Spell ({0}) ?????", _spell.ExcludeTargetAuraSpell); } + // ReSharper enable InvertIf } - private void AuraModTypeName(int index) + private void AuraModTypeName(SpellEffectEntry effect) { - AuraType aura = (AuraType)spell.EffectApplyAuraName[index]; - int misc = spell.EffectMiscValue[index]; + var aura = (AuraType)effect.ApplyAuraName; + var misc = effect.MiscValue; - if (spell.EffectApplyAuraName[index] == 0) + if (effect.ApplyAuraName == 0) { - rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", spell.EffectMiscValue[index]); - rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", spell.EffectMiscValueB[index]); - rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", spell.EffectAmplitude[index]); - + _rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", effect.MiscValue); + _rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", effect.MiscValueB); + _rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", effect.Amplitude); + return; } - rtb.AppendFormat("Aura Id {0:D} ({0})", aura); - rtb.AppendFormat(", value = {0}", spell.EffectBasePoints[index] + 1); - rtb.AppendFormat(", misc = {0} (", misc); - + _rtb.AppendFormat("Aura Id {0:D} ({0})", aura); + _rtb.AppendFormat(", value = {0}", effect.BasePoints); + _rtb.AppendFormat(", misc = {0} (", misc); + switch (aura) { case AuraType.SPELL_AURA_MOD_STAT: - rtb.Append((UnitMods)misc); + _rtb.Append((UnitMods)misc); break; case AuraType.SPELL_AURA_MOD_RATING: - rtb.Append((CombatRating)misc); + _rtb.Append((CombatRating)misc); break; case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER: case AuraType.SPELL_AURA_ADD_PCT_MODIFIER: - rtb.Append((SpellModOp)misc); + _rtb.Append((SpellModOp)misc); break; // todo: more case default: - rtb.Append(misc); + _rtb.Append(misc); break; } - rtb.AppendFormat("), miscB = {0}", spell.EffectMiscValueB[index]); - rtb.AppendFormatLine(", periodic = {0}", spell.EffectAmplitude[index]); + _rtb.AppendFormat("), miscB = {0}", effect.MiscValueB); + _rtb.AppendFormatLine(", periodic = {0}", effect.Amplitude); switch (aura) { case AuraType.SPELL_AURA_OVERRIDE_SPELLS: - if (!DBC.OverrideSpellData.ContainsKey((uint)misc)) + if (!DBC.DBC.OverrideSpellData.ContainsKey((uint)misc)) { - rtb.SetStyle(Color.Red, FontStyle.Bold); - rtb.AppendFormatLine("Cannot find key {0} in OverrideSpellData.dbc", (uint)misc); + _rtb.SetStyle(Color.Red, FontStyle.Bold); + _rtb.AppendFormatLine("Cannot find key {0} in OverrideSpellData.dbc", (uint)misc); } else { - rtb.AppendLine(); - rtb.SetStyle(Color.DarkRed, FontStyle.Bold); - rtb.AppendLine("Overriding Spells:"); - OverrideSpellDataEntry Override = DBC.OverrideSpellData[(uint)misc]; - for (int i = 0; i < 10; ++i) + _rtb.AppendLine(); + _rtb.SetStyle(Color.DarkRed, FontStyle.Bold); + var @override = DBC.DBC.OverrideSpellData[(uint)misc]; + _rtb.AppendFormatLine("Overriding Spells{0}:", !String.IsNullOrEmpty(@override.Name) ? String.Format(" ({0})", @override.Name) : String.Empty); + for (var i = 0; i < 10; ++i) { - if (Override.Spells[i] == 0) + if (@override.Spells[i] == 0) continue; - rtb.SetStyle(Color.DarkBlue, FontStyle.Regular); - rtb.AppendFormatLine("\t - #{0} ({1}) {2}", i + 1, Override.Spells[i], - DBC.Spell.ContainsKey(Override.Spells[i]) ? DBC.Spell[Override.Spells[i]].SpellName : "?????"); + _rtb.SetStyle(Color.DarkBlue, FontStyle.Regular); + _rtb.AppendFormatLine("\t - #{0} ({1}) {2}", i + 1, @override.Spells[i], + DBC.DBC.SpellInfoStore.ContainsKey(@override.Spells[i]) ? DBC.DBC.SpellInfoStore[@override.Spells[i]].SpellName : "?????"); } - rtb.AppendLine(); + _rtb.AppendLine(); } break; case AuraType.SPELL_AURA_SCREEN_EFFECT: - rtb.SetStyle(Color.DarkBlue, FontStyle.Bold); - rtb.AppendFormatLine("ScreenEffect: {0}", - DBC.ScreenEffect.ContainsKey((uint)misc) ? DBC.ScreenEffect[(uint)misc].Name : "?????"); + _rtb.SetStyle(Color.DarkBlue, FontStyle.Bold); + _rtb.AppendFormatLine("ScreenEffect: {0}", + DBC.DBC.ScreenEffect.ContainsKey((uint)misc) ? DBC.DBC.ScreenEffect[(uint)misc].Name : "?????"); break; default: break; } } - private void AppendItemInfo() + private readonly string[] modeNames = new[] + { + "Normal 10", + "Normal 25", + "Heroic 10", + "Heroic 25", + }; + + private void AppendDifficultyInfo() + { + var difficultyId = _spell.SpellDifficultyId; + if (difficultyId == 0) + return; + + if (!DBC.DBC.SpellDifficulty.ContainsKey(difficultyId)) + { + _rtb.AppendFormatLine("Cannot find difficulty overrides for id {0} in SpellDifficulty.dbc!", difficultyId); + return; + } + + _rtb.SetBold(); + _rtb.AppendLine("Spell difficulty Ids:"); + + var difficulty = DBC.DBC.SpellDifficulty[difficultyId]; + for (var i = 0; i < 4; ++i) + { + if (difficulty.SpellId[i] <= 0) + continue; + + _rtb.AppendFormatLine("{0}: {1}", modeNames[i], difficulty.SpellId[i]); + } + } + + private void AppendAreaInfo() { - if (!MySQLConnect.Connected) + if (_spell.AreaGroupId <= 0) + return; + + var areaGroupId = (uint)_spell.AreaGroupId; + if (!DBC.DBC.AreaGroup.ContainsKey(areaGroupId)) + { + _rtb.AppendFormatLine("Cannot find area group id {0} in AreaGroup.dbc!", _spell.AreaGroupId); return; - - var items = from item in DBC.ItemTemplate - where item.SpellID.ContainsElement(spell.ID) + } + + _rtb.AppendLine(); + _rtb.SetBold(); + _rtb.AppendLine("Allowed areas:"); + while (DBC.DBC.AreaGroup.ContainsKey(areaGroupId)) + { + var groupEntry = DBC.DBC.AreaGroup[areaGroupId]; + for (var i = 0; i < 6; ++i) + { + var areaId = groupEntry.AreaId[i]; + if (DBC.DBC.AreaTable.ContainsKey(areaId)) + { + var areaEntry = DBC.DBC.AreaTable[areaId]; + _rtb.AppendFormatLine("{0} - {1} (Map: {2})", areaId, areaEntry.Name, areaEntry.MapId); + } + } + + + if (groupEntry.NextGroup == 0) + break; + + // Try search in next group + areaGroupId = groupEntry.NextGroup; + } + + _rtb.AppendLine(); + } + + private void AppendItemInfo() + { + var items = from item in DBC.DBC.ItemTemplate + where item.SpellId.ContainsElement((int)_spell.ID) select item; if (items.Count() == 0) return; - rtb.AppendLine(_line); - rtb.SetStyle(Color.Blue, FontStyle.Bold); - rtb.AppendLine("Items used this spell:"); - rtb.SetDefaultStyle(); + _rtb.AppendLine(_line); + _rtb.SetStyle(Color.Blue, FontStyle.Bold); + _rtb.AppendLine("Items using this spell:"); + _rtb.SetDefaultStyle(); - foreach (Item item in items) + foreach (var item in items) { - string name = item.LocalesName == string.Empty ? item.Name : item.LocalesName; - string desc = item.LocalesDescription == string.Empty ? item.Description : item.LocalesDescription; - - desc = desc == string.Empty ? string.Empty : string.Format("({0})", desc); + var name = string.IsNullOrEmpty(item.LocalesName) ? item.Name : item.LocalesName; + var desc = string.IsNullOrEmpty(item.LocalesDescription) ? item.Description : item.LocalesDescription; + + desc = string.IsNullOrEmpty(desc) ? string.Empty : string.Format(" - \"{0}\"", desc); - rtb.AppendFormatLine(@" {0} - {1} {2} ", item.Entry, name, desc); + _rtb.AppendFormatLine(@" {0}: {1} {2}", item.Entry, name, desc); } } } diff --git a/SpellWork/Spell/SpellInfoHelper.cs b/SpellWork/Spell/SpellInfoHelper.cs new file mode 100644 index 00000000..5568ed58 --- /dev/null +++ b/SpellWork/Spell/SpellInfoHelper.cs @@ -0,0 +1,404 @@ +using System; +using System.Linq; +using System.Text; +using SpellWork.DBC.Structures; +using SpellWork.Extensions; + +namespace SpellWork.Spell +{ + public sealed class SpellInfoHelper + { + public uint ID; // 0 m_ID + public uint Category; // 1 m_category + public uint Dispel; // 2 m_dispelType + public uint Mechanic; // 3 m_mechanic + public uint Attributes; // 4 m_attribute + public uint AttributesEx; // 5 m_attributesEx + public uint AttributesEx2; // 6 m_attributesExB + public uint AttributesEx3; // 7 m_attributesExC + public uint AttributesEx4; // 8 m_attributesExD + public uint AttributesEx5; // 9 m_attributesExE + public uint AttributesEx6; // 10 m_attributesExF + public uint AttributesEx7; // 11 3.2.0 (0x20 - totems, 0x4 - paladin auras, etc...) + public uint AttributesEx8; + public uint AttributesEx9; + public uint AttributesEx10; + public ulong Stances; // 12-13 m_shapeshiftMask + public ulong StancesNot; // 14-15 m_shapeshiftExclude + public uint Targets; // 16 m_targets + public uint TargetCreatureType; // 17 m_targetCreatureType + public uint RequiresSpellFocus; // 18 m_requiresSpellFocus + public uint FacingCasterFlags; // 19 m_facingCasterFlags + public uint CasterAuraState; // 20 m_casterAuraState + public uint TargetAuraState; // 21 m_targetAuraState + public uint CasterAuraStateNot; // 22 m_excludeCasterAuraState + public uint TargetAuraStateNot; // 23 m_excludeTargetAuraState + public uint CasterAuraSpell; // 24 m_casterAuraSpell + public uint TargetAuraSpell; // 25 m_targetAuraSpell + public uint ExcludeCasterAuraSpell; // 26 m_excludeCasterAuraSpell + public uint ExcludeTargetAuraSpell; // 27 m_excludeTargetAuraSpell + public uint CastingTimeIndex; // 28 m_castingTimeIndex + public uint RecoveryTime; // 29 m_recoveryTime + public uint CategoryRecoveryTime; // 30 m_categoryRecoveryTime + public uint InterruptFlags; // 31 m_interruptFlags + public uint AuraInterruptFlags; // 32 m_auraInterruptFlags + public uint ChannelInterruptFlags; // 33 m_channelInterruptFlags + public uint ProcFlags; // 34 m_procTypeMask + public uint ProcChance; // 35 m_procChance + public uint ProcCharges; // 36 m_procCharges + public uint MaxLevel; // 37 m_maxLevel + public uint BaseLevel; // 38 m_baseLevel + public uint SpellLevel; // 39 m_spellLevel + public uint DurationIndex; // 40 m_durationIndex + public uint PowerType; // 41 m_powerType + public uint ManaCost; // 42 m_manaCost + public uint ManaCostPerlevel; // 43 m_manaCostPerLevel + public uint ManaPerSecond; // 44 m_manaPerSecond + public uint RangeIndex; // 46 m_rangeIndex + public float Speed; // 47 m_speed + public uint ModalNextSpell; // 48 m_modalNextSpell not used + public uint StackAmount; // 49 m_cumulativeAura + public uint[] Totem; // 50-51 m_totem + public uint[] Reagent; // 52-59 m_reagent + public uint[] ReagentCount; // 60-67 m_reagentCount + public uint EquippedItemClass; // 68 m_equippedItemClass (value) + public uint EquippedItemSubClassMask; // 69 m_equippedItemSubclass (mask) + public uint EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask) + public SpellEffectEntry[] Effects; + public uint[] SpellVisual; // 131-132 m_spellVisualID + public uint SpellIconID; // 133 m_spellIconID + public uint ActiveIconID; // 134 m_activeIconID + public string SpellName; // 136-151 m_name_lang + public string Rank; // 153-168 m_nameSubtext_lang + public string _Description; // 170-185 m_description_lang not used + public string ToolTip; // 187-202 m_auraDescription_lang not used + public uint ManaCostPercentage; // 204 m_manaCostPct + public uint StartRecoveryCategory; // 205 m_startRecoveryCategory + public uint StartRecoveryTime; // 206 m_startRecoveryTime + public uint MaxTargetLevel; // 207 m_maxTargetLevel + public uint SpellFamilyName; // 208 m_spellClassSet + public uint[] SpellFamilyFlags; // 209-211 m_spellClassMask + public uint MaxAffectedTargets; // 212 m_maxTargets + public uint DmgClass; // 213 m_defenseType + public uint PreventionType; // 214 m_preventionType + public int StanceBarOrder; // 215 m_stanceBarOrder not used + public uint MinFactionId; // 219 m_minFactionID not used + public uint MinReputation; // 220 m_minReputation not used + public uint RequiredAuraVision; // 221 m_requiredAuraVision not used + public uint[] TotemCategory; // 222-223 m_requiredTotemCategoryID + public int AreaGroupId; // 224 m_requiredAreaGroupId + public uint SchoolMask; // 225 m_schoolMask + public uint RuneCostID; // 226 m_runeCostID + public uint SpellMissileID; // 227 m_spellMissileID not used + public uint PowerDisplayId; // 228 PowerDisplay.dbc, new in 3.1 + public uint SpellDescriptionVariableID; // 232 3.2.0 + public uint SpellDifficultyId; // 233 3.3.0 // 239 3.3.0 + public SpellScalingEntry Scaling; + + public string CastTime + { + get + { + if (Scaling != null) + { + if (Scaling.MaxCastTime > 0) + { + if (Scaling.MaxCastTimeLevel > DBC.DBC.SelectedLevel) + return String.Format("Cast time = {0:F}", (Scaling.MinCastTime + (DBC.DBC.SelectedLevel - 1) * (Scaling.MaxCastTime - Scaling.MinCastTime) / (Scaling.MaxCastTimeLevel - 1)) / 1000.0f); + + return String.Format("Cast time = {0:F}", Scaling.MaxCastTime / 1000.0f); + } + + return String.Empty; + } + + if (CastingTimeIndex == 0) + return String.Empty; + + return !DBC.DBC.SpellCastTimes.ContainsKey(CastingTimeIndex) + ? String.Format("Cast time (Id {0}) = ????", CastingTimeIndex) + : String.Format("Cast time (Id {0}) = {1:F}", CastingTimeIndex, + DBC.DBC.SpellCastTimes[CastingTimeIndex].CastTime / 1000.0f); + } + } + + public string Duration + { + get { return DBC.DBC.SpellDuration.ContainsKey(DurationIndex) ? DBC.DBC.SpellDuration[DurationIndex].ToString() : String.Empty; } + } + + public string ProcInfo + { + get + { + var i = 0; + var sb = new StringBuilder(); + var proc = ProcFlags; + while (proc != 0) + { + if ((proc & 1) != 0) + sb.AppendFormatLine(" {0}", SpellEnums.ProcFlagDesc[i]); + ++i; + proc >>= 1; + } + + return sb.ToString(); + } + } + + public string Range + { + get + { + if (RangeIndex == 0 || !DBC.DBC.SpellRange.ContainsKey(RangeIndex)) + return String.Empty; + + var range = DBC.DBC.SpellRange[RangeIndex]; + var sb = new StringBuilder(); + sb.AppendFormatLine("SpellRange: (Id {0}) \"{1}\":", range.Id, range.Name); + sb.AppendFormatLine(" MinRangeNegative = {0}, MinRangePositive = {1}", range.MinRangeNegative, range.MinRangePositive); + sb.AppendFormatLine(" MaxRangeNegative = {0}, MaxRangePositive = {1}", range.MaxRangeNegative, range.MaxRangePositive); + + return sb.ToString(); + } + } + + public SpellSchoolMask School + { + get { return (SpellSchoolMask)SchoolMask; } + } + + public string SpellNameRank + { + get { return String.IsNullOrEmpty(Rank) ? SpellName : String.Format("{0} ({1})", SpellName, Rank); } + } + + public string ScalingText { get { return Scaling != null ? String.Format(" (Level {0})", DBC.DBC.SelectedLevel) : String.Empty; } } + + public string Description + { + get + { + var sb = new StringBuilder(); + if (!String.IsNullOrEmpty(_Description)) + sb.AppendFormatLine("Description: {0}", _Description); + + if (SpellDescriptionVariableID == 0 || !DBC.DBC.SpellDescriptionVariables.ContainsKey(SpellDescriptionVariableID)) + return sb.ToString(); + + var sdesc = DBC.DBC.SpellDescriptionVariables[SpellDescriptionVariableID]; + sb.AppendFormatLine("Description variable Id: {0}", sdesc.Id); + sb.AppendFormatLine("Description variable: {0}", sdesc.Variables); + return sb.ToString(); + } + } + + public SpellInfoHelper(SpellEntry dbcData) + { + ID = dbcData.Id; + Attributes = dbcData.Attributes; + AttributesEx = dbcData.AttributesEx; + AttributesEx2 = dbcData.AttributesEx2; + AttributesEx3 = dbcData.AttributesEx3; + AttributesEx4 = dbcData.AttributesEx4; + AttributesEx5 = dbcData.AttributesEx5; + AttributesEx6 = dbcData.AttributesEx6; + AttributesEx7 = dbcData.AttributesEx7; + AttributesEx8 = dbcData.AttributesEx8; + AttributesEx9 = dbcData.AttributesEx9; + AttributesEx10 = dbcData.AttributesEx10; + CastingTimeIndex = dbcData.CastingTimeIndex; + DurationIndex = dbcData.DurationIndex; + PowerType = dbcData.PowerType; + RangeIndex = dbcData.RangeIndex; + Speed = dbcData.Speed; + SpellVisual = (uint[])dbcData.SpellVisual.Clone(); + SpellIconID = dbcData.SpellIconID; + ActiveIconID = dbcData.ActiveIconID; + SpellName = dbcData.SpellName; + Rank = dbcData.Rank; + _Description = dbcData.Description; + ToolTip = dbcData.ToolTip; + SchoolMask = dbcData.SchoolMask; + RuneCostID = dbcData.RuneCostID; + SpellMissileID = dbcData.SpellMissileID; + SpellDescriptionVariableID = dbcData.SpellDescriptionVariableID; + SpellDifficultyId = dbcData.SpellDifficultyId; + + // SpellCategories.dbc + var cat = dbcData.Category; + if (cat != null) + { + Category = cat.Category; + Dispel = cat.Dispel; + Mechanic = cat.Mechanic; + StartRecoveryCategory = cat.StartRecoveryCategory; + DmgClass = cat.DmgClass; + PreventionType = cat.PreventionType; + } + + // SpellShapeshift.dbc + var shapeshift = dbcData.Shapeshift; + if (shapeshift != null) + { + Stances = shapeshift.Stances; + StancesNot = shapeshift.StancesNot; + StanceBarOrder = shapeshift.StanceBarOrder; + } + + // SpellTargetRestrictions.dbc + var targetRestrictions = dbcData.TargetRestrictions; + if (targetRestrictions != null) + { + Targets = targetRestrictions.Targets; + TargetCreatureType = targetRestrictions.TargetCreatureType; + MaxAffectedTargets = targetRestrictions.MaxAffectedTargets; + MaxTargetLevel = targetRestrictions.MaxTargetLevel; + } + + // SpellCastingRequirements.dbc + var castingRequirements = dbcData.CastingRequirements; + if (castingRequirements != null) + { + RequiresSpellFocus = castingRequirements.RequiresSpellFocus; + FacingCasterFlags = castingRequirements.FacingCasterFlags; + MinFactionId = castingRequirements.MinFactionId; + MinReputation = castingRequirements.MinReputation; + RequiredAuraVision = castingRequirements.RequiredAuraVision; + AreaGroupId = castingRequirements.AreaGroupId; + } + + // SpellAuraRestrictions.dbc + var auraRestrictions = dbcData.AuraRestrictions; + if (auraRestrictions != null) + { + CasterAuraState = auraRestrictions.CasterAuraState; + TargetAuraState = auraRestrictions.TargetAuraState; + CasterAuraStateNot = auraRestrictions.CasterAuraStateNot; + TargetAuraStateNot = auraRestrictions.TargetAuraStateNot; + CasterAuraSpell = auraRestrictions.CasterAuraSpell; + TargetAuraSpell = auraRestrictions.TargetAuraSpell; + ExcludeCasterAuraSpell = auraRestrictions.ExcludeCasterAuraSpell; + ExcludeTargetAuraSpell = auraRestrictions.ExcludeTargetAuraSpell; + } + + // SpellCooldowns.dbc + var cooldowns = dbcData.Cooldowns; + if (cooldowns != null) + { + RecoveryTime = cooldowns.RecoveryTime; + CategoryRecoveryTime = cooldowns.CategoryRecoveryTime; + StartRecoveryTime = cooldowns.StartRecoveryTime; + } + + // SpellInterrupts.dbc + var interrupts = dbcData.Interrupts; + if (interrupts != null) + { + InterruptFlags = interrupts.InterruptFlags; + AuraInterruptFlags = interrupts.AuraInterruptFlags; + ChannelInterruptFlags = interrupts.ChannelInterruptFlags; + } + + // SpellAuraOptions.dbc + var options = dbcData.AuraOptions; + if (options != null) + { + ProcFlags = options.ProcFlags; + ProcChance = options.ProcChance; + ProcCharges = options.ProcCharges; + StackAmount = options.StackAmount; + } + + // SpellLevels.dbc + var levels = dbcData.Levels; + if (levels != null) + { + MaxLevel = levels.MaxLevel; + BaseLevel = levels.BaseLevel; + SpellLevel = levels.SpellLevel; + } + + // SpellPower.dbc + var power = dbcData.Power; + if (power != null) + { + ManaCost = power.ManaCost; + ManaCostPerlevel = power.ManaCostPerlevel; + ManaPerSecond = power.ManaPerSecond; + ManaCostPercentage = power.ManaCostPercentage; + PowerDisplayId = power.PowerDisplayId; + } + + // SpellClassOptions.dbc + var classOptions = dbcData.ClassOptions; + if (classOptions != null) + { + ModalNextSpell = classOptions.ModalNextSpell; + _Description = String.IsNullOrEmpty(Description) ? classOptions.Description : _Description; + SpellFamilyName = classOptions.SpellFamilyName; + SpellFamilyFlags = (uint[])classOptions.SpellFamilyFlags.Clone(); + } + else + SpellFamilyFlags = new uint[3]; + + // SpellTotems.dbc + var totems = dbcData.Totems; + if (totems != null) + { + Totem = (uint[])totems.Totem.Clone(); + TotemCategory = (uint[])totems.TotemCategory.Clone(); + } + else + { + Totem = new uint[2]; + TotemCategory = new uint[2]; + } + + // SpellReagents.dbc + var reagents = dbcData.Reagents; + if (reagents != null) + { + Reagent = (uint[])reagents.ItemId.Clone(); + ReagentCount = (uint[])reagents.Count.Clone(); + } + else + { + Reagent = new uint[8]; + ReagentCount = new uint[8]; + } + + // SpellEquippedItems.dbc + var equippedItems = dbcData.EquippedItems; + if (equippedItems != null) + { + EquippedItemClass = equippedItems.EquippedItemClass; + EquippedItemSubClassMask = equippedItems.EquippedItemSubClassMask; + EquippedItemInventoryTypeMask = equippedItems.EquippedItemInventoryTypeMask; + } + + Scaling = dbcData.Scaling; + Effects = new SpellEffectEntry[DBC.DBC.MaxEffectIndex]; + } + + public bool HasEffect(SpellEffects effect) + { + return Effects.Where(eff => eff != null && eff.Type == (uint)effect).Count() > 0; + } + + public bool HasAura(AuraType aura) + { + return Effects.Where(eff => eff != null && eff.ApplyAuraName == (uint)aura).Count() > 0; + } + + public bool HasTargetA(Targets target) + { + return Effects.Where(eff => eff != null && eff.ImplicitTargetA == (uint)target).Count() > 0; + } + + public bool HasTargetB(Targets target) + { + return Effects.Where(eff => eff != null && eff.ImplicitTargetB == (uint)target).Count() > 0; + } + } +} diff --git a/SpellWork/SpellWork.csproj b/SpellWork/SpellWork.csproj index 9ee59d8b..7a4c88ae 100644 --- a/SpellWork/SpellWork.csproj +++ b/SpellWork/SpellWork.csproj @@ -10,7 +10,7 @@ Properties SpellWork SpellWork - v3.5 + v4.0 512 New Icon.ico false @@ -33,6 +33,7 @@ 1.0.0.%2a false true + true @@ -44,20 +45,24 @@ 4 true AllRules.ruleset + false - pdbonly + none true bin\Release\ - DEBUG;TRACE prompt 4 true AllRules.ruleset + false + + .\DBFilesClient.NET.dll + False libs\MySql.Data.dll @@ -79,6 +84,47 @@ + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -88,7 +134,6 @@ FormAboutBox.cs - Form @@ -101,20 +146,23 @@ FormSearch.cs - - - - - - Form - + FormSettings.cs + + Form + + + FormSpellScaling.cs + + + + + - @@ -125,6 +173,7 @@ + FormAboutBox.cs @@ -138,14 +187,17 @@ FormMain.cs Designer + + FormSettings.cs + + + FormSpellScaling.cs + ResXFileCodeGenerator Resources.Designer.cs Designer - - FormSettings.cs - True Resources.resx @@ -199,6 +251,7 @@ true +