Hallo epvp ich habe ein Problem mit einer Warpquest:
Wenn man auf abbrechen klickt dann bleibt der Text im bild aber das fenster ist zu.
PHP Code:
quest warptest begin
state start begin
when 20093.click begin
say_title("Hallo ".. pc.get_name() ..",")
say("Ich kann dich auf wichtige Maps Teleportieren.")
say("Jede Map hat ein Minimales und Maximales LvL.")
say("D.h du siehst die Maps nur wenn du in derem LvL")
say("bereich bist!")
say_reward("Levelbereiche der Maps:")
say_reward("Lv75-105 - Lv105-115 - Lv115-140 - Lv140-150 - Lv150")
local warptab = {
--[[ Möglich:
empire
minlvl
maxlvl
minalign
maxalign
is_gm (true)
eventflag
]]
["Farmmaps (Lv75 - 150)"] = {
["minlvl"] = 75,
["subs"] = {
["1. Farmmap1 Lv75"] = {["x"] = 5994, ["y"] = 7563, ["minlvl"] = 75},
["2. Farmmap2 Lv105"] = {["x"] = 2887, ["y"] = 57, ["minlvl"] = 105},
["3. Farmmap3 Lv115"] = {["x"] = 11199, ["y"] = 708, ["minlvl"] = 115},
["4. Farmmap4 Lv140"] = {["x"] = 8451, ["y"] = 7459, ["minlvl"] = 140},
["5. Farmmap5 Lv150"] = {["x"] = 5905, ["y"] = 1105, ["minlvl"] = 150},
},
},
["Dungeons (Lv75 - 150)"] = {
["minlvl"] = 75,
["subs"] = {
["1. Beran Setaou Lv75"] = {["x"] = 5994, ["y"] = 7563, ["minlvl"] = 75},
["2. Spinnenbaroness Lv105"] = {["x"] = 2887, ["y"] = 57, ["minlvl"] = 105},
["3. Devil Catacomb Lv115"] = {["x"] = 11199, ["y"] = 708, ["minlvl"] = 115},
["4. Rotdrachen-Festung Lv140"] = {["x"] = 8451, ["y"] = 7459, ["minlvl"] = 140},
["5. Nemeres Warte Lv150"] = {["x"] = 5905, ["y"] = 1105, ["minlvl"] = 150},
},
},
["Levelmaps (Lv75 - 150)"] = {
["minlvl"] = 75,
["subs"] = {
["1. Levelmap1 Lv75"] = {["x"] = 5994, ["y"] = 7563, ["minlvl"] = 75},
["2. Levelmap2 Lv105"] = {["x"] = 2887, ["y"] = 57, ["minlvl"] = 105},
["3. Levelmap3 Lv115"] = {["x"] = 11199, ["y"] = 708, ["minlvl"] = 115},
["4. Levelmap4 Lv140"] = {["x"] = 8451, ["y"] = 7459, ["minlvl"] = 140},
["5. Levelmap5 Lv150"] = {["x"] = 5905, ["y"] = 1105, ["minlvl"] = 150},
},
},
}
-- Ab hier nichts mehr Ändern.
local wp = {}
-- Kategorien
local function create_list(nm,index)
table.foreach((index or warptab),
function(i,l)
local x = (nm or '')..'#/'..i
--print(i,x)
if l.subs ~= nil then
create_list(x,l.subs)
wp[x] = {["type"] = "kat"}
else
wp[x] = l
wp[x]["type"] = "warp"
wp[x]["kat"] = (nm or '')
end
end
)
end
--Erstelle Liste der vorhandenen Warps
create_list()
local function show_menu(id,kat)
local index = id or 1
-- Funktionen START
local function count(str,del)
local out = 0
for i in string.gfind(str,del) do
out = out+1
end
return out
end
local function trim(str)
str = string.gsub(str,'.-#/','',index)
return str
end
-- Funktionen ENDE
-- Erstellen der Warpliste f??elect2
local wl,co = {
["list"] = {},
["data"] = {},
},1
table.sort(wp)
table.foreach(wp,
function(i,l)
if count(i,'.-#/') == index then
local function cc()
-- Da es viele If's sind, nicht extra eingerückt
if l.empire == nil or l.empire == pc.get_empire() then
if l.maxlvl == nil or pc.get_level() <= l.maxlvl then
if l.minlvl == nil or pc.get_level() >= l.minlvl then
if l.minalign == nil or pc.get_real_alignment() >= l.minalign then
if l.maxalign == nil or pc.get_real_alignment() <= l.maxalign then
if l.eventflag == nil or game.get_event_flag(l.eventflag) == 1 then
if l.is_gm == nil or pc.is_gm() == l.is_gm then
if l.type == "kat" then
local str = ' '..(string.gsub(trim(i),'#%d+',''))..' '
wl.list[co] = str
wl.data[str] = l
wl.data[str]["name"] = i
else
local str = (string.gsub(trim(i),'#%d+',''))
wl.list[co] = str
wl.data[str] = l
end
co = co+1
end -- gamemaster
end -- eventflag
end -- maxalign
end -- minalign
end -- minlvl
end -- maxlvl
end -- empire
-- if Block ende
end
if index == 1 then
cc()
elseif kat ~= nil and string.sub(i,1,string.len(kat)) == kat then
cc()
end
end
end
)
-- Ausgabe
table.sort(wl.list)
table.insert(wl.list,1,8)
if index ~= 1 then
table.insert(wl.list,'Zurück')
end
table.insert(wl.list,'Abbrechen')
local sel = select2(wl.list)
if sel == table.getn(wl.list) then return end
if index ~= 1 and sel == table.getn(wl.list)-1 then
local nextkat = function()
local t,out = split(kat,'#/'),''
table.foreach(t,
function(i,l)
if i < table.getn(t) and i > 1 then
out = out..'#/'..l
end
end
)
return out
end
show_menu(index-1,nextkat())
return
end
if wl.data[wl.list[sel]]["type"] == "kat" then
show_menu(index+1, wl.data[wl.list[sel]]["name"],kat or nil)
return
else
pc.warp(wl.data[wl.list[sel]]["x"]*100,wl.data[wl.list[sel]]["y"]*100)
end
end
show_menu()
end
end
end