Advertisement
KingGerar

KG - Skill Tree

Mar 28th, 2017
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================================
  2. // KG - Skill Tree
  3. //=============================================================================================
  4.  
  5.  /*:
  6.  @plugindesc Este plugin cria uma tela de árvore de habilidades.
  7.  @author King Gerar
  8.  
  9.  @param OptAddOnMainMenu
  10.  @desc Deseja adicionar um comando que leva à árvore de habilidades ao menu principal? (Yes ou No)
  11.  @default Yes
  12.  
  13.  @param TxtMainMenuCommand
  14.  @desc Texto que será exibido no comando no menu principal.
  15.  @default Skill Tree
  16.  
  17.  @param OptShowHeaderScene
  18.  @desc Deseja exibir um cabeçalho com o nome da tela de árvore de habilidades? (Yes ou No)
  19.  @default Yes
  20.  
  21.  @param HeaderHeight
  22.  @desc Altura (em pixels) do cabeçalho.
  23.  @default 72
  24.  
  25.  @param TxtSkillTreeSceneName
  26.  @desc Texto que será exibido como nome da tela de árvore de habilidades.
  27.  @default Árvore de Habilidades
  28.  
  29.  @param TxtSkillTreeSceneNameAlign
  30.  @desc Texto que será exibido como nome da tela de menu principal.
  31.  @default Left
  32.  
  33.  @param NmbVisibleCols
  34.  @desc Número de colunas visíveis na tela da árvore de habilidades.
  35.  @default 6
  36.  
  37.  @param NmbVisibleRows
  38.  @desc Número de linhas visíveis na tela da árvore de habilidades.
  39.  @default 5
  40.  
  41.  @param TxtAvailablePoints
  42.  @desc Texto que indica a quantidade de pontos disponíveis.
  43.  @default Pontos:
  44.  
  45.  @param TxtRequiredPoints
  46.  @desc Texto que indica a quantidade de pontos necessária para liberar um habilidade.
  47.  @default Pontos Requeridos:
  48.  
  49.  @param TxtLearnedSkill
  50.  @desc Texto que indica que uma habilidade da árvore de habilidades já foi aprendida.
  51.  @default Aprendida
  52.  ---------------------------------------------------------------------------------------------
  53.  @help Para utilizar o sistema de árvore de habilidades é preciso, antes, criar
  54.  as árvores dentro do código do plugin. O código já apresenta um exemplo de
  55.  árvore de habilidades, contendo 15 espaços e 5 habilidades. A árvore de
  56.  habilidades é criada como uma matriz semelhante à uma tabela, em que cada
  57.  célula/quadradinho é uma habilidade.
  58.  As células que forem ficar vazias devem conter somente o código "vazio"
  59.  incluindo as aspas, conforme o exemplo:
  60.  
  61.  ["vazio"],
  62.  
  63.  Por outro lado, as células que possuirão habilidades deverão ser escritas da
  64.  seguinte forma:
  65.  
  66.  [id da skill, sup-esq, sup-cen, sup-dir, cen-esq, cen-dir, inf-esq, inf-cen, inf-dir],
  67.  
  68.  Em que:
  69.  id da skill = Id da habilidade exibida dna célula em questão.
  70.  sup-esq = Id da habilidade à posição superior-esquerda, se fizer ligação com a em questão.
  71.  sup-cen = Id da habilidade à posição superior-central, se fizer ligação com a em questão.
  72.  sup-dir = Id da habilidade à posição superior-direita, se fizer ligação com a em questão.
  73.  cen-esq = Id da habilidade à posição centro-esquerda, se fizer ligação com a em questão.
  74.  cen-dir = Id da habilidade à posição centro-direita, se fizer ligação com a em questão.
  75.  inf-esq = Id da habilidade à posição inferior-esquerda, se fizer ligação com a em questão.
  76.  inf-cen = Id da habilidade à posição inferior-central, se fizer ligação com a em questão.
  77.  inf-dir = Id da habilidade à posição inferior-direita, se fizer ligação com a em questão.
  78.  
  79.  Se algum dos campos acima não possuir id para preencher, coloque 0 (zero).
  80.  ---------------------------------------------------------------------------------------------
  81.  É importante lembrar que, a primeira habilidade da árvore (que inicia a
  82.  ramificação) deve estar atribuída ao personagem desde o início. Você pode
  83.  fazer isso na aba classes do banco de dados, no campo "Skills to Learn".
  84.  
  85.  Árvores de habilidades criadas, deve-se atribuir a árvore aos personagens.
  86.  Para isso, é preciso adicionar a tag <SkillTree:n>, onde n é o id da árvore
  87.  de habilidades desejada. Cada personagem pode ter somente uma árvore de
  88.  habilidades e todas as tags devem ser adicionadas no campo de notas.
  89.  
  90.  Você também deve definir com quantos pontos de habilidade o personagem começa,
  91.  utilizando a tag <StartPoints:n>, onde n é a quantidade de pontos.
  92.  
  93.  E ainda deve definir quantos pontos de habilidade o personagem ganha ao ganhar
  94.  um nível, utilizando a tag <LevelPoints:n>, onde n é a quantidade de pontos.
  95.  
  96.  Por último, defina quantos pontos será necessário para liberar a habilidade
  97.  adicionando a tag <Points:n>, onde n é a quantidade de pontos.
  98.  */
  99.  
  100. //=============================================================================
  101. // Árvores de Habilidades
  102. //=============================================================================
  103.     SkillTrees = new Array(1);
  104.     SkillTrees[0] = [
  105.                                     ["vazio"],
  106.                                     ["vazio"],
  107.                                     [11, 0, 0, 0, 0, 0, 12, 0, 13],
  108.                                     ["vazio"],
  109.                                     ["vazio"],
  110.                                    
  111.                                     ["vazio"],
  112.                                     [12, 0, 0, 11, 0, 0, 0, 14, 0],
  113.                                     ["vazio"],
  114.                                     [13, 11, 0, 0, 0, 0, 0, 15, 0],
  115.                                     ["vazio"],
  116.                                    
  117.                                     ["vazio"],
  118.                                     [14, 0, 12, 0, 0, 0, 0, 0, 0],
  119.                                     ["vazio"],
  120.                                     [15, 0, 13, 0, 0, 0, 0, 0, 0],
  121.                                     ["vazio"]
  122.                                     ]
  123.  
  124.     KG_SkillTreeConfig = {
  125.         optAddOnMainMenu: (PluginManager.parameters('KG - Skill Tree')['OptAddOnMainMenu']).toLowerCase(),
  126.         txtMainMenuCommand: PluginManager.parameters('KG - Skill Tree')['TxtMainMenuCommand'],
  127.        
  128.         optShowHeaderScene: (PluginManager.parameters('KG - Skill Tree')['OptShowHeaderScene']).toLowerCase(),
  129.         headerHeight: Number(PluginManager.parameters('KG - Skill Tree')['HeaderHeight']),
  130.         txtSkillTreeSceneName: PluginManager.parameters('KG - Skill Tree')['TxtSkillTreeSceneName'],
  131.         txtSkillTreeSceneNameAlign: (PluginManager.parameters('KG - Skill Tree')['TxtSkillTreeSceneNameAlign']).toLowerCase(),
  132.        
  133.         nmbVisibleCols: Number(PluginManager.parameters('KG - Skill Tree')['NmbVisibleCols']),
  134.         nmbVisibleRows: Number(PluginManager.parameters('KG - Skill Tree')['NmbVisibleRows']),
  135.         txtAvailablePoints: PluginManager.parameters('KG - Skill Tree')['TxtAvailablePoints'],
  136.         txtRequiredPoints: PluginManager.parameters('KG - Skill Tree')['TxtRequiredPoints'],
  137.         txtLearnedSkill: PluginManager.parameters('KG - Skill Tree')['TxtLearnedSkill'],
  138.     };
  139.    
  140. //=============================================================================
  141. // Scene_SkillTree
  142. //-----------------------------------------------------------------------------
  143. // Esta classe é responsável por exibir a tela de árvore de habilidade.
  144. //=============================================================================
  145.     function Scene_SkillTree() {
  146.     this.initialize.apply(this, arguments);
  147.     }
  148.  
  149.     Scene_SkillTree.prototype = Object.create(Scene_MenuBase.prototype);
  150.     Scene_SkillTree.prototype.constructor = Scene_SkillTree;
  151.  
  152.     Scene_SkillTree.prototype.initialize = function() {
  153.     Scene_MenuBase.prototype.initialize.call(this);
  154.     };
  155.  
  156.     Scene_SkillTree.prototype.create = function() {
  157.     Scene_MenuBase.prototype.create.call(this);
  158.         this.createWindowHeader();
  159.         this.createWindowHelp();
  160.         this.createWindowSkillTree();
  161.         this.createWindowPoints();
  162.         this.windowSkillTree.refresh(this.actor());
  163.         this.windowSkillPoints.refresh(this.actor());
  164.         this.windowSkillTree.selectFirstItem();
  165.         this.windowSkillTree.activate();
  166.     };
  167.    
  168.     Scene_SkillTree.prototype.createWindowHeader = function() {
  169.         this.windowHeader = new Window_SceneHeader();
  170.     this.addWindow(this.windowHeader);
  171.     };
  172.    
  173.     Scene_SkillTree.prototype.createWindowHelp = function() {
  174.         this.windowHelp = new Window_SkillHelp(3);
  175.         this.addWindow(this.windowHelp);
  176.         this.windowHelp.y = this.windowHeader.height;
  177.     };
  178.    
  179.     Scene_SkillTree.prototype.createWindowSkillTree = function() {
  180.         this.windowSkillTree = new Window_SkillTree(this.windowHelp.y + this.windowHelp.height)
  181.         this.windowSkillTree.setHandler('ok',     this.onSkillOk.bind(this));
  182.     this.windowSkillTree.setHandler('cancel', this.popScene.bind(this));
  183.         this.addWindow(this.windowSkillTree);
  184.         this.windowSkillTree.setHelpWindow(this.windowHelp);
  185.     };
  186.    
  187.     Scene_SkillTree.prototype.createWindowPoints = function() {
  188.         this.windowSkillPoints = new Window_SkillPoints(this.windowSkillTree.y)
  189.         this.addWindow(this.windowSkillPoints);
  190.     };
  191.    
  192.     Scene_SkillTree.prototype.onSkillOk = function() {
  193.         var selectedCell = this.windowSkillTree._data[this.windowSkillTree.index()]
  194.         if (selectedCell[0] === "vazio" || this.actor().isLearnedSkill(this.windowSkillTree._data[this.windowSkillTree.index()][0])) {
  195.             this.windowSkillTree.activate();
  196.         } else {
  197.             var selectedSkill = $dataSkills[this.windowSkillTree._data[this.windowSkillTree.index()][0]];
  198.             var reqPoints = Number(selectedSkill.meta.Points);
  199.             if (this.actor().skillPoints >= reqPoints && this.windowSkillTree.canLearnThisSkill()) {
  200.                 this.actor().skillPoints -= Number($dataSkills[this.windowSkillTree._data[this.windowSkillTree.index()][0]].meta.Points);
  201.                 this.actor().learnSkill(this.windowSkillTree._data[this.windowSkillTree.index()][0]);
  202.                 this.windowSkillTree.refresh(this.actor());
  203.                 this.windowSkillPoints.refresh(this.actor());
  204.                 this.windowSkillTree.activate();
  205.             } else {
  206.                 SoundManager.playBuzzer();
  207.                 this.windowSkillTree.activate();
  208.             };
  209.         }; 
  210.     };
  211.        
  212. //=============================================================================
  213. // Window_SceneHeader
  214. //-----------------------------------------------------------------------------
  215. // Esta janela exibe o nome da tela atual.
  216. //=============================================================================
  217.     function Window_SceneHeader() {
  218.         this.initialize.apply(this, arguments);
  219.     }
  220.  
  221.     Window_SceneHeader.prototype = Object.create(Window_Base.prototype);
  222.     Window_SceneHeader.prototype.constructor = Window_SceneHeader;
  223.  
  224.     Window_SceneHeader.prototype.initialize = function() {
  225.         Window_Base.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, KG_SkillTreeConfig.headerHeight);
  226.         this.drawContents();
  227.     };
  228.    
  229.     Window_SceneHeader.prototype.drawContents = function() {
  230.         this.drawText(KG_SkillTreeConfig.txtSkillTreeSceneName, 0, 0, this.contentsWidth(), KG_SkillTreeConfig.txtSkillTreeSceneNameAlign);
  231.     };
  232.    
  233. //=============================================================================
  234. // Window_SkillTree
  235. //-----------------------------------------------------------------------------
  236. // Esta janela exibe a árvore de habilidades.
  237. //=============================================================================
  238.     function Window_SkillTree() {
  239.         this.initialize.apply(this, arguments);
  240.     }
  241.  
  242.     Window_SkillTree.prototype = Object.create(Window_Selectable.prototype);
  243.     Window_SkillTree.prototype.constructor = Window_SkillTree;
  244.  
  245.     Window_SkillTree.prototype.initialize = function(y) {
  246.     Window_Selectable.prototype.initialize.call(this, 0, y, Graphics.boxWidth - 240, Graphics.boxHeight - y);
  247.         this._data = [];
  248.     };
  249.    
  250.     Window_SkillTree.prototype.maxCols = function() {
  251.         return KG_SkillTreeConfig.nmbVisibleCols;
  252.     };
  253.  
  254.     Window_SkillTree.prototype.spacing = function() {
  255.         return 0;
  256.     };
  257.    
  258.     Window_SkillTree.prototype.itemHeight = function() {
  259.     return this.contentsHeight() / KG_SkillTreeConfig.nmbVisibleRows;
  260.     };
  261.    
  262.     Window_SkillTree.prototype.maxItems = function() {
  263.     return this._data ? this._data.length : 1;
  264.     };
  265.    
  266.     Window_SkillTree.prototype.updateHelp = function() {
  267.     if (this.index() != -1) {
  268.             if (this._data[this.index()] != "vazio") {
  269.                 this._helpWindow.refresh(this.actor, $dataSkills[this._data[this.index()][0]])
  270.             } else {
  271.                 this._helpWindow.contents.clear()
  272.             };
  273.         };
  274.     };
  275.    
  276.     Window_SkillTree.prototype.refresh = function(actor) {
  277.         if (this.contents) {
  278.       this.contents.clear();
  279.             if (actor) { this.actor = actor };
  280.             this._data = SkillTrees[$dataActors[this.actor.actorId()].meta.SkillTree];
  281.       this.drawAllItems();
  282.     };
  283.     };
  284.    
  285.     Window_SkillTree.prototype.drawItem = function(index) {
  286.         if (this._data[index] != "vazio") {
  287.             var skill = $dataSkills[this._data[index][0]];
  288.             var rect = this.itemRect(index);
  289.             this.changePaintOpacity(this.actor.isLearnedSkill(this._data[index][0]));
  290.             this.drawAllLinks(index, rect);
  291.             this.contents.clearRect(rect.x + (Math.floor(rect.width - 64) / 2), rect.y + (Math.floor(rect.height - 64) / 2), 64, 64);
  292.             this.drawBigIcon(skill.iconIndex, rect.x + (Math.floor(rect.width - 64) / 2), rect.y + (Math.floor(rect.height - 64) / 2));
  293.             this.changePaintOpacity(1);
  294.     };
  295.     };
  296.    
  297.     Window_SkillTree.prototype.changePaintOpacity = function(enabled) {
  298.     this.contents.paintOpacity = enabled ? 255 : 125;
  299.     };
  300.    
  301.     Window_SkillTree.prototype.selectFirstItem = function() {
  302.         var n = 0;
  303.         while (this._data[n][0] === "vazio") { n++ };
  304.         this.select(n);
  305.     };
  306.    
  307.     Window_SkillTree.prototype.drawBigIcon = function(iconIndex, x, y) {
  308.     var bitmap = ImageManager.loadSystem('IconSet');
  309.     var sx = iconIndex % 16 * 32;
  310.     var sy = Math.floor(iconIndex / 16) * 32;
  311.         this.contents._context.imageSmoothingEnabled = false;
  312.     this.contents.blt(bitmap, sx, sy, 32, 32, x, y, 64, 64);
  313.     };
  314.    
  315.     Window_SkillTree.prototype.drawAllLinks = function(index, rect) {
  316.         var x = rect.x + Math.floor(rect.width / 2);
  317.         var y = rect.y + Math.floor(rect.height / 2);
  318.         var xO = x;
  319.         var yO = y;
  320.         if (this.topRow() > 0 && index > (this.maxCols() * this.topRow()) && index < (this.maxCols() * this.topRow() + this.maxCols())) {
  321.             var startLinkId = 0;
  322.         } else {
  323.             var startLinkId = 5;
  324.         };
  325.         for (n = startLinkId; n < this._data[index].length; n++) {
  326.             if (this._data[index][n] === 0) { continue };
  327.             xO = x;
  328.             yO = y;
  329.             if (n === 1) {
  330.                 xO -= rect.width;
  331.                 yO -= rect.height;
  332.             } else if (n === 2) {
  333.                 yO -= rect.height;
  334.             } else if (n === 3) {
  335.                 xO += rect.width;
  336.                 yO -= rect.height;
  337.             } else if (n === 4) {
  338.                 xO -= rect.width;
  339.             } else if (n === 5) {
  340.                 xO += rect.width;
  341.             } else if (n === 6) {
  342.                 xO -= rect.width;
  343.                 yO += rect.height;
  344.             } else if (n === 7) {
  345.                 yO += rect.height;
  346.             } else if (n === 8) {
  347.                 xO += rect.width;
  348.                 yO += rect.height;
  349.             };
  350.             this.drawUnidirectLine(x, y, xO, yO, 0)
  351.         };
  352.     };
  353.    
  354.     Window_SkillTree.prototype.canLearnThisSkill = function() {
  355.         var existsLink = false;
  356.         for (n = 1; n < this._data[this.index()].length; n++) {
  357.             if (this._data[this.index()][n] != 0 && this.actor.isLearnedSkill(this._data[this.index()][n])) {
  358.                 existsLink = true;
  359.                 break;
  360.             };
  361.         };
  362.         return existsLink;
  363.     };
  364.    
  365. //=============================================================================
  366. // Window_SkillPoints
  367. //-----------------------------------------------------------------------------
  368. // Esta janela exibe a árvore de habilidades.
  369. //=============================================================================
  370.     function Window_SkillPoints() {
  371.         this.initialize.apply(this, arguments);
  372.     }
  373.  
  374.     Window_SkillPoints.prototype = Object.create(Window_Base.prototype);
  375.     Window_SkillPoints.prototype.constructor = Window_SkillPoints;
  376.  
  377.     Window_SkillPoints.prototype.initialize = function(y, actor) {
  378.     Window_Base.prototype.initialize.call(this, Graphics.boxWidth - 240, y, 240, Graphics.boxHeight - y);
  379.     };
  380.    
  381.     Window_SkillPoints.prototype.refresh = function(actor) {
  382.         this.contents.clear();
  383.         this.drawActorName(actor, 0, 0);
  384.         this.drawActorFace(actor, (this.contentsWidth() - 144) / 2, this.lineHeight());
  385.         this.drawActorClass(actor, 0, this.lineHeight() + 144);
  386.         this.drawActorLevel(actor, 0, 144 + (this.lineHeight() * 2));
  387.         this.drawHorzLine(144 + (this.lineHeight() * 3));
  388.         this.drawText(KG_SkillTreeConfig.txtAvailablePoints, 0, 144 + (this.lineHeight() * 4), this.contentsWidth());
  389.         this.drawText(actor.skillPoints, 0, 144 + (this.lineHeight() * 5), this.contentsWidth(), 'right');
  390.     };
  391.    
  392.     Window_SkillPoints.prototype.drawHorzLine = function(y) {
  393.     var lineY = y + this.lineHeight() / 2 - 1;
  394.     this.contents.paintOpacity = 48;
  395.     this.contents.fillRect(0, lineY, this.contentsWidth(), 2, this.normalColor());
  396.     this.contents.paintOpacity = 255;
  397.     };
  398.    
  399. //=============================================================================
  400. // Window_SkillHelp
  401. //-----------------------------------------------------------------------------
  402. // Esta janela exibe o nome e a descrição de uma habilidade da árvore de
  403. // habilidades.
  404. //=============================================================================
  405.     function Window_SkillHelp() {
  406.     this.initialize.apply(this, arguments);
  407.     }
  408.  
  409.     Window_SkillHelp.prototype = Object.create(Window_Base.prototype);
  410.     Window_SkillHelp.prototype.constructor = Window_SkillHelp;
  411.  
  412.     Window_SkillHelp.prototype.initialize = function(numLines) {
  413.     var height = this.fittingHeight(numLines || 2);
  414.     Window_Base.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, height);
  415.     };
  416.  
  417.     Window_SkillHelp.prototype.refresh = function(actor, skill) {
  418.     this.contents.clear();
  419.         this.changeTextColor(this.systemColor());
  420.         this.drawText(skill.name, 0, 0, this.contentsWidth());
  421.         if (actor.isLearnedSkill(skill.id)) {
  422.             this.drawText(KG_SkillTreeConfig.txtLearnedSkill, 0, 0, this.contentsWidth(), 'right');
  423.             this.resetTextColor();
  424.         } else {
  425.             this.drawText(KG_SkillTreeConfig.txtRequiredPoints, 0, 0, this.contentsWidth() - this.textWidth("00"), 'right');
  426.             this.resetTextColor();
  427.             this.drawText(skill.meta.Points, 0, 0, this.contentsWidth(), 'right');
  428.         };
  429.     this.drawTextEx(skill.description, 0, this.lineHeight());
  430.     };
  431.    
  432. //=============================================================================
  433. // Scene_Menu
  434. //-----------------------------------------------------------------------------
  435. // Esta classe é responsável por exibir a tela de menu principal.
  436. //=============================================================================
  437.     var KG_SkillTree_SceneMenu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  438.     Scene_Menu.prototype.createCommandWindow = function() {
  439.         KG_SkillTree_SceneMenu_createCommandWindow.call(this);
  440.     if (KG_SkillTreeConfig.optAddOnMainMenu === "yes") { this._commandWindow.setHandler('skillTree', this.commandPersonal.bind(this)) };
  441.     };
  442.    
  443.     var KG_SkillTree_SceneMenu_onPersonalOk = Scene_Menu.prototype.onPersonalOk;
  444.     Scene_Menu.prototype.onPersonalOk = function() {
  445.         KG_SkillTree_SceneMenu_onPersonalOk.call(this);
  446.         if (this._commandWindow.currentSymbol() === 'skillTree') {
  447.             SceneManager.push(Scene_SkillTree);
  448.         };
  449.     };
  450.    
  451. //=============================================================================
  452. // Window_Base
  453. //-----------------------------------------------------------------------------
  454. // Esta função cria uma linha entre dois pontos.
  455. //=============================================================================
  456.     Window_Base.prototype.drawUnidirectLine = function(x, y, x2, y2, color) {
  457.     this.contents.diagonalLine(x, y, x2, y2, this.textColor(color));
  458.   };
  459.    
  460. //=============================================================================
  461. // Window_MenuCommand
  462. //-----------------------------------------------------------------------------
  463. // Esta classe é responsável por exibir a janela de comandos no menu principal.
  464. //=============================================================================
  465.     var KG_SkillTree_MenuCommand_makeCommandList = Window_MenuCommand.prototype.makeCommandList;
  466.     Window_MenuCommand.prototype.makeCommandList = function() {
  467.         KG_SkillTree_MenuCommand_makeCommandList.call(this);
  468.         this.addSkillTreeCommand();
  469.     };
  470.    
  471.     Window_MenuCommand.prototype.addSkillTreeCommand = function() {
  472.     this.addCommand(KG_SkillTreeConfig.txtMainMenuCommand, 'skillTree', true);
  473.     };
  474.    
  475. //=============================================================================
  476. // Bitmap
  477. //-----------------------------------------------------------------------------
  478. // Esta função desenha uma linha entre dois pontos em uma janela.
  479. //=============================================================================
  480.     Bitmap.prototype.diagonalLine = function(x, y, x2, y2, color) {
  481.     var context = this._context;
  482.       context.lineWidth = 3;
  483.       context.strokeStyle = color;
  484.       context.beginPath();
  485.     context.moveTo(x, y);
  486.     context.lineTo(x2, y2);
  487.     context.stroke();
  488.   };
  489.    
  490. //=============================================================================
  491. // Game_Actor
  492. //-----------------------------------------------------------------------------
  493. // Esta função adiciona o parâmetro de pontos de habildade ao personagem.
  494. //=============================================================================
  495.     var KG_SkillTree_Game_Actor_setup = Game_Actor.prototype.setup;
  496.     Game_Actor.prototype.setup = function(actorId){
  497.         KG_SkillTree_Game_Actor_setup.call(this, actorId);
  498.     this.skillPoints = Number($dataActors[this._actorId].meta.StartPoints);
  499.     };
  500.    
  501.     var KG_SkillTree_Game_Actor_levelUp = Game_Actor.prototype.levelUp;
  502.     Game_Actor.prototype.levelUp = function() {
  503.         KG_SkillTree_Game_Actor_levelUp.call(this);
  504.     this.skillPoints += Number($dataActors[this._actorId].meta.LevelPoints);
  505.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement