Jump to content
  • 0

Disguise EVent Reward Random


Subzero

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  07/25/16
  • Last Seen:  

hello rA,may i ask again about random reward on disguise event

this is my current script https://pastebin.com/xgfupBjE

i like to make a random reward for disguise event example reward

7539,7420,671,672,673

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

11 hours ago, Subzero said:

hello rA,may i ask again about random reward on disguise event

this is my current script https://pastebin.com/xgfupBjE

i like to make a random reward for disguise event example reward

7539,7420,671,672,673

Make it more exciting with this... Edit it by your own needs.

It adds chance to get the reward. You can add more according to your needs.

		// setarray .@reward1, "chance", item id, item amount...
		setarray .@reward1, 5, 7539, 10; // Item ID 7539 x 10with chance of 5% in getting, You can add more..
		setarray .@reward2, 15, 7420, 5; // Item ID 7420 x 5 with chance of 15% in getting, You can add more..
		setarray .@reward3, 20, 671, 1; // etc...
		setarray .@reward4, 25, 672, 1;
		setarray .@reward5, 30, 673, 1;
		setarray .@reward7, 100, 673, 1;
		
		sleep2 300;
		set .@r, rand(100);
		while( .@r >= getd( ".@reward"+ .@i ) ) .@i++;
		.@rand_index = rand( 1,( getarraysize( getd( ".@reward"+ .@i ) ) -1 )/2 ) *2 -1;
		getitem getd( ".@reward"+ .@i +"["+ .@rand_index +"]" ), getd( ".@reward"+ .@i +"["+ (.@rand_index +1) +"]" );
		
Edited by pajodex
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  07/25/16
  • Last Seen:  

9 hours ago, pajodex said:

Make it more exciting with this... Edit it by your own needs.

It adds chance to get the reward. You can add more according to your needs.


		// setarray .@reward1, "chance", item id, item amount...
		setarray .@reward1, 5, 7539, 10; // Item ID 7539 x 10with chance of 5% in getting, You can add more..
		setarray .@reward2, 15, 7420, 5; // Item ID 7420 x 5 with chance of 15% in getting, You can add more..
		setarray .@reward3, 20, 671, 1; // etc...
		setarray .@reward4, 25, 672, 1;
		setarray .@reward5, 30, 673, 1;
		setarray .@reward7, 100, 673, 1;
		
		sleep2 300;
		set .@r, rand(100);
		while( .@r >= getd( ".@reward"+ .@i ) ) .@i++;
		.@rand_index = rand( 1,( getarraysize( getd( ".@reward"+ .@i ) ) -1 )/2 ) *2 -1;
		getitem getd( ".@reward"+ .@i +"["+ .@rand_index +"]" ), getd( ".@reward"+ .@i +"["+ (.@rand_index +1) +"]" );
		

which part should i change sir?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

50 minutes ago, Subzero said:

which part should i change sir?

Everything is pretty much explained. Please do read the comments in the codebox

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  07/25/16
  • Last Seen:  

thanks sir

 

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...