Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
This API is deprecated in retail, see: |
Returns info for a companion.
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
- boolean - 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)
Details[]
- 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[]
Patch 7.0.3 (2016-07-19): Deprecated (possibly earlier) in favor of C_MountJournal.GetMountInfoByID.
Patch 5.0.4 (2012-08-28): Companions are now account-wide. This function only returns information about non-combat companions (battle pets) your character had acquired before the account-wide merge, as well as all mounts. For information about battle pets, use the C_PetJournal API.
Patch 3.0.2 (2008-10-14): Added.