Jump to content

item.set_socket and pc.give_item2


Recommended Posts

Sup guys, I'm feeling kind of dumb today. I was trying to write a simple quest for poly shop but i failed don't know why.

How do I set the socket?

http://wklej.org/hash/447cfbc9923/

quest poly begin
    state start begin
        when 80009.use begin
            
            local poly = {
                [1] = {"xx_1", 101},
                [2] = {"xx_2", 502},
            }
            
            local p = {}
            
            for i =1, table.getn(poly) do
                table.insert(p, poly[1])
            end
            
            local s = select_table(p)
            local polys = poly
            
            pc.give_item2(70104, item.set_socket(0, polys[2]))
            --pc.give_item2(70104)
            --item.set_socket(0, polys[2])
        end
    end
end

 

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Honorable Member

For prior game file versions; use like this:

 

quest books begin
	state start begin
		when 50000001.use begin
		--when kill with npc.is_pc() == false and npc.race >= 8000 and npc.race < 8500 begin --for stones
			if pc.get_empty_inventory_count() < 1 then
				syschat("You cannot open this box while you doesn't free up some spaces in your inventory.")
				return
			end
			local sb = {
				{{1,2,3,4,5,6},{16,17,18,19,20,21},},--Warrior
				{{31,32,33,34,35,36},{46,47,48,49,50,51},},--Assassin
				{{61,62,63,64,65,66},{76,77,78,79,80,81},},--Sura
				{{91,92,93,94,95,96},{106,107,108,109,110,111},},--Shaman
				--{{170,171,172,173,174,175}},--Wolfman
			}
			local class = number(1,table.getn(sb))
			local group = number(1,2)
			--if class == WOLFMAN then group=1 end
			local skill_vnum = number(1, table.getn(sb[class][group]))
			local itemid = pc.give_item2(50300,1)
			if itemid ~= 0 then 
				item.select(itemid)
				item.set_socket(0, skill_vnum)
			else
				syschat(string.format("ERROR: code(0x%d|0x%d|0x%d)", class, group, skill_vnum))
			end
		end
	end
end

 
Link to comment
Share on other sites

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.