Jump to content
  • 0

Need a fix for Random Option System


Question

Posted

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 ❤️

3 answers to this question

Recommended Posts

  • 0
Posted

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

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