Jump to content
  • 0

Help for modify


KCritz

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

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 by KCritz
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


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 by Patskie
Edited
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

I tested it and its working no error on server map but the problem is it don't give any cashpoint

 

34is3gx.jpg

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

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 by sandbox
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

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 :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

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 

e0sbki.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

I think you forgot the NPC headers? :o

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

oopppsss ahaha my bad ahm sorry :P

 

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 is

You 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 by KCritz
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Edited previous post

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

Thank you sir Patskie :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...