You can basically just do it like this:
prontera,155,139,5 script ShenRon 10500,{
function LinkItem_;
.@name$ = strcharinfo(0);
.@rand = rand(.chances);
.@i = 0;
if( countitem(Item_ID1) < Amount && countitem(Item_ID2) < Amount && countitem(Item_ID3) < Amount ){
mes .n$;
mes "You don't have any";
mes "Item_ID1 name xAmount";
mes "Item_ID2 name xAmount";
mes "Item_ID3 name xAmount";
mes "in your inventory.";
mes " ";
mes "Come back to me if you have it already.";
close;
}
mes .n$;
mes rand(2) ? ""+callfunc("F_Hi")+" ^0000FFI am Shenron^000000, of Prontera Rune-Midgard City."
: ""+callfunc("F_Hi")+" ^0000FFI am Shenron^000000, of Prontera Rune-Midgard City.";
mes "Required Item: "+.itm_a+" x "+(.itm_n$)+"";
mes " ";
mes "Would you risk to play this game?";
next;
if( select("- Play Game","- Cancel") == 2 ) {
mes .n$;
mes "Alright! "+ strcharinfo(0) +" come back anytime you want.";
close;
}
while (( .@rand -= .item_Rate[.@i] ) >= 0 ) .@i++;
progressbar "0x11CC99",.loading; specialeffect2 EF_REMOVETRAP;
getitem .item_ID[.@i], 1;
delitem Item_ID1, Amount;
delitem Item_ID2, Amount;
delitem Item_ID3, Amount;
announce "[ Shenron ]: Player "+ .@name$ +" obtained 1 x "+ getitemname(.item_ID[.@i]) +" with "+ .item_Rate[.@i] +"%.",0;
mes .n$;
mes "You have obtained 1 x ^FF3000"+ getitemname(.item_ID[.@i]) +"^000000 with "+ .item_Rate[.@i] +"%.";
close;
function LinkItem_ {
.@id = getarg(0);
.@showslot = getarg(1,0);
.@slot = getitemslots(.@id);
return "<ITEM>"+(.@slot&&.@showslot?getitemname(.@id)+" ["+.@slot+"]":getitemname(.@id))+"<INFO>"+.@id+"</INFO></ITEM>";
}
OnInit:
.n$ = "[ Shenron ]";
.loading = 1; // 0 = No Delay
//.itm_p = 60796; // Required Item
//.itm_a = 10; // Required Amount
.itm_n$ = LinkItem_(.itm_p);
setarray .item_ID, 7539,35434,35390,60043,60066,60081,60068,60147,60148,60149,60150,60151,60152,7179; // Item ID List
setarray .item_Rate, 90,10,10,10,10,10,10,5,5,5,5,5,5,1; // Item ID Chances
.@i = 0;
while ( .item_ID[.@i] ) {
.chances += .item_Rate[.@i];
.@i++;
}
end;
I'm sure there's a better way to do this, but simply can be just like this.