stoneharry

Untitled

Sep 7th, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 32.13 KB | None | 0 0
  1. Imports System.IO
  2. Imports System.Runtime.InteropServices
  3.  
  4. Structure DBC_Header
  5.     Dim magic As UInt32 ' always 'WDBC'
  6.     Dim record_count As UInt32 ' records per file
  7.     Dim field_count As UInt32 ' fields per record
  8.     Dim record_size As UInt32 ' sum (sizeof (field_type_i)) | 0 <= i < field_count. field_type_i is NOT defined in the files.
  9.     Dim string_block_size As UInt32
  10. End Structure
  11.  
  12. Structure DBC_Body
  13.     Dim Header As DBC_Header
  14.     Dim records() As SpellRecord
  15.     Dim string_block() As Char
  16. End Structure
  17.  
  18. Public Class DBC
  19.     Private fsSource As FileStream
  20.     Dim bytes() As Byte
  21.     Dim numBytesToRead As UInt32
  22.     Dim numBytesRead As UInt32
  23.  
  24.     Private SpellDBC As DBC_Body
  25.  
  26.     Private sizeofUint32 As UInt32
  27.     Private sizeofUint64 As UInt32
  28.  
  29.     Public Sub OpenDBC(ByVal path As String)
  30.         fsSource = New FileStream(path, FileMode.Open, FileAccess.Read)
  31.         bytes = New Byte((fsSource.Length) - 1) {}
  32.         numBytesToRead = CType(fsSource.Length, Integer)
  33.         numBytesRead = 0
  34.     End Sub
  35.  
  36.     Public Sub CloseDBC()
  37.         fsSource.Close()
  38.     End Sub
  39.  
  40.     Public Sub ReadHeader()
  41.         Dim Header As New DBC_Header
  42.  
  43.         Dim n As UInt32 = fsSource.Read(bytes, numBytesRead, Marshal.SizeOf(Header))
  44.         numBytesToRead = (numBytesToRead - n)
  45.  
  46.         Dim temp As UInt64
  47.  
  48.         sizeofUint32 = Marshal.SizeOf(Header.magic)
  49.         sizeofUint64 = Marshal.SizeOf(temp)
  50.  
  51.         Header.magic = BitConverter.ToUInt32(bytes, numBytesRead)
  52.         numBytesRead = numBytesRead + sizeofUint32
  53.         Header.record_count = BitConverter.ToUInt32(bytes, numBytesRead)
  54.         numBytesRead = numBytesRead + sizeofUint32
  55.         Header.field_count = BitConverter.ToUInt32(bytes, numBytesRead)
  56.         numBytesRead = numBytesRead + sizeofUint32
  57.         Header.record_size = BitConverter.ToUInt32(bytes, numBytesRead)
  58.         numBytesRead = numBytesRead + sizeofUint32
  59.         Header.string_block_size = BitConverter.ToUInt32(bytes, numBytesRead)
  60.         numBytesRead = numBytesRead + sizeofUint32
  61.  
  62.         SpellDBC.Header = Header
  63.  
  64.         SpellDBC.records = New SpellRecord(Header.record_count) {}
  65.     End Sub
  66.  
  67.     Public Sub ReadBody()
  68.  
  69.         Dim i As Integer
  70.         For i = 0 To SpellDBC.Header.record_count - 1
  71.  
  72.             Dim Spell As New SpellRecord
  73.  
  74.             Dim n As UInt32 = fsSource.Read(bytes, numBytesRead, Marshal.SizeOf(Spell))
  75.             numBytesToRead = (numBytesToRead - n)
  76.  
  77.             ReadRecord(Spell)
  78.  
  79.             SpellDBC.records(i) = Spell
  80.         Next i
  81.  
  82.         MessageBox.Show(SpellDBC.records(3).Id.ToString())
  83.     End Sub
  84.  
  85.     Private Sub ReadRecord(ByRef Spell As SpellRecord)
  86.         Spell.Id = BitConverter.ToUInt32(bytes, numBytesRead)
  87.         numBytesRead = numBytesRead + sizeofUint32
  88.         Spell.Category = BitConverter.ToUInt32(bytes, numBytesRead)
  89.         numBytesRead = numBytesRead + sizeofUint32
  90.         Spell.Dispel = BitConverter.ToUInt32(bytes, numBytesRead)
  91.         numBytesRead = numBytesRead + sizeofUint32
  92.         Spell.Mechanic = BitConverter.ToUInt32(bytes, numBytesRead)
  93.         numBytesRead = numBytesRead + sizeofUint32
  94.         Spell.Attributes = BitConverter.ToUInt32(bytes, numBytesRead)
  95.         numBytesRead = numBytesRead + sizeofUint32
  96.         Spell.AttributesEx = BitConverter.ToUInt32(bytes, numBytesRead)
  97.         numBytesRead = numBytesRead + sizeofUint32
  98.         Spell.AttributesEx2 = BitConverter.ToUInt32(bytes, numBytesRead)
  99.         numBytesRead = numBytesRead + sizeofUint32
  100.         Spell.AttributesEx3 = BitConverter.ToUInt32(bytes, numBytesRead)
  101.         numBytesRead = numBytesRead + sizeofUint32
  102.         Spell.AttributesEx4 = BitConverter.ToUInt32(bytes, numBytesRead)
  103.         numBytesRead = numBytesRead + sizeofUint32
  104.         Spell.AttributesEx5 = BitConverter.ToUInt32(bytes, numBytesRead)
  105.         numBytesRead = numBytesRead + sizeofUint32
  106.         Spell.AttributesEx6 = BitConverter.ToUInt32(bytes, numBytesRead)
  107.         numBytesRead = numBytesRead + sizeofUint32
  108.         Spell.AttributesEx7 = BitConverter.ToUInt32(bytes, numBytesRead)
  109.         numBytesRead = numBytesRead + sizeofUint32
  110.         Spell.Stances = BitConverter.ToUInt32(bytes, numBytesRead)
  111.         numBytesRead = numBytesRead + sizeofUint32
  112.         Spell.unk_320_2 = BitConverter.ToUInt32(bytes, numBytesRead)
  113.         numBytesRead = numBytesRead + sizeofUint32
  114.         Spell.StancesNot = BitConverter.ToUInt32(bytes, numBytesRead)
  115.         numBytesRead = numBytesRead + sizeofUint32
  116.         Spell.unk_320_3 = BitConverter.ToUInt32(bytes, numBytesRead)
  117.         numBytesRead = numBytesRead + sizeofUint32
  118.         Spell.Targets = BitConverter.ToUInt32(bytes, numBytesRead)
  119.         numBytesRead = numBytesRead + sizeofUint32
  120.         Spell.TargetCreatureType = BitConverter.ToUInt32(bytes, numBytesRead)
  121.         numBytesRead = numBytesRead + sizeofUint32
  122.         Spell.RequiresSpellFocus = BitConverter.ToUInt32(bytes, numBytesRead)
  123.         numBytesRead = numBytesRead + sizeofUint32
  124.         Spell.FacingCasterFlags = BitConverter.ToUInt32(bytes, numBytesRead)
  125.         numBytesRead = numBytesRead + sizeofUint32
  126.         Spell.CasterAuraState = BitConverter.ToUInt32(bytes, numBytesRead)
  127.         numBytesRead = numBytesRead + sizeofUint32
  128.         Spell.TargetAuraState = BitConverter.ToUInt32(bytes, numBytesRead)
  129.         numBytesRead = numBytesRead + sizeofUint32
  130.         Spell.CasterAuraStateNot = BitConverter.ToUInt32(bytes, numBytesRead)
  131.         numBytesRead = numBytesRead + sizeofUint32
  132.         Spell.TargetAuraStateNot = BitConverter.ToUInt32(bytes, numBytesRead)
  133.         numBytesRead = numBytesRead + sizeofUint32
  134.         Spell.casterAuraSpell = BitConverter.ToUInt32(bytes, numBytesRead)
  135.         numBytesRead = numBytesRead + sizeofUint32
  136.         Spell.targetAuraSpell = BitConverter.ToUInt32(bytes, numBytesRead)
  137.         numBytesRead = numBytesRead + sizeofUint32
  138.         Spell.excludeCasterAuraSpell = BitConverter.ToUInt32(bytes, numBytesRead)
  139.         numBytesRead = numBytesRead + sizeofUint32
  140.         Spell.excludeTargetAuraSpell = BitConverter.ToUInt32(bytes, numBytesRead)
  141.         numBytesRead = numBytesRead + sizeofUint32
  142.         Spell.CastingTimeIndex = BitConverter.ToUInt32(bytes, numBytesRead)
  143.         numBytesRead = numBytesRead + sizeofUint32
  144.         Spell.RecoveryTime = BitConverter.ToUInt32(bytes, numBytesRead)
  145.         numBytesRead = numBytesRead + sizeofUint32
  146.         Spell.CategoryRecoveryTime = BitConverter.ToUInt32(bytes, numBytesRead)
  147.         numBytesRead = numBytesRead + sizeofUint32
  148.         Spell.InterruptFlags = BitConverter.ToUInt32(bytes, numBytesRead)
  149.         numBytesRead = numBytesRead + sizeofUint32
  150.         Spell.AuraInterruptFlags = BitConverter.ToUInt32(bytes, numBytesRead)
  151.         numBytesRead = numBytesRead + sizeofUint32
  152.         Spell.ChannelInterruptFlags = BitConverter.ToUInt32(bytes, numBytesRead)
  153.         numBytesRead = numBytesRead + sizeofUint32
  154.         Spell.procFlags = BitConverter.ToUInt32(bytes, numBytesRead)
  155.         numBytesRead = numBytesRead + sizeofUint32
  156.         Spell.procChance = BitConverter.ToUInt32(bytes, numBytesRead)
  157.         numBytesRead = numBytesRead + sizeofUint32
  158.         Spell.procCharges = BitConverter.ToUInt32(bytes, numBytesRead)
  159.         numBytesRead = numBytesRead + sizeofUint32
  160.         Spell.maxLevel = BitConverter.ToUInt32(bytes, numBytesRead)
  161.         numBytesRead = numBytesRead + sizeofUint32
  162.         Spell.baseLevel = BitConverter.ToUInt32(bytes, numBytesRead)
  163.         numBytesRead = numBytesRead + sizeofUint32
  164.         Spell.spellLevel = BitConverter.ToUInt32(bytes, numBytesRead)
  165.         numBytesRead = numBytesRead + sizeofUint32
  166.         Spell.DurationIndex = BitConverter.ToUInt32(bytes, numBytesRead)
  167.         numBytesRead = numBytesRead + sizeofUint32
  168.         Spell.powerType = BitConverter.ToUInt32(bytes, numBytesRead)
  169.         numBytesRead = numBytesRead + sizeofUint32
  170.         Spell.manaCost = BitConverter.ToUInt32(bytes, numBytesRead)
  171.         numBytesRead = numBytesRead + sizeofUint32
  172.         Spell.manaCostPerlevel = BitConverter.ToUInt32(bytes, numBytesRead)
  173.         numBytesRead = numBytesRead + sizeofUint32
  174.         Spell.manaPerSecond = BitConverter.ToUInt32(bytes, numBytesRead)
  175.         numBytesRead = numBytesRead + sizeofUint32
  176.         Spell.manaPerSecondPerLevel = BitConverter.ToUInt32(bytes, numBytesRead)
  177.         numBytesRead = numBytesRead + sizeofUint32
  178.         Spell.rangeIndex = BitConverter.ToUInt32(bytes, numBytesRead)
  179.         numBytesRead = numBytesRead + sizeofUint32
  180.         Spell.speed = BitConverter.ToUInt32(bytes, numBytesRead)
  181.         numBytesRead = numBytesRead + sizeofUint32
  182.         Spell.modalNextSpell = BitConverter.ToUInt32(bytes, numBytesRead)
  183.         numBytesRead = numBytesRead + sizeofUint32
  184.         Spell.StackAmount = BitConverter.ToUInt32(bytes, numBytesRead
  185.         numBytesRead = numBytesRead + sizeofUint32
  186.         Spell.Totem1 = BitConverter.ToUInt32(bytes, numBytesRead)
  187.         numBytesRead = numBytesRead + sizeofUint32
  188.         Spell.Totem2 = BitConverter.ToUInt32(bytes, numBytesRead)
  189.         numBytesRead = numBytesRead + sizeofUint32
  190.         Spell.Reagent1 = BitConverter.ToInt32(bytes, numBytesRead)
  191.         numBytesRead = numBytesRead + sizeofUint32
  192.         Spell.Reagent2 = BitConverter.ToInt32(bytes, numBytesRead)
  193.         numBytesRead = numBytesRead + sizeofUint32
  194.         Spell.Reagent3 = BitConverter.ToInt32(bytes, numBytesRead)
  195.         numBytesRead = numBytesRead + sizeofUint32
  196.         Spell.Reagent4 = BitConverter.ToInt32(bytes, numBytesRead)
  197.         numBytesRead = numBytesRead + sizeofUint32
  198.         Spell.Reagent5 = BitConverter.ToInt32(bytes, numBytesRead)
  199.         numBytesRead = numBytesRead + sizeofUint32
  200.         Spell.Reagent6 = BitConverter.ToInt32(bytes, numBytesRead)
  201.         numBytesRead = numBytesRead + sizeofUint32
  202.         Spell.Reagent7 = BitConverter.ToInt32(bytes, numBytesRead)
  203.         numBytesRead = numBytesRead + sizeofUint32
  204.         Spell.Reagent8 = BitConverter.ToInt32(bytes, numBytesRead)
  205.         numBytesRead = numBytesRead + sizeofUint32
  206.         Spell.ReagentCount1 = BitConverter.ToUInt32(bytes, numBytesRead)
  207.         numBytesRead = numBytesRead + sizeofUint32
  208.         Spell.ReagentCount2 = BitConverter.ToUInt32(bytes, numBytesRead)
  209.         numBytesRead = numBytesRead + sizeofUint32
  210.         Spell.ReagentCount3 = BitConverter.ToUInt32(bytes, numBytesRead)
  211.         numBytesRead = numBytesRead + sizeofUint32
  212.         Spell.ReagentCount4 = BitConverter.ToUInt32(bytes, numBytesRead)
  213.         numBytesRead = numBytesRead + sizeofUint32
  214.         Spell.ReagentCount5 = BitConverter.ToUInt32(bytes, numBytesRead)
  215.         numBytesRead = numBytesRead + sizeofUint32
  216.         Spell.ReagentCount6 = BitConverter.ToUInt32(bytes, numBytesRead)
  217.         numBytesRead = numBytesRead + sizeofUint32
  218.         Spell.ReagentCount7 = BitConverter.ToUInt32(bytes, numBytesRead)
  219.         numBytesRead = numBytesRead + sizeofUint32
  220.         Spell.ReagentCount8 = BitConverter.ToUInt32(bytes, numBytesRead)
  221.         numBytesRead = numBytesRead + sizeofUint32
  222.         Spell.EquippedItemClass = BitConverter.ToInt32(bytes, numBytesRead)
  223.         numBytesRead = numBytesRead + sizeofUint32
  224.         Spell.EquippedItemSubClassMask = BitConverter.ToInt32(bytes, numBytesRead)
  225.         numBytesRead = numBytesRead + sizeofUint32
  226.         Spell.EquippedItemInventoryTypeMask = BitConverter.ToInt32(bytes, numBytesRead)
  227.         numBytesRead = numBytesRead + sizeofUint32
  228.         Spell.Effect1 = BitConverter.ToUInt32(bytes, numBytesRead)
  229.         numBytesRead = numBytesRead + sizeofUint32
  230.         Spell.Effect2 = BitConverter.ToUInt32(bytes, numBytesRead)
  231.         numBytesRead = numBytesRead + sizeofUint32
  232.         Spell.Effect3 = BitConverter.ToUInt32(bytes, numBytesRead)
  233.         numBytesRead = numBytesRead + sizeofUint32
  234.         Spell.EffectDieSides1 = BitConverter.ToInt32(bytes, numBytesRead)
  235.         numBytesRead = numBytesRead + sizeofUint32
  236.         Spell.EffectDieSides2 = BitConverter.ToInt32(bytes, numBytesRead)
  237.         numBytesRead = numBytesRead + sizeofUint32
  238.         Spell.EffectDieSides3 = BitConverter.ToInt32(bytes, numBytesRead)
  239.         numBytesRead = numBytesRead + sizeofUint32
  240.         Spell.EffectRealPointsPerLevel1 = BitConverter.ToSingle(bytes, numBytesRead)
  241.         numBytesRead = numBytesRead + sizeofUint32
  242.         Spell.EffectRealPointsPerLevel2 = BitConverter.ToSingle(bytes, numBytesRead)
  243.         numBytesRead = numBytesRead + sizeofUint32
  244.         Spell.EffectRealPointsPerLevel3 = BitConverter.ToSingle(bytes, numBytesRead)
  245.         numBytesRead = numBytesRead + sizeofUint32
  246.         Spell.EffectBasePoints1 = BitConverter.ToInt32(bytes, numBytesRead)
  247.         numBytesRead = numBytesRead + sizeofUint32
  248.         Spell.EffectBasePoints2 = BitConverter.ToInt32(bytes, numBytesRead)
  249.         numBytesRead = numBytesRead + sizeofUint32
  250.         Spell.EffectBasePoints3 = BitConverter.ToInt32(bytes, numBytesRead)
  251.         numBytesRead = numBytesRead + sizeofUint32
  252.         Spell.EffectMechanic1 = BitConverter.ToUInt32(bytes, numBytesRead)
  253.         numBytesRead = numBytesRead + sizeofUint32
  254.         Spell.EffectMechanic2 = BitConverter.ToUInt32(bytes, numBytesRead)
  255.         numBytesRead = numBytesRead + sizeofUint32
  256.         Spell.EffectMechanic3 = BitConverter.ToUInt32(bytes, numBytesRead)
  257.         numBytesRead = numBytesRead + sizeofUint32
  258.         Spell.EffectImplicitTargetA1 = BitConverter.ToUInt32(bytes, numBytesRead)
  259.         numBytesRead = numBytesRead + sizeofUint32
  260.         Spell.EffectImplicitTargetA2 = BitConverter.ToUInt32(bytes, numBytesRead)
  261.         numBytesRead = numBytesRead + sizeofUint32
  262.         Spell.EffectImplicitTargetA3 = BitConverter.ToUInt32(bytes, numBytesRead)
  263.         numBytesRead = numBytesRead + sizeofUint32
  264.         Spell.EffectImplicitTargetB1 = BitConverter.ToUInt32(bytes, numBytesRead)
  265.         numBytesRead = numBytesRead + sizeofUint32
  266.         Spell.EffectImplicitTargetB2 = BitConverter.ToUInt32(bytes, numBytesRead)
  267.         numBytesRead = numBytesRead + sizeofUint32
  268.         Spell.EffectImplicitTargetB3 = BitConverter.ToUInt32(bytes, numBytesRead)
  269.         numBytesRead = numBytesRead + sizeofUint32
  270.         Spell.EffectRadiusIndex1 = BitConverter.ToUInt32(bytes, numBytesRead)
  271.         numBytesRead = numBytesRead + sizeofUint32
  272.         Spell.EffectRadiusIndex2 = BitConverter.ToUInt32(bytes, numBytesRead)
  273.         numBytesRead = numBytesRead + sizeofUint32
  274.         Spell.EffectRadiusIndex3 = BitConverter.ToUInt32(bytes, numBytesRead)
  275.         numBytesRead = numBytesRead + sizeofUint32
  276.         Spell.EffectApplyAuraName1 = BitConverter.ToUInt32(bytes, numBytesRead)
  277.         numBytesRead = numBytesRead + sizeofUint32
  278.         Spell.EffectApplyAuraName2 = BitConverter.ToUInt32(bytes, numBytesRead)
  279.         numBytesRead = numBytesRead + sizeofUint32
  280.         Spell.EffectApplyAuraName3 = BitConverter.ToUInt32(bytes, numBytesRead)
  281.         numBytesRead = numBytesRead + sizeofUint32
  282.         Spell.EffectAmplitude1 = BitConverter.ToUInt32(bytes, numBytesRead)
  283.         numBytesRead = numBytesRead + sizeofUint32
  284.         Spell.EffectAmplitude2 = BitConverter.ToUInt32(bytes, numBytesRead)
  285.         numBytesRead = numBytesRead + sizeofUint32
  286.         Spell.EffectAmplitude3 = BitConverter.ToUInt32(bytes, numBytesRead)
  287.         numBytesRead = numBytesRead + sizeofUint32
  288.         Spell.EffectMultipleValue1 = BitConverter.ToSingle(bytes, numBytesRead)
  289.         numBytesRead = numBytesRead + sizeofUint32
  290.         Spell.EffectMultipleValue2 = BitConverter.ToSingle(bytes, numBytesRead)
  291.         numBytesRead = numBytesRead + sizeofUint32
  292.         Spell.EffectMultipleValue3 = BitConverter.ToSingle(bytes, numBytesRead)
  293.         numBytesRead = numBytesRead + sizeofUint32
  294.         Spell.TODOMERAWR = BitConverter.ToUInt32(bytes, numBytesRead)
  295.         numBytesRead = numBytesRead + sizeofUint32
  296.  
  297.  
  298.         Dim EffectChainTarget1 As UInt32
  299.         Dim EffectChainTarget2 As UInt32
  300.         Dim EffectChainTarget3 As UInt32  ' 104-106  m_effectChainTargets
  301.         Dim EffectItemType1 As UInt32
  302.         Dim EffectItemType2 As UInt32
  303.         Dim EffectItemType3 As UInt32 ' 107-109  m_effectItemType
  304.         Dim EffectMiscValue1 As Int32
  305.         Dim EffectMiscValue2 As Int32
  306.         Dim EffectMiscValue3 As Int32 ' 110-112  m_effectMiscValue
  307.         Dim EffectMiscValueB1 As Int32
  308.         Dim EffectMiscValueB2 As Int32
  309.         Dim EffectMiscValueB3 As Int32  ' 113-115  m_effectMiscValueB
  310.         Dim EffectTriggerSpell1 As UInt32
  311.         Dim EffectTriggerSpell2 As UInt32
  312.         Dim EffectTriggerSpell3 As UInt32 ' 116-118  m_effectTriggerSpell
  313.  
  314.         Dim EffectPointsPerComboPoint1 As Single
  315.         Dim EffectPointsPerComboPoint2 As Single
  316.         Dim EffectPointsPerComboPoint3 As Single ' 119-121  m_effectPointsPerCombo
  317.  
  318.         Dim EffectSpellClassMaskA1 As UInt32
  319.         Dim EffectSpellClassMaskA2 As UInt32
  320.         Dim EffectSpellClassMaskA3 As UInt32 ' 122-124  m_effectSpellClassMaskA, effect 0
  321.         Dim EffectSpellClassMaskB1 As UInt32
  322.         Dim EffectSpellClassMaskB2 As UInt32
  323.         Dim EffectSpellClassMaskB3 As UInt32  ' 125-127  m_effectSpellClassMaskB, effect 1
  324.         Dim EffectSpellClassMaskC1 As UInt32
  325.         Dim EffectSpellClassMaskC2 As UInt32
  326.         Dim EffectSpellClassMaskC3 As UInt32 ' 128-130  m_effectSpellClassMaskC, effect 2
  327.         Dim SpellVisual1 As UInt32
  328.         Dim SpellVisual2 As UInt32 ' 131-132  m_spellVisualID
  329.         Dim SpellIconID As UInt32                                   ' 133      m_spellIconID
  330.         Dim activeIconID As UInt32                                  ' 134      m_activeIconID
  331.         Dim spellPriority As UInt32                                 ' 135      m_spellPriority    
  332.         <VBFixedString(16)> Dim SpellName As String                                  ' 136-151  m_name_lang
  333.         Dim SpellNameFlag As UInt32                                ' 152
  334.         <VBFixedString(16)> Dim Rank As String                                       ' 153-168  m_nameSubtext_lang
  335.         Dim RankFlags As UInt32                                  ' 169
  336.         <VBFixedString(16)> Dim Description As String                            ' 170-185  m_description_lang
  337.         Dim DescriptionFlags As UInt32                              ' 186
  338.         <VBFixedString(16)> Dim ToolTip As String                               ' 187-202  m_auraDescription_lang
  339.         Dim ToolTipFlags As UInt32                               ' 203
  340.         Dim ManaCostPercentage As UInt32                            ' 204      m_manaCostPct
  341.         Dim StartRecoveryCategory As UInt32                        ' 205      m_startRecoveryCategory
  342.         Dim StartRecoveryTime As UInt32                           ' 206      m_startRecoveryTime
  343.         Dim MaxTargetLevel As UInt32                            ' 207      m_maxTargetLevel
  344.         Dim SpellFamilyName As UInt32                           ' 208      m_spellClassSet
  345.         Dim SpellFamilyFlags As UInt64                              ' 209-210  m_spellClassMask NOTE: size is 12 bytes!!!
  346.         Dim SpellFamilyFlags2 As UInt32                        ' 211      addition to m_spellClassMask
  347.         Dim MaxAffectedTargets As UInt32                        ' 212      m_maxTargets
  348.         Dim DmgClass As UInt32                        ' 213      m_defenseType
  349.         Dim PreventionType As UInt32                          ' 214      m_preventionType
  350.         Dim StanceBarOrder As UInt32                         ' 215      m_stanceBarOrder
  351.         Dim DmgMultiplier1 As Single
  352.         Dim DmgMultiplier2 As Single
  353.         Dim DmgMultiplier3 As Single ' 216-218  m_effectChainAmplitude
  354.         Dim MinFactionId As UInt32                              ' 219      m_minFactionID
  355.         Dim MinReputation As UInt32                              ' 220      m_minReputation
  356.         Dim RequiredAuraVision As UInt32                           ' 221      m_requiredAuraVision
  357.         Dim TotemCategory1 As UInt32
  358.         Dim TotemCategory2 As UInt32 ' 222-223  m_requiredTotemCategoryID
  359.         Dim AreaGroupId As Int32                             ' 224      m_requiredAreaGroupId
  360.         Dim SchoolMask As UInt32                              ' 225      m_schoolMask
  361.         Dim runeCostID As UInt32                              ' 226      m_runeCostID
  362.         Dim spellMissileID As UInt32                             ' 227      m_spellMissileID
  363.         Dim PowerDisplayId As UInt32                           ' 228      PowerDisplay.dbc, new in 3.1
  364.         Dim EffectBonusMultiplier1 As Single
  365.         Dim EffectBonusMultiplier2 As Single
  366.         Dim EffectBonusMultiplier3 As Single ' 229-231  3.2.0
  367.         Dim spellDescriptionVariableID As UInt32                  ' 232      3.2.0
  368.         Dim SpellDifficultyId As UInt32                    ' 233      3.3.0
  369.     End Sub
  370. End Class
  371.  
  372. Structure SpellRecord
  373.     Dim Id As UInt32                                             ' 0        m_ID
  374.     Dim Category As UInt32                                       ' 1        m_category
  375.     Dim Dispel As UInt32                                        ' 2        m_dispelType
  376.     Dim Mechanic As UInt32                                   ' 3        m_mechanic
  377.     Dim Attributes As UInt32                                   ' 4        m_attribute
  378.     Dim AttributesEx As UInt32                              ' 5        m_attributesEx
  379.     Dim AttributesEx2 As UInt32                             ' 6        m_attributesExB
  380.     Dim AttributesEx3 As UInt32                           ' 7        m_attributesExC
  381.     Dim AttributesEx4 As UInt32                            ' 8        m_attributesExD
  382.     Dim AttributesEx5 As UInt32                             ' 9        m_attributesExE
  383.     Dim AttributesEx6 As UInt32                            ' 10       m_attributesExF
  384.     Dim AttributesEx7 As UInt32                             ' 11       3.2.0 (0x20 - totems, 0x4 - paladin auras, etc...) --- Even more attributes needed, thanks MrLama for this
  385.     Dim Stances As UInt32                               ' 12       m_shapeshiftMask
  386.     Dim unk_320_2 As UInt32                             ' 13       3.2.0
  387.     Dim StancesNot As UInt32                              ' 14       m_shapeshiftExclude
  388.     Dim unk_320_3 As UInt32                              ' 15       3.2.0
  389.     Dim Targets As UInt32                             ' 16       m_targets
  390.     Dim TargetCreatureType As UInt32                         ' 17       m_targetCreatureType
  391.     Dim RequiresSpellFocus As UInt32                       ' 18       m_requiresSpellFocus
  392.     Dim FacingCasterFlags As UInt32                        ' 19       m_facingCasterFlags
  393.     Dim CasterAuraState As UInt32                        ' 20       m_casterAuraState
  394.     Dim TargetAuraState As UInt32                         ' 21       m_targetAuraState
  395.     Dim CasterAuraStateNot As UInt32                      ' 22       m_excludeCasterAuraState
  396.     Dim TargetAuraStateNot As UInt32                        ' 23       m_excludeTargetAuraState
  397.     Dim casterAuraSpell As UInt32                         ' 24       m_casterAuraSpell
  398.     Dim targetAuraSpell As UInt32                      ' 25       m_targetAuraSpell
  399.     Dim excludeCasterAuraSpell As UInt32                      ' 26       m_excludeCasterAuraSpell
  400.     Dim excludeTargetAuraSpell As UInt32                     ' 27       m_excludeTargetAuraSpell
  401.     Dim CastingTimeIndex As UInt32                     ' 28       m_castingTimeIndex
  402.     Dim RecoveryTime As UInt32                     ' 29       m_recoveryTime
  403.     Dim CategoryRecoveryTime As UInt32                      ' 30       m_categoryRecoveryTime
  404.     Dim InterruptFlags As UInt32                        ' 31       m_interruptFlags
  405.     Dim AuraInterruptFlags As UInt32                          ' 32       m_auraInterruptFlags
  406.     Dim ChannelInterruptFlags As UInt32                          ' 33       m_channelInterruptFlags
  407.     Dim procFlags As UInt32                           ' 34       m_procTypeMask
  408.     Dim procChance As UInt32                           ' 35       m_procChance
  409.     Dim procCharges As UInt32                      ' 36       m_procCharges
  410.     Dim maxLevel As UInt32                          ' 37       m_maxLevel
  411.     Dim baseLevel As UInt32                          ' 38       m_baseLevel
  412.     Dim spellLevel As UInt32                           ' 39       m_spellLevel
  413.     Dim DurationIndex As UInt32                         ' 40       m_durationIndex
  414.     Dim powerType As UInt32                           ' 41       m_powerType
  415.     Dim manaCost As UInt32                           ' 42       m_manaCost
  416.     Dim manaCostPerlevel As UInt32                        ' 43       m_manaCostPerLevel
  417.     Dim manaPerSecond As UInt32                        ' 44       m_manaPerSecond
  418.     Dim manaPerSecondPerLevel As UInt32                        ' 45       m_manaPerSecondPerLeve
  419.     Dim rangeIndex As UInt32                         ' 46       m_rangeIndex
  420.     Dim speed As Single                                        ' 47       m_speed
  421.     Dim modalNextSpell As UInt32                              ' 48       m_modalNextSpell
  422.     Dim StackAmount As UInt32                              ' 49       m_cumulativeAura
  423.     Dim Totem1 As UInt32
  424.     Dim Totem2 As UInt32  ' 50-51    m_totem
  425.     Dim Reagent1 As Int32
  426.     Dim Reagent2 As Int32
  427.     Dim Reagent3 As Int32
  428.     Dim Reagent4 As Int32
  429.     Dim Reagent5 As Int32
  430.     Dim Reagent6 As Int32
  431.     Dim Reagent7 As Int32
  432.     Dim Reagent8 As Int32  ' 52-59    m_reagent
  433.     Dim ReagentCount1 As UInt32
  434.     Dim ReagentCount2 As UInt32
  435.     Dim ReagentCount3 As UInt32
  436.     Dim ReagentCount4 As UInt32
  437.     Dim ReagentCount5 As UInt32
  438.     Dim ReagentCount6 As UInt32
  439.     Dim ReagentCount7 As UInt32
  440.     Dim ReagentCount8 As UInt32 ' 60-67    m_reagentCount
  441.     Dim EquippedItemClass As Int32                         ' 68       m_equippedItemClass (value)
  442.     Dim EquippedItemSubClassMask As Int32                ' 69       m_equippedItemSubclass (mask)
  443.     Dim EquippedItemInventoryTypeMask As Int32               ' 70       m_equippedItemInvTypes (mask)
  444.     Dim Effect1 As UInt32
  445.     Dim Effect2 As UInt32
  446.     Dim Effect3 As UInt32 ' 71-73    m_effect
  447.     Dim EffectDieSides1 As Int32
  448.     Dim EffectDieSides2 As Int32
  449.     Dim EffectDieSides3 As Int32 ' 74-76    m_effectDieSides
  450.     Dim EffectRealPointsPerLevel1 As Single
  451.     Dim EffectRealPointsPerLevel2 As Single
  452.     Dim EffectRealPointsPerLevel3 As Single ' 77-79    m_effectRealPointsPerLevel
  453.     Dim EffectBasePoints1 As Int32
  454.     Dim EffectBasePoints2 As Int32
  455.     Dim EffectBasePoints3 As Int32  ' 80-82    m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
  456.     Dim EffectMechanic1 As UInt32
  457.     Dim EffectMechanic2 As UInt32
  458.     Dim EffectMechanic3 As UInt32 ' 83-85    m_effectMechanic
  459.     Dim EffectImplicitTargetA1 As UInt32
  460.     Dim EffectImplicitTargetA2 As UInt32
  461.     Dim EffectImplicitTargetA3 As UInt32  ' 86-88    m_implicitTargetA
  462.     Dim EffectImplicitTargetB1 As UInt32
  463.     Dim EffectImplicitTargetB2 As UInt32
  464.     Dim EffectImplicitTargetB3 As UInt32  ' 89-91    m_implicitTargetB
  465.     Dim EffectRadiusIndex1 As UInt32
  466.     Dim EffectRadiusIndex2 As UInt32
  467.     Dim EffectRadiusIndex3 As UInt32    ' 92-94    m_effectRadiusIndex - spellradius.dbc
  468.     Dim EffectApplyAuraName1 As UInt32
  469.     Dim EffectApplyAuraName2 As UInt32
  470.     Dim EffectApplyAuraName3 As UInt32 ' 95-97    m_effectAura
  471.     Dim EffectAmplitude1 As UInt32
  472.     Dim EffectAmplitude2 As UInt32
  473.     Dim EffectAmplitude3 As UInt32 ' 98-100   m_effectAuraPeriod
  474.     Dim EffectMultipleValue1 As Single
  475.     Dim EffectMultipleValue2 As Single
  476.     Dim EffectMultipleValue3 As Single ' 101-103  m_effectAmplitude
  477.     Dim EffectChainTarget1 As UInt32
  478.     Dim EffectChainTarget2 As UInt32
  479.     Dim EffectChainTarget3 As UInt32  ' 104-106  m_effectChainTargets
  480.     Dim EffectItemType1 As UInt32
  481.     Dim EffectItemType2 As UInt32
  482.     Dim EffectItemType3 As UInt32 ' 107-109  m_effectItemType
  483.     Dim EffectMiscValue1 As Int32
  484.     Dim EffectMiscValue2 As Int32
  485.     Dim EffectMiscValue3 As Int32 ' 110-112  m_effectMiscValue
  486.     Dim EffectMiscValueB1 As Int32
  487.     Dim EffectMiscValueB2 As Int32
  488.     Dim EffectMiscValueB3 As Int32  ' 113-115  m_effectMiscValueB
  489.     Dim EffectTriggerSpell1 As UInt32
  490.     Dim EffectTriggerSpell2 As UInt32
  491.     Dim EffectTriggerSpell3 As UInt32 ' 116-118  m_effectTriggerSpell
  492.     Dim EffectPointsPerComboPoint1 As Single
  493.     Dim EffectPointsPerComboPoint2 As Single
  494.     Dim EffectPointsPerComboPoint3 As Single ' 119-121  m_effectPointsPerCombo
  495.     Dim EffectSpellClassMaskA1 As UInt32
  496.     Dim EffectSpellClassMaskA2 As UInt32
  497.     Dim EffectSpellClassMaskA3 As UInt32 ' 122-124  m_effectSpellClassMaskA, effect 0
  498.     Dim EffectSpellClassMaskB1 As UInt32
  499.     Dim EffectSpellClassMaskB2 As UInt32
  500.     Dim EffectSpellClassMaskB3 As UInt32  ' 125-127  m_effectSpellClassMaskB, effect 1
  501.     Dim EffectSpellClassMaskC1 As UInt32
  502.     Dim EffectSpellClassMaskC2 As UInt32
  503.     Dim EffectSpellClassMaskC3 As UInt32 ' 128-130  m_effectSpellClassMaskC, effect 2
  504.     Dim SpellVisual1 As UInt32
  505.     Dim SpellVisual2 As UInt32 ' 131-132  m_spellVisualID
  506.     Dim SpellIconID As UInt32                                   ' 133      m_spellIconID
  507.     Dim activeIconID As UInt32                                  ' 134      m_activeIconID
  508.     Dim spellPriority As UInt32                                 ' 135      m_spellPriority    
  509.     <VBFixedString(16)> Dim SpellName As String                                  ' 136-151  m_name_lang
  510.     Dim SpellNameFlag As UInt32                                ' 152
  511.     <VBFixedString(16)> Dim Rank As String                                       ' 153-168  m_nameSubtext_lang
  512.     Dim RankFlags As UInt32                                  ' 169
  513.     <VBFixedString(16)> Dim Description As String                            ' 170-185  m_description_lang
  514.     Dim DescriptionFlags As UInt32                              ' 186
  515.     <VBFixedString(16)> Dim ToolTip As String                               ' 187-202  m_auraDescription_lang
  516.     Dim ToolTipFlags As UInt32                               ' 203
  517.     Dim ManaCostPercentage As UInt32                            ' 204      m_manaCostPct
  518.     Dim StartRecoveryCategory As UInt32                        ' 205      m_startRecoveryCategory
  519.     Dim StartRecoveryTime As UInt32                           ' 206      m_startRecoveryTime
  520.     Dim MaxTargetLevel As UInt32                            ' 207      m_maxTargetLevel
  521.     Dim SpellFamilyName As UInt32                           ' 208      m_spellClassSet
  522.     Dim SpellFamilyFlags As UInt64                              ' 209-210  m_spellClassMask NOTE: size is 12 bytes!!!
  523.     Dim SpellFamilyFlags2 As UInt32                        ' 211      addition to m_spellClassMask
  524.     Dim MaxAffectedTargets As UInt32                        ' 212      m_maxTargets
  525.     Dim DmgClass As UInt32                        ' 213      m_defenseType
  526.     Dim PreventionType As UInt32                          ' 214      m_preventionType
  527.     Dim StanceBarOrder As UInt32                         ' 215      m_stanceBarOrder
  528.     Dim DmgMultiplier1 As Single
  529.     Dim DmgMultiplier2 As Single
  530.     Dim DmgMultiplier3 As Single ' 216-218  m_effectChainAmplitude
  531.     Dim MinFactionId As UInt32                              ' 219      m_minFactionID
  532.     Dim MinReputation As UInt32                              ' 220      m_minReputation
  533.     Dim RequiredAuraVision As UInt32                           ' 221      m_requiredAuraVision
  534.     Dim TotemCategory1 As UInt32
  535.     Dim TotemCategory2 As UInt32 ' 222-223  m_requiredTotemCategoryID
  536.     Dim AreaGroupId As Int32                             ' 224      m_requiredAreaGroupId
  537.     Dim SchoolMask As UInt32                              ' 225      m_schoolMask
  538.     Dim runeCostID As UInt32                              ' 226      m_runeCostID
  539.     Dim spellMissileID As UInt32                             ' 227      m_spellMissileID
  540.     Dim PowerDisplayId As UInt32                           ' 228      PowerDisplay.dbc, new in 3.1
  541.     Dim EffectBonusMultiplier1 As Single
  542.     Dim EffectBonusMultiplier2 As Single
  543.     Dim EffectBonusMultiplier3 As Single ' 229-231  3.2.0
  544.     Dim spellDescriptionVariableID As UInt32                  ' 232      3.2.0
  545.     Dim SpellDifficultyId As UInt32                    ' 233      3.3.0
  546. End Structure
Advertisement
Add Comment
Please, Sign In to add comment