Jump to content

Quest (Item_to_shop)


Rafa23Alzira
 Share

Recommended Posts

Os traigo una quest que he creado para poner los items en el shop_item sin tener que ir poniendo 1 a 1 (la vagancia)

quest item_to_shop begin
	state start begin
		function change_flag()
			say("Para que tienda deseas poner los[ENTER]objetos")
			local t = tonumber(input())
			if t >0 then
				say("Has puesto la tienda "..t.."")
				game.set_event_flag("item_to_shop",t)
				return
			end
                end

		when 20095.take with pc.is_gm() begin
			local ITEM_PARA_CAMBIAR_FLAG = 2
			local item,flag,cantidad = item.get_vnum(),game.get_event_flag("item_to_shop"),item.get_count()
			if flag == 0 then
				item_to_shop.change_flag()
			else
				if item == ITEM_PARA_CAMBIAR_FLAG then
					item_to_shop.change_flag()
				else
					mysql_query("INSERT INTO  player.shop_item  (shop_vnum, item_vnum, count) VALUES ('"..flag.."', '"..item.."', '"..cantidad.."')")
					chat("Item "..item.." ("..cantidad..") agregado a la NPC "..flag.."")
				end
			end
		end
	end
end
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...