WoW:API UnitClassification: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(boilerplate)
No edit summary
Line 7: Line 7:


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


== Example ==
== Example ==

Revision as of 11:18, 12 December 2012

WoW API < UnitClassification

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

classification = UnitClassification(unit);

Arguments

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

Returns

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

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.