function script randbox {
mes "Do you really want to open one(1) Lottery Box?";
mes "^FF0000NOTE: Dont press cancel(beside OK) or the box will be gone.^000000";
mes "No refund will be given if you do so.";
//next;
switch(select("Yes Please:No! Not yet!")) {
case 1:
set .@r, rand(100);
//if( .@r >= 0 && .@r < 2) {
// switch( rand(1) ) {
// case 0: getitem 32025,1; break;
// }
//}
if( .@r >= 1 && .@r < 5 ) {
switch( rand(1,6) ) {
case 1: getitem 32008,1; break;
case 2: getitem 32009,1; break;
case 3: getitem 32010,1; break;
case 4: getitem 32011,1; break;
case 5: getitem 32012,1; break;
case 6: getitem 32013,1; break;
}
}
if( .@r >= 6 && .@r < 10 ) {
switch( rand(1,9) ) {
case 1: getitem 32025,1; break;
case 2: getitem 8400,2; break;
case 3: getitem 8403,2; break;
case 4: getitem 8402,6; break;
case 5: getitem 607,25; break;
case 6: getitem 8400,10; break;
case 7: getitem 8402,20; break;
case 8: getitem 8403,8; break;
case 9: getitem 32025,3; break;
}
}
if( .@r >= 11 && .@r < 20 ) {
switch( rand(1,6) ) {
case 1: getitem 32007,1; break;
case 2: getitem 32006,1; break;
case 3: getitem 32005,1; break;
case 4: getitem 32004,1; break;
case 5: getitem 32003,1; break;
case 6: getitem 32002,1; break;
}
}
if( .@r >= 21 && .@r < 35 ) {
switch( rand(1,12) ) {
case 1: getitem 32021,60; break;
case 2: getitem 32022,60; break;
case 3: getitem 8404,rand(2,3); break;
case 4: getitem 32025,1; break;
case 5: getitem 6553,1; break;
case 6: getitem 6564,1; break;
case 7: getitem 6565,1; break;
case 8: getitem 6566,1; break;
case 9: getitem 8524,1; break;
case 10: getitem 8506,1; break;
case 11: getitem 8501,1; break;
case 12: getitem 608,35; break;
}
}
if( .@r >= 36 && .@r < 47 ) {
switch( rand(1,4) ) {
case 1: getitem 32023,40; break;
case 2: getitem 32024,40; break;
case 3: getitem 984,15; break;
case 4: getitem 985,15; break;
}
}
if( .@r >= 48 && .@r < 60 ) {
switch( rand(1,5) ) {
case 1: getitem 32001,1; break;
case 2: getitem 32000,1; break;
case 3: getitem 608,15; break;
case 4: getitem 607,10; break;
case 5: getitem 610,10; break;
}
}
if( .@r >= 61 && .@r < 79 ) {
switch( rand(1,2) ) {
case 1: getitem 32023,20; break;
case 2: getitem 32024,20; break;
}
}
if( .@r >= 81 && .@r < 100 ) {
switch( rand(1,2) ) {
case 1: getitem 32021,30; break;
case 2: getitem 32022,30; break;
}
}
emotion e_grat,1;
close;
case 2:
getitem 32020,1;
close;
}
//close;
}
My problem here is that sometimes, when the box is opened, no items will be given.
The goal of this script is to give items randomly with certain percentage. I was trying to conceptualize and make the script but this is all i can think of. If you have better version of this, please dont hesitate to edit this.
Question
Mabuhay
The goal of this script is to give items randomly with certain percentage. I was trying to conceptualize and make the script but this is all i can think of. If you have better version of this, please dont hesitate to edit this.
Waiting for reply. Thank you!
Edited by MrVandalBusLink to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.