Quantcast
WoWInterface - View Single Post - Whistle Master
Thread: Whistle Master
View Single Post
08-17-18, 07:40 AM   #3
flow0284
An Aku'mai Servant
Join Date: Jan 2015
Posts: 39
When you are in a Legion zone you should se on your worldmap a green circle around the next nearest flightpoint where the whistle will bring you.

so the function GetPlayerMapPosition() is no longer valid. so there i can use C_Map.GetPlayerMapPosition() in combination with C_Map.GetBestMapForUnit()

but(!) i found nothing for GetNumMapLandmarks() and GetMapLandmarkInfo() to gather the taxinode pois

Lua Code:
  1. local function GetNode()
  2.     local node
  3.     local distance
  4.     local index
  5.     for k = 1, GetNumMapLandmarks() do
  6.         local n = {}
  7.         n.type, n.name, n.description, n.textureIndex, n.x, n.y = GetMapLandmarkInfo(k)
  8.         if n.type == LE_MAP_LANDMARK_TYPE_TAXINODE then --LE_MAP_LANDMARK_TYPE_TAXINODE is a constant defined by Blizzard
  9.             local d = GetDistance(n.x, n.y)
  10.             if distance == nil or d < distance then
  11.                 n.index = k
  12.                 distance = d
  13.                 node = n
  14.             end
  15.         end
  16.     end
  17.     return node
  18. end
  Reply With Quote