Evolution/Skill Tree/load/doc

From Portals of Phereon Wiki

Pre-script preparation:

Find \r\n and replace with (empty) in regex mode (text mode)

Script operation:

  1. Open web console
  2. Set the file text, type and copy the text inside the single quotes for each skill tree
    let skillText = {
      "Centaur": TEXT FROM SKILL FILE HERE,
      "PlantGirl": TEXT FROM SKILL FILE HERE,
      "Mermaid": TEXT FROM SKILL FILE HERE,
      "LavaGirl": TEXT FROM SKILL FILE HERE,
      "Lymean": TEXT FROM SKILL FILE HERE,
      "Succubus": TEXT FROM SKILL FILE HERE,
      "Harpy": TEXT FROM SKILL FILE HERE,
      "LizardGirl": TEXT FROM SKILL FILE HERE,
      "InsectGirl": TEXT FROM SKILL FILE HERE,
      "BeastGirl": TEXT FROM SKILL FILE HERE,
      "Shadow": TEXT FROM SKILL FILE HERE,
      "Tanid": TEXT FROM SKILL FILE HERE
    };
    
  3. Run this script:
    let json = {},outputText = "";
    function createEntry(node) {
      let outObj = {};
      outObj.name = node.name;
      outObj.count = node.amountPossible;
      outObj.costPrimary = node.pointCostPrimary;
      if (node.pointCostSecondary > 0) {
        outObj.costSecondary = node.pointCostSecondary;
        outObj.speciesSecondary = node.secondarySpeciesPoints;
      }
      outObj.type = node.nodeType;
      outObj.connectionRight = node.connectionRight;
      outObj.connectionBottom = node.connectionBottom;
      return outObj;
    }
    for (const prop in skillText) {
      if (skillText.hasOwnProperty(prop)) {
        for (var i = 0; i < skillText[prop].length; i++) { 
          skillText[prop][i] = createEntry(skillText[prop][i]);
        }
      }
    }
    outputText += JSON.stringify(skillText);
    outputText += "{{Documentation}}";
    outputText;
    
  4. Press copy button on the output string
  5. Replace all the text in Evolution/Skill_Tree/load with the output, remove any " before and after the output