Maybe something like:
function script Get_FreyaItems {
setarray .@items,501,502,1503,504;
setarray .@chance,10,5,5,15;
set .@rand,rand(1,getarraysize(.@items));
if (rand(99) < .@chance[.@rand]){
getitem .@items[.@rand],1;
if (.@chance[.@rand] < 6)
announce "A rare item has been created",bc_all;
}
end;
}
Note: I have not tested this script
Note: This script means you can get no items also. If you want something that always give at least a item, the summ of all items chance must be 100. And this script has to be different.