Advertisement
Guest User

special_drop.quest

a guest
Apr 22nd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. quest special_drop begin
  2. state start begin
  3.  
  4. function info()
  5. return {
  6. ["huevos_min_max"] = {50160, 50179},
  7. ["niveles"] = {1, 21},
  8. ["prob"] = 1,
  9. ["premios"] = {
  10. ["id_objetos"] = {10, 11, 12, 13, 14, 15, 19},
  11. ["cantidad_id_objetos"] = {1, 1, 1, 1, 1, 1, 1},
  12. ["huevos_req"] = {20, 30, 40, 50, 70, 90, 100}},
  13. }
  14. end
  15.  
  16. when 30129.chat."Evento de pascua" with pc.is_gm() begin
  17. say_title("Empezar el evento")
  18. say("Metin2...")
  19. say("¿Quieres comenzar el evento?")
  20. say("Los monstruos que maten los jugadores")
  21. say("les dará unos objetos especiales")
  22. say("")
  23. say_reward("¿Que quieres hacer?")
  24. local evento = select ("Activarlo" , "Desactivarlo" , "Salir")
  25. if evento == 1 then
  26. game.set_event_flag("pascua_drop", 1)
  27. notice_all("El evento de huevos de pascua ha comenzado!")
  28. notice_all("Solo los personajes del 1 al 99 les caera el items")
  29. notice_all("Que tengais Mucha Suerte....")
  30. elseif evento == 2 then
  31. game.set_event_flag("pascua_drop", 0)
  32. notice_all("El evento de huevos de pascua ha terminado")
  33. notice_all("esperamos que os haya gustado!")
  34. end
  35. end
  36.  
  37. when kill with not npc.is_pc() begin
  38. local sett = special_drop.info()
  39. local s = number(1, 100)
  40. if s <= sett.prob then
  41. game.drop_item(number(sett.huevos_min_max[1], sett.huevos_min_max[2]))
  42. end
  43. end
  44.  
  45. when 30129.chat."Los Huevos" begin --Elige tu NPC
  46. local sett = special_drop.info()
  47. local cantidad = 0
  48. for go = sett.huevos_min_max[1], sett.huevos_min_max[2], 1 do
  49. cantidad = pc.count_item(go) + cantidad
  50. end
  51. say_title(mob_name(npc.get_race()))
  52. say("[ENTER]Tienes un total de "..cantidad.." huevos")
  53. say("[ENTER]¿Quieres cambiarlos?")
  54.  
  55. local k = select("Sí ", "No")
  56. if k == 1 then
  57. local p = select(item_name(sett.premios.id_objetos[1]), item_name(sett.premios.id_objetos[2]),
  58. item_name(sett.premios.id_objetos[3]), item_name(sett.premios.id_objetos[4]),
  59. item_name(sett.premios.id_objetos[5]), item_name(sett.premios.id_objetos[6]),
  60. item_name(sett.premios.id_objetos[7]), "Cancelar")
  61.  
  62. if p != (table.getn(sett.premios.id_objetos)+1) and cantidad >= sett.premios.huevos_req[p] then
  63. say_title(mob_name(npc.get_race()))
  64. say("[ENTER]Ahora tienes " .. item_name(sett.premios.id_objetos[p]).." x"..sett.premios.cantidad_id_objetos[p])
  65. pc.give_item2(sett.premios.id_objetos[p], sett.premios.cantidad_id_objetos[p])
  66. say("[ENTER]Felicitaciones!")
  67. local acumulador_de_huevos = 0
  68. for go = sett.huevos_min_max[1], sett.huevos_min_max[2], 1 do
  69. local huevos_necesarios = sett.premios.huevos_req[p]
  70. if pc.count_item(go) >= huevos_necesarios and acumulador_de_huevos == 0 then
  71. pc.remove_item(go, huevos_necesarios)
  72. break
  73. else
  74. acumulador_de_huevos = pc.count_item(go) + acumulador_de_huevos
  75. if acumulador_de_huevos <= huevos_necesarios then
  76. pc.remove_item(go, pc.count_item(go))
  77. else
  78. pc.remove_item(go, pc.count_item(go) - (acumulador_de_huevos - huevos_necesarios))
  79. end
  80.  
  81. end
  82. end
  83. else
  84. syschat("No tienes los huevos necesarios")
  85. end
  86. end
  87. end
  88. end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement