Jump to content

[QUEST]Recomensa aleatoria. (Item)


Dragonslayer

Mensajes recomendados

Bueno a peticion de Jex, una quest muy sencilla.

quest cofre begin
    state start begin  
        when xxxxx.use begin
	     cofre.giverandomitem()
	          pc.remove_item(xxxxx, 1)
	     end
        end
          
        function giverandomitem()
            local ids = number(1,5) //5 la cantidad de objetos
            local items = {
            --numero  idobjeto cant tamaño(inventario)
                [1] = {71018,200,1},
                [2] = {71020,200,1},
                [3] = {90027,1,1},
                [4] = {90027,2,1},
                [5] = {90028,1,1},
            }
	if pc.get_empty_inventory_count() >= items[ids][3] then
		pc.give_item2(items[ids][1],items[ids][2])
	else
		syschat("No tienes espacio en el inventario.")
	end
	end
    end
end

Edit: La funcion pc.get_empty_inventory_count es muy rara, creo que con añadirla al quest_fuction funciona bien.

Enlace para comentar
Compartir en otros sitios

Unirse a la conversación

Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.

Guest
Responder a este tema...

×   Has pegado contenido con formato .   Eliminar formato

  Only 75 emoji are allowed.

×   Tu enlace se ha incorporado automáticamente.   Mostrar un enlace en su lugar

×   Se ha restaurado el contenido anterior. .   Borrar editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...