Wikia

WoWWiki

API GetMapZones

Talk1
102,077pages on
this wiki
Revision as of 16:52, October 8, 2008 by Zefler (Talk | contribs)

WoW API < GetMapZones

Returns the zone names of a continent

zone_1, zone_2, ..., zone_N = GetMapZones(continentIndex);

Arguments
(continentIndex)
continentIndex 
Number - Which continent to fetch the zone list from (continent indexes refer to the result of GetMapContinents()). Currently the values are 1 for Kalimdor, 2 for Eastern Kingdoms, and 3 is for Outlands (without Twisting Nether).

Returns
zone_1, zone_2, ..., zone_N
zone_i 
String - The name of the i'th zone within the continent (i corresponds to the value GetCurrentMapZone() returns)

Example
ZoneNames = {};

function LoadZones(...)
   for i=1, arg.n, 1 do
      ZoneNames[i] = arg[i];
   end
end

LoadZones(GetMapZones(2)); -- Eastern Kingdoms

Note that this is equivalent to

ZoneNames = { GetMapZones(2) } ;
Result
The array ZoneNames holds all available zone names of the Eastern Kingdoms:
ZoneNames[1] == "Alterac Mountains"
ZoneNames[2] == "Arathi Highlands"
...
ZoneNames[25] == "Wetlands"

Details
There are a different number of zones on each continent and these may change without notice as new content is added. Use the name of a zone if you wish to make your code future-proof.
Beware : zone names depend on locale, and zone number too because GetMapZones() returns them in alphabetical order. So french and german clients do not have the zones returned in the same order than english ones, see the table of localized map zones.

Around Wikia's network

Random Wiki