Zarsla

Sepreated EXP and Leveling

Dec 27th, 2017
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //For MV version 1.5.1 RPG Objects.js
  2.  
  3. // Replace Lines 3943 - 3946 in RPG Objects.js
  4.  
  5. Game_Actor.prototype.changeLevel = function(level, show) {
  6. level = level.clamp(1, this.maxLevel());
  7. while (!this.isMaxLevel() && level > this._level) {
  8. this._level++;
  9. }
  10. while (this._level > 1 && level < this._level) {
  11. this._level--;
  12. }
  13. };
  14.  
  15.  
  16. // Replace Lines 3926 - 3929 in RPG Objects.js
  17. Game_Actor.prototype.gainExp = function(exp) {
  18. var newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
  19. this._exp[this._classId] = Math.max(newExp, 0);
  20. };
  21.  
  22. //Replace Lines 10254 in RPG Objects.js
  23. actor.gainExp(value);
  24.  
  25. //Replace Lines 10254 in RPG Objects.js
  26. actor.gainExp(value);
  27.  
  28. //Replace Lines 3534 - 3536 in RPG Objects.js
  29. Game_Actor.prototype.initExp = function() {
  30. if(this._level > 0){
  31. this._exp[this._classId] = this.currentLevelExp();
  32. } else {
  33. this._exp[this._classId] = 0;
  34. }
  35. };
RAW Paste Data