API GetSpecializationMasterySpells

Returns the mastery spellID of the current player's specializiation. spellID = GetSpecializationMasterySpells(specIndex [, isInspect, isPet])

Arguments

 * specIndex: Integer - The index of the specialization to query (1, 2, 3, 4) (Druids have four specializations)
 * isInspect: Boolean - (Optional) Reserved. Must be nil
 * isPet: Boolean - (Optional) Reserved. Must be nil

Returns

 * masterySpell : Number - The Mastery spellID corresponding to one of the current player's specializations
 * masterySpell2 : Number - The Mastery spellID corresponding to one of the current player's specializations

Example return values for different classes:

Details
For any type of data tracking, use the second parameter, since it is guaranteed to stay the same in different-language clients. This is especially important in Europe, where it is not uncommon for people with e.g. german or french client software to play on english servers. You can keep track of mappings for display by remembering the output pairs in a table, e.g.:

local mySpecializationIndex = GetSpecialization; --e.g. 1: Brewmaster local myMasterySpellID; if (mySpecializationIndex) then myMasterySpellID = GetSpecializationMasterySpells(mySpecializationIndex); else myMasterySpellID = nil; end;

or we can store all the current player's mastery spells:

local playerMasterySpells = { GetSpecializationMasterySpells(1), --e.g. Brewmaster GetSpecializationMasterySpells(2), --e.g. Mistweaver GetSpecializationMasterySpells(3), --e.g. Windwalker )