caspa Posted June 5, 2018 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted June 5, 2018 How do you increase the chance rate to get the reward on the cluckers npc event? if (.startcluck) { specialeffect2 EF_HIT3; switch(rand(15)) { case 0: npctalk "CLUUUUUUCK!!!"; sc_start SC_Sleep,10000,0; emotion e_gg; break; case 1: npctalk "Cluuuuuck!~"; break; case 2: sc_start SC_Sleep,10000,0; emotion e_omg;break; case 3: sc_start SC_Freeze,10000,0; break; case 4: npctalk "CLUUUUUUUUUCK!!!"; sc_start SC_Freeze,10000,0; break; emotion e_omg; break; case 5: sc_start SC_Sleep,10000,0; break; case 6: sc_start SC_Stone,10000,0; emotion e_gg; break; case 7: npctalk "CLUUUUUUCK!!!"; sc_start SC_Sleep,10000,0; emotion e_gg; break; case 8: npctalk "Cluck! CLUUUCK!!"; sc_start SC_Sleep,10000,0; emotion e_gg; break; case 9: sc_start SC_Stun,10000,0; break; case 10: sc_start SC_Sleep,10000,0; emotion e_gg; break; case 11: npctalk "Cluck! Cluck!"; emotion e_omg; break; case 12: sc_start SC_Stun,10000,0; break; case 13: npctalk "Cluuuuuck!~"; sc_start SC_Stun,10000,0; break; default: if (rand(50) < 4) { npctalk "Woof!... Wooff!..."; specialeffect2 EF_SPHERE; announce "[Cluck Cluck Boom] : '" + strcharinfo(0) + "' squeezed out the prize, Well done!",bc_map,0x00FFFF; getitem $cluck_item_id,$cluck_item_amount; set .startcluck,0; } else { npctalk "Cluck! CLUUUCK!!"; sc_start SC_Freeze,10000,0; emotion e_omg; } break; } end; i don't understand the rand(50) < 4 part.. what does it mean? does it mean that in random number from 1 to 50 i have 4% chance of getting the item? or what? LOL! i don't understand T_T Quote Link to comment Share on other sites More sharing options...
0 TheDerpySupport Posted June 5, 2018 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 208 Reputation: 60 Joined: 09/23/17 Last Seen: July 28, 2021 Share Posted June 5, 2018 38 minutes ago, caspa said: How do you increase the chance rate to get the reward on the cluckers npc event? if (.startcluck) { specialeffect2 EF_HIT3; switch(rand(15)) { case 0: npctalk "CLUUUUUUCK!!!"; sc_start SC_Sleep,10000,0; emotion e_gg; break; case 1: npctalk "Cluuuuuck!~"; break; case 2: sc_start SC_Sleep,10000,0; emotion e_omg;break; case 3: sc_start SC_Freeze,10000,0; break; case 4: npctalk "CLUUUUUUUUUCK!!!"; sc_start SC_Freeze,10000,0; break; emotion e_omg; break; case 5: sc_start SC_Sleep,10000,0; break; case 6: sc_start SC_Stone,10000,0; emotion e_gg; break; case 7: npctalk "CLUUUUUUCK!!!"; sc_start SC_Sleep,10000,0; emotion e_gg; break; case 8: npctalk "Cluck! CLUUUCK!!"; sc_start SC_Sleep,10000,0; emotion e_gg; break; case 9: sc_start SC_Stun,10000,0; break; case 10: sc_start SC_Sleep,10000,0; emotion e_gg; break; case 11: npctalk "Cluck! Cluck!"; emotion e_omg; break; case 12: sc_start SC_Stun,10000,0; break; case 13: npctalk "Cluuuuuck!~"; sc_start SC_Stun,10000,0; break; default: if (rand(50) < 4) { npctalk "Woof!... Wooff!..."; specialeffect2 EF_SPHERE; announce "[Cluck Cluck Boom] : '" + strcharinfo(0) + "' squeezed out the prize, Well done!",bc_map,0x00FFFF; getitem $cluck_item_id,$cluck_item_amount; set .startcluck,0; } else { npctalk "Cluck! CLUUUCK!!"; sc_start SC_Freeze,10000,0; emotion e_omg; } break; } end; i don't understand the rand(50) < 4 part.. what does it mean? does it mean that in random number from 1 to 50 i have 4% chance of getting the item? or what? LOL! i don't understand T_T It means it generates a number at random 1~50 and if it lands on 1, 2, or 3 you win; You can either lower the rand(50) or increase the number less than to look for. 1 Quote Link to comment Share on other sites More sharing options...
0 caspa Posted June 5, 2018 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted June 5, 2018 [SOLVED] thank you sir. Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted June 5, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted June 5, 2018 17 hours ago, TheDerpySupport said: It means it generates a number at random 1~50 and if it lands on 1, 2, or 3 you win; You can either lower the rand(50) or increase the number less than to look for. correction .... rand(2) actually produce number 0 or 1 .. if ( rand(50) < 4 ) actually means 4 out 50, means land on 0,1,2,3 is true condition, 4~49 is false condition when you quote the code ... didn't you see it has case 0: ? and the default: case is actually case 14: Quote Link to comment Share on other sites More sharing options...
0 TheDerpySupport Posted June 5, 2018 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 208 Reputation: 60 Joined: 09/23/17 Last Seen: July 28, 2021 Share Posted June 5, 2018 13 minutes ago, AnnieRuru said: correction .... rand(2) actually produce number 0 or 1 .. if ( rand(50) < 4 ) actually means 4 out 50, means land on 0,1,2,3 is true condition, 4~49 is false condition when you quote the code ... didn't you see it has case 0: ? and the default: case is actually case 14: Thanks for the correction, I wasn't aware it randomizes 0 as a number 1 Quote Link to comment Share on other sites More sharing options...
Question
caspa
How do you increase the chance rate to get the reward on the cluckers npc event?
i don't understand the rand(50) < 4 part.. what does it mean?
does it mean that in random number from 1 to 50 i have 4% chance of getting the item? or what? LOL! i don't understand T_T
Link to comment
Share on other sites
4 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.