iraciz Posted May 19, 2019 Posted May 19, 2019 Good Night, I'm asking help for my script, Between only two choices, I need to call one case at 75% and the other at 25% Example: //-----------This is lose case 75% percent of the times case 1: specialeffect 540; specialeffect 500; sleep2 150; cutin "StartP0",2; sleep2 250; specialeffect 18; cutin "StartOCA1",2; sleep2 250; cutin "StartOCA2",2; sleep2 350; soundeffectall "rafflesia_attack.wav",0; cutin "StartOCAL",2; specialeffect2 191; sleep2 300; cutin "",255; makeitem 7539,1,"prontera",140,172; npctalk "Perdiste"; specialeffect 584; sleep2 250; specialeffect2 1; specialeffect2 426; sleep2 250; heal -7000,0; break; //-------------- Win case 25% of the times case 2: specialeffect 540; specialeffect 500; sleep2 150; cutin "StartP0",2; sleep2 200; specialeffect 18; cutin "StartOCA1",2; sleep2 150; cutin "StartOCA2",2; sleep2 150; specialeffect 40; cutin "StartOCA3",2; sleep2 200; specialeffect 18; cutin "Pwin",2; sleep2 150; cutin "Pwin1",2; sleep2 150; cutin "Pwin2",2; sleep2 150; cutin "Pwin3",2; sleep2 150; specialeffect2 100; specialeffect 18; cutin "StartOCA3",2; npctalk "Ganaste un Old Card Album"; sleep2 200; getitem 616,1; cutin "",255; specialeffect 500; break; } end; Ragnarok Online 05_19_2019 6_41_11 p. m..mp4 Quote
1 sader1992 Posted May 19, 2019 Posted May 19, 2019 (edited) it look for me in the video your script all about chances , so i am not sure what you are asking about its as simple as if(rand(1,100) < 76){ //75% chance (the result is between and includes 1 and 75) }else{ //25% chance (the result is else) } Edited May 20, 2019 by sader1992 Quote
0 iraciz Posted May 20, 2019 Author Posted May 20, 2019 (edited) Dear Sadder1992 Quote it look for me in the video your script all about chances , so i am not sure what you are asking about Yes, you are right, chances In the last video were a sort of 6 array cases to win any stat food, shown as: switch( rand(6) ) { case 1: getitem 12202,1; break; case 2: getitem 12203,1; break; case 3: getitem 12204,1; break; case 4: getitem 12205,1; break; case 5: getitem 12206,1; break; case 6: getitem 12207,1; break; } But same were not defined by rates, Its all kinda random. I was asking about chances, 25% win versus 75% loose for a separate case between two choices. Update: Script worked well as intended, I the video I won the 25% chance. I tested many times and after many tries I caught the prize. Many thanks for the support. Ragnarok Online 05_19_2019 10_04_00 p. m..mp4 Edited May 20, 2019 by iraciz Quote
Question
iraciz
Good Night, I'm asking help for my script,
Between only two choices, I need to call one case at 75% and the other at 25%
Example:
//-----------This is lose case 75% percent of the times
case 1:
specialeffect 540; specialeffect 500; sleep2 150; cutin "StartP0",2; sleep2 250;
specialeffect 18; cutin "StartOCA1",2; sleep2 250; cutin "StartOCA2",2; sleep2 350;
soundeffectall "rafflesia_attack.wav",0; cutin "StartOCAL",2; specialeffect2 191; sleep2 300;
cutin "",255; makeitem 7539,1,"prontera",140,172; npctalk "Perdiste";
specialeffect 584; sleep2 250; specialeffect2 1; specialeffect2 426; sleep2 250; heal -7000,0; break;
//-------------- Win case 25% of the times
case 2:
specialeffect 540; specialeffect 500; sleep2 150; cutin "StartP0",2; sleep2 200;
specialeffect 18; cutin "StartOCA1",2; sleep2 150; cutin "StartOCA2",2; sleep2 150; specialeffect 40; cutin "StartOCA3",2; sleep2 200;
specialeffect 18; cutin "Pwin",2; sleep2 150; cutin "Pwin1",2; sleep2 150; cutin "Pwin2",2; sleep2 150;
cutin "Pwin3",2; sleep2 150; specialeffect2 100; specialeffect 18; cutin "StartOCA3",2;
npctalk "Ganaste un Old Card Album"; sleep2 200; getitem 616,1; cutin "",255; specialeffect 500;
break; }
end;
2 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.