Jump to content
  • 0

Roulette System Chance's


Tales

Question


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

Where can increase the dificult? Are too easy to get all ranks.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Development Manager
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  732
  • Reputation:   525
  • Joined:  12/13/11
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  11/16/12
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   4
  • Joined:  04/16/12
  • Last Seen:  

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