Wowpedia

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

READ MORE

Wowpedia
mNo edit summary
mNo edit summary
Line 1: Line 1:
 
{{wowapi}} __NOTOC__
 
{{wowapi}} __NOTOC__
Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"). Only works on Beasts, since the family's only function is to determine what abilities the unit will have if a hunter tames it. Returns nil if the creature isn't a Beast or doesn't belong to a family that includes a tameable creature.
+
Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"). Only works on Beasts, since the family's only function is to determine what abilities the unit will have if a hunter tames it; however, works on most currently untameable Beasts for reasons of backward and forward compatibility. Returns nil if the creature isn't a Beast or doesn't belong to a family that includes a tameable creature.
 
creatureFamily = UnitCreatureFamily(unit);
 
creatureFamily = UnitCreatureFamily(unit);
   

Revision as of 14:14, 13 August 2011

Returns the creature family of the specified unit (e.g., "Crab" or "Wolf"). Only works on Beasts, since the family's only function is to determine what abilities the unit will have if a hunter tames it; however, works on most currently untameable Beasts for reasons of backward and forward compatibility. Returns nil if the creature isn't a Beast or doesn't belong to a family that includes a tameable 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.