se7enet purgatorio

Page 1 of 1 1
Topic Options
Rate This Topic
#16918 - 03/20/08 01:17 PM Levels????
gamefreak888
Rice Krispies


Registered: 09/06/07
Posts: 215

Offline
I can't find SQL table/script for levels and their exp. requirements anywhere. Are they in the lib.php file? I hope not, because I want to make it harder to level up and add new levels (up to lvl 200).
Or are they generated depending on your class?

Top
#16922 - 03/20/08 07:04 PM Re: Levels???? [Re: gamefreak888]
Jamin Administrator
Cookie Crisp
****

Registered: 02/25/05
Posts: 2649
Loc: Texas

Offline
fight.php I think, though I may be wrong. It's a function. Levels aren't explicitly stored, it just runs a bunch of math on your experience every time you win a fight to determine if you've hit your next level.

---Jamin
_________________________
Diablo 3 Lead Designer Jay Wilson:
“The development of a Blizzard game is sometimes a long affair. This is how long it took us to be ready.”

Top
#16927 - 03/20/08 08:26 PM Re: Levels???? [Re: Jamin]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Yeah it's in fight. I am making 300 in my game.
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#16930 - 03/21/08 10:47 AM Re: Levels???? [Re: gamefreak888]
gamefreak888
Rice Krispies


Registered: 09/06/07
Posts: 215

Offline
Thanks, but I'm not sure how to edit it. This is the code:
 Code:
function dolevels($level) {
    
    $leveltotal = 15;
    $leveladd = 15;
    $i = 2;
    while ($i < $level) {
        $levelstart = $leveltotal;
        if ($i < 4) { 
            $leveladd = ceil($leveladd * 2.0);
        } elseif ($i < 13) { 
            $leveladd = floor($leveladd * 1.45);
        } elseif ($i < 40) { 
            $leveladd = floor($leveladd * 1.20);
        } elseif ($i < 60) { 
            $leveladd = 150000;
        } elseif ($i < 80) { 
            $leveladd = 200000;
        } elseif ($i < 100) { 
            $leveladd = 300000;
        } elseif ($i >= 100) { 
            $leveladd = 500000;
        }
        $leveltotal = $levelstart + $leveladd;
        $i++;
    }
    return $leveltotal;
    
}

But what does 'Leveltotal: 15' and 'Leveladd: 15' means? The function says your leveltotal is your levelstart + leveladd but what is the max. level? And how do I add new ones?

This code is in the youwin function:

 Code:
// Check for new levelup.
    if ($userrow["experience"] >= dolevels($userrow["level"]+1)) {
        $template = "fight_levelup";
        $userrow["level"]++;
        $userrow["levelup"] += 5;
        $userrow["maxtp"] += 5;
        $userrow["currenthp"] = $userrow["maxhp"];
        $userrow["currentmp"] = $userrow["maxmp"];
        $userrow["currenttp"] = $userrow["maxtp"];
        if (($userrow["level"] % 5 == 0)) { $userrow["levelspell"]++; $template = "fight_levelupspell"; }
    }

So it adds 5 points to levelup, which are your 'skill points', which is how I call them, and 5 points to your TP.
But are there now differces in the experience you'll need based on difficulty/class...?

Top
#16931 - 03/21/08 07:20 PM Re: Levels???? [Re: gamefreak888]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Says level max is 100?
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#16932 - 03/21/08 10:39 PM Re: Levels???? [Re: Fayt]
Jamin Administrator
Cookie Crisp
****

Registered: 02/25/05
Posts: 2649
Loc: Texas

Offline
There really isn't a "maximum level" in Scourge.* There is only a point when every level after a certain point (level 100) costs exactly the same amount of exp to reach (that is, once you hit level 100, you will continue to level up every 500k exp). If you want to extend this, simply add more elseif statements to that block.

In the stock code, every level below 40 is mathematically based on the previous level (current level's exp cost times a pre-determined multiplier). After 40, they are hard-coded amounts (this is done to reduce the exponential effect of multiplying).

So if you want to add more exp costs to higher levels, just change the final elseif ($i >= 100) to elseif ($i < next jump) and continue ad nauseum.

* The default "experience" MySQL column type is INT UNSIGNED, which means it can hold any number up to 4,294,967,295. I don't know exactly what level that ends up being, but theoretically there is a level cap once you get enough exp to go over the amount the column is allowed to store. If one of your users has absolutely no life and has somehow hit this exp amount, all you need to do is change the column type to BIGINT UNSIGNED and you get a massive amount of more possible levels.

---Jamin
_________________________
Diablo 3 Lead Designer Jay Wilson:
“The development of a Blizzard game is sometimes a long affair. This is how long it took us to be ready.”

Top
#16933 - 03/22/08 04:25 AM Re: Levels???? [Re: gamefreak888]
gamefreak888
Rice Krispies


Registered: 09/06/07
Posts: 215

Offline
Thanks for your reply!
So I just change the script to this:

 Code:
function dolevels($level) {
    
    $leveltotal = 15;
    $leveladd = 15;
    $i = 2;
    while ($i < $level) {
        $levelstart = $leveltotal;
        if ($i < 4) { 
            $leveladd = ceil($leveladd * 2.0);
        } elseif ($i < 13) { 
            $leveladd = floor($leveladd * 1.45);
        } elseif ($i < 40) { 
            $leveladd = floor($leveladd * 1.20);
        } elseif ($i < 60) { 
            $leveladd = 150000;
        } elseif ($i < 80) { 
            $leveladd = 200000;
        } elseif ($i < 100) { 
            $leveladd = 300000;
        } elseif ($i < 150) { 
            $leveladd = 500000;
        } elseif ($i < 200) {
            $leveladd = 800000;
        } elseif ($i < 250) {
            $leveladd = 1000000;
        } elseif ($i >= 250) {
            $leveladd = 1500000;
        }
        $leveltotal = $levelstart + $leveladd;
        $i++;
    }
    return $leveltotal;
    
}

Top
#16934 - 03/22/08 04:47 AM Re: Levels???? [Re: gamefreak888]
AnmanIndustries
Cookie Crisp
*****

Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth

Offline
Whatever you do there, you also need to change in the profile function, so it calculates your required experience correctly when you view your profile.
_________________________
If you want me to punch you in the nuts go to:
http://www.AnmanIndustries.com

I'll do it for free too. Enjoy.

Top
#16937 - 03/22/08 05:31 AM Re: Levels???? [Re: gamefreak888]
gamefreak888
Rice Krispies


Registered: 09/06/07
Posts: 215

Offline
The users.php file has this code:
 Code:
// Next level.
    $leveltotal = 15;
    $leveladd = 15;
    $i = 2;
    while ($i < ($newuserrow["level"] + 1)) {
        $levelstart = $leveltotal;
        if ($i < 4) { 
            $leveladd = ceil($leveladd * 2.0);
        } elseif ($i < 13) { 
            $leveladd = floor($leveladd * 1.45);
        } elseif ($i < 40) { 
            $leveladd = floor($leveladd * 1.20);
        } elseif ($i < 60) { 
            $leveladd = 150000;
        } elseif ($i < 80) { 
            $leveladd = 200000;
        } elseif ($i < 100) { 
            $leveladd = 300000;
        } elseif ($i >= 100) { 
            $leveladd = 500000;
        }
        $leveltotal = $levelstart + $leveladd;
        $i++;
    }


And you can change that the same way as in fight.php

Top
#16938 - 03/22/08 08:23 AM Re: Levels???? [Re: gamefreak888]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Correct
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#16968 - 03/24/08 08:17 AM Re: Levels???? [Re: Fayt]
AAT
Malt-o-Meal


Registered: 01/30/08
Posts: 18

Offline
Useful.....
Thanks.
_________________________

Top
Page 1 of 1 1


Hop to:

se7enet

Barack Obama Logo