Jump to content
  • 1

Question

4 answers to this question

Recommended Posts

  • 0
Posted

No script command to retrieve the total parameter value like crazyarashi said, but you can create one

/*==========================================
 * Returns a character's specified total stat.
 * readparam2 <param>;
 *------------------------------------------*/
BUILDIN_FUNC(readparam2)
{
	TBL_PC *sd = NULL;
	int value = 0, param_type = script_getnum(st, 2);

	if (!script_rid2sd(sd)) {
		script_pushint(st, -1);
		return SCRIPT_CMD_FAILURE;
	}
	switch( param_type ) {
	case 0:
		value = sd->base_status.str;
		break;
	case 1:
		value = sd->base_status.agi;
		break;
	case 2:
		value = sd->base_status.vit;
		break;
	case 3:
		value = sd->base_status.int_;
		break;
	case 4:
		value = sd->base_status.dex;
		break;
	case 5:
		value = sd->base_status.luk;
		break;
	default:
		script_pushint(st, -1);
		return SCRIPT_CMD_FAILURE;
	}
	script_pushint(st,value);
	return SCRIPT_CMD_SUCCESS;
}
BUILDIN_DEF(readparam2,"i"),

0 to 5 as parameter  to retrieve str agi vit int dex luk

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