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