WoW:API UnitCreatureFamily: Difference between revisions

m
Move page script moved page API UnitCreatureFamily to WoW:API UnitCreatureFamily without leaving a redirect
(created)
 
m (Move page script moved page API UnitCreatureFamily to WoW:API UnitCreatureFamily without leaving a redirect)
 
(6 intermediate revisions by 5 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).
  creatureFamily = UnitCreatureFamily(unit);


Returns the creature family of the specified unit (e.g., "Crab" or "Wolf").
==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:
{| style="margin-left: 3em; margin-top: 0;" cellspacing="0" cellpadding="0"
| style="padding-right: 2em"|<poem>Bat
Bear
Bird of Prey
Boar
Carrion Bird
Cat
Chimaera
Core Hound</poem>
| style="padding-right: 2em"|<poem>Crab
Crocolisk
Devilsaur
Doomguard
Dragonhawk
Felguard
Felhunter
Ghoul</poem>
| style="padding-right: 2em"|<poem>Gorilla
Hyena
Imp
Moth
Nether Ray
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>
|}


local creatureFamily = UnitCreatureFamily(unit);
==Example==
 
if ( UnitCreatureFamily("target") == "Bear" ) then
----
  message("It's a godless killing machine! Run for your lives!");
;''Arguments''
end
 
===Result===
:(String unit)
Displays a message if the target is a type of bear.
 
:;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").
 
----
{{Template:WoW API}}
Anonymous user