Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
mNo edit summary
(→‎Returns: arrange list in a table: space constraints)
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
{{wowapi}} __NOTOC__
<center>'''UnitCreatureFamily''' ''-Documentation by [[User:Boro|Boro]]-''</center>
 
 
 
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);
   
  +
==Parameters==
local creatureFamily = UnitCreatureFamily(unit);
 
 
===Arguments===
 
  +
:;unit : [[UnitId]] - unit you wish to query.
----
 
 
===Returns===
;''Arguments''
 
 
;creatureFamily : String - localized name of the creature family (e.g., "Crab" or "Wolf"). Possible English values are:
 
  +
{| style="margin-left: 3em; margin-top: 0;" cellspacing="0" cellpadding="0"
:(String unit)
 
  +
| style="padding-right: 2em"|<poem>Bat
 
  +
Bear
:;unit : the unit name (e.g., "target", "mouseover")
 
  +
Bird of Prey
 
  +
Boar
----
 
  +
Carrion Bird
;''Returns''
 
  +
Cat
 
  +
Chimaera
:creatureFamily
 
  +
Core Hound</poem>
:;creatureFamily : a string representing the creature family (e.g., "Crab" or "Wolf")
 
  +
| style="padding-right: 2em"|<poem>Crab
 
  +
Crocolisk
----
 
  +
Devilsaur
;''Example''
 
  +
Doomguard
if ( UnitCreatureFamily("target") == "Bear" ) then
 
  +
Dragonhawk
Jump(); -- jump for joy because you found Pooh bear
 
  +
Felguard
end
 
  +
Felhunter
 
  +
Ghoul</poem>
;''Result''
 
  +
| style="padding-right: 2em"|<poem>Gorilla
If the target is a bear, then you jump.
 
  +
Hyena
 
  +
Imp
----
 
  +
Moth
;''Description''
 
  +
Nether Ray
 
  +
Raptor
: 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).
 
  +
Ravager
  +
Remote Control</poem>
  +
| style="padding-right: 2em"|<poem>Rhino
  +
Scorpid
  +
Serpent
  +
Silithid
  +
Spider
  +
Spirit Beast
  +
Sporebat
  +
Succubus</poem>
  +
| style="padding-right: 2em"|<poem>Tallstrider
  +
Turtle
  +
Voidwalker
  +
Warp Stalker
  +
Wasp
  +
Wind Serpent
  +
Wolf
  +
Worm</poem>
  +
|}
   
 
==Example==
----
 
 
if ( UnitCreatureFamily("target") == "Bear" ) then
{{Template:WoW API}}
 
  +
message("It's a godless killing machine! Run for your lives!");
[[Category:API Functions|UnitCreatureFamily]]
 
 
end
[[Category:API Unit Functions|UnitCreatureFamily]]
 
 
===Result===
  +
Displays a message if the target is a type of bear.

Revision as of 14:47, 5 April 2009

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 - localized name of the creature family (e.g., "Crab" or "Wolf"). Possible English values are:

Bat
Bear
Bird of Prey
Boar
Carrion Bird
Cat
Chimaera
Core Hound

Crab
Crocolisk
Devilsaur
Doomguard
Dragonhawk
Felguard
Felhunter
Ghoul

Gorilla
Hyena
Imp
Moth
Nether Ray
Raptor
Ravager
Remote Control

Rhino
Scorpid
Serpent
Silithid
Spider
Spirit Beast
Sporebat
Succubus

Tallstrider
Turtle
Voidwalker
Warp Stalker
Wasp
Wind Serpent
Wolf
Worm

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.