hello every one,i will share my gaming quest for you,if you like it,please give thanks.
sorry for my english.
sorry for my english.
PHP Code:
quest bocai begin
state start begin
when letter with pc . is_gm ( ) begin
send_letter ( "GM betting Settings" )
end
when button or info begin
say ( "gaming Settings" )
caidan = select ("Automatic gaming system","Manual gaming system","Cancel")
if caidan == 1 then
sheding = select ("activate the automatic gaming system", "stop automatic gaming system", "stop the current round of betting," "set the reward items," "bet Time Setting", "Duijiang time setting", "Cancel" )
if sheding == 1 then
if game . get_event_flag ( "auto" ) >= 1 then
say ( "automatic system has been in active gaming" )
else
say ( "gaming system is automatically activated." )
game . set_event_flag ( "auto" , 1 )
server_timer ( "mex" , t )
end
elseif sheding == 2 then
say ( "automatic gaming system has stopped" )
game . set_event_flag ( "auto" , 0 )
clear_server_timer ( "mex" )
clear_server_timer ( "mex1" )
elseif sheding == 3 then
local aa = number(1, 9)
local bb = number(1, 9)
local cc = number(1, 9)
game.set_event_flag("aa", aa)
game.set_event_flag("bb", bb)
game.set_event_flag("cc", cc)
game.set_event_flag("caipiao", 0)
notice_all("the end of this round of betting.")
notice_all("the ultimate winning numbers: "..aa.."-"..bb.." lucky number is:"..cc.."")
elseif sheding == 4 then
say_title("Grand Prize award set!")
say_reward("Please enter the Grand Prize item ID!")
local wupin = input()
say_reward("Please enter a display name of reward.")
local shuliang = input()
say_reward("Grand Prize award items is:")
say_item(" ", wupin, " ")
say("[COLOR r;0|g;1|b;0.2] "..shuliang.."X 1个[/COLOR]")
say("")
say("")
local js = select("OK", "Cancel")
if js == 1 then
game.set_event_flag("wupin", wupin)
game.set_event_flag("shuliang", shuliang)
else
say_title("Please re-enter the Grand Prize award!")
end
elseif sheding == 5 then
say ( "Please enter a bet every time the value:" )
m = tonumber(input())
if m == nil then
say ( "You must enter the number" )
elseif m < 1 then
say ( "You must enter the number greater than 0" )
else
h = select ( "seconds" , "minute" , "hour" )
if h == 1 then
t = m
elseif h == 2 then
t = tonumber(m * 60)
elseif h == 3 then
t = tonumber(m * 60 * 60)
end
end
elseif sheding == 6 then
say ( "Please enter Duijiang time interval values:" )
n = tonumber(input())
if n == nil then
say ( "You must enter the number" )
elseif n < 1 then
say ( "You must enter the number greater than 0" )
else
h1 = select ( "seconds" , "minute" , "hour" )
if h1 == 1 then
t1 = n
elseif h == 2 then
t1 = tonumber(n * 60)
elseif h == 3 then
t1 = tonumber(n * 60 * 60)
end
end
end
elseif caidan == 2 then
say("Manual Gaming System")
else
end
end
when mex.server_timer begin
if game.get_event_flag ( "auto" ) == 1 then
notice_all("a new round of betting has been opened!")
notice_all("Players can bet the city of the NPC。")
game.set_event_flag("caipiao", 1)
game.set_event_flag ("yideng", 0)
game.set_event_flag ("erdeng", 0)
game.set_event_flag ("tedeng", 0)
server_timer ( "mex1" , t )
else
end
end
when mex1.server_timer begin
if game . get_event_flag ( "auto" ) == 1 then
local aa = number(1, 9)
local bb = number(1, 9)
local cc = number(1, 9)
game.set_event_flag("aa", aa)
game.set_event_flag("bb", bb)
game.set_event_flag("cc", cc)
game.set_event_flag("caipiao", 0)
notice_all("the end of this round of betting.")
notice_all("the ultimate winning numbers: "..aa.."-"..bb.." lucky number is:"..cc.."")
server_timer ( "mex" , t1 )
else
end
end
when 11001.chat."betting" with game.get_event_flag("caipiao") == 1 begin
say_title("betting!")
say("Rule description:")
say("betting round choice two ordinary numbers and a lucky number.")
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
say("number range is 1-9.")
say("[COLOR r;1.2|g;0.4|b;0.4]whether to continue?[/COLOR]")
local xuanze = select("OK", "Cancel")
if xuanze == 1 then
if pc . gold > 10000000 then
pc.setqf("a", 0)
pc.setqf("b", 0)
pc.setqf("c", 0)
say_title("betting!")
say("Rule description:")
say("betting round choice two ordinary numbers and a lucky number.")
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
say("number range is 1-9.")
say("[COLOR r;1.2|g;0.4|b;0.4]Enter the first number(1-9).[/COLOR]")
local a = input()
say_title("betting!")
say("Rule description:")
say("betting round choice two ordinary numbers and a lucky number.")
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
say("number range is 1-9.")
say_reward("you choose the first number: "..a.."")
say("[COLOR r;1.2|g;0.4|b;0.4]Please enter the second number(1-9).[/COLOR]")
local b = input()
say_title("betting!")
say("Rule description:")
say("betting round choice two ordinary numbers and a lucky number.")
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
say("number range is 1-9.")
say_reward("you choose the first number: "..a.."")
say_reward("you choose the second number: "..b.."")
say("[COLOR r;1.2|g;0.4|b;0.4]Please, enter your lucky numbers(1-9).[/COLOR]")
local c = input()
say_title("betting!")
say("Rule description:")
say("betting round choice two ordinary numbers and a lucky number.")
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
say("number range is 1-9.")
say("[COLOR r;1|g;0|b;1]you choose the first number: "..a.."[/COLOR]")
say("[COLOR r;1|g;0|b;1]you choose the second number: "..b.."[/COLOR]")
say("[COLOR r;1|g;0|b;1]your lucky number is: "..c.."[/COLOR]")
say("")
say("[COLOR r;1|g;1|b;0]Please confirm whether the bet, if confirmed, will directly deduct the amount bet[/COLOR]")
local tz = select("sure bet", "rebet")
if tz == 1 then
say("[COLOR r;1|g;1|b;0]betting success! [/COLOR]")
pc.setqf("a", a)
pc.setqf("b", b)
pc.setqf("c", c)
pc.setqf("d", 1)
pc . change_money ( - 10000000 )
else
say_title("Please reenter the betting number!")
end
else
say("betting needs 10,000,000 gold every time.")
end
else
say_title("Welcome to your next bet!")
end
end
when 11001.chat."prize pool exchange" with game.get_event_flag("caipiao") == 0 begin
say_title("round of betting is over.")
say_reward("the ultimate winning numbers: "..game.get_event_flag("aa").."-"..game.get_event_flag("bb").." lucky number is:"..game.get_event_flag("cc").."")
say("You choose the number ultimately: "..pc.getqf("a").."-"..pc.getqf("b").."lucky number is:"..pc.getqf("c").."")
say("")
local a1 = pc.getqf("a")
local b1 = pc.getqf("b")
local c1 = pc.getqf("c")
local aa1 = game.get_event_flag("aa")
local bb1 = game.get_event_flag("bb")
local cc1 = game.get_event_flag("cc")
local wupin1 = game.get_event_flag("wupin")
local shuliang1 = game.get_event_flag("shuliang")
if pc.getqf("d") == 1 then
if a1 == aa1 then
if b1 == bb1 and c1 != cc1 then
say("Congratulations! the first prize")
game . set_event_flag ( "yideng" , game . get_event_flag ( "yideng" ) + 1 )
pc.setqf("d", 0)
return
elseif b1 == bb1 and c1 == cc1 then
say ("Congratulations! in the Grand Prize")
pc.give_item2(wupin1,shuliang1)
game . set_event_flag ( "tedeng" , game . get_event_flag ( "tedeng" ) + 1 )
pc.setqf("d", 0)
return
else
say ("Congratulations! in the second prize.")
game . set_event_flag ( "erdeng" , game . get_event_flag ( "erdeng" ) + 1 )
pc.setqf("d", 0)
return
end
elseif a1 != aa1 then
if b1 == bb1 and c1 != cc1 then
say ("Congratulations! in the second prize.")
game . set_event_flag ( "yideng" , game . get_event_flag ( "yideng" ) + 1 )
pc.setqf("d", 0)
return
else
say ("Too bad you did not win")
end
elseif a1 == bb1 then
if b1 == aa1 and c1 != cc1 then
say ("Congratulations! the first prize")
game . set_event_flag ( "yideng" , game . get_event_flag ( "yideng" ) + 1 )
pc.setqf("d", 0)
return
elseif b1 == aa1 and c1 == cc1 then
say ("Congratulations! in the Grand Prize")
pc.give_item2(wupin1,shuliang1)
game . set_event_flag ( "tedeng" , game . get_event_flag ( "tedeng" ) + 1 )
pc.setqf("d", 0)
return
else
say ("Congratulations! in the second prize.")
game . set_event_flag ( "erdeng" , game . get_event_flag ( "erdeng" ) + 1 )
pc.setqf("d", 0)
return
end
else
say ("Too bad you did not win")
end
elseif b1 != bb1 then
if a1 == aa1 and c1 != cc1 then
say ("Congratulations! in the second prize.")
game . set_event_flag ( "yideng" , game . get_event_flag ( "yideng" ) + 1 )
pc.setqf("d", 0)
return
else
say ("Too bad you did not win")
end
else
say ("you have not been betting or have already received the award.")
end
end
when 11001.chat."grand prize round of betting inquiry" with game.get_event_flag("caipiao") == 0 begin
local wupin2 = game.get_event_flag("wupin")
local shuliang2 = game.get_event_flag("shuliang")
local name1 = game.get_event_flag("name")
say_title ("Grand Prize award check!")
say_reward ("Grand Prize of the current round of awards is:")
say_item(" ", wupin2, "")
say("[COLOR r;1|g;1|b;0] 1个[/COLOR]")
say("")
say_reward("Second Prize have: "..game.get_event_flag("erdeng").."")
say_reward("the first prize have: "..game.get_event_flag("yideng").."")
say_reward("Grand Prize have: "..game.get_event_flag("tedeng").."")
say("")
end
end
end