WoW:API UnitCreatureFamily: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Jump() is actually removed, replace example)
Line 7: Line 7:
:;unit : [[UnitId]] - unit you wish to query.
:;unit : [[UnitId]] - unit you wish to query.
===Returns===
===Returns===
:;creatureFamily : String - 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:
::
    * 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==
==Example==

Revision as of 14:13, 5 April 2009

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

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.