WoW:API UnitClassification: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Formatting mostly)
Line 1: Line 1:
<center>'''UnitClassification''' ''-Documentation by [[User:Danboo|danboo]]-''</center>
{{wowapi}} __NOTOC__


Returns the classification of the specified unit (e.g., "elite" or "worldboss").
Returns the classification of the specified unit (e.g., "elite" or "worldboss").
Line 5: Line 5:
  local classification = UnitClassification(unit);
  local classification = UnitClassification(unit);


----
== Parameters ==
;''Arguments''
=== Arguments ===


:[[API_TYPE_UnitId|UnitID]]
:;unit : the [[unitId]] to query, e.g. "target"


:;unit : the unit name (e.g., "target")
=== Returns ===


----
:;classification : String - the unit's classification: "worldboss", "rareelite", "elite", "rare" or "normal"
;''Returns''


:classification
== Example ==
:;classification : a string representing the classification ("worldboss", "rareelite", "elite", "rare" or "normal")


----
;''Example''
   if ( UnitClassification("target") == "worldboss" ) then
   if ( UnitClassification("target") == "worldboss" ) then
     -- If unit is a world boss show skull regardless of level
     -- If unit is a world boss show skull regardless of level
Line 26: Line 22:
   end
   end


;''Result''
=== Result ===
If the target is a world boss, then the level isn't shown in the target frame, instead a special high level texture is shown.
: If the target is a world boss, then the level isn't shown in the target frame, instead a special high level texture is shown.
 
----
;''Description''
 
: Returns the classification of the specified unit (e.g., "elite" or "worldboss").
 
----
{{WoW API}}

Revision as of 09:29, 11 August 2006

WoW API < UnitClassification

Returns the classification of the specified unit (e.g., "elite" or "worldboss").

local classification = UnitClassification(unit);

Parameters

Arguments

unit
the unitId to query, e.g. "target"

Returns

classification
String - the unit's classification: "worldboss", "rareelite", "elite", "rare" or "normal"

Example

 if ( UnitClassification("target") == "worldboss" ) then
   -- If unit is a world boss show skull regardless of level
   TargetLevelText:Hide();
   TargetHighLevelTexture:Show();
  end

Result

If the target is a world boss, then the level isn't shown in the target frame, instead a special high level texture is shown.