During the development of an addon I used to make for World of Warcraft, I had to go around and collect a lot of area IDs from the world. The reasoning for this, is that no where at all had an up-to-date list of these area IDs.
For example, an area ID of 749 represents the Wailing Caverns dungeon, where as 14 represents the world of Azeroth. That's where this problem now changes!Presented on my GitHub, I have uploaded nearly every possible area ID for all the areas - that is: every world, area, zone, dungeons, battlegrounds and more.
This is not by any means a complete list, as even I am still updating it. I have managed to get access back to Warcraft for a month, and thought it would be a great idea to refresh my LUA abilities; as well as update this ID list and my QuestTracker addon (which I will upload to here at somepoint, after some polishing).
A few area IDs are missing, mainly some of the Outland's raids, and the newer Cataclysm dungeons after the introduction of the Firelands. (And quite obvious zones from the Mists of Pandaria).
When you see the list, a lot of it is obvious. But the Hour of Twilight is a tricky one. There are three dungeons for the whole of the Hour of Twilight: End Time, Well of Eternity, and Hour of Twilight. Yet, the the first two are encompassed within the same area code - which makes things confusing!
On a final note, the area IDs have been formatted so they can just be copy-pasted straight into a LUA document. As for usage, you could do something like:
GetCurrentMapAreaID() is fairly obvious: it will return the ID of the area you are currently in. As for the second part, this is just your basic
indexing into an array to get the location. So if we got the ID of 504, then
AreaIDs = Dalaran.