Jump to content
  • 0
Sign in to follow this  
utofaery

Help 1 read Maxlevel from exp_group_db.conf and 2 getstorageinventorylist

Question

1.

I recently find out about this file.

What can I do to read maxLevel from it?

If ( I am magician ) {

get maxlevel from exp_group_db.conf and blablabla...

}

 

2.

How to get array of item from storage??

I know of getinventorylist and getcartinventorylist but there is no "getStorageInventoryList" available..

Edited by utofaery

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

1. apparently MAX_LEVEL always return 175
I think have to do this in the script, just BaseLevel == 99 blah blah

 

2. I search in both forum and nobody actually write getstoragelist ...
https://rathena.org/board/topic/73566-storage-list/#comment-153023
and I am the one who made that script version hijacking SQL ....

but now our script engine no longer limit to 128, I think I can write a plugin for it
hmm ... or make a pull request ...
hmm ... why do you need it for anyway ? nobody actually requesting this ...

Share this post


Link to post
Share on other sites
  • 0

1.  Why not create some command to check each class max level for that purpose?>

2.  For a good reason:

Easy clean up of storage by custom item through function call

alike to what getinventorylist() did but I wanted getinsteadlist()

so It's like easy cleanup of certain type of item in storage like etc, arrow, or any stash up item type

Edited by utofaery

Share this post


Link to post
Share on other sites
  • 0

maybe because its too simpuru ?

Spoiler

#include "common/hercules.h"
#include "map/pc.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"maxbaselv",
	SERVER_TYPE_MAP,
	"x_O",
	HPM_VERSION,
};

BUILDIN(maxbaselv) {
	struct map_session_data *sd = script->rid2sd(st);

	if ( sd == NULL )
		return true;

	script_pushint( st, pc->maxbaselv(sd) );
	return true;
}

BUILDIN(maxjoblv) {
	struct map_session_data *sd = script->rid2sd(st);

	if ( sd == NULL )
		return true;

	script_pushint( st, pc->maxjoblv(sd) );
	return true;
}

HPExport void plugin_init (void) {
	addScriptCommand( "maxbaselv", "", maxbaselv );
	addScriptCommand( "maxjoblv", "", maxjoblv );
}

 

Spoiler

#include "common/hercules.h"
#include "map/pc.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"getstoragelist",
	SERVER_TYPE_MAP,
	"x_O",
	HPM_VERSION,
};

BUILDIN(getstoragelist) {
	struct map_session_data *sd = script->rid2sd(st);
	char card_var[SCRIPT_VARNAME_LENGTH];
	int i = 0, j = 0, k = 0;

	if ( sd == NULL )
		return true;

	for ( i = 0; i < VECTOR_LENGTH(sd->storage.item); i++ ) {
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_id"), j ), VECTOR_INDEX(sd->storage.item, i).nameid );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_amount"), j ), VECTOR_INDEX(sd->storage.item, i).amount );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_refine"), j ), VECTOR_INDEX(sd->storage.item, i).refine );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_identify"), j ), VECTOR_INDEX(sd->storage.item, i).identify );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_attribute"), j ), VECTOR_INDEX(sd->storage.item, i).attribute );
		for ( k = 0; k < MAX_SLOTS; k++ ) {
			sprintf( card_var, "@storagelist_card%d", k +1 );
			pc->setreg( sd, reference_uid( script->add_variable(card_var), j ), VECTOR_INDEX(sd->storage.item, i).card[k]);
		}
		pc->setreg( sd, reference_uid(script->add_variable("@storagelist_expire"), j ), VECTOR_INDEX(sd->storage.item, i).expire_time);
		pc->setreg( sd, reference_uid(script->add_variable("@storagelist_bound"), j ), VECTOR_INDEX(sd->storage.item, i).bound);
		for ( k = 0; k < MAX_ITEM_OPTIONS; k++ ) {
			sprintf( card_var, "@storagelist_opt_id%d", k + 1 );
			pc->setreg(sd, reference_uid(script->add_variable(card_var), j), VECTOR_INDEX(sd->storage.item, i).option[k].index);
			sprintf( card_var, "@storagelist_opt_val%d", k + 1 );
			pc->setreg(sd, reference_uid(script->add_variable(card_var), j), VECTOR_INDEX(sd->storage.item, i).option[k].value);
			sprintf( card_var, "@storagelist_opt_param%d", k + 1 );
			pc->setreg(sd, reference_uid(script->add_variable(card_var), j), VECTOR_INDEX(sd->storage.item, i).option[k].param);
		}
		j++;
	}
	pc->setreg( sd, script->add_variable("@storagelist_count") , j );
	return true;
}

HPExport void plugin_init (void) {
	addScriptCommand( "getstoragelist", "", getstoragelist );
}

 

 

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

3.  Are those 2 for plugin?

and the procedure for mapcache.c plugin applies to these 2 also??

 

4.  is this in there??

@inventorylist_card1[]     - These four arrays contain card data for the
@inventorylist_card2[]       items. These data slots are also used to store
@inventorylist_card3[]       names inscribed on the items, so you can
@inventorylist_card4[]       explicitly check if the character owns an item
 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, utofaery said:

3.  Are those 2 for plugin?
and the procedure for mapcache.c plugin applies to these 2 also??

yes, in hercules we despise source edits because patch outdated very very fast
plugins can last longer ... well, at least it last longer than patches

 

1 hour ago, utofaery said:

4.  is this in there??

@inventorylist_card1[]     - These four arrays contain card data for the
@inventorylist_card2[]       items. These data slots are also used to store
@inventorylist_card3[]       names inscribed on the items, so you can
@inventorylist_card4[]       explicitly check if the character owns an item

		for ( k = 0; k < MAX_SLOTS; k++ ) {
			sprintf( card_var, "@storagelist_card%d", k +1 );
			pc->setreg( sd, reference_uid( script->add_variable(card_var), j ), VECTOR_INDEX(sd->storage.item, i).card[k]);
		}

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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