LibTourist Classic Era API Reference

LibTourist Classic Era API Reference

  


Notes about Flight node data

 

Data is gathered by LibTouristClassicEra about flight nodes, using the C_TaxiMap interface. For each zone that has flight nodes, the node IDs have been stored in the library. At runtime, the C_TaxiMap interface is used to assign node data to these IDs in a lookup table.

Libtourist caches the MapTaxiNodeInfo objects from C_TaxiMap with two additional properties: 

structure TaxiMap.MapTaxiNodeInfo
        number nodeID              -- unique flight node ID
        table position                 -- position of the node on the Flight Master's map (no relation with the world map!)
        string name                    -- node name as displayed in game, includes zone name (mostly)
        string atlasName          -- atlas object type
        Enum.FlightPathFaction faction        -- 0 = Neutral, 1 = Horde, 2 = Alliance
        (optional) string textureKitPrefix    -- no clue what this is for
        string factionName      -- added by LibTouristClassic: "Neutral", "Horde" or "Alliance" (not localized)
        table zones                      -- added by LibTouristClassic: localized names of the zones in which the node resides*

*) some nodes, like those in major cities, are linked to the city (i.e. Orgrimmar) and the zone in which the city is located (i.e. Durotar). The majority however, has only one zone assigned.

The following API functions are available to access flight node data:

  • DoesZoneHaveFlightnodes(zone)
  • GetFlightnode(nodeID)
  • GetFlightnodeFactionColor(faction)
  • GetFlightnodeLookupTable()
  • IterateZoneFlightnodes(zone)
  • RefreshFlightNodeData() 

The C_TaxiMap interface is used by the game to populate the TaxiMap. There is no relation whatsoever with the World Map or its coordinate system. The relations between nodes and zones have been included in LibTourist manually, but the world map coordinates of the flight nodes are unfortunately not available. Also, there is no data available in C_TaxiMap on connections between flight nodes.


 

Alphabetical API Reference

 

Tourist:CalculateLevelColor(low, high, currentLevel)

- low: the lower bound of a level range (number)

- high: the upper bound of the level range (number)

- currentLevel: the player level for which to calculate the level color (number)

Returns an r, g and b value representing a color ranging from grey (too low) via green, yellow and orange to red (too high) depending on the player level within the given range. Returns white if no level is applicable, like in cities.

Note: this function can be used for all kinds level ranges, i.e. zone levels or fishing skills.

 

Tourist:DoesZoneHaveComplexes(zone)

- zone: zone name or uiMapID

Returns true if the zone is known and contains one or more complexes. A complex is a zone containing the entrances for multiple instances.

 

Tourist:DoesZoneHaveFlightnodes(zone)

- zone: zone name or uiMapID
Returns true if any flight nodes (available to the player character or not) have been assigned to the given zone.

See introduction to flight node data (above) for more information.
 

Tourist:DoesZoneHaveHerbs(zone)

- zone: zone name or uiMapID
Returns true if the zone contains herbs.

 

Tourist:DoesZoneHaveInstances(zone)

- zone: zone name or uiMapID

Returns true if the zone is known and contains one or more dungeon or raid instances.

 

Tourist:DoesZoneHaveMiningNodes(zone)

- zone: zone name or uiMapID
Returns true if there are any standard mining nodes in the zone.

 

Tourist:GetBestZoneCoordinate()

Returns x, y, localized zone name and uiMapID for the most suitable map for the player's current position, x and y are values between 0 and 1.

 

Tourist:GetComplex(zone)

- zone: name or uiMapID of an instance

Returns the localized name of the complex in which the instance resides, if any.

 

Tourist:GetComplexZone(complex)

- complex: name or uiMapID of a complex

Returns the localized name of the zone in which the given complex resides.

 

Tourist:GetContinent(zone)

- zone: zone name or uiMapID

Returns the localized name of the continent on which the given zone resides. Returns the localized continent name if the zone is a continent.

 

Tourist:GetContinentMapID(uiMapID)

- uiMapID: number, uiMapID of a zone as provided by the C_Map API or Tourist:GetMapZonesAlt.

Returns the uiMapID of the continent for the given uiMapID. Searches up through the C_Map hierarchy until the continent is found. If uiMapID represents a continent, the same ID is returned. If uiMapID represents a World map or Cosmic map, nil is returned. If no continent could be determined, nil is returned.

 

