View Single Post
01-04-21, 05:25 AM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by mazer665 View Post
ID 363 (ValleyofTrials) has a Parent of 6451 (ValleyofTrialsStart)

which in return
ID 6451 has a parent of 14 (Durotar) <- this is the value i am looking for

So you want to get the parent AreaID for a specific AreaID?
https://wow.tools/dbc/?dbc=areatable...;4]=exact%3A14

I don't think that's possible with the in-game API. There is only C_Map.GetAreaInfo() and C_MapExplorationInfo.GetExploredAreaIDsAtPosition()

Can you elaborate what you are trying to do?

In any case, you can map from UiMapIDs to AreaIDs and vice versa by parsing the CSVs for AreaTable.db2 and UiMapAssignment.db2 and converting it to a table.
Or just only a table that maps from AreaIDs to ParentAreaIDs:
Lua Code:
  1. local AreaTable = {
  2.     -- ID = ParentID
  3.     [6451] = 14, -- "Valley of Trials"
  4.     [6453] = 14, -- "Echo Isles"
  5.     [6529] = 14, -- "Hellscream's Fist"
  6. }
  7.  
  8. local function GetParentAreaID(id)
  9.     return AreaTable[id]
  10. end
See this for reference https://github.com/ketho-wow/UnexploredAreas
  Reply With Quote