[IdiotRelease]1st RB StatPoints formula

04/29/2012 03:43 U2_Caparzo#1
well, a friend was doing the 1st rb in a source, and i began to try to get the formula for the stat points that u get after the rb (i like the maths ^^) and i got this.

Code:
        public static byte StatPoints(double level, byte job)
        {
            if(level > 130)
                level = 130;
            if (job == 135)
            {
                if (level % 2 != 0)
                    level -= 1;
                level = ((130 - level) / 2) + level;
            }
            return (byte)((level - 120) * ((level - 119) / 2) + 42);
        }
there is no big reason to using this instead the one u should have with checks, but i just want to share what i got ^^
04/29/2012 04:10 InfamousNoone#2
Why is level defined as a 'double' (instead of an int)?
Why is job defined as a 'byte' (instead of an int or an enumeration)?
Why is the return value defined as a 'byte' (instead of an int)?
04/29/2012 04:23 U2_Caparzo#3
Quote:
Originally Posted by InfamousNoone View Post
Why is level defined as a 'double' (instead of an int)?
Why is job defined as a 'byte' (instead of an int or an enumeration)?
Why is the return value defined as a 'byte' (instead of an int)?
1.- if u change the level to an int, the return value changes too.
2.- i don't see the difference between make it byte or an integer (i wish u can let me know why) and isn't an enum because i see it more "global" to use since no every source have the same jobs enum name.
3.- same than 2 :s.
04/29/2012 05:15 nTL3fTy#4
What I got from the TQ binaries:
Code:
public int GetRebirthAddPoint(int oldProf, int oldLevel, int newProf, int metempsychosis)
{
    if (metempsychosis == 1)
    {
        if (oldLevel > 130)
        {
            oldLevel = 130;
        }

        return oldProf == 135
                    ? 72 + (1 + (oldLevel - 110) / 2) * ((oldLevel - 110) / 2) / 2
                    : 72 + (1 + (oldLevel - 120)) * (oldLevel - 120) / 2;
    }

    var attrib = Strength + Agility + Vitality + Spirit + AddPoint;
    var add = Math.Max(attrib, 397 - oldLevel * 3 - 7);

    return oldProf == 135
                ? add + BaseFunc.GetRebirthAddPointBonus((oldLevel - 110) / 2 - 1) + oldLevel * 3 - 3
                : add + BaseFunc.GetRebirthAddPointBonus(oldLevel - 120 - 1) + oldLevel * 3 - 3;
}
04/29/2012 05:59 U2_Caparzo#5
Quote:
Originally Posted by nTL3fTy View Post
What I got from the TQ binaries:
Code:
public int GetRebirthAddPoint(int oldProf, int oldLevel, int newProf, int metempsychosis)
{
    if (metempsychosis == 1)
    {
        if (oldLevel > 130)
        {
            oldLevel = 130;
        }

        return oldProf == 135
                    ? 72 + (1 + (oldLevel - 110) / 2) * ((oldLevel - 110) / 2) / 2
                    : 72 + (1 + (oldLevel - 120)) * (oldLevel - 120) / 2;
    }

    var attrib = Strength + Agility + Vitality + Spirit + AddPoint;
    var add = Math.Max(attrib, 397 - oldLevel * 3 - 7);

    return oldProf == 135
                ? add + BaseFunc.GetRebirthAddPointBonus((oldLevel - 110) / 2 - 1) + oldLevel * 3 - 3
                : add + BaseFunc.GetRebirthAddPointBonus(oldLevel - 120 - 1) + oldLevel * 3 - 3;
}
that made the mine looks incomplete :o

but i lost the step of it at
Strength + Agility + Vitality + Spirit + AddPoint;
and
BaseFunc.GetRebirthAddPointBonus :(
04/29/2012 06:18 nTL3fTy#6
Quote:
Originally Posted by U2_Caparzo View Post
that made the mine looks incomplete :o

but i lost the step of it at
Strength + Agility + Vitality + Spirit + AddPoint;
and
BaseFunc.GetRebirthAddPointBonus :(
The first bit is so you don't lose stats from being over 130.
The second bit (GetRebirthAddPointBonus) simply accesses an array of the points given based on your level:
Code:
{ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55 }
04/29/2012 06:38 U2_Caparzo#7
Quote:
Originally Posted by nTL3fTy View Post
The first bit is so you don't lose stats from being over 130.
The second bit (GetRebirthAddPointBonus) simply accesses an array of the points given based on your level:
Code:
{ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55 }
i see, so what i posted is like GetRebirthAddPointBonus but i added 14 * 3 for each level from 1 to 15... the way that i saw in most of the public sources.

thanks :)

#EDIT
Another question :$
when u define
var attrib = Strength + Agility + Vitality + Spirit + AddPoint;
for example, what mean Strenght? the Strength points before reborn, asigned after reborn for the level or what? srry to keep asking u about this, but i'm a bit interested in it
04/29/2012 06:52 nTL3fTy#8
Quote:
Originally Posted by U2_Caparzo View Post
i see, so what i posted is like GetRebirthAddPointBonus but i added 14 * 3 for each level from 1 to 15... the way that i saw in most of the public sources.

thanks :)

