//事件脚本:$gameSystem.changeMaxLevel(1, 10) 1号角色最大等级变为10
//=====================================================================================================================
;(function(){
Game_System.prototype.maxLevelData = function() {
return this._maxLevelData || [];
};
Game_System.prototype.maxLevel = function(actorId) {
return this.maxLevelData()[actorId];
};
Game_System.prototype.changeMaxLevel = function(actorId, max) {
if (!actorId || !max) return;
this._maxLevelData = this._maxLevelData || [];
this._maxLevelData[actorId] = max.clamp(1, max);
};
//=====================================================================================================================
Game_Actor.prototype.maxLevel = function() {
return $gameSystem.maxLevel(this._actorId) || this.actor().maxLevel;
};
//=====================================================================================================================
var XdRsData_MaxLv_Game_InterpreterPluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
XdRsData_MaxLv_Game_InterpreterPluginCommand.call(this, command, args);
command === 'ChangeMaxLevel' && $gameSystem.changeMaxLevel(+args[0], +args[1]);
};
}());
//=====================================================================================================================