Jump to content

Copy an item to another table


Recommended Posts

Copy an item to another table.
Example my quest copy take item to other table..

 

when 9005.take begin
            ----"111111222222333333444444555555666666777777888888999999000000"
            say_title("bla bla bla")
            say("")
            local store=select("Save item", "Exit")
            if store==2 then
            return
            end
            mysql_direct_query("select * from player.save_item;")
            mysql_direct_query("INSERT INTO `save_item` (`id`,  `owner_id`,  `window`,  `pos`,  `count`,  `vnum`,  `socket0`,  `socket1`,  `socket2`,  `socket3`,  `socket4`,  `socket5`,  `attrtype0`,  `attrvalue0`,  `attrtype1`,  `attrvalue1`,  `attrtype2`,  `attrvalue2`,  `attrtype3`,  `attrvalue3`,  `attrtype4`,  `attrvalue4`,  `attrtype5`,  `attrvalue5`,  `attrtype6`,  `attrvalue6`) VALUES ('"..pc.get_player_id().."');")
            item.remove()
            setskin(NOWINDO)
        end

 

Quest 2

		when 9005.take with item.get_id() begin
			code = item_attr.set_value()
			codu = item.get_vnum()
			----"111111222222333333444444555555666666777777888888999999000000"
			say_title("bla bla bla")
			say("")
			local store=select("Save item", "Exit")
			if store==2 then
			return
			end
			local code, codu = mysql_direct_query("INSERT INTO save_item_copy1 (id, owner_id, window, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6) SELECT id, owner_id, window, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6 FROM save_item WHERE id LIMIT 1)
			item.remove()
			setskin(NOWINDO)
		end

 

 

Suggestion?

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.