WoW:API UnitClassification: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(→‎Returns: Snake Trap Snakes are "trivial")
(boilerplate)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{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"


== Parameters ==
== Returns ==
=== Arguments ===
;classification : String - the unit's classification: "worldboss", "rareelite", "elite", "rare", "normal" or "trivial"
 
:;unit : the [[unitId]] to query, e.g. "target"
 
=== Returns ===
 
:;classification : String - the unit's classification: "worldboss", "rareelite", "elite", "rare", "normal" or "trivial"


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


  if ( UnitClassification("target") == "worldboss" ) then
<big>'''Result'''</big>
    -- 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.
: 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.

Revision as of 14:44, 11 March 2010

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" or "trivial"

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.