Super charge items, Activate XP Boosts, Unassign all squads STW

This commit is contained in:
Lawin0129
2021-11-22 22:44:50 +00:00
parent b669f49518
commit cedfdbd98d
2 changed files with 218 additions and 59 deletions

260
index.js
View File

@@ -1374,14 +1374,6 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetHomebaseBanner", async (
// Buy skill tree perk STW // Buy skill tree perk STW
express.post("/fortnite/api/game/v2/profile/*/client/PurchaseHomebaseNode", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/PurchaseHomebaseNode", async (req, res) => {
function makeid() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}
const profile = require(`./profiles/${req.query.profileId || "profile0"}.json`); const profile = require(`./profiles/${req.query.profileId || "profile0"}.json`);
// do not change any of these or you will end up breaking it // do not change any of these or you will end up breaking it
@@ -1943,14 +1935,6 @@ express.post("/fortnite/api/game/v2/profile/*/client/UpgradeItemBulk", async (re
// Evolve item STW // Evolve item STW
express.post("/fortnite/api/game/v2/profile/*/client/ConvertItem", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/ConvertItem", async (req, res) => {
function makeid() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}
const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
// do not change any of these or you will end up breaking it // do not change any of these or you will end up breaking it
@@ -2050,16 +2034,62 @@ express.post("/fortnite/api/game/v2/profile/*/client/ConvertItem", async (req, r
res.end(); res.end();
}); });
// Craft item STW (Guns, melees and traps only) // Super charge item STW
express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/PromoteItem", async (req, res) => {
function makeid() { const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString(); // do not change any of these or you will end up breaking it
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex'); var ApplyProfileChanges = [];
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32); var BaseRevision = profile.rvn || 0;
return FinishedID; var QueryRevision = req.query.rvn || -1;
var StatChanged = false;
if (req.body.targetItemId) {
profile.items[req.body.targetItemId].attributes.level += 2;
StatChanged = true;
} }
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
ApplyProfileChanges.push({
"changeType": "itemAttrChanged",
"itemId": req.body.targetItemId,
"attributeName": "level",
"attributeValue": profile.items[req.body.targetItemId].attributes.level
})
fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2), function(err) {
if (err) {
console.log('error:', err)
};
});
}
// this doesn't work properly on version v12.20 and above but whatever
if (QueryRevision != BaseRevision) {
ApplyProfileChanges = [{
"changeType": "fullProfileUpdate",
"profile": profile
}];
}
res.json({
"profileRevision": profile.rvn || 0,
"profileId": req.query.profileId || "campaign",
"profileChangesBaseRevision": BaseRevision,
"profileChanges": ApplyProfileChanges,
"profileCommandRevision": profile.commandRevision || 0,
"serverTime": new Date().toISOString(),
"responseVersion": 1
})
res.status(200);
res.end();
});
// Craft item STW (Guns, melees and traps only)
express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req, res) => {
const seasondata = require("./season.json"); const seasondata = require("./season.json");
const seasonchecker = require("./seasonchecker.js"); const seasonchecker = require("./seasonchecker.js");
seasonchecker(req, seasondata); seasonchecker(req, seasondata);
@@ -3209,14 +3239,6 @@ express.post("/fortnite/api/game/v2/profile/*/client/RecycleItemBatch", async (r
// Add item from collection book STW // Add item from collection book STW
express.post("/fortnite/api/game/v2/profile/*/client/ResearchItemFromCollectionBook", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/ResearchItemFromCollectionBook", async (req, res) => {
function makeid() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}
const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
// do not change any of these or you will end up breaking it // do not change any of these or you will end up breaking it
@@ -3382,14 +3404,6 @@ express.post("/fortnite/api/game/v2/profile/*/client/SlotItemInCollectionBook",
// Unslot item from collection book STW // Unslot item from collection book STW
express.post("/fortnite/api/game/v2/profile/*/client/UnslotItemFromCollectionBook", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/UnslotItemFromCollectionBook", async (req, res) => {
function makeid() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}
const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
// do not change any of these or you will end up breaking it // do not change any of these or you will end up breaking it
@@ -3729,16 +3743,150 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetActiveHeroLoadout", asyn
res.end(); res.end();
}); });
// Open llama STW // Activate consumable stw STW
express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/ActivateConsumable", async (req, res) => {
function makeid() { const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString(); // do not change any of these or you will end up breaking it
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex'); var ApplyProfileChanges = [];
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32); var BaseRevision = profile.rvn || 0;
return FinishedID; var QueryRevision = req.query.rvn || -1;
var StatChanged = false;
var XPBoost;
if (req.body.targetItemId) {
profile.items[req.body.targetItemId].quantity -= 1;
for (var key in profile.items) {
if (profile.items[key].templateId == "Token:xpboost") {
var randomNumber = Math.floor(Math.random() * 1250000);
if (randomNumber < 1000000) {
randomNumber += 1000000
} }
profile.items[key].quantity += randomNumber;
XPBoost = key;
}
}
StatChanged = true;
}
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
ApplyProfileChanges.push({
"changeType": "itemQuantityChanged",
"itemId": req.body.targetItemId,
"quantity": profile.items[req.body.targetItemId].quantity
})
if (XPBoost) {
ApplyProfileChanges.push({
"changeType": "itemQuantityChanged",
"itemId": XPBoost,
"quantity": profile.items[XPBoost].quantity
})
}
fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2), function(err) {
if (err) {
console.log('error:', err)
};
});
}
// this doesn't work properly on version v12.20 and above but whatever
if (QueryRevision != BaseRevision) {
ApplyProfileChanges = [{
"changeType": "fullProfileUpdate",
"profile": profile
}];
}
res.json({
"profileRevision": profile.rvn || 0,
"profileId": req.query.profileId || "campaign",
"profileChangesBaseRevision": BaseRevision,
"profileChanges": ApplyProfileChanges,
"profileCommandRevision": profile.commandRevision || 0,
"serverTime": new Date().toISOString(),
"responseVersion": 1
})
res.status(200);
res.end();
});
// Unassign all squads STW
express.post("/fortnite/api/game/v2/profile/*/client/UnassignAllSquads", async (req, res) => {
const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
// do not change any of these or you will end up breaking it
var ApplyProfileChanges = [];
var BaseRevision = profile.rvn || 0;
var QueryRevision = req.query.rvn || -1;
var StatChanged = false;
if (req.body.squadIds) {
for (var i = 0; i < req.body.squadIds.length; i++) {
let id = req.body.squadIds[i];
for (var key in profile.items) {
if (profile.items[key].attributes.hasOwnProperty('squad_id')) {
if (profile.items[key].attributes.squad_id.toLowerCase() == id.toLowerCase()) {
profile.items[key].attributes.squad_id = "";
ApplyProfileChanges.push({
"changeType": "itemAttrChanged",
"itemId": key,
"attributeName": "squad_id",
"attributeValue": profile.items[key].attributes.squad_id
})
}
}
}
}
StatChanged = true;
}
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2), function(err) {
if (err) {
console.log('error:', err)
};
});
}
// this doesn't work properly on version v12.20 and above but whatever
if (QueryRevision != BaseRevision) {
ApplyProfileChanges = [{
"changeType": "fullProfileUpdate",
"profile": profile
}];
}
res.json({
"profileRevision": profile.rvn || 0,
"profileId": req.query.profileId || "campaign",
"profileChangesBaseRevision": BaseRevision,
"profileChanges": ApplyProfileChanges,
"profileCommandRevision": profile.commandRevision || 0,
"serverTime": new Date().toISOString(),
"responseVersion": 1
})
res.status(200);
res.end();
});
// Open llama STW
express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req, res) => {
const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`);
const ItemIDS = require("./responses/ItemIDS.json"); const ItemIDS = require("./responses/ItemIDS.json");
@@ -3866,14 +4014,6 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
// Purchase llama STW // Purchase llama STW
express.post("/fortnite/api/game/v2/profile/*/client/PurchaseCatalogEntry", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/PurchaseCatalogEntry", async (req, res) => {
function makeid() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}
const profile = require(`./profiles/${req.query.profileId || "profile0"}.json`); const profile = require(`./profiles/${req.query.profileId || "profile0"}.json`);
const campaign = require("./profiles/campaign.json"); const campaign = require("./profiles/campaign.json");
const athena = require("./profiles/athena.json"); const athena = require("./profiles/athena.json");
@@ -5261,3 +5401,11 @@ function getItemShop() {
return catalog; return catalog;
} }
function makeid() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}

View File

@@ -3908,6 +3908,17 @@
}, },
"quantity": 9579248 "quantity": 9579248
}, },
"xp-boost": {
"templateId": "Token:xpboost",
"attributes": {
"max_level_bonus": 0,
"level": 1,
"item_seen": false,
"xp": 0,
"favorite": false
},
"quantity": 0
},
"b863ca8b-be12-4715-8a84-7d34e1b306f4": { "b863ca8b-be12-4715-8a84-7d34e1b306f4": {
"templateId": "Worker:workerbasic_c_t01", "templateId": "Worker:workerbasic_c_t01",
"attributes": { "attributes": {
@@ -86832,7 +86843,7 @@
"offense": 5000, "offense": 5000,
"resistance": 5000 "resistance": 5000
}, },
"level": 310, "level": 309,
"xp_overflow": 0, "xp_overflow": 0,
"latent_xp_marker": "4977938", "latent_xp_marker": "4977938",
"event_currency": { "event_currency": {