#EDIT
Another question :$
when u define
var attrib = Strength + Agility + Vitality + Spirit + AddPoint;
for example, what mean Strenght? the Strength points before reborn, asigned after reborn for the level or what? srry to keep asking u about this, but i'm a bit interested in it
This method is located in my main User class, thus they refer to the actual user's strength, agility, etc. values.
04/29/2012 07:00 pro4never#9
Quote:
Originally Posted by nTL3fTy View Post
What I got from the TQ binaries:
Code:
public int GetRebirthAddPoint(int oldProf, int oldLevel, int newProf, int metempsychosis)
{
    if (metempsychosis == 1)
    {
        if (oldLevel > 130)
        {
            oldLevel = 130;
        }

        return oldProf == 135
                    ? 72 + (1 + (oldLevel - 110) / 2) * ((oldLevel - 110) / 2) / 2
                    : 72 + (1 + (oldLevel - 120)) * (oldLevel - 120) / 2;
    }

    var attrib = Strength + Agility + Vitality + Spirit + AddPoint;
    var add = Math.Max(attrib, 397 - oldLevel * 3 - 7);

    return oldProf == 135
                ? add + BaseFunc.GetRebirthAddPointBonus((oldLevel - 110) / 2 - 1) + oldLevel * 3 - 3
                : add + BaseFunc.GetRebirthAddPointBonus(oldLevel - 120 - 1) + oldLevel * 3 - 3;
}
I do love it when you post your proper way of doing things (proper in that it's how tq handles it) and make people's code look like trash.

I'm a horrible person like that.
04/29/2012 07:16 U2_Caparzo#10
Quote:
Originally Posted by nTL3fTy View Post
This method is located in my main User class, thus they refer to the actual user's strength, agility, etc. values.
really thanks :)
Quote:
Originally Posted by pro4never View Post
I do love it when you post your proper way of doing things (proper in that it's how tq handles it) and make people's code look like trash.

I'm a horrible person like that.
that went to my heart :( ^^
04/29/2012 07:17 DyjgK64J451Jhv0#11
umm i got a code source for calculator , the exp bar is bugged (wasn't coded correctly)
here's the link of the tool : [Only registered and activated users can see links. Click Here To Register...]
here is the code source : [Only registered and activated users can see links. Click Here To Register...]
wish that was helpful , be kind that was my second educational project on c# ^^
P.S ignore the exp ball / level rate , just have a look about how it calculate the att. points when reborn , second reborn
04/29/2012 07:32 U2_Caparzo#12
Quote:
Originally Posted by DyjgK64J451Jhv0 View Post
umm i got a code source for calculator , the exp bar is bugged (wasn't coded correctly)
here's the link of the tool : [Only registered and activated users can see links. Click Here To Register...]
here is the code source : [Only registered and activated users can see links. Click Here To Register...]
wish that was helpful , be kind that was my second educational project on c# ^^
P.S ignore the exp ball / level rate , just have a look about how it calculate the att. points when reborn , second reborn
i'll check it right now, thanks, a word says more than 1000 thanks button but anyways there u go ^^
04/30/2012 05:07 _DreadNought_#13
Quote:
Originally Posted by nTL3fTy View Post
The first bit is so you don't lose stats from being over 130.
The second bit (GetRebirthAddPointBonus) simply accesses an array of the points given based on your level:
Code:
{ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55 }
Is that the complete array? If not could you share it? This could come in handy. I always love official formulas.
04/30/2012 05:27 pro4never#14
Quote:
Originally Posted by _DreadNought_ View Post
Is that the complete array? If not could you share it? This could come in handy. I always love official formulas.
It's 10 elements long so it should be representing the bonuses from reborning between 120-130. Water taos balance out their bonus point for getting 110-120 iirc and then add the same bonuses for 121-130 which this array covers.

Keep in mind I'm operating off very casual memory of how the system works here but should be correct.