Tourist:GetEntrancePortalLocation(instance)

- instance: name  or uiMapID of an instance

Returns localized zone name, x-coordinate and y-coordinate of the entrance portal of the given instance, if the instance and the coordinates are known. The coordinates are values between 0 and 1.

 

Tourist:GetFactionColor(zone)

- zone: zone name or uiMapID

Returns an r, g and b value representing a color, depending on the given zone and the current character's faction.

  • Blue = sanctuary
  • Orange = PvP
  • Green = friendly
  • Red = hostile
  • Yellow = neutral, contested or unknown. 

 

Tourist:GetFishingLevel(zone)

- zone: zone name or uiMapID

Returns the fishing level required to be able to fish in the given zone (low), and the minimum level required to completely avoid get-aways (high).

 

Tourist:GetFishingLevelString(zone)
- zone: zone name or uiMapID
Returns required fishing skills as "[fishing_low]-[fishing_high]".

 

Tourist:GetFlightnode(nodeID)

- nodeID: ID of a Flight Node

Returns a node struct for the specified nodeID, if known and available (see introduction at the top of this page).

 

Tourist:GetFlightnodeFactionColor(faction)

- faction: can be 0 (neutral), 1 (Horde), 2 (Alliance), "Neutral", "Horde" or "Alliance" (not localized)

Returns an r, g and b value representing a color (yellow, red or green), depending on the given flight node faction and the current character's faction.

 

Tourist:GetFlightnodeLookupTable()
Returns the lookup table with all flight nodes.

Key = node ID, Value = a node struct if the node could be found in C_TaxiMap (see introduction at the top of this page). If the node was not returned by C_Taximap, Value is true instead of a node struct.

 

Tourist:GetGatheringSkillColor(minLevel, currentSkill)

- minLevel: minimum required level for the mining node or herb

- currentSkill: current player profession skill
Returns an r, g and b value representing the gathering difficulty color for a specific herb or mining node level, given the current player skill.

 

Tourist:GetHBD()

Returns a reference to the API of HereBeDragons, which is a dependency of LibTourist. Using this, HereBeDragons can be accessed without having to include or install it.

 

Tourist:GetHerb(herbItemID)

- herbItemID: item ID (not the node type ID) of a specific herb

Returns herb data containing herb name, minimum skill level and a collection of zone mapIDs.

The following data is returned:

- name: localized name of the herb
- itemID: herb item ID (this is not the node object ID)
- minLevel: minimum herbalism level required to gather the herb
- zones; table: key = mapID of a zone where the herb can be found

 

Tourist:GetHerbSkillColor(herbItemID, currentSkill)

- herbItemID: item ID (not the node type ID) of a specific herb

- currentSkill: current player profession skill
Returns an r, g and b value representing the gathering difficulty of a specific herb, given the current player skill.

 

 

Tourist:GetInstanceGroupMinSize(instance)

- instance: name or uiMapID of an instance

Returns the minimum size of the primary group size of the given instance. If the primary group size is fixed, the minimum and maximum will be equal.

 

Tourist:GetInstanceGroupMaxSize(instance)

- instance: name or uiMapID of an instance

Returns the maximum size of the primary group size of the given instance. If the primary group size is fixed, the minimum and maximum will be equal.

 

Tourist:GetInstanceGroupSize(instance)

- instance: name or uiMapID of an instance

Returns the group size of the given instance. If a minimum and a maximum group size is available, the maximum group size will be returned (for backward compatibility).

 

Tourist:GetInstanceGroupSizeString(instance)

- instance: name or uiMapID of an instance

This function composes a string reflecting the group sizes of an instance. Contains the minimum and maximum group size (if available).

Output examples: "5", "10-30".

 

Tourist:GetInstanceZone(instance)

- instance: name or uiMapID of an instance

Returns the localized name of the zone in which the instance resides.

 

Tourist:GetLevel(zone)

- zone: zone name or uiMapID

Returns the minimum and maximum level for the given zone, instance or battleground.

 

Tourist:GetLevelColor(zone)

- zone: zone name or uiMapID

Returns an r, g and b value representing a color ranging from grey (too low) via green, yellow and orange to red (too high), by calling CalculateLevelColor with the min and max level of the given zone and the current player level.

GetLevelColor returns r/g/b-values for the following colors:

  • City or level unknown -> White
  • Exact match, one-level bracket -> Yellow
  • Player is three or more levels short of Low -> Red
  • Player is two or less levels short of Low -> sliding scale between Red and Orange
  • Player is at low, at least two-level bracket -> Orange
  • Player is between low and the middle of the bracket -> sliding scale between Orange and Yellow
  • Player is at the middle of the bracket -> Yellow
  • Player is between the middle of the bracket and High -> sliding scale between Yellow and Green
  • Player is at High, at least two-level bracket -> Green
  • Player is up to three levels above High -> sliding scale between Green and Gray
  • Player is at High + 3 or above -> Gray

 

Tourist:GetLevelString(zone)

- zone: zone name or uiMapID

Formats the minimum and maximum player level for the given zone as "[min]-[max]". Returns one number if min and max are equal. Returns an empty string if no player levels are applicable (like in Cities).

 

Tourist:GetLookupTable()

This function replaces the abandoned LibBabble-Zone library and returns a lookup table containing all zone names (including continents, instances etcetera) where the English zone name is the key and the localized zone name is the value.

 

Tourist:GetMapContinentsAlt()

Alternative for the deprecated WoW API function GetMapContinents. Returns a table with the uiMapID as key and the localized zone name as a value. Both can be used for the LibTourist lookup functions.

 

Tourist:GetMapIDLookupTable()

Returns the lookup table with all uiMapIDs as key and the non-localized English zone name as value.

 

Tourist:GetMapNameByIDAlt(uiMapID)

- uiMapID: ID of the map, as used by the C_Map API

Alternative for the deprecated WoW API function GetMapNameByID. Returns a localized zone name that can be used to lookup data in LibTourist.

 

Tourist:GetMapZonesAlt(continentID)

- continentID: uiMapID of the continent (as provided by Tourist:GetMapContinentsAlt or the C_Map API)

Alternative for the deprecated WoW API function GetMapZones. GetMapZonesAlt returns a table with the names of all zones within a continent, with the uiMapID as key. 

 

Tourist:GetMiningNode(nodeObjectID)

- nodeObjectID: object ID of the mining node

Returns mining node data containing mining node name, node object ID, ore name, ore item ID, minimum skill level and a collection of zone mapIDs.

The following data is returned: 

- nodeName: localized name of the mining node
- nodeObjectID: object ID of the mining node
- oreName: localized name of the ore that can be minded from the node
- oreItemID: item ID of the ore that can be minded from the node
- minLevel: minimum mining skill required to mine the node
- zones; table: key = mapID of a zone where the mining node can be found

 

Tourist:GetMiningSkillColor(nodeObjectID, currentSkill)

- nodeObjectID: object ID of a specific mining node

- currentSkill: current player profession skill
Returns an r, g and b value representing the mining difficulty color of a specific mining node, given the current player skill.

 

Tourist:GetRequiredSkinningSkill(level)

- level: level of a mob or zone

Returns the minimum required skinning skill for a given mob or zone level. This value is calculated.

 

Tourist:GetReverseLookupTable()

This function replaces the abandoned LibBabble-Zone library and returns a lookup table containing all zone names (including continents, instances etcetera) where the localized zone name is the key and the English zone name is the value.

 

Tourist:GetSkinningLevelString(zone)

- zone: zone name or uiMapID
Formats the calculated minimum and maximum skinning skill as "[min]-[max]", based on the minimum and maximum player level for the given zone.

The minimum value reflects the minimum skinning skill required to skin a mob of the minimum zone level.

The maximum value reflects the minimum skinning skill required to skin a mob of the maximum zone level.
Returns one number if min and max are equal.
Returns an empty string if no player levels are applicable (like in Cities) or available.

 

Tourist:GetTexture(zone)

- zone: zone name or uiMapID

Returns the uiMapArtID.

 

Tourist:GetType(zone)

- zone: zone name or uiMapID

Returns the type of zone. Possible values:

  • Battleground
  • City
  • Complex
  • Continent
  • Instance
  • PvP Zone
  • Transport
  • Zone

 

Tourist:GetYardDistance(zone1, x1, y1, zone2, x2, y2)

- zone1: zone name or uiMapID (point A)

