Jump to content

[QUEST] drop de cajas


everhdezz

Recommended Posts

hola, este es uno de mis primeros aportes, es 100% echo por mi y es exclusivamente para este foro, con el paso del tiempo espero subir mas quest que usare en mi futuro servidor, espero y la disfruten
 
 
teóricamente hace lo mismo que las quest ya existentes, pero con mucho menos codigo
 
 

quest cajas begin
	state start begin
		function dar_item(data)
			caja = item.get_vnum()
			local s= table.getn(data)
			local a = number (1,s)
			if data[a][3] == 0 then
				pc.give_item2(data[a][1],data[a][2])
			elseif data[a][3] > 0 then 
				cajas.item_con_tiempo(data[a][1],data[a][3])
			end
			pc.remove_item(caja,1)
			return
		end
		function item_con_tiempo(vnum,	duracion)
				local expiracion = 86400*duracion
				pc.give_item2_select(vnum,1)
				item.set_socket(0, get_global_time()+expiracion)
		end

--Baul tormenta desierto
		when 38054.use begin
			local items = {
					{41150,1,30},
					{71004,10,0},
					{19,1,0}
				      }
			cajas.dar_item(items)
		end

--Baul festivo
		when 38056.use begin
			local items = {
					{41150,1,30},
					{71004,10,0},
					{19,1,0}
				      }
			cajas.dar_item(items)
		end

	end
end 

 
 su nuevo codigo  
se usa de la siguiente manera (si el baul ya tiene una quest es eliminarla para que no interfieran ambas quest )
 
 -- aqui se modifica el vnum de la caja
        when 38056.use begin
 
-- aqui se agregan los items
            local items = {
                    {41150,1,30},
                    {71004,10,0},
                    {19,1,0}
                 }
            cajas.dar_item(items)
        end
 
 
 
cada item se debe meter al arreglo como se ve arriba en una nueva linea separada por una , donde {vnum,cantidad,tiempo_en_dias}
 
espero sus dudas, sugerencias y/o comentarios

Link to comment
Share on other sites

  • 1 year later...

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.

  • Recently Browsing   0 members

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