WoW:API UnitCreatureFamily: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Move page script moved page API UnitCreatureFamily to API UnitCreatureFamily without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
:;unit : [[UnitId]] - unit you wish to query.
:;unit : [[UnitId]] - unit you wish to query.
===Returns===
===Returns===
:;creatureFamily : String - localized name of the creature family (e.g., "Crab" or "Wolf")
;creatureFamily : String - localized name of the creature family (e.g., "Crab" or "Wolf"). Possible English values are:
:possible English values are:
{| style="margin-left: 3em; margin-top: 0;" cellspacing="0" cellpadding="0"
::
| style="padding-right: 2em"|<poem>Bat
    * Bat
Bear
    * Bear
Bird of Prey
    * Bird of Prey
Boar
    * Boar
Carrion Bird
    * Carrion Bird
Cat
    * Cat
Chimaera
    * Chimaera
Core Hound</poem>
    * Core Hound
| style="padding-right: 2em"|<poem>Crab
    * Crab
Crocolisk
    * Crocolisk
Devilsaur
    * Devilsaur
Doomguard
    * Doomguard
Dragonhawk
    * Dragonhawk
Felguard
    * Felguard
Felhunter
    * Felhunter
Ghoul</poem>
    * Ghoul
| style="padding-right: 2em"|<poem>Gorilla
    * Gorilla
Hyena
    * Hyena
Imp
    * Imp
Moth
    * Moth
Nether Ray
    * Nether Ray
Raptor
    * Raptor
Ravager
    * Ravager
Remote Control</poem>
    * Remote Control
| style="padding-right: 2em"|<poem>Rhino
    * Rhino
Scorpid
    * Scorpid
Serpent
    * Serpent
Silithid
    * Silithid
Spider
    * Spider
Spirit Beast
    * Spirit Beast
Sporebat
    * Sporebat
Succubus</poem>
    * Succubus
| style="padding-right: 2em"|<poem>Tallstrider
    * Tallstrider
Turtle
    * Turtle
Voidwalker
    * Voidwalker
Warp Stalker
    * Warp Stalker
Wasp
    * Wasp
Wind Serpent
    * Wind Serpent
Wolf
    * Wolf
Worm</poem>
    * Worm
|}


==Example==
==Example==

Latest revision as of 04:47, 15 August 2023

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[edit]

Arguments[edit]

unit
UnitId - unit you wish to query.

Returns[edit]

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[edit]

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

Result[edit]

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