Advertisement
NewWars

Untitled

Mar 23rd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.03 KB | None | 0 0
  1. quest cavalo begin
  2.     state start begin
  3.         when login or levelup begin
  4.             if pc.get_level() < 25 then
  5.                 return
  6.             end
  7.             local d = find_npc_by_vnum(20349)
  8.             if d != 0 then
  9.                 target.vid("__TARGET__", d, "Consegue o teu cavalo armado")
  10.             end
  11.         end
  12.  
  13.         when __TARGET__.target.click or 20349.chat."Consegue o teu cavalo armado" with pc.get_level() < 25 begin
  14.             target.delete("__TARGET__")
  15.             say_title("Rapaz do Estabulo:")
  16.             say("Com esta missao te permite")
  17.             say("subir o nível do teu cavalo.")
  18.             say("Mas tens de matar 100 Arqueiros Escorpiao")
  19.             say("Depois dissos poderas cavalgar.")
  20.             say("")
  21.  
  22.             local temo = select ("Aceito" , "Sair")
  23.             if temo == 2 then return end
  24.             if temo == 1 then
  25.                 set_state(cavalo1)
  26.             end
  27.         end
  28.     end
  29.    
  30.     state cavalo1 begin
  31.         when enter begin
  32.             timer("tiempo1", 1200)
  33.             q.set_counter("Arqueiro Escorpiao", 100)
  34.         end
  35.        
  36.         when 2105.kill begin
  37.             local killed = q.get_counter("Arqueiro Escorpiao")
  38.             q.set_counter("Arqueiro Escorpiao", killed - 1)
  39.             if killed <= 0 then
  40.                 cleantimer("tiempo1")
  41.                 say_title("".. pc.get_name() ..":")
  42.                 say("Finalmente conseguiste matar todos os Arqueiros Escorpiao")
  43.                 say("dentro do tempo estimado...")
  44.                 say("Premio:")
  45.                 say_reward("Cavalo Armado")
  46.                 horse.set_level(11)
  47.                 horse.summon()
  48.                 set_state(master2)
  49.             end
  50.         end
  51.  
  52.         when tiempo1.timer begin
  53.             say_title("Falhaste a missao")
  54.             say("Infelizmente falhaste.")
  55.             say("Tenta de novo mais tarde.")
  56.             set_state(start)
  57.         end
  58.     end
  59.    
  60.     state master2 begin
  61.         when login or levelup begin
  62.             if pc.get_level() < 50 then
  63.                 return
  64.             end
  65.             local a = find_npc_by_vnum(20349)
  66.             if a != 0 then
  67.                 target.vid("__TARGET__", a, "Consegue o teu cavalo militar")
  68.             end
  69.         end
  70.  
  71.         when __TARGET__.target.click or 20349.chat."Consegue o teu cavalo militar" with pc.get_level() < 50 begin
  72.             target.delete("__TARGET__")
  73.             say_title("Rapaz do Estabulo:")
  74.             say("Com esta missao te permite")
  75.             say("subir o nivel do teu cavalo.")
  76.             say("Mas tens de matar 500 Arqueiro Demonio")
  77.             say("Depois dissos poderas cavalgar.")
  78.             say("")
  79.  
  80.             local temo = select ("Aceito" , "Sair")
  81.             if temo == 2 then return end
  82.             if temo == 1 then
  83.                 set_state(cavalo2)
  84.             end
  85.         end
  86.     end
  87.        
  88.     state cavalo2 begin
  89.         when enter begin
  90.             timer("tiempo2", 1800)
  91.             q.set_counter("Arqueiro Demonio", 500)
  92.         end
  93.        
  94.         when 1002.kill begin
  95.             local killed = q.get_counter("Arqueiro Demonio")
  96.             q.set_counter("Arqueiro Demonio", killed - 1)
  97.             if killed <= 0 then
  98.                 cleantimer("tiempo2")
  99.                 say_title("".. pc.get_name() ..":")
  100.                 say("Finalmente conseguiste matar todos os Arqueiro Demonio")
  101.                 say("dentro do tempo estimado...")
  102.                 say("Premio:")
  103.                 say_reward("Cavalo Militar")
  104.                 horse.set_level(21)
  105.                 horse.summon()
  106.                 set_state(completada)
  107.             end
  108.         end
  109.  
  110.         when tiempo2.timer begin
  111.             say_title("Falhaste a missao")
  112.             say("Infelizmente falhaste.")
  113.             say("Tenta de novo mais tarde.")
  114.             set_state(master2)
  115.         end
  116.     end
  117.  
  118.     state completada begin
  119.     end
  120. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement