ich habe mal die Teleporter-Quest verbessert, sodass man Orte nur noch in die warp-Tabelle in der get_warp_set-Funktion eintragen muss. Dabei muss man den gewünschen Anzeigenamen, eine Kondition (= Bedingung), unter der die Map der AUflistung hinzugefügt werden soll sowie die Koordinaten für jedes Reich.
Die Quest ist als Datei im Anhang, ihr könnt sie euch aber hier auch anschauen:
Code:
---------------------------------------------------- -- New Teleport-Lib -- (c) 2011 by2011 ---------------------------------------------------- quest map_warp begin state start begin when 9012.chat."Möchtest du reisen?" begin say_title("Teleporter:") say("Dies ist eine faszinierende Gegend. Aber") say("passiert hier denn auch mal etwas") say("Außergewöhnliches? Eher wohl nicht. In anderen") say("Teilen des Landes sieht es mitunter ganz anders.") say("aus! Es gibt daher sicher einen intressanten") say("Ort, an den ich dich teleportieren könnte. Da") say("jedoch die Kräfte des Bösen wieder stärker") say("geworden sind, wurden Raum und Zeit ins Chaos") say("gestürzt. Dadurch kann es passieren, dass deine") say("Rückkehr nicht immer augenblicklich funktioniert.") say("Möchtest du dennoch teleportiert werden?") local main_set = select("Ja", "Nein") if main_set == 2 then return end if pc.get_level() <= 10 then say_title("Teleporter:") say("Hm… Mit deinem derzeitigen Level bist du noch") say("zu schwach für die Reise durch Zeit und Raum.") say("Komm wieder, wenn du höher als Level 10 bist.") return end local cost = math.floor(pc.get_level() / 5) * 1000 if cost < 1000 then cost = 1000 end wx, wy = map_warp.select_warp_location(0, color256(255, 230, 186).."Teleporter:"..color256(196, 196, 196).."[ENTER]Wohin möchtest du teleportiert werden?[ENTER]"..color256(255, 200, 200)..string.format("Das kostet dich %d Yang.", cost)..color256(196, 196, 196), pc.get_map_index(), pc.get_level()) if wx == 0 and wy == 0 then return end if pc.gold < cost then say_title("Teleporter:") say("Du hast nicht genug Geld.") say("Ich würde dich auch kostenlos teleportieren,") say("aber ich habe eine große Familie. Um sie zu") say("ernähren, muss ich Geld verdienen.") say_reward(string.format("Es kostet dich %d Yang.", cost)) return end pc.changegold(-cost) say_title("Teleporter:") say("Achtung, ich teleportiere dich jetzt. Du wirst") say("an einem gefährlichen Ort landen, also pass auf") say("dich auf. Viel Glück!") wait() pc.warp(wx, wy) end function select_warp_location(site, text, map_index, level) say(text) local more_areas = (table.getn(map_warp.get_warp_set(map_index, level, 1 + (site+1)*6, 5)) > 0) local warp_set = {} if more_areas == true and site != 0 then warp_set = map_warp.get_warp_set(map_index, level, 1 + site*6 + 1, 4) elseif more_areas == true and site == 0 then warp_set = map_warp.get_warp_set(map_index, level, 1 + site*6, 5) else warp_set = map_warp.get_warp_set(map_index, level, 1 + site*6, 5) end local warp_string = {} local i = 1 while i <= 1 + 5 do if warp_set[i] == nil then break end table.insert(warp_string, warp_set[i].name) i = i + 1 end if site != 0 then table.insert(warp_string, "Zurück") end if more_areas == true then table.insert(warp_string, "Andere Gebiete") else table.insert(warp_string, "Abbrechen") end local s = select_table(warp_string) if s == table.getn(warp_string) and more_areas == false then return 0, 0 elseif s == table.getn(warp_string) and more_areas == true then return map_warp.select_warp_location(site + 1, text, map_index, level) elseif s == table.getn(warp_string) - 1 and site != 0 then return map_warp.select_warp_location(site - 1, text, map_index, level) else return warp_set[s].x, warp_set[s].y end end function get_warp_set(map_index, level, start, length) local empire = pc.get_empire() local warp = { -- map1 { namestring = map_warp.get_empire_namestring(1, empire), con = map_warp.is_village_map_index(map_index) == false, pos = {{469300, 964200}, {55700, 157900}, {969600, 278400}}, }, -- map2 { namestring = map_warp.get_empire_namestring(2, empire), con = map_warp.is_village_map_index(map_index) == false, pos = {{353100, 882900}, {145500, 240000}, {863900, 246000}}, }, -- guild_map { namestring = map_warp.get_guild_map_name(), con = map_warp.is_village_map_index(map_index) == true, pos = {{128500, 1000}, {179500, 1000}, {271800, 13000}}, }, -- 64 map_n_threeway { namestring = "Tal von Seungryong", con = map_warp.is_village_map_index(map_index) == true, pos = {{402100, 673900}, {270400, 739900}, {321300, 808000}}, }, -- 63 metin2_map_n_desert_01 { namestring = "Yongbi-Wüste", con = map_warp.is_village_map_index(map_index) == true, pos = {{217800, 627200}, {221900, 502700}, {344000, 502500}}, }, -- 61 map_n_snowm_01 { namestring = "Berg Sohan", con = map_warp.is_village_map_index(map_index) == true, pos = {{434200, 290600}, {375200, 174900}, {491800, 173600}}, }, --empire_castle { namestring = map_warp.get_empire_castle_name(), con = map_warp.is_village_map_index(map_index) == true and game.get_event_flag("empire_castle") == 1, pos = {{975200, 133000}, {977200, 185000}, {923900, 183600}}, } , --Drachengottamulett { namestring = "Drachengottamulett benutzen", con = map_warp.is_village_map_index(map_index) == true, pos = {{283600, 808300}, {283600, 808300}, {283600, 808300}}, } , -- 12 metin2_map_sungzi_milgyo_pass_01 { namestring = "Zombiemap", con = (map_warp.is_village_map_index(map_index) == true and level >= 60), pos = {{1825400, 1821500}, {1825400, 1821500}, {1825400, 1821500}}, }, -- devil_tower { namestring = "Dämonenturm", con = (map_warp.is_village_map_index(map_index) == true and level >= 60), pos = {{590500, 110500}, {590500, 110500}, {590500, 110500}}, }, -- 62 metin2_map_n_flame_01 { namestring = "Feuerland", con = (map_warp.is_village_map_index(map_index) == true and level >= 60), pos = {{599400, 756300}, {597800, 622200}, {730700, 689800}}, }, -- 67 metin2_map_trent { namestring = "Lungsam (Geisterwald)", con = (map_warp.is_village_map_index(map_index) == true and level >= 60), pos = {{288700, 5700}, {288700, 5700}, {288700, 5700}}, }, -- 68 metin2_map_trent02 { namestring = "Lungsam (Roter Wald)", con = (map_warp.is_village_map_index(map_index) == true and level >= 60), pos = {{1119900, 70800}, {1119900, 70800}, {1119900, 70800}}, }, -- 8 metin2_map_dragon_timeattack_03 { namestring = "Wüstenpfad", con = (map_warp.is_village_map_index(map_index) == true and level >= 60), pos = {{1008600, 1011700}, {1008600, 1011700}, {1008600, 1011700}}, }, } local res = {} local i = start while i <= start + length do if warp[i] == nil then break end if warp[i].con == true then table.insert(res, {name = warp[i].namestring, x = warp[i].pos[empire][1], y = warp[i].pos[empire][2]}) end i = i + 1 end return res end function is_village_map_index(index) return (index == 1 or index == 3 or index == 21 or index == 23 or index == 41 or index == 43) end function get_empire_namestring(village, empire) local names = { {"Yongan", "Joan", "Pyungmoo"}, {"Jayang", "Bokjung", "Bakra"}, } return names[village][empire] end function get_empire_castle_name() local castle_names = {"Burg Milaard", "Burg Listhmos", "Burg Dendera"} return castle_names[pc.get_empire()] end function get_guild_map_name() local guild_map_names = {"Jungrang (Gildenzone)", "Waryong (Gildenzone)", "Imha (Gildenzone)"} return guild_map_names[pc.get_empire()] end end end





