chry_fld,144,48,5 script Gatcha Vending 562,{
mes "[Gatcha Ticket Vending]";
mes "Use your Gatcha Ticket here.";
next;
switch(select("- Use:- See possibility:- Exit"))
{
case 1:
if ( !countitem(.itemuse) ) {
mes "[Gatcha Ticket Vending]";
mes "A "+ getitemname(.itemuse) +" is needed to use this machine";
close;
}
delitem .itemuse, 1;
getitem .temp_array[rand(0, getarraysize(.temp_array))], 1;
end;
case 2:
next;
mes "[Gatcha Ticket Vending]";
mes "Select possibility.";
switch(select("- High Chance:- Mid Chance:- Low Chance:- Exit")){
case 1:
next;
mes "[Gatcha Ticket Vending]";
mes F_MesItemInfo(14003);
mes F_MesItemInfo(40021);
mes F_MesItemInfo(40028);
mes F_MesItemInfo(40026);
end;
case 2:
next;
mes "[Gatcha Ticket Vending]";
mes F_MesItemInfo(40030);
mes F_MesItemInfo(40031);
mes F_MesItemInfo(40039);
mes F_MesItemInfo(40040);
end;
case 3:
mes "[Gatcha Ticket Vending]";
mes F_MesItemInfo(40001);
mes F_MesItemInfo(40033);
mes F_MesItemInfo(40035);
mes F_MesItemInfo(40041);
mes F_MesItemInfo(40042);
end;
case 4:
next;
mes "[Gatcha Ticket Vending]";
mes "Good Bye.";
close;
}
}
OnInit:
waitingroom "Gatcha Pot",0,0;
.itemuse = 40022;
setarray .itemid[0], 14003,40021,40028,40026,40030,40031,40039,40040,40001,40033,40035,40041,40042;
setarray .itemchance[0], 90,90,90,90,70,70,70,70,10,10,10,10,10;
freeloop(1);
.@counter = 0;
for(.@i = 0; .@i < getarraysize(.itemid); .@i++) {
for(.@k = 0; .@k < .itemchance[.@i]; .@k++) {
.temp_array[.@counter] = .itemid[.@i];
.@counter++;
}
}
freeloop(0);
end;
}