WoW:API UnitCreatureFamily: Difference between revisions

m
Move page script moved page API UnitCreatureFamily to WoW:API UnitCreatureFamily without leaving a redirect
mNo edit summary
m (Move page script moved page API UnitCreatureFamily to WoW:API UnitCreatureFamily without leaving a redirect)
 
(4 intermediate revisions by 3 users not shown)
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 - localized name of the creature family (e.g., "Crab" or "Wolf"). Possible English values are:
:(String unit)
{| style="margin-left: 3em; margin-top: 0;" cellspacing="0" cellpadding="0"
 
| style="padding-right: 2em"|<poem>Bat
:;unit : the unit name (e.g., "target", "mouseover")
Bear
 
Bird of Prey
----
Boar
;''Returns''
Carrion Bird
 
Cat
:creatureFamily
Chimaera
:;creatureFamily : a string representing the creature family (e.g., "Crab" or "Wolf")
Core Hound</poem>
 
| style="padding-right: 2em"|<poem>Crab
----
Crocolisk
;''Example''
Devilsaur
  if ( UnitCreatureFamily("target") == "Bear" ) then
Doomguard
    Jump(); -- jump for joy because you found Pooh bear
Dragonhawk
  end
Felguard
 
Felhunter
;''Result''
Ghoul</poem>
If the target is a bear, then you jump.
| style="padding-right: 2em"|<poem>Gorilla
 
Hyena
----
Imp
;''Description''
Moth
 
Nether Ray
: 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).
Raptor
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==
{{Template:WoW API}}
if ( UnitCreatureFamily("target") == "Bear" ) then
[[Category:API Functions|UnitCreatureFamily]]
  message("It's a godless killing machine! Run for your lives!");
[[Category:API Unit Functions|UnitCreatureFamily]]
end
===Result===
Displays a message if the target is a type of bear.
Anonymous user