Jump to content

Recommended Posts

Posted

Buenas, estoy intentado hacer una quest para que al activarlo los mobs dropeen x item, con x porcentaje de entre todos, como los cofres que da items aleatorios, me he basado en la de hallowen, o en la de keko que hay por aquí, consigo que el npc me de la opción de activar el evento o desactivarlo, si edito la de hallowen me caen 100% y tal y es un royo, por eso he intentado hacer una, consigo que funcione, pero uso lo mismos locales que keko y no me funciona, en cambio si borro el math.random si me funciona, pero logicamente no dropeara aleatoriamente, aquí está mi quest.

Quote

quest drops_nazox begin
    state start begin
            when 20087.chat."Evento de super drop" with pc.is_gm() begin
                say_title("Empezar el evento")
                say("Metin2")
                say("Quieres activar el evento?")
                say("")
                say_reward("Que quieres hacer?")

                local evento == select ("Activarlo" , "Desactivarlo" , "Salir")
                if evento == 1 then
                    notice_all("El evento de Super drop ha comenzado.")
                    notice_all("Buena suerte a todos")
                elseif evento == 2 then
                    notice_all("El evento de Super drop ha terminado")
                    notice_all("Esperamos que os hayais divertido.")
                elseif evento == 3 then
                            return
                            end
                        end
            when kill with npc.is_pc() and pc.get_level() >= 106 begin
                local items = number(1,10)  ----------------si tengo este o local items == math.random(1,x) no funciona la quest, si borro esta linea si que funciona pero no dropea.
                local drop = {80016,80017,19,299}
                if items == 1 then
                game.drop_item(drop[1],1)
                if items == 2 then
                game.drop_item(drop[2],1)
                if items == 3 then
                game.drop_item(drop[3],1)
                if items == 4 then
                game.drop_item(drop[4],1)
            end
        end
    end
end

y aquí como la tenía esta apenas varia: Quest

dilong me ha comentado que añada game.set_event_flag("halloween_drop", 1  y game.get_event_flag("halloween_drop") == 1 begin x ejemplo, pero no se que tengo que poner donde hallowen x ejemplo, gracias de antemano ^^

Posted
Spoiler

 quest drops_nazox begin
    state start begin
            when 20087.chat."Evento de super drop" with pc.is_gm() begin
                say_title("Empezar el evento")
                say("Metin2")
                say("Quieres activar el evento?")
                say("")
                say_reward("Que quieres hacer?")
                local evento == select ("Activarlo","Desactivarlo","Salir")
                if evento == 1 then
                    game.set_event_flag("evento",1)
                    notice_all("El evento de Super drop ha comenzado.")
                    notice_all("Buena suerte a todos")
                elseif evento == 2 then
                    game.set_event_flag("evento",0)
                    notice_all("El evento de Super drop ha terminado")
                    notice_all("Esperamos que os hayais divertido.")
                    return end end end
            when kill with not npc.is_pc() and pc.get_level() >= 106 and game.get_event_flag("evento")==1 begin
                local drop = {80016,80017,19,299}
                local aleatorio = math.random(1,4)
                local prob = number(1, 200)
                if prob <= 5 then
                game.drop_item_with_ownership(drop[aleatorio],1)
            end
        end
    end
end

 

 

Posted
hace 2 horas, Dilong dijo:
  Ocultar contenido


 quest drops_nazox begin
    state start begin
            when 20087.chat."Evento de super drop" with pc.is_gm() begin
                say_title("Empezar el evento")
                say("Metin2")
                say("Quieres activar el evento?")
                say("")
                say_reward("Que quieres hacer?")
                local evento == select ("Activarlo","Desactivarlo","Salir")
                if evento == 1 then
                    game.set_event_flag("evento",1)
                    notice_all("El evento de Super drop ha comenzado.")
                    notice_all("Buena suerte a todos")
                elseif evento == 2 then
                    game.set_event_flag("evento",0)
                    notice_all("El evento de Super drop ha terminado")
                    notice_all("Esperamos que os hayais divertido.")
                    return end end end
            when kill with not npc.is_pc() and pc.get_level() >= 106 and game.get_event_flag("evento")==1 begin
                local drop = {80016,80017,19,299}
                local aleatorio = math.random(1,4)
                local prob = number(1, 200)
                if prob <= 5 then
                game.drop_item_with_ownership(drop[aleatorio],1)
            end
        end
    end
end

 

 

Gracias, pero cuando le doy click al npc no funciona no me sale el evento , me da este error : super_drop.quest:18:syntax error : [string "startpc . is_gm ( )"]:6: unexpected symbol near `=='
Abort (core dumped)

Posted

Le sobra un end donde la comprobación del estado del evento. El tercero cierra el state.
Además, debeis usar number, y no math.random a secas - sin hacerle seed primero.

Posted
hace 12 minutos, NazoX dijo:

Gracias, pero cuando le doy click al npc no funciona no me sale el evento , me da este error : super_drop.quest:18:syntax error : [string "startpc . is_gm ( )"]:6: unexpected symbol near `=='
Abort (core dumped)

No me fije, la parte de " == select( " dejalo asi: = select(

Posted

dejo esta corregida por  si alguien quiere una idea gracias a paci y dilong 

Quote

quest drops_nazox begin
    state start begin
            when 20087.chat."Evento de super drop" with pc.is_gm() begin
                say_title("Empezar el evento")
                say("Metin2")
                say("Quieres activar el evento?")
                say("")
                say_reward("Que quieres hacer?")
                local evento = select ("Activarlo","Desactivarlo","Salir")
                if evento == 1 then
                    game.set_event_flag("evento",1)
                    notice_all("El evento de Super drop ha comenzado.")
                    notice_all("Buena suerte a todos")
                elseif evento == 2 then
                    game.set_event_flag("evento",0)
                    notice_all("El evento de Super drop ha terminado")
                    notice_all("Esperamos que os hayais divertido.")
                    return end end
            when kill with not npc.is_pc() and pc.get_level() >= 1 and game.get_event_flag("evento")==1 begin
                local drop = {80016,80017,19,299}
                local aleatorio = math.random(1,4)
                local prob = number(1, 200)
                if prob <= 5 then
                game.drop_item_with_ownership(drop[aleatorio],1)
            end
        end
    end
end

 

  • Dilong locked, unlocked and locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies to enhance your browsing experience and provide relevant content. By continuing to browse, you agree to our We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. and Terms of Use. For more information on how we protect your data, please check our Privacy Policy.