QuestPOIGetIconInfo

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 3.3.0
Removed in 11.0.0

Returns WorldMap POI icon information for the given quest.

completed, posX, posY, objective = QuestPOIGetIconInfo(questId)

Arguments

questId
number - you can get this from the quest link or from GetQuestLogTitle(questLogIndex).

Returns

completed
boolean - is the quest completed (the icon is a question mark).
posX
number (between 0 and 1 inclusive) - the X position where the icon is shown on the map.
posY
number (between 0 and 1 inclusive) - the Y position where the icon is shown on the map.
objective
number - which is sometimes negative and doesn't appear to have anything to do with the quest's actual objectives.

Example

local playerX, playerY = GetPlayerMapPosition("player")
local _, questX, questY = QuestPOIGetIconInfo(12345)
local diffX, diffY = abs(playerX - questX), abs(playerY - questY)
local distanceToTarget = math.sqrt(math.pow(diffX, 2) + math.pow(diffY, 2))
print("You are ", floor(distanceToTarget * 100), " clicks from the target location.")

Results

You are 42 clicks from the target location.