UnitClass

From Wowpedia
(Redirected from API UnitClassBase)
Jump to: navigation, search

Two functions provide the class of a specified unit:

  • UnitClass() provides three returns including a localized className
  • UnitClassBase() provides only two non-localized returns
className, classFilename, classId = UnitClass(unitId)
classFilename, classId = UnitClassBase(unitId)

Arguments

unitId 
string - The UnitId of the unit to check (e.g. "player" or "target")

Returns

className 
string - Localized class name, suitable for use in user interfaces; e.g. "Mage", "Warrior", "Guerrier".
classFilename 
string - Localization-independent class name, used as some table keys; e.g. "MAGE", "WARRIOR", "DEATHKNIGHT".
classId 
number - Numeric localization-independent classId.
ID className (enUS) classFile
1
Warrior WARRIOR
2
Paladin PALADIN
3
Hunter HUNTER
4
Rogue ROGUE
5
Priest PRIEST
6
Death Knight DEATHKNIGHT
7
Shaman SHAMAN
8
Mage MAGE
9
Warlock WARLOCK
10
Monk MONK
11
Druid DRUID
12
Demon Hunter DEMONHUNTER

Example

/dump UnitClass("target")

Possible return: "Mage", "MAGE", 8

Patch history

See also

External Links

UnitClass()
UnitClassBase()
 

References

 
  1. ^ 2008-03-25, Blizzard_RaidUI.lua, version 2.4.0.8089, near line 59, archived at Townlong-Yak