Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API GetCompanionInfo

From Wowpedia
Jump to: navigation, search

Returns information about the companions you have.

creatureID, creatureName, creatureSpellID, icon, issummoned, mountType = GetCompanionInfo("type", id)

Arguments

type 
String - Companion type to query: "CRITTER" or "MOUNT".
id 
Number - Index of the slot to query. Starting at 1 and going up to GetNumCompanions("type").

Returns

creatureID
Number - The NPC ID of the companion.
creatureName
String - The name of the companion.
creatureSpellID
Number - The spell ID to cast the companion. This is not passed to CallCompanion, but can be used with, e.g., GetSpellInfo.
icon
String - The texture of the icon for the companion.
issummoned
Flag - 1 if the companion is summoned, nil if it's not.
mountType
Number - Bitfield for air/ground/water mounts
0x1: Ground
0x2: Can fly
0x4: ? (set for most mounts)
0x8: Underwater
0x10: Can jump (turtles cannot)

Notes

  • The indices are unstable: you may not rely on the ("type", id) mapping to the same companion after an arbitrary amount of time, even if the player does not learn/unlearn any companions during the period.
  • Generally, the indices are ordered alphabetically, though this order may be violated during the initial loading process and upon zoning.

Patch changes

See also