mirror of
https://github.com/Lawin0129/AthenaProfileGenerator.git
synced 2026-01-13 03:02:22 +01:00
Add LEGO© Kits, Jam Tracks, Cars and Instruments.
This commit is contained in:
75
index.js
75
index.js
@@ -2,45 +2,60 @@ const { default: request } = require("axios");
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
let athena = require("./athena_template.json");
|
let athena = require("./athena_template.json");
|
||||||
|
|
||||||
console.log("Fortnite Athena Profile Generator by Lawin v1.0.2\n");
|
const fixedBackendValues = {
|
||||||
request.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => {
|
"AthenaEmoji": "AthenaDance",
|
||||||
|
"AthenaSpray": "AthenaDance",
|
||||||
|
"AthenaToy": "AthenaDance",
|
||||||
|
"AthenaPetCarrier": "AthenaBackpack",
|
||||||
|
"AthenaPet": "AthenaBackpack",
|
||||||
|
"SparksDrum": "SparksDrums",
|
||||||
|
"SparksMic": "SparksMicrophone"
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Fortnite Athena Profile Generator by Lawin v1.0.3\n");
|
||||||
|
request.get("https://fortnite-api.com/v2/cosmetics").then(resp => {
|
||||||
let data = resp.data.data;
|
let data = resp.data.data;
|
||||||
|
|
||||||
console.log("[GEN] Starting to generate...\n");
|
console.log("[GEN] Starting to generate...\n");
|
||||||
|
|
||||||
data.forEach(item => {
|
for (var mode in data) {
|
||||||
if (item.id.toLowerCase().includes("random")) return;
|
if (mode == "lego") continue; // Adding lego characters to the profile is unnecessary
|
||||||
|
|
||||||
// Credits to PRO100KatYT for backendValue fixes
|
data[mode].forEach(item => {
|
||||||
if (item.type.backendValue == "AthenaEmoji" || item.type.backendValue == "AthenaSpray" || item.type.backendValue == "AthenaToy") item.type.backendValue = "AthenaDance";
|
if (item.id.toLowerCase().includes("random")) return;
|
||||||
if (item.type.backendValue == "AthenaPetCarrier") item.type.backendValue = "AthenaBackpack";
|
|
||||||
|
|
||||||
let id = `${item.type.backendValue}:${item.id}`;
|
if (mode == "tracks") item.type = {"backendValue": "SparksSong"};
|
||||||
let variants = [];
|
|
||||||
|
|
||||||
if (item.variants) {
|
// Credits to PRO100KatYT for backendValue fixes
|
||||||
item.variants.forEach(obj => {
|
if (fixedBackendValues.hasOwnProperty(item.type.backendValue)) item.type.backendValue = fixedBackendValues[item.type.backendValue];
|
||||||
variants.push({
|
|
||||||
"channel": obj.channel || "",
|
let id = `${item.type.backendValue}:${item.id}`;
|
||||||
"active": obj.options[0].tag || "",
|
let variants = [];
|
||||||
"owned": obj.options.map(variant => variant.tag || "")
|
|
||||||
|
if (item.variants) {
|
||||||
|
item.variants.forEach(obj => {
|
||||||
|
variants.push({
|
||||||
|
"channel": obj.channel || "",
|
||||||
|
"active": obj.options[0].tag || "",
|
||||||
|
"owned": obj.options.map(variant => variant.tag || "")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
|
||||||
|
|
||||||
athena.items[id] = {
|
athena.items[id] = {
|
||||||
"templateId": id,
|
"templateId": id,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"max_level_bonus": 0,
|
"max_level_bonus": 0,
|
||||||
"level": 1,
|
"level": 1,
|
||||||
"item_seen": true,
|
"item_seen": true,
|
||||||
"xp": 0,
|
"xp": 0,
|
||||||
"variants": variants,
|
"variants": variants,
|
||||||
"favorite": false
|
"favorite": false
|
||||||
},
|
},
|
||||||
"quantity": 1
|
"quantity": 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFileSync("./athena.json", JSON.stringify(athena, null, 2));
|
fs.writeFileSync("./athena.json", JSON.stringify(athena, null, 2));
|
||||||
const stats = fs.statSync("./athena.json");
|
const stats = fs.statSync("./athena.json");
|
||||||
|
|||||||
Reference in New Issue
Block a user