Jump to content
  • 0

How to have pre-re stat formula in re server?


Kido

Question


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Hi, I found this post

 that's exactly the same problem I have, but when I enter to the src folder, I can't find the pc.c file, only found pc.cpp and pc.hpp

I found this piece of code in that file:

#ifdef RENEWAL_STAT
/// Renewal status point cost formula
#define PC_STATUS_POINT_COST(low) (((low) < 100) ? (2 + ((low) - 1) / 10) : (16 + 4 * (((low) - 100) / 5)))
#else
/// Pre-Renewal status point cost formula
#define PC_STATUS_POINT_COST(low) (( 1 + ((low) + 9) / 10 ))
#endif

/// Returns the number of stat points needed to change the specified stat by val.
/// If val is negative, returns the number of stat points that would be needed to
/// raise the specified stat from (current value - val) to current value.
int pc_need_status_point(struct map_session_data* sd, int type, int val)
{
	int low, high, sp = 0, max = 0;

	if ( val == 0 )
		return 0;

	low = pc_getstat(sd,type);
	max = pc_maxparameter(sd,(enum e_params)(type-SP_STR));

	if ( low >= max && val > 0 )
		return 0; // Official servers show '0' when max is reached

	high = low + val;

	if ( val < 0 )
		SWAP(low, high);

	for ( ; low < high; low++ )
		sp += PC_STATUS_POINT_COST(low);

	return sp;
}

should I just replace the 

#define PC_STATUS_POINT_COST(low) (((low) < 100) ? (2 + ((low) - 1) / 10) : (16 + 4 * (((low) - 100) / 5)))

for

#define PC_STATUS_POINT_COST(low) (( 1 + ((low) + 9) / 10 ))

to get it like this?

#ifdef RENEWAL_STAT
/// Renewal status point cost formula
#define PC_STATUS_POINT_COST(low) (( 1 + ((low) + 9) / 10 ))
#else
/// Pre-Renewal status point cost formula
#define PC_STATUS_POINT_COST(low) (( 1 + ((low) + 9) / 10 ))
#endif

/// Returns the number of stat points needed to change the specified stat by val.
/// If val is negative, returns the number of stat points that would be needed to
/// raise the specified stat from (current value - val) to current value.
int pc_need_status_point(struct map_session_data* sd, int type, int val)
{
	int low, high, sp = 0, max = 0;

	if ( val == 0 )
		return 0;

	low = pc_getstat(sd,type);
	max = pc_maxparameter(sd,(enum e_params)(type-SP_STR));

	if ( low >= max && val > 0 )
		return 0; // Official servers show '0' when max is reached

	high = low + val;

	if ( val < 0 )
		SWAP(low, high);

	for ( ; low < high; low++ )
		sp += PC_STATUS_POINT_COST(low);

	return sp;
}

 

and then recompile? 

thanks in advance < 3 kissu

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  11/22/12
  • Last Seen:  

On 7/10/2019 at 5:08 PM, Haruka Mayumi said:

Try to comment the RENEWAL_ASPD on renewal.hpp ?

Hello sorry for commenting on old post, I have a same issue about statpoints and I follow your advice about commenting on RENEWAL_STATS but on RENEWAL_ASPD even I already comment it still I have MAX ASPD even i dont have stats (1agi = max aspd).

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

You can do that however it's best solution to use the config folder in src.

under src/config/renewal.hpp

comment the #define RENEWAL_STAT

/// Renewal stat calculations
/// (disable by commenting the line)
///
/// Leave this line to enable renewal calculation for increasing status/parameter points
//#define RENEWAL_STAT

Up Vote and Answer if it helps.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Uh I'm not sure why, but I tried to comment some renewl stuff and for some reason, all characters got the aspd always maxed, even a novice 1/1 got maxed its aspd with 1 agi -_- i'm not sure what i'm doing x_x uhh another dev did comment some renewal stuff to prevent it from happening, like the cast time to be 150 dex = free cast, that went well, but now I got this issue about the aspd always getting maxed for all players, even with 1 agi x_x

 

ty for your response, i'lmm mess around a bit to see if I can fix that... any ideas why the aspd thing happened?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

Try to comment the RENEWAL_ASPD on renewal.hpp ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

and those files are the same just some are moved around and stuff if your looking at old tutorials 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Solved, not sure how, all I did was leave the stats part alone and disable renewall features, now I have problems with the damage -__- but that's for another post... thank you both ?

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