Hi everyone,
First of all, my apologies for the text wall, but you'll get to know the root of the problem and hopefully learn something new. :p
The following script is based on [Only registered and activated users can see links. Click Here To Register...]. However, there is a big difference between this one and the original one: the original one can be exploited, this one can't. I'm not sure if this was documented before and/or if anyone released a fixed one, so I decided to post this up anywayz.
To get started, let me explain to you what's not right about the original one. Most parts of it are doing what they should perfectly fine. However, the way it handles the actual reborns is what causes it to bug. And with bug I mean: giving out more stats than it should and skipping rebirths. For example someone who would make his first rebirth suddenly gets 1000 stats and is set to 4th RB.
This is where it all goes wrong (small excerpt from the script):
What happens is that a player reaches the RB level (let's say 180), so he logs out to make his RB. Now there are a few options: he either logs out completely or he goes to the char select screen.
When he logs out completely, all will be good and the rebirth will be done.
When he goes to the char select screen, that's where things can go wrong.
The player can either log out from the character select screen or log back in from the character select screen. In case he logs out from there without logging back in, all will be good. But when he logs back in from the char select screen, he'll still be at the same RB. Or so he thinks...
When the player logs out, to either character select screen or completely, the script kicks in and performs the RB job (might take a minute, depends on what shedule the SQL job is running). That means that the row of data containing the character's info gets changed: the stats get set according to the value in the reborn column and the RB column goes +1. "Fine!" is what you're probably thinking...
Well now, when the player decides to log in again without being fully logged out, the following will happen:
the stats data gets rolled back to what it originally was, because the data wasn't commited (account was logged in, so changes to char data couldn't be made, BUT the 'Reborn' column does not roll back, since that column isn't actual game data.
If the player repeats the proces of logging in - going to char select - logging - ... a few times, then he can go from 0 RB to 5th RB. He just has to log out completely at the time that the RB column is set to 5 and his stats will be written to his character. When he fails to fully log out in time, because he did the relogging process too many times, he will be 'stuck'. With the RB column at 5 he won't RB anymore and his stats didn't go up either, because he never fully logged out.
So now that you know the 'bugging-process', let's look at a solution. I know that there are probably other ways to solve this, but the easiest and fail-proof way that I can recommend is to not base the amount of stats given out on the value in the rebirth column, but on the sum of stats that the player already has. That way, it's independant from non-game data and never misses.
An example of this, based on RB at level 180 and a default 5 stats per level, for the first 2 RBs (I wouldn't want you to be lazy and just copy the whole thing;)):
Just complete it for the rest of the RBs and adjust the rest accordingly to what you want RBs to require. Calcute the minimum amount of stats at the base RB level (180 here) and the maximum amount of stats that anyone can have at the max RB level (if they decide the level past 180 for some reason and log out then - max lvl 200 in this example). Also take the initial 15 stats into account, that u get after every rebirth, when calculating the stat cap for that rebirth. Then fill in the numbers for each rebirth, where it says "BETWEEN xxx AND xxx" in the above script.
No rocket-science, but I hope that this helps some people that were struggling with this problem.:)
Best regards,
Razgriz
DK Rusaki admin :mofo:
First of all, my apologies for the text wall, but you'll get to know the root of the problem and hopefully learn something new. :p
The following script is based on [Only registered and activated users can see links. Click Here To Register...]. However, there is a big difference between this one and the original one: the original one can be exploited, this one can't. I'm not sure if this was documented before and/or if anyone released a fixed one, so I decided to post this up anywayz.
To get started, let me explain to you what's not right about the original one. Most parts of it are doing what they should perfectly fine. However, the way it handles the actual reborns is what causes it to bug. And with bug I mean: giving out more stats than it should and skipping rebirths. For example someone who would make his first rebirth suddenly gets 1000 stats and is set to 4th RB.
This is where it all goes wrong (small excerpt from the script):
Code:
SET wStatPoint = 250 * (Reborn + 1), Reborn = Reborn + 1
When he logs out completely, all will be good and the rebirth will be done.
When he goes to the char select screen, that's where things can go wrong.
The player can either log out from the character select screen or log back in from the character select screen. In case he logs out from there without logging back in, all will be good. But when he logs back in from the char select screen, he'll still be at the same RB. Or so he thinks...
When the player logs out, to either character select screen or completely, the script kicks in and performs the RB job (might take a minute, depends on what shedule the SQL job is running). That means that the row of data containing the character's info gets changed: the stats get set according to the value in the reborn column and the RB column goes +1. "Fine!" is what you're probably thinking...
Well now, when the player decides to log in again without being fully logged out, the following will happen:
the stats data gets rolled back to what it originally was, because the data wasn't commited (account was logged in, so changes to char data couldn't be made, BUT the 'Reborn' column does not roll back, since that column isn't actual game data.
If the player repeats the proces of logging in - going to char select - logging - ... a few times, then he can go from 0 RB to 5th RB. He just has to log out completely at the time that the RB column is set to 5 and his stats will be written to his character. When he fails to fully log out in time, because he did the relogging process too many times, he will be 'stuck'. With the RB column at 5 he won't RB anymore and his stats didn't go up either, because he never fully logged out.
So now that you know the 'bugging-process', let's look at a solution. I know that there are probably other ways to solve this, but the easiest and fail-proof way that I can recommend is to not base the amount of stats given out on the value in the rebirth column, but on the sum of stats that the player already has. That way, it's independant from non-game data and never misses.
An example of this, based on RB at level 180 and a default 5 stats per level, for the first 2 RBs (I wouldn't want you to be lazy and just copy the whole thing;)):
Code:
USE [character]; GO UPDATE dbo.user_character SET wLevel = 1, dwExp = 0, wStatPoint = 250, nHP=106, nMP=16, dwMoney = dwMoney - (500), wStr = 6, wDex = 3, wCon = 4, wSpr = 2, wPosX = 336, wPosY = 366, Reborn = 1, wMapIndex = 7, wSkillPoint = 0, bySkillClearCount = 0 WHERE (wlevel >= 180) AND (dwMoney >= (500)) AND ((wStr + wDex + wCon + wSpr + wStatPoint) BETWEEN 900 AND 1015) ; UPDATE dbo.user_character SET wLevel = 1, dwExp = 0, wStatPoint = 500, nHP=106, nMP=16, dwMoney = dwMoney - (500), wStr = 6, wDex = 3, wCon = 4, wSpr = 2, wPosX = 336, wPosY = 366, Reborn = 2, wMapIndex = 7, wSkillPoint = 0, bySkillClearCount = 0 WHERE (wlevel >= 180) AND (dwMoney >= (500)) AND ((wStr + wDex + wCon + wSpr + wStatPoint) BETWEEN 1150 AND 1265) ;
No rocket-science, but I hope that this helps some people that were struggling with this problem.:)
Best regards,
Razgriz
DK Rusaki admin :mofo: