Jump to content
  • 0

Can Anyone See My Error?


Humble_Bee

Question


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

I altered the stat point formula for the game, and it is working like I wanted it to, except for one thing. When a player reaches max level (201 for me), I want the game to give them 217 extra stat points to play with. Can anyone see the error in my formula, or perhaps I'm missing a flag I need to create? Is there a way to make a separate command line that says "At this level, give all characters this many extra stat points to raise stats with"?

Here's my coding, and the coding I based the formula off of (the stat cost formula, which is below my stat point gain formula, works with addressing different level ranges):

 

Spoiler

int pc_gets_status_point(int level)
{
    if (battle_config.use_statpoint_table) //Use values from "db/statpoint.txt"
        return (statp[level+1] - statp[level]);
    else //Default increase
        return (((level) < 201) ? ((level / 10) + 5) : ((level / 10) + 217));
}

// The above is the "gain stat points" formula. The below is the game's Renewal stat point cost formula.

#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)))

I've tried adjusting the stat point gain to one level lower (200) and it still didn't give the extra (+217) stat points I was looking for. It keeps using just the ((level / 10) + 5).

Thanks for any useful feedback. Also, I'm not looking to add that many stat points to lv. 1 characters or transcendents, as that would be too much of a boost in stat points for me for lower level characters, so those paths are not an option.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

1 hour ago, Humble_Bee said:

When a player reaches max level (201 for me), I want the game to give them 217 extra stat points to play with

You can adjust stat points in rathena/db/pre(re)/statpoint.txt

Go to the line (Line 201 for level 201) that you want to add stats points and manually add +217 to current value until you reach the max level.

 

Edited by Mabuhay
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

2 minutes ago, Mabuhay said:

You can adjust stat points in rathena/db/pre(re)/statpoint.txt

Go to the line (Line 201 for level 201) that you want to add stats points and manually add +217 to current value until you reach the max level.

 

That only works if my game is reading stat point gains from the statpoint.txt file. My game is creating the stat points to give per level based on the formula I wrote (outside of that one extra amount I'm trying to add at the end). The reason I'm using a set formula is so that I don't have to edit level after level of stat point numbers. It saves me time.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

2 minutes ago, Humble_Bee said:

That only works if my game is reading stat point gains from the statpoint.txt file. My game is creating the stat points to give per level based on the formula I wrote (outside of that one extra amount I'm trying to add at the end). The reason I'm using a set formula is so that I don't have to edit level after level of stat point numbers. It saves me time.

Oh yah i forgot about that. 

Anyways, this is how I understand the original code :
 

	else //Default increase
		return ((level+15) / 5);

translate to :

((1 level up + 15) / 5) per level up

Meaning, every level up would give player + 3 status points.

supposedly it should be around 3.8 but since the emulator cannot read decimal, it automatically rounds down(?)

 

if you want to add +217 status points, you may be looking at the wrong area.

Im not sure because i havent tested but if you could, try looking for this part on pc.cpp 

int pc_checkbaselevelup(struct map_session_data *sd)

....

next = pc_gets_status_point(sd->status.base_level);
sd->status.base_level++;
sd->status.status_point += next;

add this below

if ( sd->status.base_level == 201 )
	sd->status.status_point += 217;

 

Tell me how is it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

On 11/19/2019 at 8:26 PM, Mabuhay said:

Oh yah i forgot about that. 

Anyways, this is how I understand the original code :
 


	else //Default increase
		return ((level+15) / 5);

translate to :


((1 level up + 15) / 5) per level up

Meaning, every level up would give player + 3 status points.

supposedly it should be around 3.8 but since the emulator cannot read decimal, it automatically rounds down(?)

 

if you want to add +217 status points, you may be looking at the wrong area.

Im not sure because i havent tested but if you could, try looking for this part on pc.cpp 


int pc_checkbaselevelup(struct map_session_data *sd)

....

next = pc_gets_status_point(sd->status.base_level);
sd->status.base_level++;
sd->status.status_point += next;

add this below


if ( sd->status.base_level == 201 )
	sd->status.status_point += 217;

 

Tell me how is it.


It didn't work either.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

30 minutes ago, Humble_Bee said:


It didn't work either.

I tested my self, and yeah it seems not to be working. On my free time, I will look into this and if I find the answer before somebody got it correctly, I will post it here again.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

I think I'm going to edit a few things to make it work for me. I wanted the players to get bonus stats at the final lv. after completing a quest, so I think I'll just use a stat point seller that needs an item from the final lv. quest (I can give actual stats that way, instead of stat points, which will ruin people's ability to go from 250 to 200 in one stat in order to add 100+ in another). I might also alter the transcendent stat bonus so that it applies to everyone when they reach their equivalent of 3rd job. Will be a little bit of work, but I think I have all the tools to do it. Will just take a little trial and error in the coding.

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