WoW API type: TitleId

From AddOn Studio
Revision as of 20:36, 10 July 2008 by WoWWiki>Mundocani (New page to describe titleIDs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Warning: Display title "WoW API type: TitleId" overrides earlier display title "titleID".API types

titleID API Type (Number)

titleIDs are used for retrieving and setting the player's displayed title, e.g. "Champion of the Naaru" or "Private"

They are indices from 1 to GetNumTitles().

The titleIDs as of July 10, 2008 are

1: Private
2: Corporal
3: Sergeant
4: Master Sergeant
5: Sergeant Major
6: Knight
7: Knight-Lieutenant
8: Knight-Captain
9: Knight-Champion
10: Lieutenant Commander
11: Commander
12: Marshal
13: Field Marshal
14: Grand Marshal
15: Scout
16: Grunt
17: Sergeant
18: Senior Sergeant
19: First Sergeant
20: Stone Guard
21: Blood Guard
22: Legionnaire
23: Centurion
24: Champion
25: Lieutenant General
26: General
27: Warlord
28: High Warlord
29: Gladiator
30: Duelist
31: Rival
32: Challenger
33: Scarab Lord
34: Conqueror
35: Justicar
36: Champion of the Naaru
37: Merciless Gladiator
38: of the Shattered Sun
39: Hand of A'dal
40: Vengeful Gladiator
41: nil

GetNumTitles returns 41, but GetTitleName returns nil for the 41st title.

Printing titleIDs for debug

This simple script code will iterate through the title IDs and display them in the default chat window

for i = 1, GetNumTitles() do
    DEFAULT_CHAT_FRAME:AddMessage(i.." "..(GetTitleName(i) or "nil"))
end