m
Move page script moved page API UnitClass to WoW:API UnitClass without leaving a redirect
(Formatting, another example) |
m (Move page script moved page API UnitClass to WoW:API UnitClass without leaving a redirect) |
||
| (5 intermediate revisions by 5 users not shown) | |||
| Line 3: | Line 3: | ||
Returns the class (Mage, Warrior, etc) of the specified unit. | Returns the class (Mage, Warrior, etc) of the specified unit. | ||
localizedClass, englishClass = UnitClass("unit"); | localizedClass, englishClass, classIndex = UnitClass("unit"); | ||
== Parameters == | == Parameters == | ||
=== Arguments === | === Arguments === | ||
:;unit: String - the [[unitId]] to query, e.g. "player" | :;unit | ||
:: String - the [[unitId]] to query, e.g. "player" | |||
=== Returns === | === Returns === | ||
:localizedClass, englishClass | :localizedClass, englishClass, classIndex | ||
:;localizedclass : The localized class of the specified unit as a string. | :;localizedclass | ||
:: The localized class of the specified unit as a string. e.g. "Mage", "Warrior", "Guerrier", etc. | |||
:;englishclass : The fully capitalized english class name, e.g. "MAGE", "WARRIOR", etc. | :;englishclass | ||
:: The fully capitalized english class name with no spaces, e.g. "MAGE", "WARRIOR", "DEATHKNIGHT", etc. | |||
:;classIndex | |||
:: the number index corresponding to the particular class that is returned. Number mapping is as follows: | |||
::None = 0 | |||
::Warrior = 1 | |||
::Paladin = 2 | |||
::Hunter = 3 | |||
::Rogue = 4 | |||
::Priest = 5 | |||
::DeathKnight = 6 | |||
::Shaman = 7 | |||
::Mage = 8 | |||
::Warlock = 9 | |||
::Monk = 10 | |||
::Druid = 11 | |||
::Demon Hunter = 12 | |||
== Example == | == Example == | ||
| Line 24: | Line 44: | ||
=== Result === | === Result === | ||
Prints the player's class to the chat frame, e.g. | Prints the player's class to the chat frame, e.g. | ||
Your player is a : Warrior; WARRIOR | Your player is a : Warrior; WARRIOR. | ||
== Details == | == Details == | ||