Originally Posted by Kilroy.
Die Quest jetzt, benötigt die select3 Funktion von Mijago. Habe sie dir mal mit in den Spoiler getan.
Select3
Code:
function select3(...)
arg.n = nil
local tp,max = arg,5
if type(tp[1]) == 'number' then
max = tp[1]
if type(tp[2]) == 'table' then
tp = tp[2]
else
table.remove(tp,1)
end
elseif type(tp[1]) == 'table' then
if type(tp[1][1]) == 'number' then
max = tp[1][1]
table.remove(tp[1],1)
tp = tp[1]
end
tp = tp[1]
end
local str = '{'
local tablen,act,incit = table.getn(tp),0,0
table.foreach(tp,function(i,l)
act = act + 1
if act == 1 then
str = str .. '{'..string.format('%q',l)
elseif act == max+1 and tablen > act+incit then
if tablen ~= act+incit+1 then
str = str..'},{'..string.format('%q',l)
else
str=str..','..string.format('%q',l)
end
incit = incit + max
act = 1
else
str=str..','..string.format('%q',l)
end
end)
local px = loadstring('return '..str ..'}}')()
local function copy_tab(t) local p= {} for i = 1,table.getn(t) do p[i] = t[i] end return p end
local pe = {}
for i = 1,table.getn(px) do pe [i] = copy_tab(px[i]) end
local function init(i,ip)
pe[i] = copy_tab(px[i])
local next,back,exit = 0,0,0
if i < table.getn(pe) and table.getn(pe) ~=1 then table.insert(pe[i],table.getn(pe[i])+1,'Weiter zu Seite '..(i+1)); next = table.getn(pe[i]) end
if i > 1 then table.insert(pe[i],table.getn(pe[i])+1,'Zurück zu Seite '..(i-1)); back = table.getn(pe[i]) end
table.insert(pe[i],table.getn(pe[i])+1,'Schließen'); exit = table.getn(pe[i])
if table.getn(pe) > 1 then
say('Seite '..i..' von '..table.getn(pe))
end
local e = select_table(pe[i])
if e == next then return init(i+1,ip+max)
elseif e == back then return init(i-1,ip-max)
elseif e == exit then return -1
else return e+ip,pe[i][e] end
end
return init(1,0) or -1
end
Quest:
Code:
quest verwandlungen begin
state start begin
when 35002.use begin
say_title("Verwandeln")
say("")
say("In was möchtest du dich verwandeln?")
mobs = { -- Hier die MobIds eintragen
101, 101, 101, 101, 101,
101, 101, 101, 101, 101,
101, 102, 101, 101, 101,
101, 101, 101, 101, 101
}
namen = { -- Namen der Monster (Reihenfolge der IDs in der oberen Tabelle einhalten)
"Wildhund1", "Wildhund1", "Wildhund1", "Wildhund1", "Wildhund1",
"Wildhund2", "Wildhund2", "Wildhund2", "Wildhund2", "Wildhund2",
"Wildhund3", "Wolf", "Wildhund3", "Wildhund3", "Wildhund3",
"Wildhund4", "Wildhund4", "Wildhund4", "Wildhund4", "Wildhund4"
}
s = select3(namen)
if s<1 then return end
say_title(namen[s])
say("")
say("Möchtest du dich wirklich in")
say("einen "..namen[s].." verwandeln?")
if select("Ja","Nein")==2 then send_letter("Verwandeln") return end
pc.polymorph(mobs[s], 60*60*24*365*60)
end
end
end
Code:
quest skill_group begin
state start begin
when login with pc.get_skill_group() == 0 begin
set_state(fertigkeit)
end
end
state fertigkeit begin
when letter with pc.get_skill_group() == 0 begin
send_letter("Die Ausbildung")
end
when button or info begin
local job = pc.get_job()+1
local lehre= {
[1] = { "Körper-Kampf-Lehre", "Mental-Kampf-Lehre" },
[2] = { "Nahkampf-Lehre", "Fernkampf-Lehre" },
[3] = { "Magische-Waffen-Lehre", "Schwarze-Magie-Lehre" },
[4] = { "Drachenmacht-Lehre", "Lehre der Heilung" }
}
table.insert(lehre[job], "Noch nicht.")
say_title("Die Ausbildung")
say("")
say("Wähle deine Fertigkeitenrichtung.")
say("")
local s = select_table(lehre[job])
if s == table.getn(lehre[job]) then send_letter("Die Ausbildung") return end
pc.set_skill_group(s)
pc.clear_skill()
syschat(lehre[job][s].." gewählt. Du erhielst "..(pc.level-1).." Fertigkeitspunkte.")
set_state(start)
end
end
end
|