Item script of your custom box should be:
callfunc "F_EventBox";
and add this in your npc/custom folder
function script F_EventBox {
// change Item ID here
setarray .@i1[0],607,608; // Common Items
setarray .@i2[0],512,513; // Rare Items
setarray .@i3[0],514,515; // Super Rare Items
set .@i1rand,rand( getarraysize(.@i1) ); // Randomize Common Items; just change max amount if you add items
set .@i2rand,rand( getarraysize(.@i2) ); // Randomize Rare Items; just change max amount if you add items
set .@i3rand,rand( getarraysize(.@i3) ); //Randomize Super Rare Items; just change max amount if you add items
.@chance = rand(100);
// Super Rare Item 1%
if (.@chance == 1) {
getitem .@i3[.@i3rand],1;
announce "[ "+strcharinfo(0)+" ] won a [ "+getitemname(.@i3[.@i3rand])+" ] from the Event Box.",0;
}
else if (.@chance <= 10) { // 10%
getitem .@i2[.@i2rand],1;
}
// Common Items
else {
getitem .@i1[.@i1rand],1;
}
end;
}