sorcery  Artifact [a0d38cfe10]

Artifact a0d38cfe10b6c5551b87a4f460f2bc222c9136cc18d2674dfaa4d4297fec0f1e:


return {
	purge_container = function(pos,node,meta,user)
		local offset = function(pos,range)
			local r = function(min,max)
				return (math.random() * (max - min)) + min
			end
			return {
				x = pos.x + r(0 - range, range);
				y = pos.y;
				z = pos.z + r(0 - range, range);
			}
		end
		for name, inv in pairs(meta.inventory) do
			for _, item in pairs(inv) do
				if not item:is_empty() then
					minetest.add_item(offset(pos,0.4), item)
				end
			end
		end
	end;
}