- x1: x-coordinate (0..1) in zone1

- y1: y-coordinate (0..1) in zone1

- zone2: zone name or uiMapID (point B)

- x2: x-coordinate (0..1) in zone2

- y2: y-coordinate (0..1) in zone2

Calculates a distance in game yards between point A and point B. Points A and B can be in different zones but must be on the same continent.

Uses HereBeDragons:GetZoneDistance for the calculation.

 

Tourist:GetZoneMapID(zone)

- zone: zone name

Returns a uiMapID of a zone based on the zone name.

Tourist:GetZoneYardSize(zone)

- zone: zone name or uiMapID

Returns the width of a zone map in game yards. The height is always 2/3 of this value.

 

Tourist:HasRecommendedInstances()

Returns true if recommended instances are available for the current player.

 

Tourist:IsAlliance(zone)

- zone: zone name or uiMapID

Returns true if the zone is an Alliance zone.

 

 

Tourist:IsBattleground(zone)

- zone: zone name or uiMapID

Returns true if the zone is a Battleground.

 

Tourist:IsCity(zone)

- zone: zone name or uiMapID

Returns true if the zone is a City.

 

Tourist:IsComplex(zone)

- zone: zone name or uiMapID

Returns true if the zone is a Complex.

 

Tourist:IsContested(zone)

- zone: zone name or uiMapID

Returns true if the zone is contested.

 

Tourist:IsContinent(zone)

- zone: zone name or uiMapID

Returns true if the zone is a Continent. This includes Azeroth.

 

Tourist:IsFriendly(zone)

- zone: zone name or uiMapID

Returns true if the zone is of the same faction of the player.

 

Tourist:IsHorde(zone)

- zone: zone name or uiMapID

Returns true if the zone is a Horde zone.

 

Tourist:IsHostile(zone)

- zone: zone name or uiMapID

Returns true if the zone is of the opposite faction of the player.

 

Tourist:IsInEasternKingdoms(zone)

- zone: zone name or uiMapID

Returns true if the zone is on the Eastern Kingdoms continent.

 

Tourist:IsInKalimdor(zone)

- zone: zone name or uiMapID

Returns true if the zone is on the Kalimdor continent.

 

 

Tourist:IsInstance(zone)

- zone: zone name or uiMapID

Returns true if the zone is a dungeon or raid Instance, or a Battleground.

 

Tourist:IsPvPZone(zone)

- zone: zone name or uiMapID

Returns true if the zone is a PvP zone (not including instances like Battlegrounds).

 

Tourist:IsSanctuary(zone)

- zone: zone name or uiMapID

Returns true if the zone is a Sanctuary.

 

Tourist:IsTransport(zone)

- zone: zone name or uiMapID

Returns true if the zone is a Transport.

 

Tourist:IsZone(zone)

- zone: zone name or uiMapID

Returns true if the zone is not an Instance, Battleground, Transport, or Complex.

 

Tourist:IsZoneOrInstance(zone)

- zone: zone name or uiMapID

Returns true if the zone is not a Transport.

 

Tourist:IterateAlliance()

Iterates through the localized names of all zones that have player levels defined and are Alliance zones.

 

 

Tourist:IterateBattlegrounds()

Iterates through the localized names of all Battlegrounds.

 

Tourist:IterateBorderZones(zone, zonesOnly)

- zone: zone name or uiMapID

- zonesOnly: if true, paths to instances, transports and portals are ignored

Iterates through the localized names of all zones, instances or transports that have a connection with the given zone.

 

Tourist:IterateComplexes()

Iterates through the localized names of all Complexes.

 

Tourist:IterateContested()

Iterates through the localized names of all zones that have player levels defined and are contested.

 

Tourist:IterateEasternKingdoms()

Iterates through the localized names of all zones that have player levels defined and are on the Easter Kingdoms continent.

 

Tourist:IterateFriendly()

Iterates through the localized names of all zones that have player levels defined and are zones of the same faction as the player.

 

Tourist:IterateHerbs()

Iterates through all known standard herbs.

For each herb, the following data is returned:

- name: localized name of the herb
- itemID: item ID (not the node object ID) of the herb
- minLevel: minimum level required to gather the herb

- zones; table: key = mapID of a zone where the herb can be found

 

Tourist:IterateHerbsByZone(mapID)

