Automatic Ox Event System (Untimely)

03/23/2013 09:39 ErzaČ#1


PHP Code:
--------------------------------------------------------------
--- For 
Epvp
--- ErzaČ
--- Automatic Ox Event
--------------------------------------------------------------
quest automaticoxevent begin
    state start begin
        
-- Dialogue with Uriel
        when 20011.chat
."GM: Automatic Ox Event" with pc.is_gm() and pc.get_name() == "Erza" begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            
            
say("Do you want to open the Ox Event? ")
            
say("")
            
local s select(locale.yes,locale.no)
            if(
== 2then return end
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            
            
say("Ox opened the event!. ")
            
say("Please wait. ")
            
server_timer("countdown",10)
            
game.set_event_flag("automatic_oxevent_status",1)
        
end
        
        
--- Start Countdown !.
        
when countdown.server_timer begin
            
if(game.get_event_flag("automatic_oxevent_status") == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event!. ")
            else
                
notice_all("<Automatic-OxEvent> Ox opened the event!. ")
                
notice_all("<Automatic-OxEvent> 5 Minutes the countdown has begun and Entries will be closed at the end of 5 minutes.. ")
                
server_timer("countdownone",60)
            
end
        end
        
        
--- CountDown 2
        when countdownone
.server_timer begin
            
if(game.get_event_flag("automatic_oxevent_status") == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event !. ")
            else
                
notice_all("<Automatic-OxEvent> Ox closing entries : 4 minutes left")
                
server_timer("countdowntwo",60)
            
end
        end
        
        
--- CountDown 3
        when countdowntwo
.server_timer begin
            
if(game.get_event_flag("automatic_oxevent_status") == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event !. ")
            else
                
notice_all("<Automatic-OxEvent> Ox closing entries : 3 minutes left")
                
server_timer("countdownthre",60)
            
end
        end
        
        
--- CountDown 4
        when countdownthre
.server_timer begin
            
if(game.get_event_flag("automatic_oxevent_status") == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event!. ")
            else
                
notice_all("<Automatic-OxEvent> Ox closing entries : 2 minutes left")
                
server_timer("countdownfour",60)
            
end
        end
        
        
--- CountDown 5
        when countdownfour
.server_timer begin
            
if(game.get_event_flag("automatic_oxevent_status") == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event!. ")
            else
                
notice_all("<Automatic-OxEvent> Ox closing entries : 1 minutes left")
                
server_timer("countdownfive",60)
            
end
        end
        
        
--- Countdown 6
        when countdownfive
.server_timer begin
            
if(game.get_event_flag("automatic_oxevent_status") == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event!. ")
            else
                
notice_all("<Automatic-OxEvent> Ox entries closed. ")
                
notice_all("<Automatic-OxEvent> Join as a spectator!. ")
                
server_timer("playercheck",5)
                
game.set_event_flag("automatic_oxevent_status",2)
            
end
        end
        
        
--- Player Check
        when playercheck
.server_timer begin
            
if(oxevent.get_attender() == 0then
                notice_all
("<Automatic-OxEvent> Event is closed because ; There's no one inside.. ")
                
game.set_event_flag("automatic_oxevent_status",0)
            else
                
server_timer("startox",5)
            
end
        end
        
        
--- Start Ox Event
        when startox
.server_timer begin
            setskin
(NOWINDOW)
            
quiz oxevent.quiz(1,30)
            if(
quiz == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event!. ")
                
game.set_event_flag("automatic_oxevent_status",0)
                
warp_all_to_village()
            elseif(
quiz == 1then
                
if(oxevent.get_attender() == 1then
                    game
.set_event_flag("automatic_oxevent_status",0)
                    
notice_all("<Automatic-OxEvent> Event is over. See you soon ")
                    
warp_all_to_village()
                else
                    
server_timer("startoxone",40)
                
end
            
else
                
notice_all("an unexpected error occurred")
                
notice_all("closing event!. ")
                
game.set_event_flag("automatic_oxevent_status",0)
                
warp_all_to_village()
            
end
        end
        
        
--- Start Ox 1
        when startoxone
.server_timer begin
            setskin
(NOWINDOW)
            
quiz oxevent.quiz(1,30)
            if(
quiz == 0then
                notice_all
("an unexpected error occurred")
                
notice_all("closing event!. ")
                
game.set_event_flag("automatic_oxevent_status",0)
                
warp_all_to_village()
            elseif(
quiz == 1then
                
if(oxevent.get_attender() == 1then
                    game
.set_event_flag("automatic_oxevent_status",0)
                    
notice_all("<Automatic-OxEvent> Event is over. See you soon ")
                    
warp_all_to_village()
                else
                    
server_timer("startox",40)
                
end
            
else
                
notice_all("an unexpected error occurred")
                
notice_all("closing event!. ")
                
game.set_event_flag("automatic_oxevent_status",0)
                
warp_all_to_village()
            
end
        end
        
        when 20011.chat
."Ox Event !. " begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            if(
game.get_event_flag("automatic_oxevent_status") == 1then
            say
("Do you want to enter the effectiveness of the Ox")
            
say("")
            
local s select(locale.yes,locale.no)
            if(
== 2then return end
            pc
.warp(89650024600)
            elseif(
game.get_event_flag("automatic_oxevent_status") == 2then
            say
("Do you want to enter the effectiveness of the Ox")
            
say("")
            
local s select(locale.yes,locale.no)
            if(
== 2then return end
            pc
.warp(89630028900)
            elseif(
game.get_event_flag("automatic_oxevent_status") == 0then
            say
("The effectiveness of the Ox now closed")
            
say("")
            
end
        end
    end
end 
- Tested ( Photo to be added )
- There is no time
- If you can't --> Send Private Message ;)

King Regards
Mfg ErzaČ



03/23/2013 10:03 Erza'#2
There is already such a release, but thx for release it again and thx for trololo my name.. haha --'

Erza'
03/23/2013 10:23 ErzaČ#3
Quote:
Originally Posted by Erza' View Post
There is already such a release, but thx for release it again and thx for trololo my name.. haha --'

Erza'
^^ but different
05/08/2014 14:59 drunkwolfs#4
Does not work if GM not in OX map.
2089M