Jump to content

[QUEST]Recomensa aleatoria. (Item)


Dragonslayer
 Share

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

 Share

  • Recently Browsing   0 members

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