Add "CardPack" check for llama purchasing

This commit is contained in:
Lawin0129
2021-11-21 15:56:16 +00:00
committed by GitHub
parent 2d190dfa19
commit 6b29ad334c

View File

@@ -3838,8 +3838,8 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
res.end(); res.end();
}); });
// 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() { function makeid() {
let CurrentDate = (new Date()).valueOf().toString(); let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString(); let RandomFloat = Math.random().toString();
@@ -3868,6 +3868,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
profile.commandRevision += 1; profile.commandRevision += 1;
catalog.storefronts.forEach(function(value, a) { catalog.storefronts.forEach(function(value, a) {
if (value.name.toLowerCase().startsWith("cardpack")) {
catalog.storefronts[a].catalogEntries.forEach(function(value, b) { catalog.storefronts[a].catalogEntries.forEach(function(value, b) {
if (value.offerId == req.body.offerId) { if (value.offerId == req.body.offerId) {
catalog.storefronts[a].catalogEntries[b].itemGrants.forEach(function(value, c) { catalog.storefronts[a].catalogEntries[b].itemGrants.forEach(function(value, c) {
@@ -3898,6 +3899,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
}) })
} }
}) })
}
}) })
PurchasedLlama = true; PurchasedLlama = true;
@@ -3914,6 +3916,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
campaign.commandRevision += 1; campaign.commandRevision += 1;
catalog.storefronts.forEach(function(value, a) { catalog.storefronts.forEach(function(value, a) {
if (value.name.toLowerCase().startsWith("cardpack")) {
catalog.storefronts[a].catalogEntries.forEach(function(value, b) { catalog.storefronts[a].catalogEntries.forEach(function(value, b) {
if (value.offerId == req.body.offerId) { if (value.offerId == req.body.offerId) {
catalog.storefronts[a].catalogEntries[b].itemGrants.forEach(function(value, c) { catalog.storefronts[a].catalogEntries[b].itemGrants.forEach(function(value, c) {
@@ -4116,6 +4119,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
}) })
} }
}) })
}
}) })
fs.writeFileSync("./profiles/campaign.json", JSON.stringify(campaign, null, 2), function(err) { fs.writeFileSync("./profiles/campaign.json", JSON.stringify(campaign, null, 2), function(err) {
@@ -4146,10 +4150,10 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
}) })
res.status(200); res.status(200);
res.end(); res.end();
}); });
// Set multiple items favorite // Set multiple items favorite
express.post("/fortnite/api/game/v2/profile/*/client/SetItemFavoriteStatusBatch", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/SetItemFavoriteStatusBatch", async (req, res) => {
const profile = require(`./profiles/${req.query.profileId || "athena"}.json`); const profile = require(`./profiles/${req.query.profileId || "athena"}.json`);
if (profile.profileId == "athena") { if (profile.profileId == "athena") {
@@ -4214,10 +4218,10 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
}) })
res.status(200); res.status(200);
res.end(); res.end();
}); });
// Set favorite on item // Set favorite on item
express.post("/fortnite/api/game/v2/profile/*/client/SetItemFavoriteStatus", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/SetItemFavoriteStatus", async (req, res) => {
const profile = require(`./profiles/${req.query.profileId || "athena"}.json`); const profile = require(`./profiles/${req.query.profileId || "athena"}.json`);
if (profile.profileId == "athena") { if (profile.profileId == "athena") {
@@ -4280,10 +4284,10 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
}) })
res.status(200); res.status(200);
res.end(); res.end();
}); });
// Mark item as seen // Mark item as seen
express.post("/fortnite/api/game/v2/profile/*/client/MarkItemSeen", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/MarkItemSeen", async (req, res) => {
const profile = require(`./profiles/${req.query.profileId || "athena"}.json`); const profile = require(`./profiles/${req.query.profileId || "athena"}.json`);
if (profile.profileId == "athena") { if (profile.profileId == "athena") {
@@ -4348,7 +4352,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/OpenCardPack", async (req,
}) })
res.status(200); res.status(200);
res.end(); res.end();
}); });
// Equip BR Locker 1 // Equip BR Locker 1
express.post("/fortnite/api/game/v2/profile/*/client/EquipBattleRoyaleCustomization", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/EquipBattleRoyaleCustomization", async (req, res) => {