diff --git a/index.js b/index.js new file mode 100644 index 0000000..38f09a8 --- /dev/null +++ b/index.js @@ -0,0 +1,61 @@ +const axios = require("axios").default; +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}; + +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; + + data.forEach(item => { + // 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 = []; + + 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] = { + "templateId": id, + "attributes": { + "max_level_bonus": 0, + "level": 1, + "item_seen": true, + "xp": 0, + "variants": variants, + "favorite": false + }, + "quantity": 1 + } + }) + + fs.writeFileSync("./athena.json", JSON.stringify(athena, null, 2)); + const stats = fs.statSync("./athena.json"); + + console.log("[GEN] Successfully generated and saved into", `${__dirname}\\athena.json`, `(${size(stats.size)})`); +}) + +function size(bytes) { + const sizes = ["Bytes", "KB", "MB", "GB", "TB"] + + if (bytes == 0) { + return "N/A" + } + + const i = Number(Math.floor(Math.log(bytes) / Math.log(1024))) + + if (i == 0) { + return bytes + " " + sizes[i] + } + + return (bytes / Math.pow(1024, i)).toFixed(1) + " " + sizes[i] +} \ No newline at end of file diff --git a/install_packages.bat b/install_packages.bat new file mode 100644 index 0000000..59a8e22 --- /dev/null +++ b/install_packages.bat @@ -0,0 +1 @@ +npm i \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3e69813 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,26 @@ +{ + "name": "athenaprofilegenerator", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "requires": { + "follow-redirects": "^1.14.4" + } + }, + "follow-redirects": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", + "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" + }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d600059 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "athenaprofilegenerator", + "version": "1.0.0", + "description": "A fortnite athena profile generator made for fortnite backends (LawinServer, etc...)", + "main": "index.js", + "dependencies": { + "axios": "^0.24.0", + "fs": "^0.0.1-security" + }, + "devDependencies": {}, + "scripts": { + "start": "node index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Lawin0129/AthenaProfileGenerator.git" + }, + "keywords": [ + "fortnite", + "athena", + "profile" + ], + "author": "Lawin0129", + "license": "GPL-3.0", + "bugs": { + "url": "https://github.com/Lawin0129/AthenaProfileGenerator/issues" + }, + "homepage": "https://github.com/Lawin0129/AthenaProfileGenerator#readme" +} diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..e13c041 --- /dev/null +++ b/start.bat @@ -0,0 +1,2 @@ +node index.js +pause \ No newline at end of file