Do it like WoW does it.
I haven't gotten around to rewriting my DBC manager to account for the 4.0 changes, so have some gay, unmaintainable, filler code:
(Pretty much straight from IDA/HexRays, variable naming is not to be taken as facts, addresses are from base 0x00401000)
Code:
UInt32 WowSpellDatabase = *(UInt32*)Core.Addresses.ConformPointer(0x00B99294);
UInt32 WowSpellDatabaseMin = *(UInt32*)Core.Addresses.ConformPointer(0x00B99288);
if (spellId != 0)
{
UInt32 pSpellRecord = *(UInt32*)(WowSpellDatabase + 4 * (spellId - WowSpellDatabaseMin));
if (pSpellRecord != 0)
{
Int32 rowIndex1 = *(Int32*)(pSpellRecord + 136);
if (rowIndex1 != 0)
{
UInt32 pRow1 = dlgGetRow(Core.Addresses.ConformPointer(0x00B98F6C), rowIndex1);
if (pRow1 != 0)
{
Int32 rowIndex2 = *(Int32*)(pRow1 + 12);
if (rowIndex2 != 0)
{
UInt32 pRow2 = dlgGetRow(Core.Addresses.ConformPointer(0x00B99030), rowIndex2);
if (pRow2 != 0)
{
SpellType = Memory.Read<String>(pRow2 + 16, 0);
}
}
}
}
}
}