PHP Code:
quest change_to_lotto begin
state start begin
when 50027.use begin
if game.get_event_flag("lotto_event_round")!= pc.getqf("lotto_round") then
say("Dein Lotterilos ist wertlos da es aus einer")
say("schon beendeten Runde stammt")
say("")
say("Es ist verschwunden")
pc.removeitem(50027, 1)
return
end
local n1=pc.getqf("lotto_zahl_1")
local n2=pc.getqf("lotto_zahl_2")
local n3=pc.getqf("lotto_zahl_3")
local n4=pc.getqf("lotto_zahl_4")
local n5=pc.getqf("lotto_zahl_5")
local n6=pc.getqf("lotto_zahl_6")
chat("Gewählte Zahlen: "..n1.." | "..n2.." | "..n3.." | "..n4.." | "..n5.." | "..n6.."")
end
when 20094.chat."Lotto verwalten" with pc.is_gm() begin
if game.get_event_flag("lotto_event_status")==0 then
say("Lotto starten?")
local s=select("Starten", "Nein")
if s==2 then
return
end
if s==1 then
notice_all("Eine weitere Lottorunde wurde gestaret.")
notice_all("Gehe zur Hexe einen Lottoschein auszufüllen")
game.set_event_flag("lotto_event_status", 1)
game.set_event_flag("lotto_event_round", game.get_event_flag("lotto_event_round")+1)
end
elseif game.get_event_flag("lotto_event_status")==1 then
say("Willst du das man keine Lottoscheine")
say("mehr ausfüllen darf?")
say("")
say("Die Lottozahlen werden automatisch")
say("generiert und dann auch bekanntgegeben")
say("")
local s=select("Starten", "Nein")
if s==2 then
return
end
if s==1 then
game.set_event_flag("lotto_event_status", 0)
local lotto_zahl1=number(1, 45)
local lotto_zahl2=number(1, 45)
local lotto_zahl3=number(1, 45)
local lotto_zahl4=number(1, 45)
local lotto_zahl5=number(1, 45)
local lotto_zahl6=number(1, 45)
game.set_event_flag("lotto_zahl_1", lotto_zahl1)
game.set_event_flag("lotto_zahl_2", lotto_zahl2)
game.set_event_flag("lotto_zahl_3", lotto_zahl3)
game.set_event_flag("lotto_zahl_4", lotto_zahl4)
game.set_event_flag("lotto_zahl_5", lotto_zahl5)
game.set_event_flag("lotto_zahl_6", lotto_zahl6)
notice_all("So eben ist die "..game.get_event_flag("lotto_event_round").." Runde Lotto zu ende gegangen! Folgende Zahlen wurden gezogen:")
notice_all(""..lotto_zahl1.." | "..lotto_zahl2.." | "..lotto_zahl3.." | "..lotto_zahl4.." | "..lotto_zahl5.." | "..lotto_zahl6.."") game.set_event_flag("lotto_event_status", 0)
end
else
say("Komisch fehler Melde es dem Admin")
end
end
when .chat."Lotto schein ausfüllen" with game.get_event_flag("lotto_event_status")==1 begin
if pc.getqf("lotto_round")==game.get_event_flag("lotto_event_round") then
say("Du hast diese Runde schon ein Lottoschein")
say("Ausgefüllt")
return
end
say("Willst du einen Lottoschein ausfüllen?")
say("")
local a=select("Ja", "Abbrechen")
if a==2 then
return
end
if a==1 then
say("Gib deine Erste Zahl ein")
say("Alle Zahlen müssen")
say("Zwischen 1 und 45 liegen!")
local lotto_zahl1=input()
local lotto_zahl1=lotto_zahl1+0
if lotto_zahl1<1 or lotto_zahl1>45 then
say("Die Zahl muss zwischen 1 und 45 liegen!")
return
end
say("Zahl 1: "..lotto_zahl1.."")
say("Gib deine Zweite Zahl ein")
local lotto_zahl2=input()
local lotto_zahl2=lotto_zahl2+0
if lotto_zahl2<1 or lotto_zahl2>45 then
say("Die Zahl muss zwischen 1 und 45 liegen!")
end
say("Zahl 1: "..lotto_zahl1.."")
say("Zahl 2: "..lotto_zahl2.."")
say("Gib deine Dritte Zahl ein")
local lotto_zahl3=input()
local lotto_zahl3=lotto_zahl3+0
if lotto_zahl3<1 or lotto_zahl3>45 then
say("Die Zahl muss zwischen 1 und 45 liegen!")
end
say("Zahl 1: "..lotto_zahl1.."")
say("Zahl 2: "..lotto_zahl2.."")
say("Zahl 3: "..lotto_zahl3.."")
say("Gib deine Vierte Zahl ein")
local lotto_zahl4=input()
local lotto_zahl4=lotto_zahl4+0
if lotto_zahl4<1 or lotto_zahl4>45 then
say("Die Zahl muss zwischen 1 und 45 liegen!")
end
say("Zahl 1: "..lotto_zahl1.."")
say("Zahl 2: "..lotto_zahl2.."")
say("Zahl 3: "..lotto_zahl3.."")
say("Zahl 4: "..lotto_zahl4.."")
say("Gib deine Fünfte Zahl ein")
local lotto_zahl5=input()
local lotto_zahl5=lotto_zahl5+0
if lotto_zahl5<1 or lotto_zahl5>45 then
say("Die Zahl muss zwischen 1 und 45 liegen!")
end
say("Zahl 1: "..lotto_zahl1.."")
say("Zahl 2: "..lotto_zahl2.."")
say("Zahl 3: "..lotto_zahl3.."")
say("Zahl 4: "..lotto_zahl4.."")
say("Zahl 5: "..lotto_zahl5.."")
local lotto_zahl6=input()
local lotto_zahl6=lotto_zahl6+0
if lotto_zahl6<1 or lotto_zahl6>45 then
say("Die Zahl muss zwischen 1 und 45 liegen!")
end
say("Zahl 1: "..lotto_zahl1.."")
say("Zahl 2: "..lotto_zahl2.."")
say("Zahl 3: "..lotto_zahl3.."")
say("Zahl 4: "..lotto_zahl4.."")
say("Zahl 5: "..lotto_zahl5.."")
say("Zahl 6: "..lotto_zahl6.."")
say("Willst du diese Zahlen auf deinen Lottoschein")
say("schreiben?")
local s=select("Ja", "Abbrechen")
if s==2 then
return
end
if s==1 then
if game.get_event_flag("lotto_event_status")==0 then
say("Sry, in der Zeit wo du das Los machen wolltest")
say("wurden die Zahlen bekanngegeben!")
say("Versuch es das nächstemal.")
return
end
elseif s==1 then
say("Du hast erfolgreich die Zahlen auf")
say("dein Lotterielos eingetragen!")
say("")
wait()
say("<-------ACHTUNG------->")
say("")
say("Auf dem Los steht das es eine Niete ist")
say("Es stimmt aber nicht und ist bloß ein normales")
say("Lotterilos!")
say("Es wird demnächst abgeändert")
say("Danke für dein verständis")
pc.removeitem(50027, 200)
pc.setqf("lotto_zahl_1", lotto_zahl1)
pc.setqf("lotto_zahl_2", lotto_zahl2)
pc.setqf("lotto_zahl_3", lotto_zahl3)
pc.setqf("lotto_zahl_4", lotto_zahl4)
pc.setqf("lotto_zahl_5", lotto_zahl5)
pc.setqf("lotto_zahl_6", lotto_zahl6)
pc.setqf("lotto_round", game.get_event_flag("lotto_event_round"))
pc.setqf("lottoschein_abgegeben", 0)
pc.give_item2(50027, 1)
end
end
end
when 20094.take begin
local a=item.get_vnum()
local lottoitem=50027
if a!=lottoitem then
return
end
if game.get_event_flag("lotto_event_round")!= pc.getqf("lotto_round") then
say("Die letzte Lottorunde wo du dein Itemabgegebenhast ist vorbei!")
pc.removeitem(a, 1)
return
end
if game.get_event_flag("lotto_event_status")==1 then
say("Die Lotto Zahlen wurden noch nicht gesagt!")
return
end
if pc.getqf("lottoschein_abgegeben")==1 then
say("Du hast bereits einen Lotoschein abgegeben!")
return
end
local n1=pc.getqf("lotto_zahl_1")
local n2=pc.getqf("lotto_zahl_2")
local n3=pc.getqf("lotto_zahl_3")
local n4=pc.getqf("lotto_zahl_4")
local n5=pc.getqf("lotto_zahl_5")
local n6=pc.getqf("lotto_zahl_6")
local l1=game.get_event_flag("lotto_zahl_1")
local l2=game.get_event_flag("lotto_zahl_2")
local l3=game.get_event_flag("lotto_zahl_3")
local l4=game.get_event_flag("lotto_zahl_4")
local l5=game.get_event_flag("lotto_zahl_5")
local l6=game.get_event_flag("lotto_zahl_6")
local win1=0
local win2=0
local win3=0
local win4=0
local win5=0
local win6=0
say("Gezogene Lottozahlen:")
say(""..l1.." | "..l2.." | "..l3.." | "..l4.." | "..l5.." | "..l6.."")
say("Deine Lottozahlen:")
say(""..n1.." | "..n2.." | "..n3.." | "..n4.." | "..n5.." | "..n6.."")
if n1==l1 or n1==l2 or n1==l3 or n1==l4 or n1==l5 or n1==l6 then
win1=1
if n1==l1 then
l1=0
elseif n1==l2 then
l2=0
elseif n1==l3 then
l3=0
elseif n1==l4 then
l4=0
elseif n1==l5 then
l5=0
elseif n1==l6 then
l6=0
end
end
if n2==l1 or n2==l2 or n2==l3 or n2==l4 or n2==l5 or n2==l6 then
win2=1
if n2==l1 then
l1=0
elseif n2==l2 then
l2=0
elseif n2==l3 then
l3=0
elseif n2==l4 then
l4=0
elseif n2==l5 then
l5=0
elseif n2==l6 then
l6=0
end
end
if n3==l1 or n3==l2 or n3==l3 or n3==l4 or n3==l5 or n3==l6 then
win3=1
if n3==l1 then
l1=0
elseif n3==l2 then
l2=0
elseif n3==l3 then
l3=0
elseif n3==l4 then
l4=0
elseif n3==l5 then
l5=0
elseif n3==l6 then
l6=0
end
end
if n4==l1 or n4==l2 or n4==l3 or n4==l4 or n4==l5 or n4==l6 then
win4=1
if n4==l1 then
l1=0
elseif n4==l2 then
l2=0
elseif n4==l3 then
l3=0
elseif n4==l4 then
l4=0
elseif n3==l5 then
l5=0
elseif n3==l6 then
l6=0
end
end
if n5==l1 or n5==l2 or n5==l3 or n5==l4 or n5==l5 or n5==l6 then
win5=1
if n5==l1 then
l1=0
elseif n5==l2 then
l2=0
elseif n5==l3 then
l3=0
elseif n5==l4 then
l4=0
elseif n5==l5 then
l5=0
elseif n5==l6 then
l6=0
end
end
if n6==l1 or n6==l2 or n6==l3 or n6==l4 or n6==l5 or n6==l6 then
win6=1
if n6==l1 then
l1=0
elseif n6==l2 then
l2=0
elseif n6==l3 then
l3=0
elseif n6==l4 then
l4=0
elseif n6==l5 then
l5=0
elseif n6==l6 then
l6=0
end
end
local win=win1+win2+win3+win4+win5+win6
say("Richtige Zahlen: "..win.."")
say("Dein Gewinn:")
if win==0 then
say_reward("Keine! Es gibt erst was ab 3 Richtigen!")
elseif win==1 then
say_reward("Keine! Es gibt erst was ab 3 Richtigen!")
elseif win==2 then
say_reward("Keine! Es gibt erst was ab 3 Richtigen!")
elseif win==3 then
say("Glückwunsch! Du bekommst eine Bronze Urkunde")
pc.give_item2(50038, 1)
elseif win==4 then
say("Glückwunsch! Du bekommst eine Silberne Urkunde")
pc.give_item2(50039, 1)
elseif win==5 then
say("Glückwunsch! Du bekommst eine Goldene Urkunde")
pc.give_item2(50040, 1)
notice_all(""..pc.get_name().." hat 5 Zahlen Richtig getippt!")
elseif win==5 then
say("Glückwunsch! Du bekommst 5 Goldene Urkunde")
pc.give_item2(50040, 1)
pc.give_item2(50040, 1)
pc.give_item2(50040, 1)
pc.give_item2(50040, 1)
pc.give_item2(50040, 1)
notice_all(""..pc.get_name().." hat alle 6 Zahlen Richtig getippt!")
end
pc.setqf("lottoschein_abgegeben", 1)
pc.removeitem(50027, 1)
end
end
end
gibt ein core dump
change_to_lotto.quest 65 abort trap (core dump)
error occured on compile chande_to_lotto.quest