Jump to content
  • 0
Tales

Roulette System Chance's

Question

4 answers to this question

Recommended Posts

  • 0

clif.c

        sd->roulette.prizeIdx = rnd()%rd.items[stage];

        if (rd.flag[stage][sd->roulette.prizeIdx]&1) {
            clif_roulette_generate_ack(sd,GENERATE_ROULETTE_LOSING,stage,sd->roulette.prizeIdx,0);
            clif_roulette_getitem(sd);
            clif_roulette_recvitem_ack(sd, RECV_ITEM_SUCCESS);
            return;
        }

This is the snippet of code that determines win or loss. There are two ways to go about this.

 

1) You can go to `db_roulette` and adjust more items as flag = 1 for each stage. When an item is flagged as 1, then it is considered a loss item.

2) Adjust the snippet of code above. You could make the rnd() do something like out of 100 then change the if() statment below it to check for a "%" of success.

Link to comment
Share on other sites

  • 0

I do this:

		sd->roulette.prizeStage = stage;
		sd->roulette.prizeIdx = rnd()%rd.items[stage];

		if (rd.flag[stage][sd->roulette.prizeIdx]&1 || (rand()%8 >= stage)) {
			clif_roulette_generate_ack(sd,GENERATE_ROULETTE_LOSING,stage,sd->roulette.prizeIdx,0);
			clif_roulette_getitem(sd);
			clif_roulette_recvitem_ack(sd, RECV_ITEM_SUCCESS);
			return;
		}
Link to comment
Share on other sites

  • 0
On 30/1/2016 at 6:22 AM, DanielArt said:

I do this:

		sd->roulette.prizeStage = stage;
		sd->roulette.prizeIdx = rnd()%rd.items[stage];

		if (rd.flag[stage][sd->roulette.prizeIdx]&1 || (rand()%8 >= stage)) {
			clif_roulette_generate_ack(sd,GENERATE_ROULETTE_LOSING,stage,sd->roulette.prizeIdx,0);
			clif_roulette_getitem(sd);
			clif_roulette_recvitem_ack(sd, RECV_ITEM_SUCCESS);
			return;
		}

when im editting with ur script the roulette being stuck on 1st stage only, and not animation roulette showing/running. can u fix it?

 

and at the normal case when i get lose reward i cant press start again, and always need to recall then roulette window again.

Edited by kazegawa
add some statement
Link to comment
Share on other sites

  • 0

i use this for a chance

		int8 rchance = rnd()%100;

		if( rchance > 10 ){
		//if( rd.flag[sd->roulette.stage][sd->roulette.prizeIdx]&1 ){
			result = GENERATE_ROULETTE_LOSING;
			sd->roulette.stage = 0;
		}else{
			result = GENERATE_ROULETTE_SUCCESS;
			sd->roulette.stage++;
		}
	}

it means, chance success just only 10%

Quote

 

 

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.