WoW:API UnitCreatureFamily: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Jump() is actually removed, replace example)
Line 1: Line 1:
<center>'''UnitCreatureFamily''' ''-Documentation by [[User:Boro|Boro]]-''</center>
{{wowapi}} __NOTOC__
 
Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"), or nil if the unit does not have a creature family (e.g. because it is not a creature).
Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"), or nil if the unit does not have a creature family (e.g. because it is not a creature).
creatureFamily = UnitCreatureFamily(unit);


local creatureFamily = UnitCreatureFamily(unit);
==Parameters==
 
===Arguments===
----
:;unit : [[UnitId]] - unit you wish to query.
;''Arguments''
===Returns===
 
:;creatureFamily : String - name of the creature family (e.g., "Crab" or "Wolf")
:(String unit)
 
:;unit : the unit name (e.g., "target", "mouseover")
 
----
;''Returns''
 
:creatureFamily
:;creatureFamily : a string representing the creature family (e.g., "Crab" or "Wolf")
 
----
;''Example''
  if ( UnitCreatureFamily("target") == "Bear" ) then
    Jump(); -- jump for joy because you found Pooh bear
  end
 
;''Result''
If the target is a bear, then you jump.
 
----
;''Description''
 
: Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"), or nil if the unit does not have a creature family (e.g. because it is not a creature).


----
==Example==
{{WoW API}}
if ( UnitCreatureFamily("target") == "Bear" ) then
  message("It's a godless killing machine! Run for your lives!");
end
===Result===
Displays a message if the target is a type of bear.

Revision as of 20:00, 23 December 2006

WoW API < UnitCreatureFamily

Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"), or nil if the unit does not have a creature family (e.g. because it is not a creature).

creatureFamily = UnitCreatureFamily(unit);

Parameters

Arguments

unit
UnitId - unit you wish to query.

Returns

creatureFamily
String - name of the creature family (e.g., "Crab" or "Wolf")

Example

if ( UnitCreatureFamily("target") == "Bear" ) then
 message("It's a godless killing machine! Run for your lives!");
end

Result

Displays a message if the target is a type of bear.