WoW:API UnitClassification: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API UnitClassification to API UnitClassification without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
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").
classification = UnitClassification(unit);


local classification = UnitClassification(unit);
== Arguments ==
 
;unit : [[unitId]] - the unit to query, e.g. "target"
----
;''Arguments''
 
:(String unit)
 
:;unit : the unit name (e.g., "target")
 
----
;''Returns''
 
:classification
:;classification : a string representing the 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.


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


: Returns the classification of the specified unit (e.g., "elite" or "worldboss").
== Example ==
if ( UnitClassification("target") == "worldboss" ) then
  -- If unit is a world boss show skull regardless of level
  TargetLevelText:Hide();
  TargetHighLevelTexture:Show();
end


----
<big>'''Result'''</big>
{{WoW API}}
: 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.

Latest revision as of 04:47, 15 August 2023

WoW API < UnitClassification

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

classification = UnitClassification(unit);

Arguments[edit]

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

Returns[edit]

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

Example[edit]

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.