Jump to content
  • 0

Help me - Roulette have problem. Can't go to Lv 2


GubA

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  06/16/14
  • Last Seen:  

 

Help me.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   1
  • Joined:  02/01/23
  • Last Seen:  

Hello, same problem here. I try to do something but I had no success specially because I'm not that good programming and I'm stuck between clif_parse_roulette_generate and clif_roulette_getitem in cliff.cpp. I tried to modif the code and could advace the roulette but I get some issues like 1. When roulette is in the last stage and don't claim the reward then close the roulette and after open it again, the roulette start in stage 0 (I mean that should "remember" the last stage after closing it even if don't claim), 2. Sometimes randomly reset the current stage like, go from stage 0 to 1 and pressing start again it return to stage 0 instead to go stage 2 and 3. When advance I can't claim the reward. I hope someone can help us. Thanks you.

 

Pd: Sorry for my english ?

Edited by fergusx_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   1
  • Joined:  02/01/23
  • Last Seen:  

Hello my friend, I was trying to fix it and did some modifies. For now it works but I think is not optimized because looking previous scripts of roulette (working as the people say), those are very small compared to this so if someone can help us to optimize it should be good.

Also I try to do it as I think it should be like but there is something that for now I don't know how to solve that is the possibility to choose which coin you want spend. At this moment this is spend from bronze to silver and also don't has the restriction to advance stage for stage, instead if you don't have bronze coins but silver coins, the roulette start in the stage associated to silver coin, obivously this can be changed in the way that you must advance in order (bronze->silver->gold (all of this if you have the success for every stage to advance)).

In my opinion I would like to choose which coin I would to spend but I'm working on it.

EDIT: I detect a issue, when I have silver coins but no bronze and gold, this stuck in a stage but I'm gonna continue tomorrow. I hope this help us for people that can help 8).

EDIT2: I think is because when spin, it want to continue but the condition to advance is not completed because no gold coins and the stage continues the sum in sd->roulette.stage++;

Spoiler

 

