KCritz Posted February 19, 2014 Posted February 19, 2014 (edited) Heres the script that i've requested long ago - script gvubhnji -1,{ OnNPCKillEvent: if( killedrid && ( getmonsterinfo(killedrid, 21) & 0x0020 ) && ( killedrid <= 3000 ) ) { if( getmonsterinfo(killedrid, 22) ) .@R = rand( 100, 500 );//-- MVP else .@R = rand( 50, 150 );//-- MINIBOSS #CASHPOINTS = #CASHPOINTS + .@R; dispbottom "Gained : "+ .@R +" points. Total : "+ #CASHPOINTS +" points."; } end; } just wanna make it have a percentage to get the cashpoint like MVP - 100 - 500 (random) cashpoint 25% chance to earn mini boss -50 - 150 (random) cashpoint 50% chance to earn Edited February 19, 2014 by KCritz Quote
Patskie Posted February 20, 2014 Posted February 20, 2014 (edited) OnNPCKillEvent: if( killedrid && ( getmonsterinfo( killedrid, 21 ) & 0x0020 ) && ( killedrid <= 3000 ) ) { if ( getmonsterinfo( killedrid, 22 ) ) { if ( rand( 100 ) < 25 ) { #CASHPOINTS += rand( 100, 500 ); dispbottom "You now have " +#CASHPOINTS+ " cash points."; } } else { if ( rand( 100 ) < 50 ) #CASHPOINTS += rand( 50, 150 ); } } end; Edited February 20, 2014 by Patskie Edited Quote
sandbox Posted February 20, 2014 Posted February 20, 2014 Kindly test.. find if( getmonsterinfo(killedrid, 22) ) replace set .@R,0; if( getmonsterinfo(killedrid, 22) ) find .@R = rand( 100, 500 );//-- MVP replace set .@MVPc,rand(3); if(.@MVPc == 1) set .@R,rand( 100, 500 ); //-- MVP find .@R = rand( 50, 150 );//-- MINIBOSS replace set .@MVPc,rand(1); if(.@MVPc == 1) set .@R,rand( 50, 150 ); //-- MINIBOSS Quote
KCritz Posted February 20, 2014 Author Posted February 20, 2014 I tested it and its working no error on server map but the problem is it don't give any cashpoint Quote
sandbox Posted February 20, 2014 Posted February 20, 2014 (edited) remove set .@R,0; find set .@MVPc,rand(3); replace set .@MVPc,rand(4); find set .@MVPc,rand(1); replace set .@MVPc,rand(2); Edited February 20, 2014 by sandbox Quote
sandbox Posted February 20, 2014 Posted February 20, 2014 Wow i'm a caveman, didn't know 'set' can be ignored once a variable has been declared anymore.. The disadvantages of not using an svn for almost a year Quote
KCritz Posted February 20, 2014 Author Posted February 20, 2014 OnNPCKillEvent: if( killedrid && ( getmonsterinfo( killedrid, 21 ) & 0x0020 ) && ( killedrid <= 3000 ) ) { if ( getmonsterinfo( killedrid, 22 ) ) { if ( rand( 100 ) < 25 ) #CASHPOINTS += rand( 100, 500 ); } else { if ( rand( 100 ) < 50 ) #CASHPOINTS += rand( 50, 150 ); } } dispbottom "You now have " +#CASHPOINTS+ " cash points."; end; getting error Quote
KCritz Posted February 20, 2014 Author Posted February 20, 2014 (edited) oopppsss ahaha my bad ahm sorry still got a lil problem. it always give info about your cashpoint even I just kill normal monster like poring I kill angeling give me 50 cashpoint then in window chat will say "You now have 50 cash points." - check I kill poring it shouldnt give me any cash but in window chat say "You now have 50 cash points." I would like to happen in getting cash isYou earn 50 cash points Your total cash poins is 50 and when you kill another mvp or miniboss You earn 38 cash point Your total cash points is 88 Edited February 20, 2014 by KCritz Quote
Question
KCritz
Heres the script that i've requested long ago
just wanna make it have a percentage to get the cashpoint like
MVP - 100 - 500 (random) cashpoint 25% chance to earn
mini boss -50 - 150 (random) cashpoint 50% chance to earn
Edited by KCritz10 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.