2011
----------------------------------------------------
quest map_warp begin
state start begin
when 9012.chat."Möchtest du reisen?" begin
say_title("Teleporter:")
say("Dies ist eine faszinierende Gegend. Aber")
say("passiert hier denn auch mal etwas")
say("Außergewöhnliches? Eher wohl nicht. In anderen")
say("Teilen des Landes sieht es mitunter ganz anders.")
say("aus! Es gibt daher sicher einen intressanten")
say("Ort, an den ich dich teleportieren könnte. Da")
say("jedoch die Kräfte des Bösen wieder stärker")
say("geworden sind, wurden Raum und Zeit ins Chaos")
say("gestürzt. Dadurch kann es passieren, dass deine")
say("Rückkehr nicht immer augenblicklich funktioniert.")
say("Möchtest du dennoch teleportiert werden?")
local main_set = select("Ja", "Nein")
if main_set == 2 then
return
end
if pc.get_level() <= 10 then
say_title("Teleporter:")
say("Hm… Mit deinem derzeitigen Level bist du noch")
say("zu schwach für die Reise durch Zeit und Raum.")
say("Komm wieder, wenn du höher als Level 10 bist.")
return
end
local cost = math.floor(pc.get_level() / 5) * 1000
if cost < 1000 then
cost = 1000
end
wx, wy = map_warp.select_warp_location(0, color256(255, 230, 186).."Teleporter:"..color256(196, 196, 196).."[ENTER]Wohin möchtest du teleportiert werden?[ENTER]"..color256(255, 200, 200)..string.format("Das kostet dich %d Yang.", cost)..color256(196, 196, 196), pc.get_map_index(), pc.get_level())
if wx == 0 and wy == 0 then
return
end
if pc.gold < cost then
say_title("Teleporter:")
say("Du hast nicht genug Geld.")
say("Ich würde dich auch kostenlos teleportieren,")
say("aber ich habe eine große Familie. Um sie zu")
say("ernähren, muss ich Geld verdienen.")
say_reward(string.format("Es kostet dich %d Yang.", cost))
return
end
pc.changegold(-cost)
say_title("Teleporter:")
say("Achtung, ich teleportiere dich jetzt. Du wirst")
say("an einem gefährlichen Ort landen, also pass auf")
say("dich auf. Viel Glück!")
wait()
pc.warp(wx, wy)
end
function select_warp_location(site, text, map_index, level)
say(text)
local more_areas = (table.getn(map_warp.get_warp_set(map_index, level, 1 + (site+1)*6, 5)) > 0)
local warp_set = {}
if more_areas == true and site != 0 then
warp_set = map_warp.get_warp_set(map_index, level, 1 + site*6 + 1, 4)
elseif more_areas == true and site == 0 then
warp_set = map_warp.get_warp_set(map_index, level, 1 + site*6, 5)
else
warp_set = map_warp.get_warp_set(map_index, level, 1 + site*6, 5)
end
local warp_string = {}
local i = 1
while i <= 1 + 5 do
if warp_set[i] == nil then
break
end
table.insert(warp_string, warp_set[i].name)
i = i + 1
end
if site != 0 then
table.insert(warp_string, "Zurück")
end
if more_areas == true then
table.insert(warp_string, "Andere Gebiete")
else
table.insert(warp_string, "Abbrechen")
end
local s = select_table(warp_string)
if s == table.getn(warp_string) and more_areas == false then
return 0, 0
elseif s == table.getn(warp_string) and more_areas == true then
return map_warp.select_warp_location(site + 1, text, map_index, level)
elseif s == table.getn(warp_string) - 1 and site != 0 then
return map_warp.select_warp_location(site - 1, text, map_index, level)
else
return warp_set[s].x, warp_set[s].y
end
end
function get_warp_set(map_index, level, start, length)
local empire = pc.get_empire()
local warp = {
-- map1
{
namestring = map_warp.get_empire_namestring(1, empire),
con = map_warp.is_village_map_index(map_index) == false,
pos = {{469300, 964200}, {55700, 157900}, {969600, 278400}},
},
-- map2
{
namestring = map_warp.get_empire_namestring(2, empire),
con = map_warp.is_village_map_index(map_index) == false,
pos = {{353100, 882900}, {145500, 240000}, {863900, 246000}},
},
-- guild_map
{
namestring = map_warp.get_guild_map_name(),
con = map_warp.is_village_map_index(map_index) == true,
pos = {{128500, 1000}, {179500, 1000}, {271800, 13000}},
},
-- 64 map_n_threeway
{
namestring = "Tal von Seungryong",
con = map_warp.is_village_map_index(map_index) == true,
pos = {{402100, 673900}, {270400, 739900}, {321300, 808000}},
},
-- 63 metin2_map_n_desert_01
{
namestring = "Yongbi-Wüste",
con = map_warp.is_village_map_index(map_index) == true,
pos = {{217800, 627200}, {221900, 502700}, {344000, 502500}},
},
-- 61 map_n_snowm_01
{
namestring = "Berg Sohan",
con = map_warp.is_village_map_index(map_index) == true,
pos = {{434200, 290600}, {375200, 174900}, {491800, 173600}},
},
--empire_castle
{
namestring = map_warp.get_empire_castle_name(),
con = map_warp.is_village_map_index(map_index) == true and game.get_event_flag("empire_castle") == 1,
pos = {{975200, 133000}, {977200, 185000}, {923900, 183600}},
} ,
--Drachengottamulett
{
namestring = "Drachengottamulett benutzen",
con = map_warp.is_village_map_index(map_index) == true,
pos = {{283600, 808300}, {283600, 808300}, {283600, 808300}},
} ,
-- 12 metin2_map_sungzi_milgyo_pass_01
{
namestring = "Zombiemap",
con = (map_warp.is_village_map_index(map_index) == true and level >= 60),
pos = {{1825400, 1821500}, {1825400, 1821500}, {1825400, 1821500}},
},
-- devil_tower
{
namestring = "Dämonenturm",
con = (map_warp.is_village_map_index(map_index) == true and level >= 60),
pos = {{590500, 110500}, {590500, 110500}, {590500, 110500}},
},
-- 62 metin2_map_n_flame_01
{
namestring = "Feuerland",
con = (map_warp.is_village_map_index(map_index) == true and level >= 60),
pos = {{599400, 756300}, {597800, 622200}, {730700, 689800}},
},
-- 67 metin2_map_trent
{
namestring = "Lungsam (Geisterwald)",
con = (map_warp.is_village_map_index(map_index) == true and level >= 60),
pos = {{288700, 5700}, {288700, 5700}, {288700, 5700}},
},
-- 68 metin2_map_trent02
{
namestring = "Lungsam (Roter Wald)",
con = (map_warp.is_village_map_index(map_index) == true and level >= 60),
pos = {{1119900, 70800}, {1119900, 70800}, {1119900, 70800}},
},
-- 8 metin2_map_dragon_timeattack_03
{
namestring = "Wüstenpfad",
con = (map_warp.is_village_map_index(map_index) == true and level >= 60),
pos = {{1008600, 1011700}, {1008600, 1011700}, {1008600, 1011700}},
},
}
local res = {}
local i = start
while i <= start + length do
if warp[i] == nil then
break
end
if warp[i].con == true then
table.insert(res, {name = warp[i].namestring, x = warp[i].pos[empire][1], y = warp[i].pos[empire][2]})
end
i = i + 1
end
return res
end
function is_village_map_index(index)
return (index == 1 or index == 3 or index == 21 or index == 23 or index == 41 or index == 43)
end
function get_empire_namestring(village, empire)
local names = {
{"Yongan", "Joan", "Pyungmoo"},
{"Jayang", "Bokjung", "Bakra"},
}
return names[village][empire]
end
function get_empire_castle_name()
local castle_names = {"Burg Milaard", "Burg Listhmos", "Burg Dendera"}
return castle_names[pc.get_empire()]
end
function get_guild_map_name()
local guild_map_names = {"Jungrang (Gildenzone)", "Waryong (Gildenzone)", "Imha (Gildenzone)"}
return guild_map_names[pc.get_empire()]
end
end
end

