Advertisement
Guest User

Tournoi_PVP.quest

a guest
Aug 3rd, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 19.16 KB | None | 0 0
  1. quest tournoi begin
  2.    
  3.     state start begin
  4.        
  5.         when 20092.chat."GM: Gérer les Concours" with pc.is_gm() begin -- Fonction GM pour Gerer Les Concours
  6.            
  7.            
  8.             say_title("Organisatrice de Concours:")
  9.            
  10.            
  11.                 if game.get_event_flag("tournoi_pvp") == 0 then -- Concours fermé : Les ouvrir ?
  12.                    
  13.                     say("Le tournoi pvp ne semble pas ouvert.")
  14.                     say("Voulez-vous commencer le tournoi ?")
  15.                     say("")
  16.                
  17.                     local s=select("Commencer le tournoi pvp!", "Commencer le Survivant", "Annuler")
  18.                
  19.                         if s == 1 then
  20.                    
  21.                             pvp_start()
  22.                            
  23.                             say_title("Organisatrice de Concours:")
  24.                             say("Les inscriptions sont lancés.")
  25.                        
  26.                         elseif s == 2 then
  27.                    
  28.                             survivant_start()
  29.                            
  30.                             say_title("Organisatrice de Concours:")
  31.                             say("Les inscriptions sont lancés.")
  32.                        
  33.                         end
  34.            
  35.                 elseif game.get_event_flag("tournoi_pvp") == 1 then -- Inscription Tournoi pvp ouverte : commencer ? Arreter ?
  36.                
  37.                     if pvp_verifi_error() then
  38.                        
  39.                         npc . unlock ( )
  40.                        
  41.                         return
  42.                    
  43.                     end
  44.                
  45.                     say("Les inscriptions au tournoi pvp sont ouvertes.")
  46.                     say("Que souhaitez-vous faire ?")
  47.                     say("")
  48.                    
  49.                     local s=select("Lancer les duels", "Arreter le tournoi", "Annuler")
  50.                
  51.                         if s == 1 then
  52.                            
  53.                             if pvp_verifi_participant() then
  54.                        
  55.                                 npc . unlock ( )
  56.                                
  57.                                 return
  58.                             end
  59.                    
  60.                             say_title("Organisatrice de Concours:")
  61.                             say("Normal : le tournoi se déroule tout seul")
  62.                             say("Suivi : le tournoi se déroule seul, mais vous")
  63.                             say("pouvez controler le vainqueur / attendre quand un")
  64.                             say("joueur n'est pas présent")
  65.                             say("Très Suivi : vous decidez vous même les vainqueurs")
  66.                            
  67.                             s=select("Normal", "Suivi", "Très Suivi", "Annuler")
  68.                    
  69.                                 if s == 1 then
  70.                                    
  71.                                     game.set_event_flag("tournoi_pvp",2)
  72.                                
  73.                                 elseif s == 2 then
  74.                                    
  75.                                     game.set_event_flag("tournoi_pvp",3)
  76.                                
  77.                                 elseif s == 3 then
  78.                                    
  79.                                     game.set_event_flag("tournoi_pvp",4)
  80.                                
  81.                                 end
  82.                    
  83.                                 notice_all("Le tournoi pvp commence ! Les inscriptions sont fermées.")
  84.                
  85.                                     if pvp_load_manche() then
  86.                                        
  87.                                         npc . unlock ( )
  88.                                        
  89.                                         return
  90.                                    
  91.                                     end
  92.                    
  93.                    
  94.                                     if locale.event[3][4] == 0 then -- On passe à la manche suivante ( pas de qualif )
  95.                                        
  96.                                         notice_all("Il n'y a pas de phase de qualification !")
  97.                                    
  98.                                     else
  99.                                        
  100.                                         notice_all("Phase de Qualification :")
  101.                    
  102.                                     end
  103.                    
  104.                                     pvp_next_match()
  105.                    
  106.                                     say_title("Organisatrice de Concours:")
  107.                                     say("Tournoi lancé.")
  108.                
  109.                         elseif s == 2 then
  110.                            
  111.                             pvp_stop()
  112.                        
  113.                         end
  114.            
  115.                 elseif game.get_event_flag("tournoi_pvp") == 5 then
  116.                
  117.                     if pvp_verifi_error() then
  118.                        
  119.                         npc . unlock ( )
  120.                        
  121.                         return
  122.                
  123.                     end
  124.                
  125.                     say("Les inscriptions au Survivant sont ouvertes.")
  126.                     say("Que souhaitez-vous faire ?")
  127.                     say("")
  128.                    
  129.                     local s=select("Lancer", "Arreter", "Annuler")
  130.                
  131.                         if s == 1 then
  132.                    
  133.                             survivant_go()
  134.                            
  135.                             say_title("Organisatrice de Concours:")
  136.                             say("Survivant lancé.")
  137.                
  138.                         elseif s == 2 then
  139.                            
  140.                             survivant_stop()
  141.                            
  142.                             say_title("Organisatrice de Concours:")
  143.                             say("Survivant arreté.")
  144.                         end
  145.                
  146.                 elseif game.get_event_flag("tournoi_pvp") == 6 then
  147.                
  148.                     if pvp_verifi_error() then
  149.                        
  150.                         npc . unlock ( )
  151.                        
  152.                         return
  153.                
  154.                     end
  155.                
  156.                     say("Les inscriptions au Survivant est lancé.")
  157.                     say("Que souhaitez-vous faire ?")
  158.                     say("")
  159.                    
  160.                     local s=select("Arreter", "Annuler")
  161.                        
  162.                         if s == 1 then
  163.                    
  164.                             survivant_stop()
  165.                    
  166.                             say_title("Organisatrice de Concours:")
  167.                             say("Survivant arreté.")
  168.                        
  169.                         end
  170.            
  171.                 else -- Concours déjà en cours : Forcer l'arret ?
  172.                
  173.                     if pvp_verifi_error() then
  174.                        
  175.                         npc . unlock ( )
  176.                        
  177.                         return
  178.                    
  179.                     end
  180.                
  181.                     say("Un concours est déjà lancé.")
  182.                
  183.                     local choix = {}
  184.                
  185.                         if game.get_event_flag("tournoi_pvp") == 2 then -- se fait automatiquement
  186.                            
  187.                             say("Mode : Normal")
  188.                
  189.                         elseif game.get_event_flag("tournoi_pvp") == 3 then -- permet de choisir un vainqueur quand quelqu'un est deco ou autre
  190.                    
  191.                             say("Mode : Suivi")
  192.                             say("Duel en cours :" .. locale.event[3][1] .." vs "..locale.event[3][2])
  193.                            
  194.                             table.insert(choix, "Choisir un Vainqueur")
  195.                
  196.                         else -- permet de valider ou non un match ( les matchs ne se termine pas quand un joueur tue l'autre )
  197.                            
  198.                             say("Mode : Très Suivi")
  199.                             say("Duel en cours :" .. locale.event[3][1] .." vs "..locale.event[3][2])
  200.                            
  201.                             table.insert(choix, "Choisir un Vainqueur")
  202.                         end
  203.                
  204.                         say("Que voulez-vous faire ?")
  205.                
  206.                         table.insert(choix, "Modifier le type de Tournoi")
  207.                         table.insert(choix, "Arreter le Tournoi")
  208.                         table.insert(choix, "Annuler")
  209.                
  210.                         local s = select_table ( choix )
  211.                        
  212.                             if choix[s] == "Choisir un Vainqueur" then
  213.                    
  214.                                 say_title("Organisatrice de Concours:")
  215.                                 say("Duel en cours : " .. locale.event[3][1] .." vs "..locale.event[3][2])
  216.                                 say("Choisir le Vainqueur :")
  217.                                
  218.                                 s = select(locale.event[3][1], locale.event[3][2], "Teleporter les joueurs à l'interieur", "Annuler")
  219.                    
  220.                                     if s == 3 then -- On téléporte les joueurs
  221.                        
  222.                                         pvp_warp_pos(locale.event[3][1], 1)
  223.                                         pvp_warp_pos(locale.event[3][2], 2)
  224.                        
  225.                                         say_title("Organisatrice de Concours:")
  226.                                         say("Joueur téléporté.")
  227.                                    
  228.                                     elseif s == 1 or s == 2 then -- Choix d'un victorieux
  229.                        
  230.                                         notice_all(locale.event[3][s] .. " remporte le duel !")
  231.                                         local loss = 2
  232.                                        
  233.                                         if s == 2 then loss = 1 end
  234.                        
  235.                                             pvp_warp_pos(locale.event[3][loss], 3)
  236.                                             pvp_fin_match(locale.event[3][s], locale.event[3][loss])
  237.                                            
  238.                                             return
  239.                                         end
  240.                                    
  241.                                     elseif choix[s] == "Modifier le type de Tournoi" then
  242.                    
  243.                                         say_title("Organisatrice de Concours:")
  244.                                         say("Normal : le tournoi se déroule tout seul")
  245.                                         say("Suivi : le tournoi se déroule seul, mais vous")
  246.                                         say("pouvez controler le vainqueur / attendre quand un")
  247.                                         say("joueur n'est pas présent")
  248.                                         say("Très Suivi : vous decidez vous même les vainqueurs")
  249.                    
  250.                                         s=select("Normal", "Suivi", "Très Suivi", "Annuler")
  251.                    
  252.                                             if s == 1 then
  253.                        
  254.                                                 game.set_event_flag("tournoi_pvp",2)
  255.                        
  256.                                                 say_title("Organisatrice de Concours:")
  257.                                                 say("Mode Normal.")
  258.                    
  259.                                             elseif s == 2 then
  260.                        
  261.                                                 game.set_event_flag("tournoi_pvp",3)
  262.                        
  263.                                                 say_title("Organisatrice de Concours:")
  264.                                                 say("Mode Suivi.")
  265.                    
  266.                                             elseif s == 3 then
  267.                        
  268.                                                 game.set_event_flag("tournoi_pvp",4)
  269.                        
  270.                                                 say_title("Organisatrice de Concours:")
  271.                                                 say("Mode Très Suivi.")
  272.                                            
  273.                                             end
  274.                
  275.                                     elseif choix[s] == "Arreter le Tournoi" then
  276.                    
  277.                                         say_title("Organisatrice de Concours:")
  278.                                         say("Attention ceci annule tout(classement,etc.)")
  279.                                         say("Arreter le tournoi ?")
  280.                    
  281.                                         s = select("Oui", "Non")
  282.                    
  283.                                             if s == 1 then
  284.                                            
  285.                                                 pvp_stop()
  286.                            
  287.                                                 say_title("Organisatrice de Concours:")
  288.                                                 say("Tournoi stopé.")
  289.                                            
  290.                                             end
  291.                                     end
  292.                             end
  293.            
  294.                             npc.unlock ( )
  295.                 end
  296.        
  297.        
  298.        
  299.         when 20092.chat."GM: Participants" with pc.is_gm() and game.get_event_flag("tournoi_pvp")>0 begin -- Voir les Participants
  300.             if pvp_verifi_error() then return end
  301.             if pvp_verifi_participant() then return end
  302.            
  303.             local nombre_participant = table . getn ( locale.event[1] )
  304.             local d = 1
  305.             local suite = 0
  306.             local max_affiche = 5
  307.             local tabledisplay = {}
  308.             repeat
  309.                 tabledisplay = {}
  310.                 local n = 0
  311.                 table.foreach(locale.event[1],
  312.                 function(i, name)
  313.                     n = n + 1
  314.                     if n >= d and n < d+max_affiche then
  315.                         table.insert(tabledisplay, name)
  316.                     end
  317.                 end)
  318.                 table.insert(tabledisplay, "Suite")
  319.                 suite = table . getn ( tabledisplay )
  320.                 table.insert(tabledisplay, "Quitter")
  321.                
  322.                 say_title("Organisatrice de Concours:")
  323.                 say("Il y a "..nombre_participant .. " participants :")
  324.                 s = select_table(tabledisplay)
  325.                 d = d + max_affiche
  326.             until  s != suite
  327.            
  328.             if game.get_event_flag("tournoi_pvp") == 1 and s != table . getn ( tabledisplay ) then -- Désinscrire un joueur
  329.                 local sname = tabledisplay [ s ]
  330.                 say_title("Organisatrice de Concours:")
  331.                 say("Désinscrire ".. sname .." ?")
  332.                 local u = select("Oui", "Non")
  333.                 if u == 1 then
  334.                
  335.                     if not npc . lock ( ) then
  336.                         say_title("Organisatrice de Concours:")
  337.                         say ( "J'inscrit quelqu'un en ce moment." )
  338.                         say ( "Réessaie dans quelques secondes !" )
  339.                         return
  340.                     end
  341.                     locale.event[1] = table_delete(locale.event[1], sname)
  342.                     npc . unlock ( )
  343.                    
  344.                     say_title("Organisatrice de Concours:")
  345.                     say(sname .." désinscrit.")
  346.                 end
  347.             elseif game.get_event_flag("tournoi_pvp") >= 5 and s != table . getn ( tabledisplay ) then
  348.                 local sname = tabledisplay [ s ]
  349.                 say_title("Organisatrice de Concours:")
  350.                 say("Désinscrire ".. sname .." ?")
  351.                 local u = select("Oui", "Non")
  352.                 if u == 1 then
  353.                     if not npc . lock ( ) then
  354.                         say_title("Organisatrice de Concours:")
  355.                         say ( "J'inscrit quelqu'un en ce moment." )
  356.                         say ( "Réessaie dans quelques secondes !" )
  357.                         return
  358.                     end
  359.                     locale.event[1] = table_delete(locale.event[1], sname)
  360.                     locale.event[2] = table_delete(locale.event[2], sname)
  361.                     pvp_warp_pos(sname, 3)
  362.                     npc . unlock ( )
  363.                     say_title("Organisatrice de Concours:")
  364.                     say(sname .." désinscrit.")
  365.                    
  366.                 end
  367.             end
  368.         end
  369.         when 20092.chat."Y a-t-il un concours ?" with game.get_event_flag("tournoi_pvp") == 0 begin -- Joueur : Pas de concours
  370.             say_title("Organisatrice de Concours:")
  371.             say("Un concours, maintenant ?")
  372.             say("Non non, il n'y en a pas.")
  373.             say("")
  374.             say("Revenez plus tard !")
  375.         end
  376.         when 20092.chat."Y a-t-il un concours ?" with game.get_event_flag("tournoi_pvp") > 1 and game.get_event_flag("tournoi_pvp") != 5 begin -- Joueur : Concours déjà commencé
  377.             say_title("Organisatrice de Concours:")
  378.             say("Oui il y a un concours en ce moment.")
  379.             say("Désolé, il est trop tard pour s'inscrire.")
  380.             say("")
  381.             say("Revenez un autre jour !")
  382.         end
  383.         when 20092.chat."Inscription au concours" with game.get_event_flag("tournoi_pvp") == 1 begin -- Joueur : Inscription Possible !
  384.             say_title("Organisatrice de Concours:")
  385.             say("Oui, il y a un concours !")
  386.             say("Attention, ceci n'est pas facile")
  387.             say("")
  388.             if pc.is_gm() then -- Pas pour les GMs
  389.                 say("Par contre les GMs ne peuvent pas s'inscrire")
  390.                 say("...")
  391.                 return
  392.             end
  393.             say("Voulez-vous vous inscrire ?")
  394.             local s=select("Oui", "Non")
  395.             if s == 1 then -- S'inscrire !
  396.                
  397.                 if not npc . lock ( ) then
  398.                     say_title("Organisatrice de Concours:")
  399.                     say ( "J'inscrit déjà quelqu'un en ce moment." )
  400.                     say ( "Réessaie dans quelques secondes !" )
  401.                     return
  402.                 end
  403.                 if not table_is_in(locale.event[1], pc.get_name()) then
  404.                     table.insert(locale.event[1], pc.get_name())
  405.                 end
  406.                 npc . unlock ( )
  407.                
  408.                 say_title("Organisatrice de Concours:")
  409.                 say("Vous avez été inscrit avec succès !")
  410.                 say("")
  411.                 say("Attendez que le concours commence !")
  412.                 set_state(__reward)
  413.             else
  414.                 say_title("Organisatrice de Concours:")
  415.                 say("Tu ne veux pas t'inscrire ?")
  416.                 say("Oh tant pis.")
  417.                 say("")
  418.                 say("Reviens quand tu sera pret !")
  419.             end
  420.         end
  421.         when 20092.chat."Inscription au Survivant" with game.get_event_flag("tournoi_pvp") == 5 begin -- Joueur : Inscription Possible !
  422.             say_title("Organisatrice de Concours:")
  423.             say("Oui, il y a un Survivant en ce moment !")
  424.             say("Attention, ceci n'est pas facile")
  425.             say("")
  426.             if pc.is_gm() then -- Pas pour les GMs
  427.                 say("Par contre les GMs ne peuvent pas s'inscrire")
  428.                 say("...")
  429.                 return
  430.             end
  431.             say("Voulez-vous vous inscrire ?")
  432.             local s=select("Oui", "Non")
  433.             if s == 1 then -- S'inscrire !
  434.                 if not npc . lock ( ) then
  435.                     say_title("Organisatrice de Concours:")
  436.                     say ( "J'inscrit déjà quelqu'un en ce moment." )
  437.                     say ( "Réessaie dans quelques secondes !" )
  438.                     return
  439.                 end
  440.                 if not table_is_in(locale.event[1], pc.get_name()) then
  441.                     table.insert(locale.event[1], pc.get_name())
  442.                 end
  443.                 npc . unlock ( )
  444.                
  445.                 say_title("Organisatrice de Concours:")
  446.                 say("Vous avez été inscrit avec succès !")
  447.                 say("Je te téléporte dans la zone de combat.")
  448.                 say("Attendez que le concours commence !")
  449.                 wait()
  450.                 local pos = number(1,2)
  451.                 pc . warp (locale.event_warp [ pos ][ 1 ] , locale.event_warp [ pos ][ 2 ] )
  452.                 set_state(__reward)
  453.             else
  454.                 say_title("Organisatrice de Concours:")
  455.                 say("Tu ne veux pas t'inscrire ?")
  456.                 say("Oh tant pis.")
  457.                 say("")
  458.                 say("Reviens quand tu sera pret !")
  459.             end
  460.         end
  461.     end
  462.     state __reward begin --  Etat spécial : Inscrit
  463.         when login or levelup or button or info begin -- Fin du Tournoi
  464.             if table . getn ( locale.event ) > 0 and table . getn ( locale.event[1] ) > 0 and  game.get_event_flag("tournoi_pvp") == 6 then
  465.                 if table_is_in(locale.event[1], pc.get_name()) then -- n'es pas dans la liste, il a deco et se reco : on le vire
  466.                     locale.event[1] = table_delete(locale.event[1], pc.get_name())
  467.                     locale.event[2] = table_delete(locale.event[2], pc.get_name())
  468.                     pc . warp (locale.event_warp [ 3 ][ 1 ] , locale.event_warp [ 3 ][ 2 ] )
  469.                     return
  470.                 end
  471.             end
  472.             if pvp_verifi_inscription() then
  473.                 pc.setqf("gagnant",0)
  474.                 clear_letter()
  475.                 set_state(start)
  476.                 return
  477.             end
  478.         end
  479.         when kill with npc.is_pc() begin -- Permet de voir un vainqueur
  480.            
  481.             if pvp_verifi_inscription() then
  482.                 clear_letter()
  483.                 set_state(start)
  484.                 return
  485.             end
  486.             if game.get_event_flag("tournoi_pvp") < 4 then
  487.                 if locale.event[3][1] == pc.get_name() or locale.event[3][2] == pc.get_name() then -- une victoire ?
  488.                     local moi = 1
  489.                     local lui = 2
  490.                     if locale.event[3][2] == pc.get_name() then
  491.                         moi = 2
  492.                         lui = 1
  493.                     end
  494.                    
  495.                     local ok = false
  496.                    
  497.                     local v_lui = find_pc_by_name(locale.event[3][lui])
  498.                     if v_lui != 0 then -- Il est bien ici
  499.                         local old_vid = pc.select(v_lui)
  500.                         local loss_name = pc.get_name()
  501.                         if pc.get_hp() <= 0 then -- C'est bien lui
  502.                             ok = true
  503.                             pc . warp (locale.event_warp [ 3 ][ 1 ] , locale.event_warp [ 3 ][ 2 ] ) -- on teleporte le perdant
  504.                         end
  505.                         pc.select(old_vid)
  506.                     else
  507.                         ok = true
  508.                     end
  509.                    
  510.                     if ok then
  511.                         notice_all(pc.get_name() .. " remporte le duel !")
  512.                         pvp_fin_match(pc.get_name(), locale.event[3][lui])
  513.                         return
  514.                     end
  515.                 end
  516.             end
  517.             if game.get_event_flag("tournoi_pvp") == 6 then
  518.                 local sname = ""
  519.                 local u = 0
  520.                 for i = 1, table.getn(locale.event[1]) do
  521.                     sname = locale.event[1][i]
  522.                     u = find_pc_by_name(sname)
  523.                     if u == 0 then
  524.                         notice_all(sname .. " disqualifié car non présent sur la map de combat!")
  525.                         survivant_perdant(sname)
  526.                     else
  527.                         local old_vid = pc.select(u)
  528.                         if pc.get_hp() <= 0 then -- C'est bien lui
  529.                             pc . warp (locale.event_warp [ 3 ][ 1 ] , locale.event_warp [ 3 ][ 2 ] ) -- on teleporte le perdant
  530.                             survivant_perdant(sname)
  531.                         end
  532.                         pc.select(old_vid)
  533.                     end
  534.                 end
  535.                 if table.getn(locale.event[1]) == 1 then
  536.                     survivant_winner()
  537.                 end
  538.             end
  539.         end
  540.        
  541.         when letter begin
  542.             send_letter("Tournoi Pvp")
  543.         end
  544.  
  545.         when button or info begin -- Affichage de la Quête
  546.             say_title("Organisatrice de Concours:")
  547.             say("Vous êtes inscrit au tournoi pvp.")
  548.             say("Preparez vous au duel !")
  549.             say("")
  550.         end
  551.         when 20092.click with game.get_event_flag("tournoi_pvp") == 0 begin
  552.             if pvp_verifi_inscription() then
  553.                 clear_letter()
  554.                 set_state(start)
  555.                 return
  556.             end
  557.         end
  558.        
  559.         when 20092.chat."Je suis inscrit !" with game.get_event_flag("tournoi_pvp") == 1 or game.get_event_flag("tournoi_pvp") == 5 begin -- Inscription en cours
  560.             if pvp_verifi_inscription() then
  561.                 clear_letter()
  562.                 set_state(start)
  563.                 return
  564.             end
  565.             say_title("Organisatrice de Concours:")
  566.             say("Oh, oui oui,")
  567.             say("vous êtes inscrit ! Ne vous inquietez pas !")
  568.             say("")
  569.             if game.get_event_flag("tournoi_pvp") == 5 then
  570.                 say("Mais que faites-vous de ce coté ?")
  571.                 wait()
  572.                 local pos = number(1,2)
  573.                 pc . warp (locale.event_warp [ pos ][ 1 ] , locale.event_warp [ pos ][ 2 ] )
  574.             end
  575.         end
  576.         when 20092.chat."Tournoi en cours" with game.get_event_flag("tournoi_pvp") > 1 and game.get_event_flag("tournoi_pvp") != 5 begin -- Tournoi commencé
  577.             if pvp_verifi_inscription() then
  578.                 clear_letter()
  579.                 set_state(start)
  580.                 return
  581.             end
  582.             say_title("Organisatrice de Concours:")
  583.             say("Oh, oui oui,")
  584.             say("Il y a un tournoi en cours !")
  585.             say("Vous êtes inscrit ! Preparez-vous au duel !")
  586.         end
  587.         when 20092.chat."Me désinscrire" with game.get_event_flag("tournoi_pvp") > 0 begin
  588.             if pvp_verifi_inscription() then
  589.                 clear_letter()
  590.                 set_state(start)
  591.                 return
  592.             end
  593.             say_title("Organisatrice de Concours:")
  594.             if game.get_event_flag("tournoi_pvp") == 1 or game.get_event_flag("tournoi_pvp") == 5 then
  595.                 say("Oh, ce n'est pas un tournoi facile.")
  596.                 say("Peut-être que ce n'est pas pour votre niveau.")
  597.                 say("Vous souhaitez vraiment vous désinscrire ?")
  598.                 local s=select("Oui", "Non")
  599.                 if s == 1 and  game.get_event_flag("tournoi_pvp") == 1 then
  600.                    
  601.                     if not npc . lock ( ) then
  602.                         say_title("Organisatrice de Concours:")
  603.                         say ( "J'inscrit quelqu'un en ce moment." )
  604.                         say ( "Réessaie dans quelques secondes !" )
  605.                         return
  606.                     end
  607.                     locale.event[1] = table_delete(locale.event[1], pc.get_name())
  608.                     npc . unlock ( )
  609.                    
  610.                     say_title("Organisatrice de Concours:")
  611.                     say("Très bien, je vous ai désinscrit")
  612.                     clear_letter()
  613.                     set_state(start)
  614.                 elseif s == 1 and game.get_event_flag("tournoi_pvp") == 5 then
  615.                     if not npc . lock ( ) then
  616.                         say_title("Organisatrice de Concours:")
  617.                         say ( "J'inscrit quelqu'un en ce moment." )
  618.                         say ( "Réessaie dans quelques secondes !" )
  619.                         return
  620.                     end
  621.                     locale.event[1] = table_delete(locale.event[1], pc.get_name())
  622.                     npc . unlock ( )
  623.                    
  624.                     say_title("Organisatrice de Concours:")
  625.                     say("Très bien, je vous ai désinscrit")
  626.                     clear_letter()
  627.                     set_state(start)
  628.                 end
  629.             else
  630.                 say("Désolé, le tournoi à déja commencé !")
  631.                 say("Vous ne pouvez pas vous désinscrire")
  632.                 say("")
  633.             end
  634.         end
  635.     end
  636. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement