Some changes

This commit is contained in:
Lawin0129
2023-02-16 23:23:32 +00:00
parent fd7c8b657c
commit de4c1c9c81
4 changed files with 354 additions and 42 deletions

View File

@@ -1,18 +1,22 @@
const axios = require("axios").default;
const { default: request } = require("axios");
const fs = require("fs");
var athena = {"created":"","updated":"","rvn":0,"wipeNumber":1,"accountId":"","profileId":"athena","version":"no_version","items":{"loadout1":{"templateId":"CosmeticLocker:cosmeticlocker_athena","attributes":{"locker_slots_data":{"slots":{"MusicPack":{"items":[""]},"Character":{"items":[""],"activeVariants":[null]},"Backpack":{"items":[""],"activeVariants":[null]},"SkyDiveContrail":{"items":[""],"activeVariants":[null]},"Dance":{"items":["","","","","",""]},"LoadingScreen":{"items":[""]},"Pickaxe":{"items":[""],"activeVariants":[null]},"Glider":{"items":[""],"activeVariants":[null]},"ItemWrap":{"items":["","","","","","",""],"activeVariants":[null,null,null,null,null,null,null,null]}}},"use_count":0,"banner_icon_template":"StandardBanner1","banner_color_template":"DefaultColor1","locker_name":"","item_seen":false,"favorite":false},"quantity":1}},"stats":{"attributes":{"past_seasons":[],"season_match_boost":999999999,"loadouts":["loadout1"],"favorite_victorypose":"","mfa_reward_claimed":false,"quest_manager":{"dailyLoginInterval":"","dailyQuestRerolls":1},"book_level":100,"season_num":0,"favorite_consumableemote":"","banner_color":"DefaultColor1","favorite_callingcard":"","favorite_character":"","favorite_spray":[],"book_xp":100,"favorite_loadingscreen":"","book_purchased":true,"lifetime_wins":100,"favorite_hat":"","level":100,"favorite_battlebus":"","favorite_mapmarker":"","favorite_vehicledeco":"","accountLevel":100,"favorite_backpack":"","favorite_dance":["","","","","",""],"inventory_limit_bonus":0,"last_applied_loadout":"","favorite_skydivecontrail":"","favorite_pickaxe":"","favorite_glider":"","daily_rewards":{},"xp":999,"season_friend_match_boost":999999999,"active_loadout_index":0,"favorite_musicpack":"","banner_icon":"StandardBanner1","favorite_itemwraps":["","","","","","",""]}},"commandRevision":0};
let athena = require("./athena_template.json");
console.log("Fortnite Athena Profile Generator by Lawin v1.0.0\n\n[GEN] Starting to generate...");
axios.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => {
var data = resp.data.data;
console.log("Fortnite Athena Profile Generator by Lawin v1.0.2\n");
request.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => {
let data = resp.data.data;
console.log("[GEN] Starting to generate...\n");
data.forEach(item => {
if (item.id.toLowerCase().includes("random")) return;
// Credits to PRO100KatYT for backendValue fixes
if (item.type.backendValue == "AthenaEmoji" || item.type.backendValue == "AthenaSpray" || item.type.backendValue == "AthenaToy") item.type.backendValue = "AthenaDance";
if (item.type.backendValue == "AthenaPetCarrier") item.type.backendValue = "AthenaBackpack";
var id = item.type.backendValue + ":" + item.id;
var variants = [];
let id = `${item.type.backendValue}:${item.id}`;
let variants = [];
if (item.variants) {
item.variants.forEach(obj => {
@@ -24,20 +28,17 @@ axios.get("https://fortnite-api.com/v2/cosmetics/br").then(resp => {
})
}
// Dont add anything that includes "random" in the id (Chapter 1 Season 4 and 5 crash fix)
if (!item.id.toLowerCase().includes("random")) {
athena.items[id] = {
"templateId": id,
"attributes": {
"max_level_bonus": 0,
"level": 1,
"item_seen": true,
"xp": 0,
"variants": variants,
"favorite": false
},
"quantity": 1
}
athena.items[id] = {
"templateId": id,
"attributes": {
"max_level_bonus": 0,
"level": 1,
"item_seen": true,
"xp": 0,
"variants": variants,
"favorite": false
},
"quantity": 1
}
})