Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Maliki's Class Max Levels
- // Mal_classMaxLevel.js
- // version 1.2
- //=============================================================================
- /*:
- * @plugindesc This plugin gives users the ability to set an Actor's Max Level via thier current class.
- * @author Maliki79
- *
- * @help Version 1.2
- * In order to use this plugin, simply add the following tag to class notes:
- * <maxLevel:x>
- * with X being the whole number.
- * (can also be any formula that returns a number higher than 1 allowing devs
- * to potentially make class max levels editable in-game.)
- * This will limit the max level of the actor to that number.
- * Changing classes will also change the Max Level settings.
- * Once at Max Level, the actor will no longer gain exp.
- */
- Game_Actor.prototype.maxLevel = function() {
- if (this.currentClass().meta.maxLevel) {
- var cMaxLevel = Number(eval(this.currentClass().meta.maxLevel)) || 100;
- return Math.min(cMaxLevel, this.actor().maxLevel);
- };
- return this.actor().maxLevel;
- };
- Game_Actor.prototype.classLevel = function(classId) {
- if (Yanfly.Param.CCCMaintainLv) return this.level;
- if (this._exp[classId] === undefined) this._exp[classId] = 0;
- var level = 1;
- for (;;) {
- if (level >= this.maxLevel()) break;
- if (this.expForCLevel(classId, level + 1) > this._exp[classId]) break;
- level++;
- }
- return level;
- };
- Game_Actor.prototype.expForCLevel = function(classID, level) {
- var c = $dataClasses[classID];
- var basis = c.expParams[0];
- var extra = c.expParams[1];
- var acc_a = c.expParams[2];
- var acc_b = c.expParams[3];
- return Math.round(basis*(Math.pow(level-1, 0.9+acc_a/250))*level*
- (level+1)/(6+Math.pow(level,2)/50/acc_b)+(level-1)*extra);
- };
- var malFinalExpRate = Game_Actor.prototype.finalExpRate
- Game_Actor.prototype.finalExpRate = function() {
- if (this.level == this.maxLevel()) return 0;
- return malFinalExpRate.call(this);
- };
Advertisement
Comments
-
- my classId is Rockie and maxLevel is 15 can you do that for me?
- it doesn't work for me!
Add Comment
Please, Sign In to add comment
Advertisement