iraciz Posted May 19, 2019 Group: Members Topic Count: 140 Topics Per Day: 0.03 Content Count: 562 Reputation: 111 Joined: 10/05/12 Last Seen: February 12, 2024 Share 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 Link to comment Share on other sites More sharing options...
1 sader1992 Posted May 19, 2019 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 4 hours ago Share 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 Link to comment Share on other sites More sharing options...
0 iraciz Posted May 20, 2019 Group: Members Topic Count: 140 Topics Per Day: 0.03 Content Count: 562 Reputation: 111 Joined: 10/05/12 Last Seen: February 12, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
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;
Link to comment
Share on other sites
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.