Jump to content
  • 0

Disguise EVent Reward Random


Question

4 answers to this question

Recommended Posts

  • 1
Posted (edited)
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
  • 0
Posted
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?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...