Advertisement
Guest User

Torre Demonios

a guest
Dec 29th, 2012
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.58 KB | None | 0 0
  1. quest deviltower_zone begin
  2.     state start begin
  3.     when login begin
  4.         if pc.get_map_index() == 66 then
  5.         -- Hacia fuera, perdiste el transporte.
  6.         -- Rango de capa
  7.         -- 1Piso  88  577  236 737
  8.         -- 2Piso  91  343  238 504
  9.         -- 3Piso 104  107  248 269
  10.         if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
  11.             pc.warp((5376+532)*100, (512+596+4)*100, 65)
  12.         end
  13.         pc.set_warp_location(65, 5376+532, 512+596+4)
  14.         elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
  15.         pc.set_warp_location(65, 5376+532, 512+596+4)
  16.         end
  17.     end
  18.     when deviltower_man.chat.locale.deviltower_man_chat begin
  19.         if pc.get_level() < 40 then
  20.         say(locale.deviltower_man_say_you_cant)
  21.         else
  22.         say(locale.deviltower_man_say)
  23.         local s = select(locale.deviltower_enter,locale.deviltower_no_enter)
  24.         if s == 1 then
  25.             -- warp into!
  26.             pc.warp(216500,727000)
  27.         end
  28.         end
  29.     end
  30.     when devil_stone1.kill begin
  31.         timer("devil_stone1_1", 6)
  32.     end
  33.     when devil_stone1_1.timer begin
  34.         local mapto7= pc.count_item(30302)  -- No se sabe la exitencia de las almas perdidas.
  35.         pc.remove_item(30302,mapto7)
  36.  
  37.         local boxto7= pc.count_item(30300)  -- Los valientes que se atreven a entrar a la torre no saben lo que alberga.
  38.         pc.remove_item(30300,boxto7)
  39.  
  40.         d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
  41.         d.regen_file("data/dungeon/deviltower2_regen.txt")
  42.         d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
  43.     end
  44.     --when devil_stone2.kill begin
  45.     --d.jump_all_local(special.devil_tower[2][1], special.devil_tower[2][2])
  46.     --end
  47.     when devil_stone3.kill begin
  48.         --d.jump_all_local(special.devil_tower[3][1], special.devil_tower[3][2])
  49.         --d.set_exit_all_at_eliminate(6)
  50.         --d.set_warp_at_eliminate(6, d.get_map_index(), 100, 100)
  51.         --d.set_warp_at_eliminate(4, 65, 5376+532, 512+596+4)
  52.         d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
  53.         d.check_eliminated()
  54.         --d.exit_all()
  55.     end
  56.     function get_4floor_stone_pos()
  57.         local positions = {
  58.         {368, 629},
  59.         {419, 630},
  60.         {428, 653},
  61.         {422, 679},
  62.         {395, 689},
  63.         {369, 679},
  64.         {361, 658},
  65.         }
  66.         for i = 1, 6 do
  67.         local j = number(i, 7)
  68.         if i != j then
  69.             local t = positions[i];
  70.             positions[i] = positions[j];
  71.             positions[j] = t;
  72.         end
  73.         end
  74.         --for i = 1, 7 do
  75.     --    positions[i][1] = positions[i][1] * 100
  76.     --    positions[i][2] = positions[i][2] * 100
  77.      --   end
  78.         return positions
  79.     end
  80.     when 8016.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  81.         d.setf("level", 4)
  82.         -- Reproducir una gran cantidad de monstruos y la fabricación de piedras verdaderas y falsas piedras.
  83.         --d.regen_file("data/dungeon/deviltower4_regen.txt")
  84.         local positions = deviltower_zone.get_4floor_stone_pos()
  85.         for i = 1, 6 do
  86.         chat(positions[i][1], positions[i][2])
  87.         d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
  88.         end
  89.         chat(positions[7][1], positions[7][2])
  90.         local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
  91.         chat(vid)
  92.         d.set_unique("real", vid)
  93.         server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
  94.         server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())
  95.  
  96.         d.notice("Aquí está el 4 º piso, elegir la puerta cerrada.");
  97.         d.notice("Hay incontables piedras, pero la real no se distingue.");
  98.         d.notice("Dentro de 15 minutos hay que buscarla rompiendo una por una!");
  99.         d.notice("Es la unica manera de abrir la puerta. A buscarla!");
  100.     end
  101.  
  102.     when devil_stone4_fail1.server_timer begin
  103.         if d.select(get_server_timer_arg()) then
  104.         d.notice("10 minutos restantes.")
  105.         server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
  106.         end
  107.     end
  108.  
  109.     when devil_stone4_fail2.server_timer begin
  110.         if d.select(get_server_timer_arg()) then
  111.         d.notice("5 minutos restantes.")
  112.         server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
  113.         end
  114.     end
  115.  
  116.     when devil_stone4_fail.server_timer begin
  117.         if d.select(get_server_timer_arg()) then
  118.         d.notice("El tiempo se ha acabado, la mision fracaso.")
  119.         d.exit_all()
  120.         clear_server_timer('devil_stone4_update', get_server_timer_arg())
  121.         end
  122.     end
  123.  
  124.     when devil_stone4_update.server_timer begin
  125.         if d.select(get_server_timer_arg()) then
  126.         if not d.is_unique_dead("real") then
  127.             for i = 1, 6 do
  128.             if d.getf("fakedead" .. i) == 0 then
  129.                 if d.unique_get_hp_perc("fake" .. i) < 50 then
  130.                 d.purge_unique("fake" .. i)
  131.                 d.setf("fakedead" .. i, 1)
  132.                 d.notice("Piedra falsa, desaparecida...");
  133.                 end
  134.             end
  135.             end
  136.         else
  137.             --d.clear_regen()
  138.             --d.regen_file("data/dungeon/deviltower5_regen.txt")
  139.             server_timer("devil_stone4_end", 5, get_server_timer_arg())
  140.             d.notice("En minuto bueno, la piedra verdadera se rompe toda!");
  141.             d.notice("Ahora se transladara al 5º Piso")
  142.             clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
  143.             clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
  144.             clear_server_timer('devil_stone4_fail', get_server_timer_arg())
  145.         end
  146.         else
  147.         server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
  148.         end
  149.     end
  150.  
  151.     when devil_stone4_stop_timer.server_timer begin
  152.         clear_server_timer('devil_stone4_update', get_server_timer_arg())
  153.     end
  154.  
  155.     when devil_stone4_end.server_timer begin
  156.         if d.select(get_server_timer_arg()) then
  157.         d.setf("level", 5)
  158.         d.setf("stone_count", 5)
  159.         d.notice("Tenemos 5 pilones de sellos de los cuales debemos abrir.")
  160.         d.notice("Necesitamos las 5 llaves para abrirlos, y haciendo esto desbloquear la puerta.")
  161.         d.notice("Las criaturas presentes del abismo deben poseerla.")
  162.         d.notice("Disponiendo de 20 minutos, para buscarlas todas!")
  163.         d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
  164.         server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
  165.         clear_server_timer('devil_stone4_update', get_server_timer_arg())
  166.  
  167.         -- 5th Piso, seguir matando demonios y bestias.
  168.         d.set_regen_file("data/dungeon/deviltower5_regen.txt")
  169.  
  170.         -- 5th Piso, buscar los sellos de los pilones.
  171.         d.spawn_mob(20073, 421, 452)
  172.         d.spawn_mob(20073, 380, 460)
  173.         d.spawn_mob(20073, 428, 414)
  174.         d.spawn_mob(20073, 398, 392)
  175.         d.spawn_mob(20073, 359, 426)
  176.         end
  177.     end
  178.     when devil_stone5_fail1.server_timer begin
  179.         if d.select(get_server_timer_arg()) then
  180.         d.notice("Le quedan 15 minutos.")
  181.         server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
  182.         end
  183.     end
  184.  
  185.     when devil_stone5_fail2.server_timer begin
  186.         if d.select(get_server_timer_arg()) then
  187.         d.notice("Le quedan 10 minutos.")
  188.         server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
  189.         end
  190.     end
  191.  
  192.     when devil_stone5_fail3.server_timer begin
  193.         if d.select(get_server_timer_arg()) then
  194.         d.notice("Le quedan 5 minutos.")
  195.         server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
  196.         end
  197.     end
  198.  
  199.     when devil_stone5_fail.server_timer begin
  200.         if d.select(get_server_timer_arg()) then
  201.         d.notice("El tiempo se ha acabado, la mision fracaso.")
  202.         d.exit_all()
  203.         end
  204.     end
  205.  
  206.     --when devil_stone4.kill begin
  207.         --d.setf("level", 5)
  208.         --d.setf("stone_count", 4)
  209.         --d.clear_regen()
  210.         --d.regen_file("data/dungeon/deviltower5_regen.txt")
  211.         --d.jump_all_local(special.devil_tower[4][1], special.devil_tower[4][2])
  212.     --end
  213.  
  214.     when 1062.kill with pc.in_dungeon() and d.getf("level") == 5 begin
  215.         local KILL_COUNT_FOR_DROP_KEY = 50
  216.         --if is_test_server() then
  217.         --KILL_COUNT_FOR_DROP_KEY = 1
  218.         --end
  219.         local n =d.getf("count") + 1
  220.         d.setf("count", n)
  221.         if n == KILL_COUNT_FOR_DROP_KEY then
  222.         -- Claves descendentes.
  223.         game.drop_item(50084, 1)
  224.         d.setf("count", 0)
  225.         end
  226.     end
  227.     when devil_stone5.take with item.vnum == 50084 begin
  228.         npc.purge()
  229.         item.remove()
  230.         d.setf("stone_count", d.getf("stone_count") - 1)
  231.         if d.getf("stone_count") <= 0 then
  232.         d.setf("level", 6)
  233.         d.clear_regen()
  234.         d.regen_file("data/dungeon/deviltower6_regen.txt")
  235.  
  236.         d.notice("Los pilones han sido abiertos. La puerta se ha abierto. Se transladara al 6ºPiso")
  237.         d.notice ("Las bestias y almas perdidas erradicadas, " )
  238.         d.notice ("con el poder divino.")
  239.         d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
  240.         clear_server_timer('devil_stone5_fail1', get_server_timer_arg())
  241.         clear_server_timer('devil_stone5_fail2', get_server_timer_arg())
  242.         clear_server_timer('devil_stone5_fail3', get_server_timer_arg())
  243.         clear_server_timer('devil_stone5_fail', get_server_timer_arg())
  244.         else
  245.         d . notice ( "Esto sigue todavia " .. d . getf ( "stone_count" ) .. " piedras, valor!" )
  246.         end
  247.     end
  248.  
  249.     when devil_stone6.kill begin
  250.         -- Tomar un mapa del pelon
  251.         -- De lo contrario, abrir una nueva Lian Sheng
  252.         --d.jump_all(special.devil_tower[6][1], special.devil_tower[6][2])
  253.         d.kill_all()
  254.        -- d.set_warp_at_eliminate(3*60, 65, 5376+532, 512+596+4)
  255.         d.check_eliminated()
  256.         local reward_alchemist = {20016, 20016, 20016}
  257.         d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
  258.         d.setqf("can_refine", 1)
  259.     end
  260.  
  261.     --------------------------------------
  262.     -- ¥Ñ¶i¤J7¼Ó¦Ü¨ì¹F8¼Ó¤§«e
  263.     --------------------------------------
  264.  
  265.     when 20016.chat."Voulez-vous monter?" with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  266.         say ( "Bonjour aventurier!" )
  267.         say ( "­Sache que tu t'appretes à allez plus loin que aucun autre n'est allé," )
  268.         say ( "enfin certains y sont allés mais ne sont jamais revenus..." )
  269.         say ( "Paix à leur ame!" )
  270.         wait()
  271.         if pc.level >=75 then
  272.             say ( "Tu as l'air d'avoir du cran fiston!" )  
  273.             say ( "Armes-toi de courage, ton heure est venue" )  
  274.             say ( "Adieu...." )  
  275.             timer("devil_jump_7", 6)
  276.             return
  277.         end
  278.         say ( "Tu n'as pas la force necessaire" )  
  279.         say ( "Va xp et ne reviens pas avant!" )  
  280.         say ( "Il n'est pas dans la nature d'un demon d'épargner" )
  281.         say ( "Sois très prudent ")
  282.         say("")
  283.         wait()
  284.         pc.warp(590500, 110500)
  285.         return
  286.     end
  287.     when 20075.chat."Voulez-vous monter?" with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  288.         say ( "Bonjour aventurier!" )
  289.         say ( "­Sache que tu t'appretes à allez plus loin que aucun autre n'est allé," )
  290.         say ( "enfin certains y sont allés mais ne sont jamais revenus..." )
  291.         say ( "Paix à leur ame!" )
  292.         wait()
  293.         if pc.level >=75 then
  294.             say ( "Tu as l'air d'avoir du cran fiston!" )
  295.             say ( "Armes-toi de courage, ton heure est venue" )
  296.             say ( "Adieu...." )
  297.             timer("devil_jump_7", 6)
  298.             return
  299.         end
  300.         say ( "Tu n'as pas la force necessaire" )
  301.         say ( "Va xp et ne reviens pas avant!" )
  302.         say ( "Il n'est pas dans la nature d'un demon d'épargner" )
  303.         say ( "Sois très prudent" )
  304.         say("")
  305.         wait()
  306.         pc.warp(590500, 110500)
  307.         return
  308.     end
  309.     when 20076.chat."Voulez-vous monter?" with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  310.         say ( "Bonjour aventurier!" )  
  311.         say ( "­Sache que tu t'appretes à allez plus loin que aucun autre n'est allé," )  
  312.         say ( "enfin certains y sont allés mais ne sont jamais revenus..." )  
  313.         say ( "Paix à leur ame!" )  
  314.         wait()
  315.         if pc.level >=75 then
  316.             say ( "Tu as l'air d'avoir du cran fiston!" )
  317.             say ( "Armes-toi de courage, ton heure est venue" )
  318.             say ( "Adieu...." )
  319.             timer("devil_jump_7", 6)
  320.             return
  321.         end
  322.         say ( "Tu n'as pas la force necessaire" )  
  323.         say ( "Va xp et ne reviens pas avant!" )  
  324.         say ( "Il n'est pas dans la nature d'un demon d'épargner" )  
  325.         say ( "Sois très prudent" )
  326.         say("")
  327.         wait()
  328.         pc.warp(590500, 110500)
  329.         return
  330.     end
  331.  
  332.    when devil_jump_7.timer begin
  333.         d.clear_regen()
  334.  
  335.         d.spawn_mob(8018, 639, 658)
  336.         d.spawn_mob(8018, 611, 637)
  337.         d.spawn_mob(8018, 596, 674)
  338.         d.spawn_mob(8018, 629, 670)
  339.  
  340.         d.setf("level", 7)
  341.  
  342.         d.jump_all(2048+590, 6656+638)
  343.     end
  344.    
  345.     when 8018.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  346.         local cont = d.getf("7_stone_kill") + 1
  347.         d.setf("7_stone_kill", cont)
  348.  
  349.         if cont >= 4 then
  350.             d.setf("7_stone_kill", 0)
  351.             d.set_regen_file("data/dungeon/deviltower7_regen.txt")
  352.         end    
  353.     end
  354.  
  355.     when 8019.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  356.         game.drop_item(30300, 1)
  357.     end
  358.  
  359.     when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  360.         pc.remove_item("30300", 1)
  361.         local pct = number(1,10)
  362.  
  363.         if pct == 1 then
  364.             -- ±¼¤U¯u¦a¹Ï
  365.             game.drop_item(30302, 1)
  366.             d.clear_regen()
  367.         else
  368.             -- ±¼¤U°²¦a¹Ï
  369.             game.drop_item(30301, 1)
  370.            
  371.         end
  372.     end
  373.  
  374.     when 30302.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  375.         -- ¶Ç°e¨ì8¼Ó
  376.         say("Vous allez être téléporté à l'étage maudit.")
  377.         pc.remove_item("30302", 1)
  378.            timer("devil_jump_8", 6)
  379.         d.clear_regen()
  380.     end
  381.                        
  382.     --------------------------------------------
  383.     -- ¥Ñ¶i¤J8¼Ó¦Ü¨ì¹F9¼Ó¤§«e
  384.     --------------------------------------------
  385.     when devil_jump_8.timer begin
  386.         d.setf("level", 8)
  387.         d.jump_all(2048+590, 6656+403)
  388.         d.set_regen_file("data/dungeon/deviltower8_regen.txt")
  389.         d.spawn_mob(20366, 640, 460)
  390.         local _count= pc.count_item(30302)-- ®ø·À¯u¤`ÆF¶ð
  391.         pc.remove_item(30302,_count)
  392.        
  393.     end
  394.  
  395.     when 1040.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  396.         local pct1 = number(1, 5)
  397.         if pct1 == 1 then
  398.             local pct2 = number(1, 10)
  399.             if pct2 == 1 then
  400.                 -- ±¼¤U¯uÂê°Í
  401.                 game.drop_item(30304, 1)
  402.             else
  403.                 -- ±¼¤U°²Âê°Í
  404.                 game.drop_item(30303, 1)
  405.             end
  406.         else
  407.             return
  408.         end
  409.     end
  410.  
  411.     when 20366.take with item.vnum == 30304 begin
  412.         -- 9¼Ó«Ê¦L¸Ñ°£
  413.         npc.purge()
  414.         item.remove()
  415.         timer("devil_jump_9", 6)
  416.     end
  417.  
  418.    
  419.  
  420.     ---------------------------------------------
  421.     -- ¥Ñ¶i¤J9¼Ó¦Üµ²§ô
  422.     ---------------------------------------------
  423.     when devil_jump_9.timer begin
  424.         d.setf("level", 9)
  425.         d.jump_all(2048+590, 6656+155)
  426.         d.regen_file("data/dungeon/deviltower9_regen.txt")
  427.     end
  428.  
  429.     when 1093.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  430.         d.kill_all()
  431.         timer("devil_end_jump", 60)
  432.     end
  433.  
  434.     when devil_end_jump.timer begin
  435.         d.exit_all()
  436.     end
  437. end
  438. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement