Module:Sandbox/Skills/data: Difference between revisions

Add Herblore potion tier levels
m (Re-add attackType)
(Add Herblore potion tier levels)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
-- Version: PUBLIC BETA V1.0 (?1274)
-- Version: V1.0.3 (?1806)


--[[Generated from the console via
--[[Generated from console via
(function() {
(function() {
   var getGameVersion = function() {
   var getGameVersion = function() {
       var elemNavHeader = document.getElementsByClassName("nav-main-heading")
       var elemVer = document.querySelector("li[data-target='#modal-major-update']:not(.d-none)")
      if (elemNavHeader.length > 0) {
      if (elemVer !== undefined) {
        var verElem = Array.from(elemNavHeader).filter((i, idx) => i.innerText.toLowerCase().startsWith(gameVersion.toLowerCase()))[0]
      return elemVer.innerText
        if (verElem !== undefined) {
      }
          return verElem.innerText
      else {
         }
         return gameVersion
       }
       }
      return gameVersion
     }
     }
  var formatJSON = function(txt) {
  var out = JSON.stringify(txt)
  out = out.replace(/\'/g, "\\\'")
  out = out.replace(/\\\"/g, "\\\\\"")
  return out
  }


   var fullText = "-- Version: " + getGameVersion()
   var fullText = "-- Version: " + getGameVersion()
  fullText += "\r\n\r\nlocal SkillData = {}"
  fullText += "\r\n\r\nSkillData.Skills = mw.text.jsonDecode('" + formatJSON(SKILLS) + "')"
  // Prayer
  fullText += "\r\n\r\nSkillData.Prayer = mw.text.jsonDecode('" + formatJSON(PRAYER) + "')"
  // Woodcutting
  fullText += "\r\n\r\nSkillData.Woodcutting = {}"
  fullText += "\r\nSkillData.Woodcutting.Trees = mw.text.jsonDecode('" + formatJSON(Woodcutting.trees) + "')"
  // Fishing
  fullText += "\r\n\r\nSkillData.Fishing = {}"
  fullText += "\r\nSkillData.Fishing.Fish = mw.text.jsonDecode('" + formatJSON(Fishing.data) + "')"
  fullText += "\r\nSkillData.Fishing.Areas = mw.text.jsonDecode('" + formatJSON(Fishing.areas) + "')"
  fullText += "\r\nSkillData.Fishing.JunkItems = mw.text.jsonDecode('" + formatJSON(Fishing.junkItems) + "')"
  fullText += "\r\nSkillData.Fishing.SpecialItems = mw.text.jsonDecode('" + formatJSON(Fishing.specialItems) + "')"
  // Firemaking
  fullText += "\r\n\r\nSkillData.Firemaking = mw.text.jsonDecode('" + formatJSON(Firemaking.recipes) + "')"
  // Cooking
  fullText += "\r\n\r\nSkillData.Cooking = {}"
  fullText += "\r\nSkillData.Cooking.Recipes = mw.text.jsonDecode('" + formatJSON(Cooking.recipes) + "')"
  // Mining
  fullText += "\r\n\r\nSkillData.Mining = {}"
  fullText += "\r\nSkillData.Mining.Rocks = mw.text.jsonDecode('" + formatJSON(Mining.rockData) + "')"
  // Smithing
  fullText += "\r\n\r\nSkillData.Smithing = {}"
  fullText += "\r\nSkillData.Smithing.Recipes = mw.text.jsonDecode('" + formatJSON(Smithing.recipes) + "')"
  // Thieving
  fullText += "\r\n\r\nSkillData.Thieving = {}"
  fullText += "\r\nSkillData.Thieving.NPCs = mw.text.jsonDecode('" + formatJSON(Thieving.npcs) + "')"
  fullText += "\r\nSkillData.Thieving.Areas = mw.text.jsonDecode('" + formatJSON(Thieving.areas) + "')"
  fullText += "\r\nSkillData.Thieving.RareItems = mw.text.jsonDecode('" + formatJSON(Thieving.generalRareItems) + "')"
  // Farming
  // The below function returns a modified version of newFarmingAreas, removing various properties
  // from each patch object that relate to what the user has planted & are therefore useless for
  // wiki purposes. Not required, but simply makes the data cleaner.
  function wikiGetFarmingAreas() {
    let allowedPatchKeys = ['level', 'cost']
    let wikiFarmingAreas = []
    for (i = 0; i < newFarmingAreas.length; i++) {
      let keyList = Object.keys(newFarmingAreas[i]).filter((n) => n !== 'patches')
      let newPatches = []
      let newArea = {}
      for (j = 0; j < newFarmingAreas[i].patches.length; j++) {
        let newPatch = {}
        allowedPatchKeys.forEach((k) => newPatch[k] = newFarmingAreas[i].patches[j][k])
        newPatches[j] = newPatch
      }
      keyList.forEach((n) => newArea[n] = newFarmingAreas[i][n])
      newArea['patches'] = newPatches
      wikiFarmingAreas[i] = newArea
    }
    return wikiFarmingAreas
  }
  fullText += "\r\n\r\nSkillData.Farming = {}"
  fullText += "\r\nSkillData.Farming.Patches = mw.text.jsonDecode('" + formatJSON(wikiGetFarmingAreas()) + "')"
  // Fletching
  fullText += "\r\n\r\nSkillData.Fletching = {}"
  fullText += "\r\nSkillData.Fletching.Recipes = mw.text.jsonDecode('" + formatJSON(Fletching.recipes) + "')"
  // Crafting
  fullText += "\r\n\r\nSkillData.Crafting = {}"
  fullText += "\r\nSkillData.Crafting.Recipes = mw.text.jsonDecode('" + formatJSON(Crafting.recipes) + "')"
  // Runecrafting
  fullText += "\r\n\r\nSkillData.Runecrafting = {}"
  fullText += "\r\nSkillData.Runecrafting.Recipes = mw.text.jsonDecode('" + formatJSON(Runecrafting.recipes) + "')"
  // Herblore
  fullText += "\r\n\r\nSkillData.Herblore = {}"
  fullText += "\r\nSkillData.Herblore.Potions = mw.text.jsonDecode('" + formatJSON(Herblore.potions) + "')"
  fullText += "\r\nSkillData.Herblore.TierMasteryLevels = mw.text.jsonDecode('" + formatJSON(Herblore.tierMasteryLevels) + "')"
  // Agility
  fullText += "\r\n\r\nSkillData.Agility = {}"
  fullText += "\r\nSkillData.Agility.Obstacles = mw.text.jsonDecode('" + formatJSON(Agility.obstacles) + "')"
  fullText += "\r\nSkillData.Agility.Pillars = mw.text.jsonDecode('" + formatJSON(Agility.passivePillars) + "')"
  // Summoning
  fullText += "\r\n\r\nSkillData.Summoning = {}"
  fullText += "\r\nSkillData.Summoning.RecipeGPCost = mw.text.jsonDecode('" + formatJSON(Summoning.recipeGPCost) + "')"
  fullText += "\r\nSkillData.Summoning.MarkLevels = mw.text.jsonDecode('" + formatJSON(Summoning.markLevels) + "')"
  fullText += "\r\nSkillData.Summoning.Marks = mw.text.jsonDecode('" + formatJSON(Summoning.marks) + "')"
  fullText += "\r\nSkillData.Summoning.Synergies = mw.text.jsonDecode('" + formatJSON(Summoning.synergies) + "')"
  // Astrology
  fullText += "\r\n\r\nSkillData.Astrology = {}"
  fullText += "\r\nSkillData.Astrology.Constellations = mw.text.jsonDecode('" + formatJSON(Astrology.constellations) + "')"
  fullText += "\r\nSkillData.Astrology.BaseStardustChance = mw.text.jsonDecode('" + formatJSON(Astrology.baseStardustChance) + "')"
  fullText += "\r\nSkillData.Astrology.BaseGoldenStardustChance = mw.text.jsonDecode('" + formatJSON(Astrology.baseGoldenStardustChance) + "')"
  fullText += "\r\nSkillData.Astrology.BaseInterval = mw.text.jsonDecode('" + formatJSON(Astrology.baseInterval) + "')"
  fullText += "\r\nSkillData.Astrology.ModifierMagnitudeChances = mw.text.jsonDecode('" + formatJSON(Astrology.modifierMagnitudeChances) + "')"


   var txt = JSON.stringify(CONSTANTS)
  // Mastery
   txt = txt.replace(/\'/g, "\\\'")
   var skillKeys = Object.keys(SKILLS);
  txt = txt.replace(/\\\"/g, "\\\\\"")
   var tempUnlocks = {};
   fullText = fullText + "\r\n\r\nlocal Constants = mw.text.jsonDecode('" + txt + "')"
  for(var i = 0; i < skillKeys.length; i++) {
  var key = skillKeys[i];
  if(SKILLS[key].hasMastery){
  var chkArray = [];
  var unlockArray = masteryUnlocks[key];
  for(var j = 0; j < unlockArray.length; j++) {
  chkArray[j] = {level: unlockArray[j].level, unlock: getMasteryUnlock(key, j)}
  }
  tempUnlocks[key] = chkArray;
  }
  }
   fullText += "\r\n\r\nSkillData.MasteryUnlocks = mw.text.jsonDecode('" + formatJSON(tempUnlocks) + "')"


   txt = JSON.stringify(AttackTypeID)
   var tempCheckpoints = {};
  txt = txt.replace(/\'/g, "\\\'")
  for(var i = 0; i < skillKeys.length; i++) {
  txt = txt.replace(/\\\"/g, "\\\\\"")
  var key = skillKeys[i];
   fullText = fullText + "\r\n\r\nConstants.attackType = mw.text.jsonDecode('" + txt + "')"
  if(SKILLS[key].hasMastery){
  var chkArray = [];
  for(var j = 0; j < 4; j++) {
  chkArray[j] = getMasteryCheckpointBonus(key, j)
  }
  tempCheckpoints[key] = {bonuses: chkArray};
  }
  }
   fullText += "\r\n\r\nSkillData.MasteryCheckpoints = mw.text.jsonDecode('" + formatJSON(tempCheckpoints) + "')"


   var wikiSlayerItems = new Set()
   var MasteryPoolXP = []
   SHOP.Slayer.filter((i) => i.contains.items !== undefined && i.contains.items.length == 1).forEach((i) => wikiSlayerItems.add(i.contains.items[0][0]))
   for(var i = 0; i < skillKeys.length; i++){
  txt = JSON.stringify(Array.from(wikiSlayerItems))
  var key = skillKeys[i];
  txt = txt.replace(/\'/g, "\\\'")
  if(SKILLS[key].hasMastery){
   txt = txt.replace(/\\\"/g, "\\\\\"")
  MasteryPoolXP[key] = getMasteryPoolTotalXP(key);
   fullText += "\r\n\r\nConstants.Shop = {}\r\nConstants.Shop.SlayerItems = mw.text.jsonDecode('" + txt + "')"
  }
   }
   fullText += "\r\n\r\nSkillData.MasteryPoolXP = mw.text.jsonDecode('" + formatJSON(MasteryPoolXP) + "')"


   txt = JSON.stringify(SHOP.Slayer.filter((i) => i.name.includes('Resupply')))
   var skillMilestones = Object.keys(SKILLS).map(function(s) { if (MILESTONES[SKILLS[s].name] === undefined) { return null } else { return MILESTONES[SKILLS[s].name].length } })
  txt = txt.replace(/\'/g, "\\\'")
   fullText += "\r\n\r\nSkillData.Milestones = mw.text.jsonDecode('" + formatJSON(skillMilestones) + "')"
  txt = txt.replace(/\\\"/g, "\\\\\"")
   fullText += "\r\n\r\nConstants.Shop.Packs = mw.text.jsonDecode('" + txt + "')"


   txt = JSON.stringify(Object.values(SlayerTask.data).sort(function(a, b) { return a.minLevel - b.minLevel; }))
   // Adventure mode skill unlock costs
  txt = txt.replace(/\'/g, "\\\'")
   fullText += "\r\n\r\nSkillData.SkillUnlockCosts = mw.text.jsonDecode('" + formatJSON(priceToUnlockSkill) + "')"
  txt = txt.replace(/\\\"/g, "\\\\\"")
   fullText += "\r\n\r\nConstants.Slayer = {}\r\nConstants.Slayer.Tiers = mw.text.jsonDecode('" + txt + "')"


   fullText += "\r\n\r\nreturn Constants"
   fullText += "\r\n\r\nreturn SkillData"
   console.log(fullText)
   console.log(fullText)
})()
})()
--]]
--]]


local
local SkillData = {}
 
SkillData.Skills = mw.text.jsonDecode('{"0":{"name":"Woodcutting","media":"assets/media/skills/woodcutting/woodcutting.svg","hasMastery":true,"masteryTokenID":481,"maxLevel"


Constants.attackType = mw.text.jsonDecode('{"0":"melee","1":"ranged","2":"magic","3":"unset","melee":0,"ranged":1,"magic":2,"unset":3}')
SkillData.MasteryCheckpoints = mw.text.jsonDecode('{"0":{"bonuses":["+5% increased Woodcutting Mastery XP","+5% increased chance to receive double Logs per action","All Logs sell for +50% GP Value","When you receive a Birds Nest, always receive a base minimum of 2."]},"1":{"bonuses":["+5% increased Fishing Mastery XP","Receive no more Junk","+5% increased chance to get double Fish","When you catch a Special Item, there is a 25% chance to receive one extra Special Item. It is possible to receive a different item than the original."]},"2":{"bonuses":["+5% increased Firemaking Mastery XP","10% decreased Burning interval","Receive GP equal to 25% of the value of the Log you are burning","+5% increased Global Mastery XP"]},"3":{"bonuses":["+5% increased Cooking Mastery XP","+5% increased chance to get double cooked Food","+10% chance to preserve raw food in Cooking","All Food heals for +10% HP"]},"4":{"bonuses":["+5% increased Mining Mastery XP","Reduced Ore respawn time by 10%","Reduce Mining interval by 0.2s","All Rocks gain +10 Maximum HP (Bonus applied on Rock Respawn)"]},"5":{"bonuses":["+5% increased Smithing Mastery XP","+5% resource preservation chance for Smithing","+5% resource preservation chance for Smithing","+10% chance to double items in Smithing."]},"10":{"bonuses":["+30 Thieving Stealth, +3% increased Thieving XP","Decreases Thieving Interval by 0.2s, +3% increased Thieving Mastery XP","+100% increased gold from Thieving","+100 Thieving Stealth, chance to gain unique area items from Thieving is tripled"]},"11":{"bonuses":["+5% increased Farming Mastery XP","Crops cannot die (Bonus applied when crop grows).","+5% increased Crop harvest","Reduced crop grow time by 10% (Bonus applied when crop is planted)"]},"13":{"bonuses":["+5% increased Fletching Mastery XP","Produce 1 extra Javelin per Fletch (Applied to base quantity)","Produce 1 extra Gem-Tipped Bolt per Fletch (Applied to base quantity)","Reduce Fletching Interval by 0.2s"]},"14":{"bonuses":["+5% increased Crafting Mastery XP","+5% resource preservation chance for Crafting.","Decreased Crafting Interval by 0.2s","Always Craft a base quantity of 2 for Rings and Necklaces"]},"15":{"bonuses":["+5% increased Runecrafting Mastery XP","Grants 250% base Runecrafting XP from Runes","+10% resource preservation chance for Runecrafting","Grants an extra 5 Runes per craft"]},"19":{"bonuses":["+5% increased Herblore Mastery XP","+3% increased Herblore Skill XP","+5% resource preservation chance for Herblore","+10% chance to double Potions per action in Herblore"]},"20":{"bonuses":["+5% increased Agility Mastery XP","+10% GP from Agility","+10% Global Agility Obstacle cost reduction.","+15% Agility Obstacle Item cost reduction"]},"21":{"bonuses":["+5% increased Summoning Mastery XP","+1 Shard Cost Reduction for Tier 1 & Tier 2 Summoning Tablets","+10% resource preservation chance for Summoning","+1 Shard Cost Reduction for Tier 3 Summoning Tablets. +10 Base Quantity for Summoning Tablet Creation."]},"22":{"bonuses":["+5% increased Astrology Mastery XP","+1% chance to find Stardust","+0.2% chance to find Golden Stardust","-50% Cost to reroll specific Modifiers"]}}')


Constants.Shop = {}
SkillData.MasteryPoolXP = mw.text.jsonDecode('[4500000,11500000,4500000,15500000,5500000,57500000,null,null,null,null,11500000,12000000,null,28500000,27500000,42000000,null,null,null,15000000,25500000,10000000,5500000]')
Constants.Shop.SlayerItems = mw.text.jsonDecode('[494,502,904,905,906,805,818,948,1005,1008,1007,1006,484,485,513,514,507,508,953,954,955]')


Constants.Shop.Packs = mw.text.jsonDecode('[{"name":"Basic Resupply","description":"+200 Mithril Arrows, +200 Topaz Bolts, +200 Light Runes, +100 Lobsters, +200 Magic Bones","media":"assets/media/bank/lobster_cooked.png","contains":{"items":[[265,200],[684,200],[820,200],[26,100],[441,200]]},"cost":{"gp":0,"slayerCoins":5000,"items":[]},"unlockRequirements":{},"buyLimit":[0,0,0,0],"showBuyLimit":false},{"name":"Standard Resupply","description":"+200 Adamant Arrows, +200 Sapphire Bolts, +500 Light Runes, +150 Crab, +500 Magic Bones","media":"assets/media/bank/crab_cooked.png","contains":{"items":[[266,200],[685,200],[820,500],[28,150],[441,500]]},"cost":{"gp":0,"slayerCoins":10000,"items":[]},"unlockRequirements":{"skillLevel":[[18,50]]},"buyLimit":[0,0,0,0],"showBuyLimit":false},{"name":"Generous Resupply","description":"+200 Rune Arrows, +200 Ruby Bolts, +1000 Light Runes, +200 Sharks, +1000 Magic Bones","media":"assets/media/bank/shark_cooked.png","contains":{"items":[[267,200],[686,200],[820,1000],[29,200],[441,1000]]},"cost":{"gp":0,"slayerCoins":20000,"items":[]},"unlockRequirements":{"skillLevel":[[18,75]]},"buyLimit":[0,0,0,0],"showBuyLimit":false}]')
SkillData.Milestones = mw.text.jsonDecode('[10,24,10,32,12,116,11,1,12,1,24,25,73,58,56,85,87,32,14,31,12,21,12]')


Constants.Slayer = {}
SkillData.SkillUnlockCosts = mw.text.jsonDecode('[10000,25000,50000,200000,250000,400000,1000000,2500000,10000000,25000000,50000000,100000000,200000000,500000000,500000000,500000000,500000000,500000000,500000000]')
Constants.Slayer.Tiers = mw.text.jsonDecode('[{"display":"Easy","cost":0,"minLevel":1,"maxLevel":49,"slayerLevel":1},{"display":"Normal","cost":2000,"minLevel":50,"maxLevel":99,"slayerLevel":25},{"display":"Hard","cost":5000,"minLevel":100,"maxLevel":199,"slayerLevel":50},{"display":"Elite","cost":15000,"minLevel":200,"maxLevel":374,"slayerLevel":75},{"display":"Master","cost":25000,"minLevel":375,"maxLevel":null,"slayerLevel":85}]')


return Constants
return SkillData