Returns info about a follower assigned to a building. This will return information about the follower (if any) assigned to the building on the specified plot.

Note that this function takes a plot ID, not a building ID. To query for the follower at, say, the Enchanter's Study, one would have to first find the plot where the study is and then give that plot ID to this function.


See also _(API_CAT_GARRISON).

Signature:

name, level, quality, displayID, followerID, garrFollowerID, status, portraitIconID = C_Garrison.GetFollowerInfoForBuilding(plotID)

Arguments:

  • plotID - The ID of the plot to query (number)

Returns:

  • name - Follower name (string)
  • level - Follower level (number)
  • quality - Follower quality (number)
  • displayID - Display ID for the follower model (number)
  • followerID - Follower ID (seems to be unused? See below) (number)
  • garrFollowerID - Hexadecimal number (as a string), this seems to be the actual follower ID. (string)
  • status - Follower status (number)
  • portraitIconID - Portrait icon ID for the follower (number)

Examples:

-- Finds a level 2 barracks and prints out the name of the bodyguard assigned to it
local buildings = C_Garrison.GetBuildings()
for i = 1, #buildings do
  local buildingId = buildings[i].buildingID
  if buildingId == 27 then -- Level 2 Barracks
    local name = C_Garrison.GetFollowerInfoForBuilding(plot_id)
    print("The bodyguard currently assigned to barracks is " .. name or "<No Bodyguard>")
  end
end