- 0 Talk
-
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 | Crab | Gorilla | Rhino | Tallstrider |
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.