Jump to content
  • 1

Readparameter total stat


Anatong123

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  22
  • Reputation:   0
  • Joined:  07/13/18
  • Last Seen:  

How can I read the parameter total stat eg. total luk ( base luk + bonus luk from item) I tried readparam(tLuk) but it doesnt work

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

I think there is nothing like that for now.. since readparam is reading only the base stats of the character

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  06/16/13
  • Last Seen:  

i tried your code sir capuche but it's not working in item script

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   1
  • Joined:  12/28/14
  • Last Seen:  

Hello, I got the same question. Is there a solution to this question?

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