void clif_parse_roulette_generate( int fd, map_session_data* sd ){
	enum GENERATE_ROULETTE_ACK result;

	nullpo_retv(sd);
	//ShowWarning(sd);
	if (!battle_config.feature_roulette) {
		clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1497),false,SELF); //Roulette is disabled
		return;
	}

	if( sd->roulette.tick && DIFF_TICK( sd->roulette.tick, gettick() ) > 0 ){
		return;
	}

	// Player has not claimed his prize yet
	if( sd->roulette.claimPrize ){
		
		clif_roulette_getitem( sd );

	}

	if (sd->roulette.stage >= MAX_ROULETTE_LEVEL){
		// Make sure everything is reset
		sd->roulette.stage = 0;
		sd->roulette.claimPrize = false;
		sd->roulette.prizeStage = 0;
		sd->roulette.prizeIdx = -1;
	}

	if( !sd->roulette.stage && sd->roulette_point.bronze <= 0 && sd->roulette_point.silver <= 0 && sd->roulette_point.gold <= 0 ){
		result = GENERATE_ROULETTE_NO_ENOUGH_POINT;
	}else{
		if (!sd->roulette.stage || !sd->roulette.claimPrize) {
			if (sd->roulette_point.bronze > 0 && sd->roulette.stage < 2) {
				if(sd->roulette.stage > 0){																							//This when is not the first stage in bronze range played
					sd->roulette_point.bronze -= 1;																					//Prize for bronze stages
					pc_setreg2(sd, ROULETTE_BRONZE_VAR, sd->roulette_point.bronze);
					sd->roulette.prizeStage = sd->roulette.stage;
					sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
					sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
				}else{
					sd->roulette_point.bronze -= 1;																					//Prize for bronze stages
					sd->roulette.stage = 0;																							//If is the first stage played
					pc_setreg2(sd, ROULETTE_BRONZE_VAR, sd->roulette_point.bronze);
					sd->roulette.prizeStage = sd->roulette.stage;
					sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
					sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
				}
			} else if (sd->roulette_point.silver > 0 && sd->roulette.stage < 4) {
				if(sd->roulette.stage > 2){																							//This when is not the first stage in silver range played
					sd->roulette_point.silver -= 1;																					//Prize for silver stages
					pc_setreg2(sd, ROULETTE_SILVER_VAR, sd->roulette_point.silver);
					sd->roulette.prizeStage = sd->roulette.stage;
					sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
					sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
				}else{
					sd->roulette_point.silver -= 1;																					//Prize for silver stages
					sd->roulette.stage = 2;
					pc_setreg2(sd, ROULETTE_SILVER_VAR, sd->roulette_point.silver);
					sd->roulette.prizeStage = sd->roulette.stage;
					sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
					sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
				}
			} else if (sd->roulette_point.gold > 0) {
				if(sd->roulette.stage > 4){																							//This when is not the first stage gold range played
					sd->roulette_point.gold -= 1;																					//Prize for gold stages
					pc_setreg2(sd, ROULETTE_GOLD_VAR, sd->roulette_point.gold);
					sd->roulette.prizeStage = sd->roulette.stage;
					sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
					sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
				}else{
					sd->roulette_point.gold -= 1;																					//Prize for gold stages
					sd->roulette.stage = 4;
					pc_setreg2(sd, ROULETTE_GOLD_VAR, sd->roulette_point.gold);
					sd->roulette.prizeStage = sd->roulette.stage;
					sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
					sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
				}
			}
		}
		int8 rchance = rnd()%100;
		if( rchance > 90 ){												//Chance to get the reward that is in the Stage (10% to claim the reward in the current stage).
			result = GENERATE_ROULETTE_LOSING;							//If the chance is success (you can get the item) then the roulette force to claim the reward, this is
			sd->roulette.claimPrize = true;								//if you press the Start button or Get Prize button, the roulette give you the reward, then restart the roulette.
			sd->roulette.stage = 0;
			clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], "Claim the reward", false, SELF);
		}else{
			result = GENERATE_ROULETTE_SUCCESS;							//If the chance fail, then you can press the start button to continue
			sd->roulette.claimPrize = false;							//but you can't claim the reward
			sd->roulette.stage++;
			clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], "You can continue", false, SELF);
		}
	}
	clif_roulette_generate(sd,result,sd->roulette.prizeStage,(sd->roulette.prizeIdx == -1 ? 0 : sd->roulette.prizeIdx), sd->roulette.bonusItemID);
}

 

VIDEO (working with the 3 coins but no with only 1 type)

EDIT3: How I expected, the solution was more easy and already solved it yesterday in the repository of rAthena. Anyway, in my case, I would like to choose which coin I want to use in the roulette so gonna try to do it

Quote

Captura de pantalla 2023-02-07 143652.png

Edited by fergusx_
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

Hello, I applied the fix for the stage 1 stuck problem, do you have a fix for the silver and gold coins not working? Like the one of your video that silver coin is consumed when you are about stage 3

 

 

Thank you

Edited by namerpus18
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  99
  • Reputation:   19
  • Joined:  05/01/12
  • Last Seen:  

3 hours ago, namerpus18 said:

Hello, I applied the fix for the stage 1 stuck problem, do you have a fix for the silver and gold coins not working? Like the one of your video that silver coin is consumed when you are about stage 3

 

 

Thank you

The default for silver and gold coin are 10 each.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

I dont think I understand, I mean why is the roulette using only bronze up to the last stage in my roulette? I don't know full mechanics yet, i am reading the src code but I am noob when it comes to src code so I am still dont get it. 

What i guess is bronze suppose to be for stage 1-2 or 3, silver for stage 4 or so then gold up to the last stage. But my roulette dont use silver or gold even its in laat stage

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  99
  • Reputation:   19
  • Joined:  05/01/12
  • Last Seen:  

16 hours ago, namerpus18 said:

I dont think I understand, I mean why is the roulette using only bronze up to the last stage in my roulette? I don't know full mechanics yet, i am reading the src code but I am noob when it comes to src code so I am still dont get it. 

What i guess is bronze suppose to be for stage 1-2 or 3, silver for stage 4 or so then gold up to the last stage. But my roulette dont use silver or gold even its in laat stage

That's because you won't consume coin as you progress. You'll only stop moving up and go back to start every time your roulette stop at the most far left prize (which is coin by default).

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