- mapID: UI map ID of a zone

Iterates through all standard herbs that can be found within the specified zone.

For each herb, the following data is returned:

- name: localized name of the herb
- itemID: item ID (not the node object ID) of the herb
- minLevel: minimum level required to gather the herb

 

Tourist:IterateHorde()

Iterates through the localized names of all zones that have player levels defined and are Horde zones.

 

Tourist:IterateHostile()

Iterates through the localized names of all zones that have player levels defined and are zones of the opposite faction as the player.

  

Tourist:IterateInstances()

Iterates through the localized names of all dungeon and raid Instances.

 

Tourist:IterateKalimdor()

Iterates through the localized names of all zones that have player levels defined and are on the Kalimdor continent.

 

Tourist:IterateMiningNodes()
Iterates through all known standard mining nodes.

For each mining node, the following data is returned:

- nodeName: localized name of the mining node
- nodeObjectID: object ID of the mining node
- oreName: localized name of the ore that can be minded from the node
- oreItemID: item ID of the ore that can be minded from the node
- minLevel: minimum mining skill required to mine the node
- zones; table: key = mapID of a zone where the mining node can be found

 

Tourist:IterateMiningNodesByZone(mapID)

- mapID: UI map ID of a zone

Iterates through all standard mining nodes within the specified zone.

For each mining node, the following data is returned:

- nodeName: localized name of the mining node
- nodeObjectID: object ID of the mining node
- oreName: localized name of the ore that can be minded from the node
- oreItemID: item ID of the ore that can be minded from the node
- minLevel: minimum mining skill required to mine the node

 

 

Tourist:IteratePath(alpha, bravo)

- alpha: zone name or uiMapID representing a starting zone

- bravo: zone name or uiMapID representing a destination zone

This function tries to calculate the most optimal path between alpha and bravo by foot or ground mount, that is, without using a flying mount or a taxi service. The return value, if a path is available, is an iteration that gives a travel advice in the form of a list of zones and transports to follow in order to get from alpha to bravo. The function tries to avoid hostile zones by calculating a "price" for each possible route. The price calculation takes level, faction and type into of a zone or transport account.

 

Tourist:IteratePvPZones()

Iterates through the localized names of all PvP Zones.

 

Tourist:IterateRecommendedInstances()

Iterates through the localized names of all Battlegrounds and Instances for which the player level is within the zone's level range.

 

Tourist:IterateRecommendedZones()

Iterates through the localized names of all Zones and PvP Zones for which the player level is within the zone's level range. 

 

Tourist:IterateSanctuaries()

Iterates through the localized names of all Sanctuaries.

 

Tourist:IterateZoneComplexes(zone)

- zone: zone name or uiMapID

Iterates through the localized names of all Complexes within the given zone.

 

Tourist:IterateZoneFlightnodes(zone)

- zone: zone name or uiMapID
Loops through the available flight nodes for the given zone, returning node structs (see introduction at the top of this page).

 

Tourist:IterateZoneInstances(zone)

- zone: zone name or uiMapID

Iterates through the localized names of all dungeon and raid Instances within the given zone.

 

Tourist:IterateZones()

Iterates through the localized names of all zones that have player levels defined and are not Instance, Battleground, or Complex.

 

Tourist:IterateZonesAndInstances()

Iterates through the localized names of all zones that have player levels defined.

 

Tourist:IterateZonesByHerb(herbItemID)

herbItemID: item ID (not the node object ID) of a herb
Returns the mapIDs of the zones in which the specified herb can be found

 

Tourist:IterateZonesByMiningNode(miningNodeObjectID)

- miningNodeObjectID: object ID of the mining node
Returns the mapIDs of the zones in which the specified mining node can be found

 

Tourist:RefreshFlightNodeData()
Refreshes the values of the FlightnodeLookupTable.
 

Tourist:TransposeZoneCoordinate(x, y, zone1, zone2)

- x: x-coordinate (0..1) in zone1

- y: y-coordinate (0..1) in zone1

- zone1: zone name or uiMapID

- zone2: zone name or uiMapID

This function is used to calculate the coordinates of a location in zone1, on the map of zone2. The zones can be continents (including Azeroth). The return values can be outside the range of 0 to 1.

Uses HereBeDragons:TranslateZoneCoordinates for the calculation.