Greetings, everyone!
In my project, characters have Basic Classes that allow them to grow up to level 30.
After that, they must pick one of the Advanced Classes available, where they'll now be able to grow up to level 50.
I'm doing the Class changing part through events, but I'm having a hard time trying to change the max level ingame.
Looking for answers in the forum, I've found some threads, and in one of those, @ATT_Turan provided some code that I compiled in a .js file and added in my game as a plugin.
The code reads as below:
Unfortunately, it's not working as intended, as characters are able to level up far beyond level 99.
Could someone please help me in this endeavor?
In my project, characters have Basic Classes that allow them to grow up to level 30.
After that, they must pick one of the Advanced Classes available, where they'll now be able to grow up to level 50.
I'm doing the Class changing part through events, but I'm having a hard time trying to change the max level ingame.
Looking for answers in the forum, I've found some threads, and in one of those, @ATT_Turan provided some code that I compiled in a .js file and added in my game as a plugin.
The code reads as below:
Code:
Game_Actor.prototype.maxLevel = function() {
switch (this.actorId())
{
// List actor IDs and which variable they're associated with
case 1:
//Brenda
return $gameVariables.value(11);
case 2:
//Cedric
return $gameVariables.value(12);
case 3:
//Yvanna
return $gameVariables.value(13);
case 4:
//Argus
return $gameVariables.value(14);
case 5:
//Flora
return $gameVariables.value(15);
case 6:
//Corvo
return $gameVariables.value(16);
case 7:
//Mahara
return $gameVariables.value(17);
case 8:
//Makuro
return $gameVariables.value(18);
default:
return 50;
}
};
Game_Actor.prototype.changeExp = function(exp, show) {
this._exp[this._classId] = Math.max(exp, 0);
if (this.isMaxLevel())
this._exp[this._classId] = this.expForLevel(this._level);
var lastLevel = this._level;
var lastSkills = this.skills();
while (this.currentExp() >= this.nextLevelExp()) {
this.levelUp();
if (this.isMaxLevel())
this._exp[this._classId] = this.expForLevel(this._level);
}
while (this.currentExp() < this.currentLevelExp()) {
this.levelDown();
}
if (show && this._level > lastLevel) {
this.displayLevelUp(this.findNewSkills(lastSkills));
}
this.refresh();
};
Unfortunately, it's not working as intended, as characters are able to level up far beyond level 99.
Could someone please help me in this endeavor?