Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API GetMapZones
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} 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 [[API GetMapContinents|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 [[API_GetCurrentMapZone|GetCurrentMapZone()]] returns) ---- ;''Example 1'' local function LoadZones(c, ...) for i=1,select('#', ...),1 do c[i] = select(i,...) end end local C1 = {} local C2 = {} local C3 = {} local C4 = {} LoadZones(C1,GetMapZones(1)) LoadZones(C2,GetMapZones(2)) LoadZones(C3,GetMapZones(3)) LoadZones(C4,GetMapZones(4)) ;''Result'' The array C1 holds all a list of all zone names for Kalimdore, C2 for Eastern Kingdoms, C3 for Outland, and C4 for Northrend. ---- ;''Example 2'' 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 [[LocalizedMapZones|table of localized map zones]].
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)