map_list = {

	{name = "All Maps",
	list = {{name = "All Maps"}},
		ignore_recruit_window = true
	},
	{name = "Prontera",
	list = {{name = "Fields"},
		{name = "Prontera Culvert F1"},
		{name = "Prontera Culvert F2"},
		{name = "Prontera Culvert F3"},
		{name = "Prontera Culvert F4", colorR = 255, colorG = 0, colorB = 0},
		{name = "Labyrinth Forest F1"},
		{name = "Labyrinth Forest F2"},
		{name = "Labyrinth Forest F3", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Geffen",
	list = {{name = "Fields"},
		{name = "Gypsy Village"},
		{name = "Geffen Dungeon F1"},
		{name = "Geffen Dungeon F2", colorR = 255, colorG = 0, colorB = 0},
		{name = "Geffen Dungeon F3", colorR= 255, colorG = 0, colorB = 0},
		{name = "Geffenia"},
		{name = "Orc Village", colorR = 255, colorG = 0, colorB = 0},
		{name = "Orc Dungeon F1"},
		{name = "Orc Dungeon F2"}}
	},
	{name = "Payon",
	list = {{name = "Forest", colorR = 255, colorG = 0, colorB = 0},
		{name = "Payon Cave F1"},
		{name = "Payon Cave F2"},
		{name = "Payon Cave F3"},
		{name = "Payon Cave F4 (Underground Temple)"},
		{name = "Payon Cave F5 (Underground Temple)", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Aldebaran",
	list = {{name = "Mt. Mjolnir North", colorR = 255, colorG = 0, colorB = 0},
		{name = "Mt. Mjolnir Foothills North"},
		{name = "Mt. Mjolnir South"},
		{name = "Mt. Mjolnir Foothills South"},
		{name = "Mjolnir Dead Pit F1"},
		{name = "Mjolnir Dead Pit F2"},
		{name = "Mjolnir Dead Pit F3"},
		{name = "Clock Tower F1"},
		{name = "Clock Tower F2"},
		{name = "Clock Tower F3"},
		{name = "Clock Tower F4"},
		{name = "Clock Tower B1"},
		{name = "Clock Tower B2"},
		{name = "Clock Tower B3"},
		{name = "Clock Tower B4"}}
	},
	{name = "Alberta",
	list = {{name = "Sunken Ship F1"},
		{name = "Sunken Ship F1", colorR = 255, colorG = 0, colorB = 0},
		{name = "Turtle Island"},
		{name = "Turtle Island Dungeon"},
		{name = "Good Turtles Village"},
		{name = "Turtle Palace", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Morocc",
	list = {{name = "Sograt Desert", colorR = 255, colorG = 0, colorB = 0},
		{name = "Morocc Field (Dimensional Gorge)", colorR = 255, colorG = 0, colorB = 0},
		{name = "Ant Hell F1"},
		{name = "Ant Hell F2", colorR = 255, colorG = 0, colorB = 0},
		{name = "Sphinx B1"},
		{name = "Sphinx B2"},
		{name = "Sphinx B3"},
		{name = "Sphinx B4"},
		{name = "Sphinx B5", colorR = 255, colorG = 0, colorB = 0},
		{name = "Inside Pyramid F1"},
		{name = "Inside Pyramid F2"},
		{name = "Inside Pyramid F3"},
		{name = "Inside Pyramid F4", colorR = 255, colorG = 0, colorB = 0},
		{name = "Inside Pyramid B1"},
		{name = "Inside Pyramid B2", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Izlude",
	list = {{name = "Undersea Tunnel F1"},
		{name = "Undersea Tunnel F2"},
		{name = "Undersea Tunnel F3"},
		{name = "Undersea Tunnel F4"},
		{name = "Undersea Tunnel F5"}}
	},
	{name = "Comodo",
	list = {{name = "Papuchicha Forest"},
		{name = "Kokomo Beach"},
		{name = "Zenhai Marsh"},
		{name = "Pharos Beacon Island"},
		{name = "Fortress Saint Darmain (East)"},
		{name = "Fortress Saint Darmain (South)"},
		{name = "Fortress Saint Darmain (West)"},
		{name = "Karu, the West Cave", colorR = 255, colorG = 0, colorB = 0},
		{name = "Ruande, the North Cave"},
		{name = "Mao, the East Cave"}}
	},
	{name = "Lutie",
	list = {{name = "Fields", colorR = 255, colorG = 0, colorB = 0},
		{name = "Toy Factory Warehouse"},
		{name = "Toy Monitoring Room", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Yuno",
	list = {{name = "Border Checkpoint/Post"},
		{name = "Kiel Hyre's Cottage"},
		{name = "El Mes Plateau"},
		{name = "El Mes Gorge (Valley of Abyss)"},
		{name = "Kiel Hyre's Academy"},
		{name = "Schwarzwald Guards Camp"},
		{name = "Fields"},
		{name = "Nogg Road F1"},
		{name = "Nogg Road F2"},
		{name = "External Juperus Ruins"},
		{name = "Inside Juperus Ruins"},
		{name = "Center of Juperos", colorR = 255, colorG = 0, colorB = 0},
		{name = "Robot Factory Level F1"},
		{name = "Robot Factory Level F2", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Umbala",
	list = {{name = "Luluka Forest"},
		{name = "Kalala Swamp"},
		{name = "Hoomga Forest"},
		{name = "Hoomga Jungle"}}
	},
	{name = "Einbech",
	list = {{name = "Mine Dungeon F1"},
		{name = "Mine Dungeon F2", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Lighthalzen",
	list = {{name = "Field"},
		{name = "Lighthalzen Field (Grim Reaper's Valley)"},
		{name = "Somatology Laboratory F1"},
		{name = "Somatology Laboratory F2", colorR = 255, colorG = 0, colorB = 0},
		{name = "Somatology Laboratory F3", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Thanatos Tower",
	list = {{name = "Hacheungbu Museum Entrance"}, --need translator please :)
		{name = "Hacheungbu Museum"},
		{name = "Hacheungbu Abandoned Space"},
		{name = "Upper Level"},
		{name = "Upper Room of Angel"},
		{name = "Upper Room of Agony"},
		{name = "Upper Room of Sorrow"},
		{name = "Upper Room of Despair"},
		{name = "Upper Room of Hatred"},
		{name = "Unknown Area", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Glast Heim",
	list = {{name = "Glast Heim F1"},
		{name = "Glast Heim F2"},
		{name = "St. Abbey"},
		{name = "Catacombs", colorR = 255, colorG = 0, colorB = 0}, --Churchyard[English official server]
		{name = "Underground B1"}, --The Lowest Cave in Glast Heim F1[English official server]
		{name = "Underground B2"}, --The Lowest Cave in Glast Heim F2[English official server]
		{name = "Inside"}, --Inside Glast Heim[English official server]
		{name = "Chivalry F1"},
		{name = "Chivalry F2"},
		{name = "Underprison F1"},
		{name = "Underprison F2"},
		{name = "Culvert F1"},
		{name = "Culvert F2"},
		{name = "Culvert F3"},
		{name = "Culvert F4"},
		{name = "Staircase Dungeon"}}
	},
	{name = "Hugel",
	list = {{name = "Fields"},
		{name = "Odin Temple West"},
		{name = "Odin Temple South"},
		{name = "Odin Temple North", colorR = 255, colorG = 0, colorB = 0},
		{name = "Abyss Lake"},
		{name = "Abyss Lake Underground Cave F1"},
		{name = "Abyss Lake Underground Cave F2"},
		{name = "Abyss Lake Underground Cave F3", colorR = 255, colorG = 0, colorB = 0},
		{name = "Infront of Thanatos Tower"}} --What?
	},
	{name = "Rachel",
	list = {{name = "Audumra Grass Land"},
		{name = "Ida Plane", colorR = 255, colorG = 0, colorB = 0},
		{name = "Fortu Luna", colorR = 255, colorG = 0, colorB = 0},
		{name = "Temple Sanctuary North F1"}, --Freya's Sacred Precinct F1
		{name = "Temple Sanctuary West F1"}, --Freya's Sacred Precinct F2
		{name = "Temple Sanctuary East F1"}, --Freya's Sacred Precinct F3
		{name = "Temple Sanctuary South F1"}, --Freya's Sacred Precinct F4
		{name = "Temple Sanctuary Center", colorR = 255, colorG = 0, colorB = 0}, --Freya's Sacred Precinct F5
		{name = "Ice Cave F1"},
		{name = "Ice Cave F2"},
		{name = "Ice Cave F3"}}
	},
	{name = "Veins",
	list = {{name = "Fields", colorR = 255, colorG = 0, colorB = 0},
		{name = "Nameless Island"},
		{name = "Cursed Abbey F1"},
		{name = "Cursed Abbey B1", colorR = 255, colorG = 0, colorB = 0},
		{name = "Cursed Abbey B2", colorR = 255, colorG = 0, colorB = 0},
		{name = "Thor's Volcano Dungeon F1"},
		{name = "Thor's Volcano Dungeon F2"},
		{name = "Thor's Volcano Dungeon F3", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Niflheim",
	list = {{name = "Skellington Solitary Village"},
		{name = "Valley of Gyoll"},
		{name = "Niflheim", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Passage",
	list = {{name = "Manuk Field"},
		{name = "Splendide Field"},
		{name = "Foot of Kamidal Mountain"}, --El Descates Field Foot Of The Kamidal Mountain
		{name = "Kamidal Tunnel"}, --Underground Passage Kamidal Tunnel
		{name = "Scaraba Hole", colorR = 255, colorG = 0, colorB = 0}, --Underground Nest Scaraba Hole
		{name = "Nidhogg's Dungeon F1"},
		{name = "Nidhogg's Dungeon F2"}}
	},
	{name = "Amatsu",
	list = {{name = "Fields"},
		{name = "Tatami Maze"},
		{name = "Underground Forest Battle Field"},
		{name = "Underground Shrine", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Gonryun",
	list = {{name = "Fields" },
		{name = "Queen's Shrine" },
		{name = "Hermit's Checkers" },
		{name = "Arcadia", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Louyang",
	list = {{name = "Fields"},
		{name = "Royal Tomb"},
		{name = "Inside the Royal Tomb"},
		{name = "Suei Long Gon", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Ayothaya",
	list = {{name = "Fields"},
		{name = "Ancient Shrine Maze"},
		{name = "Inside Ancient Shrine", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Brasilis",
	list = {{name = "Fields"},
		{name = "Waterfall Cave Entrance"},  --Brasilia's Dungeon F1
		{name = "Inside Waterfall Cave", colorR = 255, colorG = 0, colorB = 0}}  --Brasilia's Dungeon F2
	},
	{name = "Moscovia",
	list = {{name = "Fields"}, --Okrestnosti Of Moscovia
		{name = "Les Forest"},
		{name = "Temny Forest"},
		{name = "Dremuci Forest", colorR = 255, colorG = 0, colorB = 0}}
	},
	{name = "Memorial Dungeon",
	list = {{name = "Endless Tower", colorR = 255, colorG = 0, colorB = 0},
		{name = "Sealed Shrine", colorR = 255, colorG = 0, colorB = 0},
		{name = "Orc Memories", colorR = 255, colorG = 0, colorB = 0},
		{name = "Nidhogg's Nest", colorR = 255, colorG = 0, colorB = 0}}
	},
}

printMapList = function() 
	local regionId = 0
	local mapId = 0
	local state = ""
	print("------------------")
	for key, region in pairs(map_list) do
		regionId = regionId +1
		mapId = 0 
		if region["ignore_recruit_window"] == true then
			state = "파티 모집 (신청) 창에서는 보이지 않는 메뉴임" --Party Recruitment (Application) menu is not available?
		else
			state = ""
		end
		print(regionId,region["name"],state)
		for key, map in pairs(region["list"]) do
			mapId = mapId +1
			if map["color"] == nil then
				color = "Primary Colors"
			else 
				color = "R: " .. map.color.R .. "G:" .. map.color.G .. "B:" .. map.color.B
			end
			print("\t" .. mapId .. ":" .. map.name, map.map_file, color)
		end
	end
	print("------------------")
end

__mapList = {}
makeMapList = function()
	for regionId, region in ipairs(map_list) do
		__mapList[regionId] = region
		region["id"] = regionId
		for mapId, map in ipairs(region["list"]) do
			__mapList[regionId][mapId] = map
			map.id = mapId
			map.ignore_recruit_window = region["ignore_recruit_window"]
		end
	end
end
queryRegionInfo = function(regionId)
	if __mapList[regionId] == nil then 
		return nil,nil,nil,nil
	end
	return regionId,
		__mapList[regionId]["name"],
		getMapIterator(regionId),
		__mapList[regionId]["ignore_recruit_window"]
end
queryMapInfo = function(regionId, mapId)
	if __mapList[regionId] == nil then
		return nil,nil,nil,nil,nil,nil
	end
	if __mapList[regionId][mapId] == nil then
		return nil,nil,nil,nil,nil,nil
	end
	return regionId,
	mapId,
	__mapList[regionId][mapId]["name"],
	__mapList[regionId][mapId]["colorR"],
	__mapList[regionId][mapId]["colorG"],
	__mapList[regionId][mapId]["colorB"]
end
getRegionIterator = function()
	local pos = 1
	return { 
		["hasNext"] = function() return __mapList[pos] 
			end,
		["value"] = function() temp_pos = pos 
			pos = pos + 1
			return __mapList[temp_pos]
			end
		}
end

getMapIterator = function(regionId)
	local pos = 1
	return {
		["hasNext"] = function() 
			if __mapList[regionId] == nil then
				return nil
			end
				return __mapList[regionId][pos]
		end,
		["value"] = function() 
			temp_pos = pos
			pos = pos +1
			return __mapList[regionId][temp_pos]
		end
	}
end

makeMapList()
print("[All Output Data Structure]")
regionIterator = getRegionIterator()
while regionIterator.hasNext() do
	region = regionIterator.value()
	print(region["id"],region["name"])
	mapIterator = getMapIterator(region["id"])
	while mapIterator.hasNext() do
		map = mapIterator.value()
		print("\t",queryMapInfo(region.id,map.id))
	end
end

print("\n[Local Data Search]")
regionIterator = getRegionIterator()
while regionIterator.hasNext() do
	region = regionIterator.value()
	print(region.id,region.name)
end

print("\n[Map Data Search]")
mapIterator = getMapIterator(2)
while mapIterator.hasNext() do
	map = mapIterator.value()
	print(map.id,map.name)
end

print("\n[Regional Data Information Request]")
print(queryRegionInfo(2))
_,_,mapIterator,_ = queryRegionInfo(2)
while mapIterator.hasNext() do
	map = mapIterator.value()
	print(map.id,map.name)
end

print("\n[Map Data Information Request]")
print(queryMapInfo(2,1))
PartyBookingHelp = {
	"/recruit: Brings up the Recruitment Party window.",
	"/booking: Brings up the Party Application List window.", --or Brings up the Party Booking List window
	"/organize \"Party Name\": Creates a party.",
	"/invite \"Character Name\": Invite the specific character to the party."
}
GetPartyBookingHelp = function()
	local descript = ""
	local obj = PartyBookingHelp
	if obj ~= nil then
		for i,v in pairs(obj) do
			descript = descript .. v
			descript = descript .. "\r\n"
		end
	end
	return descript
end