17,101
edits
(Update JS - Avoid modified descriptions for shop purchases) |
(Update JS) |
||
Line 17: | Line 17: | ||
this.baseDir = '/assets/data/'; | this.baseDir = '/assets/data/'; | ||
this.namespaces = { | this.namespaces = { | ||
melvorD: { displayName: 'Demo', | melvorD: { | ||
melvorF: { displayName: 'Full Version', | displayName: 'Demo', | ||
packFile: 'melvorDemo.json', | |||
}, | |||
melvorF: { | |||
displayName: 'Full Version', | |||
packFile: 'melvorFull.json', | |||
}, | |||
melvorTotH: { | melvorTotH: { | ||
displayName: 'Throne of the Herald', | displayName: 'Throne of the Herald', | ||
packFile: 'melvorTotH.json', | |||
}, | }, | ||
melvorAoD: { | melvorAoD: { | ||
displayName: 'Atlas of Discovery', | displayName: 'Atlas of Discovery', | ||
packFile: 'melvorExpansion2.json', | |||
}, | }, | ||
melvorBirthday2023: { | melvorBirthday2023: { | ||
displayName: 'Melvor Birthday 2023', | displayName: 'Melvor Birthday 2023', | ||
packFile: 'melvorBirthday2023.json', | |||
}, | }, | ||
melvorItA: { | melvorItA: { | ||
displayName: 'Into the Abyss', | displayName: 'Into the Abyss', | ||
packFile: 'melvorItA.json', | |||
}, | }, | ||
}; | }; | ||
Line 85: | Line 91: | ||
this.gameData = {}; | this.gameData = {}; | ||
this.skillDataInit = {}; | this.skillDataInit = {}; | ||
} | |||
getDataPackURL(nsID) { | |||
return 'https://' + location.hostname + this.baseDir + this.namespaces[nsID].packFile + '?' + DATA_VERSION.toString(); | |||
} | } | ||
async getWikiData() { | async getWikiData() { | ||
Line 92: | Line 101: | ||
for (const nsIdx in Object.keys(this.namespaces)) { | for (const nsIdx in Object.keys(this.namespaces)) { | ||
const ns = Object.keys(this.namespaces)[nsIdx]; | const ns = Object.keys(this.namespaces)[nsIdx]; | ||
const dataURL = this. | const dataURL = this.getDataPackURL(ns); | ||
console.log(`URL: ${dataURL}`); | console.log(`URL: ${dataURL}`); | ||
const dataPackage = await this.getDataPackage(dataURL); | const dataPackage = await this.getDataPackage(dataURL); | ||
Line 344: | Line 353: | ||
case 'melvorD:Summoning': | case 'melvorD:Summoning': | ||
importKeys = ['baseInterval']; | importKeys = ['baseInterval']; | ||
const sumKeys = ['recipeGPCost', 'markLevels']; | const sumKeys = ['recipeAPCost', 'recipeGPCost', 'markLevels']; | ||
sumKeys.forEach((k) => (dataNode.data[k] = Summoning[k])); | sumKeys.forEach((k) => (dataNode.data[k] = Summoning[k])); | ||
break; | break; | ||
Line 592: | Line 601: | ||
const dependentData = this.packData[namespace].dependentData; | const dependentData = this.packData[namespace].dependentData; | ||
if (dependentData !== undefined) { | if (dependentData !== undefined) { | ||
console.warn( | |||
`Data package for ${namespace} has dependent data, which is currently unsupported` | |||
); | |||
// TODO Handle dependentData | // TODO Handle dependentData | ||
} | } | ||
Line 1,271: | Line 1,283: | ||
strongholds: { | strongholds: { | ||
name: { key: 'STRONGHOLD_NAME', idFormat: 'NAME_{ID}' }, | name: { key: 'STRONGHOLD_NAME', idFormat: 'NAME_{ID}' }, | ||
}, | |||
equipmentSlots: { | |||
emptyName: { idFormat: 'EQUIP_SLOT_{ID}' } | |||
}, | }, | ||
gamemodes: { | gamemodes: { |