Jump to content
  • 0

Need a fix for Random Option System


WhiteEagle

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

Currently, the problem with the "Random Option System" is that when options can be distributed randomly, it happens that a option is not displayed.
This happens when one of the random options is skipped.
Can anyone solve this problem? It is extremely inconvenient when the player cannot see what options active now.

Here is a picture which shows what is meant. The knife has 2 options but only one is shown in the item description.

Unbenannt.PNG.c46073deff9dcdcbcd3fcdbc663a6329.PNG


In the SQL the problem can be shown very simply.
Here you can see that this problem only occurs when one of the options is skipped, as already mentioned above.
In this case option_id1 was skipped and option_id2 got the value.

Unbenannt2.PNG.04234a648d5e03a8de2cc3fb520f0cb5.PNG

 

I hope I could describe the problem so far understandable so that the error can be fixed.

Thank you ❤️

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   663
  • Joined:  11/12/12
  • Last Seen:  

It's a client issue. Change the clif_add_random_options function to skip empty entries. Something like...

/// Fills in part of the item buffers that calls for variable bonuses data. [Napster]
/// A maximum of 5 random options can be supported.
static uint8 clif_add_random_options( struct ItemOptions buf[MAX_ITEM_RDM_OPT], struct item* it ){
	nullpo_retr( 0, it );

	uint8 count = 0;
	
	memset(buf, 0, sizeof(struct ItemOptions) * MAX_ITEM_RDM_OPT);
	
	for( int i = 0; i < MAX_ITEM_RDM_OPT; i++ ){
		if( it->option[i].id ){
			buf[count].index = it->option[i].id;	// OptIndex
			buf[count].value = it->option[i].value;	// Value
			buf[count].param = it->option[i].param;	// Param1
			count++;
		}
	}
	
#if MAX_ITEM_RDM_OPT < 5
	for( ; i < 5; i++ ){
		buf[i].index = 0;	// OptIndex
		buf[i].value = 0;	// Value
		buf[i].param = 0;	// Param1
	}
#endif

	return count;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   167
  • Joined:  04/05/13
  • Last Seen:  

Do you using custom scripts for Random Option?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

No, the problem is present since it was released. (I am talking about the current .yml version)

Thanks for your help. You safed my life. ^-^

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