Skip to content

Commit

Permalink
Started adapted SpellWork for dbc 2.4.3
Browse files Browse the repository at this point in the history
the is no works version

Signed-off-by: Konctantin <gawrilyako@gmail.com>
  • Loading branch information
Konctantin committed Jun 18, 2010
1 parent 8156df4 commit a1db3b4
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 168 deletions.
111 changes: 49 additions & 62 deletions SpellWork/DBC/Structure.cs
Expand Up @@ -34,52 +34,48 @@ 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
public uint CastUI; // 2 not used
public uint Dispel; // 3 m_dispelType
public uint Mechanic; // 4 m_mechanic
public uint Attributes; // 5 m_attribute
public uint AttributesEx; // 6 m_attributesEx
public uint AttributesEx2; // 7 m_attributesExB
public uint AttributesEx3; // 8 m_attributesExC
public uint AttributesEx4; // 9 m_attributesExD
public uint AttributesEx5; // 10 m_attributesExE
public uint AttributesEx6; // 11 m_attributesExF
public uint Stances; // 12 m_shapeshiftMask
public uint StancesNot; // 13 m_shapeshiftExclude
public uint Targets; // 14 m_targets
public uint TargetCreatureType; // 15 m_targetCreatureType
public uint RequiresSpellFocus; // 16 m_requiresSpellFocus
public uint FacingCasterFlags; // 17 m_facingCasterFlags
public uint CasterAuraState; // 18 m_casterAuraState
public uint TargetAuraState; // 19 m_targetAuraState
public uint CasterAuraStateNot; // 20 m_excludeCasterAuraState
public uint TargetAuraStateNot; // 21 m_excludeTargetAuraState
public uint CastingTimeIndex; // 22 m_castingTimeIndex
public uint RecoveryTime; // 23 m_recoveryTime
public uint CategoryRecoveryTime; // 24 m_categoryRecoveryTime
public uint InterruptFlags; // 25 m_interruptFlags
public uint AuraInterruptFlags; // 26 m_auraInterruptFlags
public uint ChannelInterruptFlags; // 27 m_channelInterruptFlags
public uint ProcFlags; // 28 m_procTypeMask
public uint ProcChance; // 29 m_procChance
public uint ProcCharges; // 30 m_procCharges
public uint MaxLevel; // 31 m_maxLevel
public uint BaseLevel; // 32 m_baseLevel
public uint SpellLevel; // 33 m_spellLevel
public uint DurationIndex; // 34 m_durationIndex
public uint PowerType; // 35 m_powerType
public uint ManaCost; // 36 m_manaCost
public uint ManaCostPerlevel; // 37 m_manaCostPerLevel
public uint ManaPerSecond; // 38 m_manaPerSecond
public uint ManaPerSecondPerLevel; // 39 m_manaPerSecondPerLevel
public uint RangeIndex; // 40 m_rangeIndex
public float Speed; // 41 m_speed
public uint ModalNextSpell; // 42 m_modalNextSpell not used
public uint StackAmount; // 43 m_cumulativeAura
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public uint[] Totem; // 50-51 m_totem
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
Expand All @@ -94,6 +90,10 @@ public struct SpellEntry
[MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)]
public int[] EffectDieSides; // 74-76 m_effectDieSides
[MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)]
public uint[] EffectBaseDice;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = DBC.MAX_EFFECT_INDEX)]
public float[] EffectDicePerLevel;
[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)
Expand Down Expand Up @@ -123,14 +123,8 @@ public struct SpellEntry
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
Expand All @@ -151,8 +145,8 @@ public struct SpellEntry
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!!!
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
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
Expand All @@ -166,13 +160,6 @@ public struct SpellEntry
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

/// <summary>
/// Return current Spell Name
Expand Down
10 changes: 3 additions & 7 deletions SpellWork/Extensions/TreeViewExtensions.cs
Expand Up @@ -11,17 +11,15 @@ public static class TreeViewExtensions
/// <returns></returns>
public static uint[] GetMask(this TreeView tv)
{
uint[] val = new uint[3];
uint[] val = new uint[2];
foreach (TreeNode node in tv.Nodes)
{
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);
val[1] += 1U << (node.Index - 32);
}
}
return val;
Expand All @@ -40,10 +38,8 @@ public static void SetMask(this TreeView tv, uint[] mask)
{
if (i < 32)
tv.Nodes[i].Checked = ((mask[0] / (1 << i)) % 2) != 0;
else if (i < 64)
tv.Nodes[i].Checked = ((mask[1] / (1 << (i - 32))) % 2) != 0;
else
tv.Nodes[i].Checked = ((mask[2] / (1 << (i - 64))) % 2) != 0;
tv.Nodes[i].Checked = ((mask[1] / (1 << (i - 32))) % 2) != 0;
}

ProcInfo.Update = true;
Expand Down
3 changes: 1 addition & 2 deletions SpellWork/Forms/FormMain.cs
Expand Up @@ -173,8 +173,7 @@ private void AdvancedSearch()
|| (spell.AttributesEx3 & at) != 0
|| (spell.AttributesEx4 & at) != 0
|| (spell.AttributesEx5 & at) != 0
|| (spell.AttributesEx6 & at) != 0
|| (spell.AttributesExG & at) != 0))
|| (spell.AttributesEx6 & at) != 0))

&& ((id != 0 || ic != 0 && at != 0) || spell.SpellName.ContainsText(name))

Expand Down
3 changes: 1 addition & 2 deletions SpellWork/Forms/FormSearch.cs
Expand Up @@ -43,8 +43,7 @@ private void IdName_KeyDown(object sender, KeyEventArgs e)
|| (spell.AttributesEx3 & at) != 0
|| (spell.AttributesEx4 & at) != 0
|| (spell.AttributesEx5 & at) != 0
|| (spell.AttributesEx6 & at) != 0
|| (spell.AttributesExG & at) != 0))
|| (spell.AttributesEx6 & at) != 0))

&& (id != 0 || ic != 0 && at != 0) || spell.SpellName.ContainsText(name)

Expand Down
16 changes: 6 additions & 10 deletions SpellWork/Spell/ProcInfo.cs
Expand Up @@ -28,19 +28,17 @@ select new
SkillLine.Value
};

for (int i = 0; i < 96; i++)
for (int i = 0; i < 64; i++)
{
uint[] mask = new uint[3];
uint[] mask = new uint[2];

if (i < 32)
mask[0] = 1U << i;
else if (i < 64)
mask[1] = 1U << (i - 32);
else
mask[2] = 1U << (i - 64);
mask[1] = 1U << (i - 32);

TreeNode node = new TreeNode();
node.Text = String.Format("0x{0:X8} {1:X8} {2:X8}", mask[2], mask[1], mask[0]);
node.Text = String.Format("0x{0:X8} {1:X8}", mask[1], mask[0]);
node.ImageKey = "family.ico";
familyTree.Nodes.Add(node);
}
Expand Down Expand Up @@ -72,14 +70,12 @@ select new

foreach (TreeNode node in familyTree.Nodes)
{
uint[] mask = new uint[3];
uint[] mask = new uint[2];

if (node.Index < 32)
mask[0] = 1U << node.Index;
else if (node.Index < 64)
mask[1] = 1U << (node.Index - 32);
else
mask[2] = 1U << (node.Index - 64);
mask[1] = 1U << (node.Index - 32);

if ((spell.SpellFamilyFlags.ContainsElement(mask)))
{
Expand Down

0 comments on commit a1db3b4

Please sign in to comment.