Jump to content
  • 0

How to disable /stat example /str 99 on player?


trizzy

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

As the title said, how to disable /stat+ example:  /str+ 99 on player?

and enable @stat example: @str 99 on player is there any solution on this?

Thanks in advance!

i don't know how to edit

anyone please? even bind command would be help.

		ACMD_DEF2("str", param),
		ACMD_DEF2("agi", param),
		ACMD_DEF2("vit", param),
		ACMD_DEF2("int", param),
		ACMD_DEF2("dex", param),
		ACMD_DEF2("luk", param),


/*==========================================
 *
 *------------------------------------------*/
ACMD_FUNC(param)
{
	uint8 i;
	int value = 0;
	const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" };
	short new_value, *status[6], max_status[6];
 	//we don't use direct initialization because it isn't part of the c standard.
	nullpo_retr(-1, sd);

	memset(atcmd_output, '\0', sizeof(atcmd_output));

	if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
		clif_displaymessage(fd, msg_txt(sd,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
		return -1;
	}

	ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 );

	if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible...
		clif_displaymessage(fd, msg_txt(sd,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
		return -1;
	}

	status[0] = &sd->status.str;
	status[1] = &sd->status.agi;
	status[2] = &sd->status.vit;
	status[3] = &sd->status.int_;
	status[4] = &sd->status.dex;
	status[5] = &sd->status.luk;

	if( pc_has_permission(sd, PC_PERM_BYPASS_MAX_STAT) )
		max_status[0] = max_status[1] = max_status[2] = max_status[3] = max_status[4] = max_status[5] = SHRT_MAX;
	else {
		max_status[0] = pc_maxparameter(sd,PARAM_STR);
		max_status[1] = pc_maxparameter(sd,PARAM_AGI);
		max_status[2] = pc_maxparameter(sd,PARAM_VIT);
		max_status[3] = pc_maxparameter(sd,PARAM_INT);
		max_status[4] = pc_maxparameter(sd,PARAM_DEX);
		max_status[5] = pc_maxparameter(sd,PARAM_LUK);
	}

	if(value > 0  && *status[i] + value >= max_status[i])
		new_value = max_status[i];
	else if(value < 0 && *status[i] <= -value)
		new_value = 1;
	else
		new_value = *status[i] + value;

	if (new_value != *status[i]) {
		*status[i] = new_value;
		clif_updatestatus(sd, SP_STR + i);
		clif_updatestatus(sd, SP_USTR + i);
		status_calc_pc(sd, SCO_FORCE);
		clif_displaymessage(fd, msg_txt(sd,42)); // Stat changed.
	} else {
		if (value < 0)
			clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value.
		else
			clif_displaymessage(fd, msg_txt(sd,149)); // Unable to increase the number/value.
		return -1;
	}

	return 0;
}

Edited by trizzy
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

anyone?

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

to enable @str or such to players.. add those stats commands in groups.conf

Link to comment
Share on other sites


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

To disable /str+ X you need to mod the src (I think it's clif_parse_StatusUp function)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

To disable /str+ X you need to mod the src (I think it's clif_parse_StatusUp function)

where's the exact location of this clif_parse_StatusUp ?

to enable @str or such to players.. add those stats commands in groups.conf

i tried but is not working! have you try it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

show us how do u add that

Link to comment
Share on other sites


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

It's a clif function in clif.c

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

show us how do u add that

isn't

str: true

agi: true

 

on groups.conf?

To disable /str+ X you need to mod the src (I think it's clif_parse_StatusUp function)

is this one?

/// Request to increase status (CZ_STATUS_CHANGE).
/// 00bb <status id>.W <amount>.B
/// status id:
///     SP_STR ~ SP_LUK
/// amount:
///     Old clients always send 1 for this, even when using /str+ and the like.
///     Newer clients (2013-12-23 and newer) send the correct amount.
void clif_parse_StatusUp(int fd,struct map_session_data *sd)
{
int increase_amount = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);


if( increase_amount < 0 ) {
ShowDebug("clif_parse_StatusUp: Negative 'increase' value sent by client! (fd: %d, value: %d)\n",
fd, increase_amount);
}
pc_statusup(sd,RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]),increase_amount);
}
Edited by trizzy
Link to comment
Share on other sites


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

Yes I think it's here

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1535
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

yes, add that to 0 groupid/level for normal player enable @str @agi / such

 

to remove /str or such u need to change src folder.

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