GetInstanceInfo

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 3.1.0 / 1.13.2

Returns info for the map instance the character is currently in.

name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceID, instanceGroupSize, LfgDungeonID = GetInstanceInfo()

Returns

1. name
string - The localized name of the instance—otherwise, the continent name (e.g., Eastern Kingdoms, Kalimdor, Outland, Northrend, Pandaria).
2. instanceType
string - "none" if the player is not in an instance, "scenario" for scenarios, "party" for dungeons, "raid" for raids, "arena" for arenas, and "pvp" for battlegrounds. Many of the following return values will be nil or otherwise useless in the case of "none".
3. difficultyID
number - The DifficultyID of the instance. Will return 0 while not in an instance.
4. difficultyName
string - The localized name for the instance's difficulty ("10 Player", "25 Player (Heroic)", etc.).
5. maxPlayers
number - Maximum number of players permitted within the instance at the same time.
6. dynamicDifficulty
number - The difficulty of dynamic enabled instances. This no longer appears to be used.
7. isDynamic
boolean - If the instance difficulty can be changed while zoned in. This is true for most raids after and including Icecrown Citadel.
8. instanceID
number - The InstanceID for the instance or continent.
9. instanceGroupSize
number - The number of players within your instance group.
10. LfgDungeonID
number - The LfgDungeonID for the current instance group, nil if not in a dungeon finder group.

Details

Related API C_Map.GetBestMapForUnit

Patch changes

Battle for Azeroth Patch 8.0.1 (2018-07-17): Now returns a LfgDungeonID, in addition to the previous returns. (Unsure when this was added, guessing 8.0.1 but could have been way earlier.)
Mists of Pandaria Patch 5.4.0 (2013-09-10): Now returns an instanceGroupSize. Also added a new possible difficultyID (14) for Flexible Raids.
Mists of Pandaria Patch 5.0.4 (2012-08-28):

  • Now returns a mapID, allowing addons to identify the current instance/continent without relying on localized names.
  • dynamicDifficulty now always returns 0, while difficultyID is updated to reflect the selected dynamic difficulty (previously, dynamicDifficulty reflected the normal/heroic switch and difficultyID the 10/25 player switch for dynamic instances).

Wrath-Logo-Small.png Patch 3.3.0 (2009-12-08): Additional return values were added.
Wrath-Logo-Small.png Patch 3.2.0 (2009-08-04): Added.