Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f80b0ab
Updated README
Mar 28, 2011
af8b58e
gitignore cleanup
Shauren Mar 28, 2011
f29e138
Whitespace cleanup
Shauren Mar 28, 2011
402be98
Implemented SpellDifficulty.dbc
Shauren Mar 28, 2011
bf3bec5
Reversed displayed order of EffectSpellClassMask and SpellFamilyFlags…
Shauren Mar 31, 2011
fd9c44a
Merge branch 'master' of git://github.com/LordJZ/spellwork_cs
Shauren Apr 18, 2011
544c430
Added TrinityCore defaults, removed some engrish and updated mysql dep
Shauren Apr 19, 2011
9dc3509
missed
Shauren Apr 19, 2011
3b89022
Added space between reagent id and count, small change but readabilit…
Shauren Apr 25, 2011
35fa47c
Cleaned all R# warnings
Shauren May 11, 2011
9371f31
Added more spell attributes
Shauren May 26, 2011
370f964
Fixed flag setting
Shauren May 27, 2011
835eb06
Attribute updates
Shauren Jul 2, 2011
b8d9c3a
More QAston's attributes
Shauren Jul 2, 2011
28563a8
Spell target updates
Shauren Jul 2, 2011
7efcc41
Added ReSharper directory to gitignore
Shauren Jul 21, 2011
6c4c27f
Added support for named pipe connections to database
Shauren Jul 21, 2011
79379b0
Attribute updates
Shauren Jul 21, 2011
9d608a1
Another update
Shauren Jul 22, 2011
dff1cd9
Attribute and target updates
Shauren Aug 22, 2011
68e4956
Added printing required areas to spell information
Shauren Aug 27, 2011
383be26
Add support for SpellMissile.dbc, SpellMissileMotion.dbc and SpellVis…
Warpten Mar 11, 2012
aab10cb
Merge pull request #1 from Warpten/master
DDuarte Mar 11, 2012
04956cb
Fixed warnings about never assigned values
Shauren Mar 31, 2012
bda5499
Output spell missile section only if spell really has a missile
Shauren Apr 8, 2012
4d5c8e6
Print MaxAffectedTargets info
Shauren Apr 18, 2012
b42cea5
Update to 4.3.4
Shauren Aug 14, 2012
35c1b33
Fixed null reference exceptions in linq join queries
Shauren Aug 14, 2012
b9e0ff4
Fixed a few forgotten changes, optimized searching spell effects
Shauren Aug 14, 2012
8265083
Corrected spell duration (it can be negative for infinite)
Shauren Aug 15, 2012
09a1fb3
Implemented spell value level scaling
Shauren Aug 15, 2012
234cb74
Implemented cast time level scaling
Shauren Aug 15, 2012
249945e
Icon cataclysm'ed
DDuarte Aug 15, 2012
dcf4a6b
Merge pull request #2 from DDuarte/4.3.4
DDuarte Aug 15, 2012
9bc6fde
Fixed scaling for some spells
Shauren Aug 17, 2012
6bab672
Fix typo
Vincent-Michael Aug 18, 2012
2da59a5
Output all spell attributes (Ex9 and Ex10)
Shauren Aug 18, 2012
1c10d54
Print the order of SpellFamilyFlags
Shauren Sep 15, 2012
57dfa8d
Merge branch 'master' into 4.3.4
Shauren Sep 15, 2012
cd923db
Updated attribute after recent TC change
Shauren Sep 16, 2012
f66ac05
Merge branch 'master' into 4.3.4
Shauren Sep 16, 2012
d308bca
Update aura name
Vincent-Michael Dec 30, 2012
bae624f
Updated auras and spell effects name with TC
Kinzcool Jan 1, 2013
8e6f913
4.3.4: Display the spell's description variable ID.
Warpten Feb 2, 2013
8e38d57
Update some spells enums
Vincent-Michael Mar 1, 2013
90a483d
Merge branch 'master' of github.com:TrinityCore/spellwork_cs into 4.3.4
Vincent-Michael Mar 1, 2013
a7fca90
Update 4.3.4 spell enums
Vincent-Michael Mar 2, 2013
19ff401
4.3.4: Display the full content of SpellDescriptionVariables.cs whene…
Warpten Mar 20, 2013
f026678
Refactored spell description variable output
Shauren Apr 1, 2013
29f7f0d
Synchronize the spell attributes with TrinityCore's latest changes
Sep 6, 2013
edb7580
Merge pull request #4 from Discover-/master
Shauren Sep 6, 2013
6396eee
Don't allow resizing the settings window
Sep 16, 2013
48c4a12
Pressing Escape in the settings form now closes it
Sep 16, 2013
3b54090
Rename 'Cencel' buttons to 'Cancel'
Sep 16, 2013
a859b02
Add a Search button to the Search form (previously only worked with p…
Sep 16, 2013
b0e6c15
Set the backcolor of the search form to the same color as the main fo…
Sep 16, 2013
2fc9e82
Merge pull request #5 from Discover-/master
raczman Sep 16, 2013
df78fbb
Correct the size of the calculate flags form instead of hardcoding a …
Sep 17, 2013
e7e1e14
Fixed the "items that use this spell" message.
Subv Nov 3, 2013
c560ce5
Reimplemented the SQL tab in 4.3.4
Subv Nov 3, 2013
5938a5a
Updated the MySQL connector to the latest version
Subv Nov 3, 2013
e4ea9d3
fix case-sensitive folder name "DataBase" in project file
Artox Jan 27, 2014
b6710f6
Merge pull request #6 from Artox/master
Jan 27, 2014
692a100
Added more attribute names from tc
Shauren Jul 15, 2014
19504fa
Remove vshost,debug,trace for release builds
Shauren Jul 15, 2014
94c522c
Merge branch 'master' of github.com:TrinityCore/spellwork_cs into 4.3.4
Shauren Jul 15, 2014
5fa3aa1
Allow to select dbc path instead select only default directory.
xjose93 Dec 25, 2014
71157c5
Remove VS 2008 .sln
DDuarte Feb 29, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ SpellWork/obj/*
*.rej
*.patch
*.log
_ReSharper*
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
3 changes: 3 additions & 0 deletions SpellWork/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

bin/*
obj/*
174 changes: 147 additions & 27 deletions SpellWork/DBC/DBC.cs
Original file line number Diff line number Diff line change
@@ -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<uint, SpellEntry> Spell;
public static Dictionary<uint, SpellRadiusEntry> SpellRadius;
public static Dictionary<uint, SpellCastTimesEntry> SpellCastTimes;
public static Dictionary<uint, SpellDifficultyEntry> SpellDifficulty;
public static Dictionary<uint, SpellRangeEntry> SpellRange;
public static Dictionary<uint, SpellDurationEntry> SpellDuration;
public static Dictionary<uint, SkillLineAbilityEntry> SkillLineAbility;
public static Dictionary<uint, SkillLineEntry> SkillLine;
public static Dictionary<uint, ScreenEffectEntry> ScreenEffect;
public static Dictionary<uint, OverrideSpellDataEntry> OverrideSpellData;

public static Dictionary<uint, string> SpellStrings = new Dictionary<uint, string>();
public static Dictionary<uint, string> SkillLineStrings = new Dictionary<uint, string>();
public static Dictionary<uint, string> SpellRangeStrings = new Dictionary<uint, string>();
public static Dictionary<uint, string> ScreenEffectStrings = new Dictionary<uint, string>();

// 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<AreaGroupEntry> AreaGroup = new DBCStorage<AreaGroupEntry>();
public static DBCStorage<AreaTableEntry> AreaTable = new DBCStorage<AreaTableEntry>();
public static DBCStorage<gtSpellScalingEntry> gtSpellScaling = new DBCStorage<gtSpellScalingEntry>();
public static DBCStorage<OverrideSpellDataEntry> OverrideSpellData = new DBCStorage<OverrideSpellDataEntry>();
public static DBCStorage<ScreenEffectEntry> ScreenEffect = new DBCStorage<ScreenEffectEntry>();
public static DBCStorage<SkillLineAbilityEntry> SkillLineAbility = new DBCStorage<SkillLineAbilityEntry>();
public static DBCStorage<SkillLineEntry> SkillLine = new DBCStorage<SkillLineEntry>();
public static DBCStorage<SpellEntry> Spell = new DBCStorage<SpellEntry>();
public static DBCStorage<SpellAuraOptionsEntry> SpellAuraOptions = new DBCStorage<SpellAuraOptionsEntry>();
public static DBCStorage<SpellAuraRestrictionsEntry> SpellAuraRestrictions = new DBCStorage<SpellAuraRestrictionsEntry>();
public static DBCStorage<SpellCastingRequirementsEntry> SpellCastingRequirements = new DBCStorage<SpellCastingRequirementsEntry>();
public static DBCStorage<SpellCastTimesEntry> SpellCastTimes = new DBCStorage<SpellCastTimesEntry>();
public static DBCStorage<SpellCategoriesEntry> SpellCategories = new DBCStorage<SpellCategoriesEntry>();
public static DBCStorage<SpellClassOptionsEntry> SpellClassOptions = new DBCStorage<SpellClassOptionsEntry>();
public static DBCStorage<SpellCooldownsEntry> SpellCooldowns = new DBCStorage<SpellCooldownsEntry>();
public static DBCStorage<SpellDescriptionVariablesEntry> SpellDescriptionVariables = new DBCStorage<SpellDescriptionVariablesEntry>();
public static DBCStorage<SpellDifficultyEntry> SpellDifficulty = new DBCStorage<SpellDifficultyEntry>();
public static DBCStorage<SpellDurationEntry> SpellDuration = new DBCStorage<SpellDurationEntry>();
public static DBCStorage<SpellEffectEntry> SpellEffect = new DBCStorage<SpellEffectEntry>();
public static DBCStorage<SpellEquippedItemsEntry> SpellEquippedItems = new DBCStorage<SpellEquippedItemsEntry>();
public static DBCStorage<SpellInterruptsEntry> SpellInterrupts = new DBCStorage<SpellInterruptsEntry>();
public static DBCStorage<SpellLevelsEntry> SpellLevels = new DBCStorage<SpellLevelsEntry>();
public static DBCStorage<SpellMissileEntry> SpellMissile = new DBCStorage<SpellMissileEntry>();
public static DBCStorage<SpellMissileMotionEntry> SpellMissileMotion = new DBCStorage<SpellMissileMotionEntry>();
public static DBCStorage<SpellPowerEntry> SpellPower = new DBCStorage<SpellPowerEntry>();
public static DBCStorage<SpellRadiusEntry> SpellRadius = new DBCStorage<SpellRadiusEntry>();
public static DBCStorage<SpellRangeEntry> SpellRange = new DBCStorage<SpellRangeEntry>();
public static DBCStorage<SpellReagentsEntry> SpellReagents = new DBCStorage<SpellReagentsEntry>();
public static DBCStorage<SpellRuneCostEntry> SpellRuneCost = new DBCStorage<SpellRuneCostEntry>();
public static DBCStorage<SpellScalingEntry> SpellScaling = new DBCStorage<SpellScalingEntry>();
public static DBCStorage<SpellShapeshiftEntry> SpellShapeshift = new DBCStorage<SpellShapeshiftEntry>();
public static DBCStorage<SpellTargetRestrictionsEntry> SpellTargetRestrictions = new DBCStorage<SpellTargetRestrictionsEntry>();
public static DBCStorage<SpellTotemsEntry> SpellTotems = new DBCStorage<SpellTotemsEntry>();
public static DBCStorage<SpellVisualEntry> SpellVisual = new DBCStorage<SpellVisualEntry>();

public static DB2Storage<ItemEntry> Item = new DB2Storage<ItemEntry>();

[DataStoreFileName("Item-sparse")]
public static DB2Storage<ItemSparseEntry> ItemSparse = new DB2Storage<ItemSparseEntry>();

public static Dictionary<uint, SpellInfoHelper> SpellInfoStore = new Dictionary<uint, SpellInfoHelper>();

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<Item> ItemTemplate = new List<Item>();

// Locale
public static LocalesDBC Locale { get; set; }
public static uint SelectedLevel = MaxLevel;
}
}
55 changes: 0 additions & 55 deletions SpellWork/DBC/DBCReader.cs

This file was deleted.

23 changes: 23 additions & 0 deletions SpellWork/DBC/DataStoreFileNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
}
Loading