ReuS Publicado 8 de Noviembre del 2020 Reportar Compartir Publicado 8 de Noviembre del 2020 Bueno, este es un pequeño aporte para quienes no saben como poner en los metines, que dropee 1 sola piedra al azar, ya que en mob_drop_item.txt no se puede hacer. --Quest realizada por ReuS para metin2zone -- Discord : ReuS#4312 quest drop_piedras begin state start begin when 101.kill begin local probabilidad = math.random(1,1) ----editable, 1,1 significa que siempre dropeara if probabilidad == 1 then local drop = math.random(1,14) --- drop al azar if drop == 1 then game.drop_item_with_ownership("28430", 1) elseif drop == 2 then game.drop_item_with_ownership("28431", 1) elseif drop == 3 then game.drop_item_with_ownership("28432", 1) elseif drop == 4 then game.drop_item_with_ownership("28433", 1) elseif drop == 5 then game.drop_item_with_ownership("28434", 1) elseif drop == 6 then game.drop_item_with_ownership("28435", 1) elseif drop == 7 then game.drop_item_with_ownership("28436", 1) elseif drop == 8 then game.drop_item_with_ownership("28437", 1) elseif drop == 9 then game.drop_item_with_ownership("28438", 1) elseif drop == 10 then game.drop_item_with_ownership("28439", 1) elseif drop == 11 then game.drop_item_with_ownership("28440", 1) elseif drop == 12 then game.drop_item_with_ownership("28441", 1) elseif drop == 13 then game.drop_item_with_ownership("28442", 1) elseif drop == 14 then game.drop_item_with_ownership("28443", 1) end end end end end NazoX reacciono a esto 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
NazoX Publicado 8 de Noviembre del 2020 Reportar Compartir Publicado 8 de Noviembre del 2020 Gracias xd, yo en su momento la única solución plausible que encontré fue poner las 4 piedras en el mob_drop_item.txt repartiendo el % de éxito de drop, esto te servirá para más items gracias ^^ ReuS reacciono a esto 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
caanmasu Publicado 8 de Noviembre del 2020 Reportar Compartir Publicado 8 de Noviembre del 2020 quest drop_piedras_4 begin state start begin function esMetin() return { [8001] = 0, --este estructura la puse así para que cada vez que mate no tenga que hacer un ciclo [8002] = 0 } end when kill with drop_piedras_4.esMetin()[npc.get_race()] != nil begin --en la tabla que puse arriba asigné números 0 (o podía poner cualquier cosa que no sea nil) para que logre detectar el vnum. Ya que toda tabla tiene sus index por defecto en nil. Al irme directamente a la posición con npc.get_race() no tendría que recorrer la tabla. if prob(0.75) then --acá está mi función "prob", esto significa 0.75% local rango_piedras = {28430, 28443} local piedra_azar = number(0, rango_piedras[2] - rango_piedras[1])+rango_piedras[1] --acá elijo un número al azar entre 0 y la diferencia en el rango, o sea, 13. Luego le sumo el vnum base y ya obtengo la piedra. game.drop_item_with_ownership(piedra_azar) end end end end --Mi función del questlib.lua function prob(probabilidad) -- formato de probabilidad: 100, 80, 55, 32.5, 1, 0.3, 0.07 local base = 1 if probabilidad >= 1 then return math.random(1, base*100) <= probabilidad else for i = 1, string.len(probabilidad)-1 do base = base*10 end return math.random(1, base) <= probabilidad*(base/10) end end Lo hice de esta manera, comentado obviamente para transmitir el conocimiento. Ojo, no la probé xD Vamos crackkksss! Esta función será útil algún día xD servidoresgame20 y NazoX reacciono a esto 1 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
OceanusPT Publicado 29 de Julio del 2022 Reportar Compartir Publicado 29 de Julio del 2022 --Quest realizada por ReuS para metin2zone -- Discord : ReuS#4312 quest drop_piedras begin state start begin when 101.kill begin if math.random(1,1) == 1 then game.drop_item_with_ownership(number(28430,28443), 1) end end end --editable, 1,1 significa que siempre dropeara \\ math.random(1,2) == 50% \\ math.random(1,100) == 1% sucess drop Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Mensajes recomendados
Unirse a la conversación
Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.