Open your client.java and search for:
- Code:
-
public int getLevelForXP(int exp) {
in that area, it calls the max level and what xp it takes to make that max level (SERVERMAXXP is not the server's max xp, but I highly recomend not having your max level's xp any higher than 100000000)... Here is what you'll see:
- Code:
-
public int getLevelForXP(int exp) {
int points = 0;
int output = 0;
if (exp > SERVERMAXXP)
return SERVERMAXLVL;
for (int lvl = 1; lvl <= SERVERMAXLVL; lvl++) {
points += Math.floor((double) lvl + 300.0
* Math.pow(2.0, (double) lvl / 7.0));
output = (int) Math.floor(points / 4);
if (output >= exp) {
return lvl;
}
}
return 0;
}
and you can guess, SERVERMAXLVL is whatever the server's max level is and SERVERMAXXP is whatever the xp it takes to get the max level...
Change them into what you want your max level and required xp to be.
now save your changes and close that.
Next, open your player.java and search for:
- Code:
-
protected int NewHPYou
will see a string that looks like this:
- Code:
-
protected int NewHP = SERVERMAXLVL;
now again, we will change the SERVERMAXLVL to what we want our server's max level to be.
Now in the same file we're in, search for:
- Code:
-
public int getLevelForXPNow
you'll see a line that looks like
- Code:
-
for (int lvl = 1; lvl <= SERVERMAXLVL; lvl++) {
a few lines down...
and again, YES! you guessed it! change the SERVERMAXLVL to the server's max level...
and now open our last file to edit, LoginHandler.txt (it might not be in the main server folder)
Now search for:
- Code:
-
for (int i = 0; i < 21; i++) {
Now you'll see a handful of text like this:
for
- Code:
-
(int i = 0; i < 21; i++) {
player.playerXP[i] = results.getInt(player.statName[i]);
int level = 0;
if (player.playerXP[i] > SERVERMAXXP) {
level = SERVERMAXLVL;
} else {
level = player.getLevelForXP(player.playerXP[i]);
}
player.playerLevel[i] = level;
player.setSkillLevel(i, level, player.playerXP[i]);
if(i == 3){
player.currentHealth = level;
player.maxHealth = level;
}
}
and by now, you know what to do... just change SERVERMAXLVL and SERVERMAXXP to what the server's max level and the xp for the max level... and you're done!
Compile your server and it should have your new max level!
(Optional: how to change your combat max level)
If you also wish to change your combat level's max ammount, open your player.java again and search for:
- Code:
-
int mag = (int) ((getLevelForXP(playerXP[4])) * 1.5);
(NOTE! if you see text with *s before the lines, keep searching till you find the text stated above, but without the *s.)
Now you'll see something like
- Code:
-
int mag = (int) ((getLevelForXP(playerXP[4])) * 1.5);
int ran = (int) ((getLevelForXP(playerXP[6])) * 1.5);
int attstr = (int) ((double) (getLevelForXP(playerXP[0])) + (double) (getLevelForXP(playerXP[2])));
combatLevel = 0;
if (ran > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.###)
+ ((getLevelForXP(playerXP[3])) * 0.###)
+ ((getLevelForXP(playerXP[5])) * 0.###) + ((getLevelForXP(playerXP[6])) * 0.####));
} else if (mag > attstr) {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.###)
+ ((getLevelForXP(playerXP[3])) * 0.###)
+ ((getLevelForXP(playerXP[5])) * 0.###) + ((getLevelForXP(playerXP[4])) * 0.####));
} else {
combatLevel = (int) (((getLevelForXP(playerXP[1])) * 0.###)
+ ((getLevelForXP(playerXP[3])) * 0.###)
+ ((getLevelForXP(playerXP[5])) * 0.###)
+ ((getLevelForXP(playerXP[0])) * 0.###) + ((getLevelForXP(playerXP[2])) * 0.###));
}
Change the area in your text where i put the ### in my text... and it will calculate between your skills to make your combat level... it might take a few times for you to get the ammount you want... (it didn't take me long to get max combat level of 1000 after i set all my levels to be a maximum of 1000...)
I hope this tutorial helped!