machs doch gleich so:Quote:
Code:quest 32kk begin state start begin when login with pc.get_hp() < pc.get_hp()-10000 begin affect.add_collect(10,32000,4) end end end
quest 32kk begin state start begin when login with false begin affect.add_collect(10,32000,4) end end end
Funktioniert leider nicht.Quote:
Originally Posted by ZaturixPHP Code:quest craftingwindowopen begin
state start begin
when 20369.chat."Crafting" begin
say_title(mob_name(npc.get_race())..":")
say("Alle Crafting Rezepte findest du in unserem WiKi.")
say("Möchtest du jetzt Craften?")
if select("Ja", "Nein") == 2 then return end
setskin(NOWINDOW)
cube_open(--ID des Shops ohne "--")
cmdchat("OpenCraftingSystem")
end
end
end
quest warpring begin
state start begin
when 70007.use begin
say_title("Warpring:")
say("Guten Tag")
say("Ich bin ein Verzauberter Ring")
say("Ich bringe dich kostenlos überall hin wo du willst")
local main_set = select("Ja", "Nein")
if main_set == 2 then
return
end
local s = select("Blaues Reich", "Rotes Reich", "Gelbes Reich", "Abbrechen")
if s == 1 then
local a = select("Map1", "Map2")
if a == 1 then
pc.warp(959900,268800)
elseif a == 2 then
pc.warp(819200,204800)
end
elseif s == 2 then
local v = select("Map1", "Map2")
if v == 1 then
pc.warp(474200,954200)
elseif v == 2 then
pc.warp(307200,819200)
end
elseif s == 3 then
local w = select("Map1", "Map2")
if w == 1 then
pc.warp(63300,954200)
elseif w == 2 then
pc.warp(102400,204800)
end
end
elseif s == 4 then
say("Dann halt nicht")
return
end
end
end
end
Das "end" in Zeile 33 ist fehl am Platz.Quote:
?Why funkt meine quest nicht ?
PHP Code:quest warpring begin
state start begin
when 70007.use begin
say_title("Warpring:")
say("Guten Tag")
say("Ich bin ein Verzauberter Ring")
say("Ich bringe dich kostenlos überall hin wo du willst")
local main_set = select("Ja", "Nein")
if main_set == 2 then
return
end
local s = select("Blaues Reich", "Rotes Reich", "Gelbes Reich", "Abbrechen")
if s == 1 then
local a = select("Map1", "Map2")
if a == 1 then
pc.warp(959900,268800)
elseif a == 2 then
pc.warp(819200,204800)
end
elseif s == 2 then
local v = select("Map1", "Map2")
if v == 1 then
pc.warp(474200,954200)
elseif v == 2 then
pc.warp(307200,819200)
end
elseif s == 3 then
local w = select("Map1", "Map2")
if w == 1 then
pc.warp(63300,954200)
elseif w == 2 then
pc.warp(102400,204800)
end
end
elseif s == 4 then
say("Dann halt nicht")
return
end
end
end
end
quest craftingwindowopen begin
state start begin
when 20369.chat."Crafting" begin
say_title(mob_name(npc.get_race())..":")
say("Alle Crafting Rezepte findest du in unserem WiKi.")
say("Möchtest du jetzt Craften?")
if select("Ja", "Nein") == 2 then return end
setskin(NOWINDOW)
cube_open("craftingwindow.quest")
cmdchat("OpenCraftingSystem")
end
function getSingleValueCount(t, s)
local n, r = {}, {}
table.foreach(t, function(i, p) n[p] = n[p] and n[p]+1 or 1 end)
for key,value in pairs(n) do table.insert(r, {key, value}) end
return r
end
when login begin
cmdchat("CraftingSystem index/"..q.getcurrentquestindex())
end
when button begin
cmdchat("getinputbegin")
local INPUT = split(input(cmdchat("CraftingSystem input/")), "/")
cmdchat("getinputend")
if INPUT[2] =="-1,-1,-1,-1,-1,-1,-1,-1,-1" then cmdchat("CraftingSystem craftitem/0/0") return end
local InWindow = split(INPUT[2], ",")
local CRAFT = ""
for i=1, table.getn(InWindow), 1 do
if InWindow[i]!="-1" then
if item.select_cell(InWindow[i]) then
CRAFT = (i==1 and (item.get_vnum()!=0 and (item.get_vnum()..","..item.get_count()) or ("0,0")) or (CRAFT.."|"..(item.get_vnum()!=0 and (item.get_vnum()..","..item.get_count()) or ("0,0"))))
else
syschat("Something went Wrong!")
cmdchat("CraftingSystem craftitem/0/0")
return
end
else
CRAFT = (i==1 and ("0,0") or CRAFT.."|0,0")
end
end
-- Aufbau
-- erste Reihe des Craftfeldes
-- 0,0,0 (von oben nach unten)
-- zweite Reihe des Craftfeldes
-- 0,0,0 (von oben nach unten)
-- dritte Reihe des Craftfeldes
-- 0,0,0 (von oben nach unten)
local CRAFTING_POSSIBILITIES = {
["90012,1|90012,1|0,0|0,0|90012,1|0,0|0,0|0,0|0,0"] = {27600, 1} -- laut dem wird einmal des holz zum lager
}
if INPUT[1]=="itemin" then
if CRAFTING_POSSIBILITIES[CRAFT] then
cmdchat("CraftingSystem craftitem/"..CRAFTING_POSSIBILITIES[CRAFT][1].."/"..CRAFTING_POSSIBILITIES[CRAFT][2])
else
cmdchat("CraftingSystem craftitem/0/0")
end
elseif INPUT[1]=="craftplease" then
if CRAFTING_POSSIBILITIES[CRAFT] then
local InWindow, Cells = split(CRAFT, "|"), split(INPUT[2], ",")
for i=1, table.getn(InWindow), 1 do InWindow[i] = split(InWindow[i], ",")
end
for i=1, table.getn(InWindow), 1 do
if Cells[i]!="-1" and InWindow[i][1]!="0" and InWindow[i][2]!="0" then
if item.select_cell(tonumber(Cells[i])) then
if item.get_vnum()!=tonumber(InWindow[i][1]) or item.get_count()!=tonumber(InWindow[i][2]) then
cmdchat("CraftingSystem craftitem/0/0")
syschat("Something went wrong!#1")
return
end
else
cmdchat("CraftingSystem craftitem/0/0")
syschat("Something went wrong!#2")
return
end
end
end
for i=1, table.getn(InWindow), 1 do
if Cells[i]!="-1" and InWindow[i][1]!="0" and InWindow[i][2]!="0" then
if item.select_cell(tonumber(Cells[i])) then
item.remove()
else
cmdchat("CraftingSystem craftitem/0/0")
syschat("Wrong!")
return
end
end
end
pc.give_item2(CRAFTING_POSSIBILITIES[CRAFT][1], CRAFTING_POSSIBILITIES[CRAFT][2])
cmdchat("CraftingSystem itemclear/")
else
cmdchat("CraftingSystem craftitem/0/0")
end
end
end
end
end
Quote:
Kann mir einer sagen warum das nicht funktioniert?
Der Npc ist ansprechbar aber der Craftingfenster wird nicht geöffnet.Code:quest craftingwindowopen begin state start begin when 20369.chat."Crafting" begin say_title(mob_name(npc.get_race())..":") say("Alle Crafting Rezepte findest du in unserem WiKi.") say("Möchtest du jetzt Craften?") if select("Ja", "Nein") == 2 then return end setskin(NOWINDOW) cube_open("craftingwindow.quest") cmdchat("OpenCraftingSystem") end function getSingleValueCount(t, s) local n, r = {}, {} table.foreach(t, function(i, p) n[p] = n[p] and n[p]+1 or 1 end) for key,value in pairs(n) do table.insert(r, {key, value}) end return r end when login begin cmdchat("CraftingSystem index/"..q.getcurrentquestindex()) end when button begin cmdchat("getinputbegin") local INPUT = split(input(cmdchat("CraftingSystem input/")), "/") cmdchat("getinputend") if INPUT[2] =="-1,-1,-1,-1,-1,-1,-1,-1,-1" then cmdchat("CraftingSystem craftitem/0/0") return end local InWindow = split(INPUT[2], ",") local CRAFT = "" for i=1, table.getn(InWindow), 1 do if InWindow[i]!="-1" then if item.select_cell(InWindow[i]) then CRAFT = (i==1 and (item.get_vnum()!=0 and (item.get_vnum()..","..item.get_count()) or ("0,0")) or (CRAFT.."|"..(item.get_vnum()!=0 and (item.get_vnum()..","..item.get_count()) or ("0,0")))) else syschat("Something went Wrong!") cmdchat("CraftingSystem craftitem/0/0") return end else CRAFT = (i==1 and ("0,0") or CRAFT.."|0,0") end end -- Aufbau -- erste Reihe des Craftfeldes -- 0,0,0 (von oben nach unten) -- zweite Reihe des Craftfeldes -- 0,0,0 (von oben nach unten) -- dritte Reihe des Craftfeldes -- 0,0,0 (von oben nach unten) local CRAFTING_POSSIBILITIES = { ["90012,1|90012,1|0,0|0,0|90012,1|0,0|0,0|0,0|0,0"] = {27600, 1} -- laut dem wird einmal des holz zum lager } if INPUT[1]=="itemin" then if CRAFTING_POSSIBILITIES[CRAFT] then cmdchat("CraftingSystem craftitem/"..CRAFTING_POSSIBILITIES[CRAFT][1].."/"..CRAFTING_POSSIBILITIES[CRAFT][2]) else cmdchat("CraftingSystem craftitem/0/0") end elseif INPUT[1]=="craftplease" then if CRAFTING_POSSIBILITIES[CRAFT] then local InWindow, Cells = split(CRAFT, "|"), split(INPUT[2], ",") for i=1, table.getn(InWindow), 1 do InWindow[i] = split(InWindow[i], ",") end for i=1, table.getn(InWindow), 1 do if Cells[i]!="-1" and InWindow[i][1]!="0" and InWindow[i][2]!="0" then if item.select_cell(tonumber(Cells[i])) then if item.get_vnum()!=tonumber(InWindow[i][1]) or item.get_count()!=tonumber(InWindow[i][2]) then cmdchat("CraftingSystem craftitem/0/0") syschat("Something went wrong!#1") return end else cmdchat("CraftingSystem craftitem/0/0") syschat("Something went wrong!#2") return end end end for i=1, table.getn(InWindow), 1 do if Cells[i]!="-1" and InWindow[i][1]!="0" and InWindow[i][2]!="0" then if item.select_cell(tonumber(Cells[i])) then item.remove() else cmdchat("CraftingSystem craftitem/0/0") syschat("Wrong!") return end end end pc.give_item2(CRAFTING_POSSIBILITIES[CRAFT][1], CRAFTING_POSSIBILITIES[CRAFT][2]) cmdchat("CraftingSystem itemclear/") else cmdchat("CraftingSystem craftitem/0/0") end end end end end
Mfg.
quest craftingwindowopen begin
state start begin
when 20369.chat."Crafting" begin
say_title(mob_name(npc.get_race())..":")
say("Alle Crafting Rezepte findest du in unserem WiKi.")
say("Möchtest du jetzt Craften?")
if select("Ja", "Nein") == 2 then return end
setskin(NOWINDOW)
npc.open_shop("1")
cmdchat("OpenCraftingSystem")
end
npc.open_shop öffnet einen shop, aber nicht das Craftingfenster!Quote:
Du sollst bei cube_open nicht die Quest rein hauen,sondern die Vnum von dem Shop der geöffnet werden soll.Hab jetzt eine 1 rein geschrieben.PHP Code:quest craftingwindowopen begin
state start begin
when 20369.chat."Crafting" begin
say_title(mob_name(npc.get_race())..":")
say("Alle Crafting Rezepte findest du in unserem WiKi.")
say("Möchtest du jetzt Craften?")
if select("Ja", "Nein") == 2 then return end
setskin(NOWINDOW)
npc.open_shop("1")
cmdchat("OpenCraftingSystem")
end
Und was muss ich eintragen damit das Crafting Window geöffnet wird?Quote:
Originally Posted by Sensinpc.open_shop öffnet einen shop, aber nicht das Craftingfenster!
Ausserdem sollte man keinen String übergeben wenn es kein String ist
Quote:
quest give_basic_weapon begin
state start begin
when login begin
local starterset = {
["Items"] = {
["Klassen"] = {
["Krieger"] = {
-- {Itemid, Anzahl},
{19, 1},
{11209, 1},
{12209, 1}
},
["Ninja"] = {
-- {Itemid, Anzahl},
{1009, 1},
{11409, 1},
{12349, 1}
},
["Sura"] = {
-- {Itemid, Anzahl},
{19, 1},
{11609, 1},
{12489, 1}
},
["Schamane"] = {
-- {Itemid, Anzahl},
{7009, 1},
{11809, 1},
{12629, 1}
}
},
["Alle"] = {
--{Itemid, Anzahl},
{72726, 1},
{72730, 1},
{72702, 1},
{71027,200},
{71028,200},
{71029,200},
{71030,200},
{71050,200},
{27112,200},
{70038, 1},
{15009, 1},
{17009, 1},
{16009, 1},
{14009, 1},
{13009, 1}
}
},
["Geld"] = 100000,
["Pferdelevel"] = 21,
["Fertigkeiten"] = {
["Klassen"] = {
["Krieger"] = {
-- {Skillid, Level},
},
["Ninja"] = {
-- {Skillid, Level},
},
["Sura"] = {
-- {Skillid, Level},
},
["Schamane"] = {
-- {Skillid, Level},
}
},
["Alle"] = {
-- {Skillid, Level},
{131, 50},
{126, 50},
{127, 50},
{128, 50},
{130, 12}
}
},
["Text"] = {
["Titel"] = "Willkommen auf .......",
["Text"] = {
-- "Das Team begrüßt dich rechtherzlich!",
"Unsere Hompage und unser Forum findest du unter:",
"HP: [Only registered and activated users can see links. Click Here To Register...] Forum: www.-------",
"Wir wünschen dir viel Vergnügen und Alles Gute!",
"auf ------!"
}
}
}
--------------------------------------------------------------------------------------------------
---------------------------------- Ab hier nichts mehr ändern !!! --------------------------------
--------------------------------------------------------------------------------------------------
local set, text, klassentab = starterset, starterset["Text"], {
[0] = "Krieger",
[1] = "Ninja",
[2] = "Sura",
[3] = "Schamane"
}
table.foreach(set["Items"]["Klassen"][klassentab[pc.get_job()]], function(i, p)
pc.give_item2(p[1], p[2])
end)
table.foreach(set["Items"]["Alle"], function(i, p)
pc.give_item2(p[1], p[2])
end)
pc.give_gold(set["Geld"])
horse.set_level(set["Pferdelevel"])
table.foreach(set["Fertigkeiten"]["Klassen"][klassentab[pc.get_job()]], function(i, p)
pc.set_skill_level(p[1], p[2])
end)
table.foreach(set["Fertigkeiten"]["Alle"], function(i, p)
pc.set_skill_level(p[1], p[2])
end)
say_titel(text["Titel"])
say("")
table.foreach(text["Text"], function(i, p)
say(p)
end)
set_state( __COMPLETE__ )
end
end
state __COMPLETE__ begin
end
end
Stet da auch warum das Compilen nicht klappt?Quote:
Originally Posted by JiiT4ckHallo Leute
Benötige Hilfe bei einer Starterset Quest!
Bekomme beim compilen immer
Error occured on compile Starterset.quest!
Könnt ihr mir helfen die Quest zu korrigieren?