From b0d07ebf0d73535efa28aa5577f20645939e6bba Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Sat, 8 Jan 2022 21:18:51 +0100 Subject: [PATCH 1/6] Added Quest Replacement for StW --- index.js | 159 +++++++++++++++++++++++++++++++++++++++ responses/stwquests.json | 1 + 2 files changed, 160 insertions(+) create mode 100644 responses/stwquests.json diff --git a/index.js b/index.js index dae543e..3be8661 100644 --- a/index.js +++ b/index.js @@ -1652,6 +1652,156 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetPinnedQuests", async (re res.end(); }); +// Replace STW Quests +express.post("/fortnite/api/game/v2/profile/*/client/FortRerollDailyQuest", async (req, res) => { + const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); + const QuestIDS = require("./responses/stwquests.json"); + + // do not change any of these or you will end up breaking it + var ApplyProfileChanges = []; + var Notifications = []; + var BaseRevision = profile.rvn || 0; + var QueryRevision = req.query.rvn || -1; + var StatChanged = false; + + const NewQuestID = makeid(); + const randomNumber = Math.floor(Math.random() * QuestIDS.length); + + if (req.body.questId && profile.stats.attributes.quest_manager.dailyQuestRerolls >= 1) { + profile.stats.attributes.quest_manager.dailyQuestRerolls -= 1; + delete profile.items[req.body.questId] + profile.items[NewQuestID] = { + "templateId": QuestIDS[randomNumber], + "attributes": { + "creation_time": new Date().toISOString(), + "completion_complete": 0, + "level": -1, + "item_seen": false, + "playlists": [], + "sent_new_notification": false, + "challenge_bundle_id": "", + "xp_reward_scalar": 1, + "challenge_linked_quest_given": "", + "quest_pool": "", + "quest_state": "Active", + "bucket": "", + "last_state_change_time": new Date().toISOString(), + "challenge_linked_quest_parent": "", + "max_level_bonus": 0, + "xp": 0, + "quest_rarity": "uncommon", + "favorite": false + }, + "quantity": 1 + }; + StatChanged = true; + } + + if (StatChanged == true) { + profile.rvn += 1; + profile.commandRevision += 1; + + ApplyProfileChanges.push({ + "changeType": "statModified", + "name": "quest_manager", + "value": profile.stats.attributes.quest_manager + }) + + ApplyProfileChanges.push({ + "changeType": "itemAdded", + "itemId": NewQuestID, + "item": profile.items[NewQuestID] + }) + + ApplyProfileChanges.push({ + "changeType": "itemRemoved", + "itemId": req.body.questId + }) + + Notifications.push({ + "type": "dailyQuestReroll", + "primary": true, + "newQuestId": QuestIDS[randomNumber] + }) + + fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2)); + } + + // 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, + "notifications": Notifications, + "profileCommandRevision": profile.commandRevision || 0, + "serverTime": new Date().toISOString(), + "responseVersion": 1 + }) + res.end(); +}); + +// Mark New Quest Notification Sent +express.post("/fortnite/api/game/v2/profile/*/client/MarkNewQuestNotificationSent", 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.itemIds) { + for (var i = 0; i < req.body.itemIds.length; i++) { + var id = req.body.itemIds[i]; + + profile.items[id].attributes.sent_new_notification = true + + ApplyProfileChanges.push({ + "changeType": "itemAttrChanged", + "itemId": id, + "attributeName": "sent_new_notification", + "attributeValue": true + }) + } + + StatChanged = true; + } + + if (StatChanged == true) { + profile.rvn += 1; + profile.commandRevision += 1; + + fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2)); + } + + // 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.end(); +}); + // Claim STW daily reward express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (req, res) => { const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); @@ -1669,6 +1819,9 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (r profile.stats.attributes.daily_rewards.totalDaysLoggedIn += 1; profile.stats.attributes.daily_rewards.lastClaimDate = DateFormat; profile.stats.attributes.daily_rewards.additionalSchedules.founderspackdailyrewardtoken.rewardsClaimed += 1; + if (profile.stats.attributes.quest_manager.dailyQuestRerolls == 0) { + profile.stats.attributes.quest_manager.dailyQuestRerolls += 1 + } StatChanged = true; } @@ -1682,6 +1835,12 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (r "value": profile.stats.attributes.daily_rewards }) + ApplyProfileChanges.push({ + "changeType": "statModified", + "name": "quest_manager", + "value": profile.stats.attributes.quest_manager + }) + fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2)); } diff --git a/responses/stwquests.json b/responses/stwquests.json new file mode 100644 index 0000000..b06e897 --- /dev/null +++ b/responses/stwquests.json @@ -0,0 +1 @@ +["Quest:Daily_DestroyTVs", "Quest:Daily_DestroyTransformers", "Quest:Daily_DestroyServerRacks", "Quest:Daily_DestroySeesaws", "Quest:Daily_DestroyPropaneTanks", "Quest:Daily_DestroyGnomes", "Quest:Daily_DestroyFireTrucks", "Quest:Daily_DestroyBears", "Quest:Daily_DestroyArcadeMachines", "Quest:Daily_PartyOf50", "Quest:Daily_Mission_Specialist_TwinePeaks", "Quest:Daily_Mission_Specialist_Stonewood", "Quest:Daily_Mission_Specialist_Soldier", "Quest:Daily_Mission_Specialist_Plankerton", "Quest:Daily_Mission_Specialist_Outlander", "Quest:Daily_Mission_Specialist_Ninja", "Quest:Daily_Mission_Specialist_Constructor", "Quest:Daily_Mission_Specialist_CannyValley", "Quest:Daily_HuskExtermination_Soldier", "Quest:Daily_HuskExtermination_Outlander", "Quest:Daily_HuskExtermination_Ninja", "Quest:Daily_HuskExtermination_Constructor", "Quest:Daily_HuskExtermination_AnyHero", "Quest:Daily_High_Priority", "Quest:Daily_GateCrasher", "Quest:Daily_DataRetrieval", "Quest:Daily_ALittleVanThatCould"] \ No newline at end of file From 7312d301cf7b33539daa21f17e1d9fe3850ca09e Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Sun, 9 Jan 2022 10:34:48 +0100 Subject: [PATCH 2/6] Fixed large news images on older builds. --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.js b/index.js index 3be8661..de24e14 100644 --- a/index.js +++ b/index.js @@ -5953,6 +5953,17 @@ function getContentPages(req) { }) } catch (err) {} + const news = ["savetheworldnews", "battleroyalenews"] + + if (seasondata.season < 5 || (seasondata.season == 5 && parseInt(seasondata.build.toString().split(".")[1]) < 30)) { + try { + news.forEach(mode => { + contentpages[mode].news.messages[0].image = "https://i.imgur.com/Az6kyrk.png"; + contentpages[mode].news.messages[1].image = "https://i.imgur.com/Wf8wQQy.png"; + }) + } catch (err) {} + } + try { contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = `season${seasondata.season}`; contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = `season${seasondata.season}`; From 0951502abad95e2d5b305fc0d77b7cc768357b74 Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Sun, 9 Jan 2022 11:23:57 +0100 Subject: [PATCH 3/6] Added Winterfest 2021 Battle Royale subgame image. --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index de24e14..056179d 100644 --- a/index.js +++ b/index.js @@ -5981,6 +5981,7 @@ function getContentPages(req) { if (seasondata.build == 19.01) { contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = "winter2021"; contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp19-lobby-xmas-2048x1024-f85d2684b4af.png"; + contentpages.subgameinfo.battleroyale.image = "https://cdn2.unrealengine.com/19br-wf-subgame-select-512x1024-16d8bb0f218f.jpg"; contentpages.specialoffervideo.bSpecialOfferEnabled = "true"; } } catch (err) {} From a844d6d65113768453df1133f58277877c750f88 Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Sun, 9 Jan 2022 11:24:52 +0100 Subject: [PATCH 4/6] Added 3 StW Daily Quests to profile0 --- profiles/profile0.json | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/profiles/profile0.json b/profiles/profile0.json index 432edc8..761f868 100644 --- a/profiles/profile0.json +++ b/profiles/profile0.json @@ -32699,6 +32699,51 @@ "favorite": false }, "quantity": 0 + }, + "Quest:Daily_DestroyTVs": { + "templateId": "Quest:Daily_DestroyTVs", + "attributes": { + "quest_state": "Active", + "last_state_change_time": "2017-12-25T02:06:00.508Z", + "completion_complete": 0, + "max_level_bonus": 0, + "level": -1, + "item_seen": true, + "xp": 0, + "sent_new_notification": true, + "favorite": false + }, + "quantity": 1 + }, + "Quest:Daily_Mission_Specialist_Soldier": { + "templateId": "Quest:Daily_Mission_Specialist_Soldier", + "attributes": { + "quest_state": "Active", + "last_state_change_time": "2017-12-25T02:06:00.508Z", + "completion_complete": 0, + "max_level_bonus": 0, + "level": -1, + "item_seen": true, + "xp": 0, + "sent_new_notification": true, + "favorite": false + }, + "quantity": 1 + }, + "Quest:Daily_PartyOf50": { + "templateId": "Quest:Daily_PartyOf50", + "attributes": { + "quest_state": "Active", + "last_state_change_time": "2017-12-25T02:06:00.508Z", + "completion_complete": 0, + "max_level_bonus": 0, + "level": -1, + "item_seen": true, + "xp": 0, + "sent_new_notification": true, + "favorite": false + }, + "quantity": 1 } }, "stats": { From e703965a9a5456c88672bf332fb79c876e5fd7be Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Sun, 9 Jan 2022 12:49:56 +0100 Subject: [PATCH 5/6] Added Quest Replacement for BR --- index.js | 12 ++++++++-- profiles/athena.json | 45 ++++++++++++++++++++++++++++++++++++++ responses/quests.json | 47 ++++++++++++++++++++++++++++++++++++++++ responses/stwquests.json | 1 - 4 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 responses/quests.json delete mode 100644 responses/stwquests.json diff --git a/index.js b/index.js index 056179d..d2acc02 100644 --- a/index.js +++ b/index.js @@ -1652,10 +1652,10 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetPinnedQuests", async (re res.end(); }); -// Replace STW Quests +// Replace Daily Quests express.post("/fortnite/api/game/v2/profile/*/client/FortRerollDailyQuest", async (req, res) => { const profile = require(`./profiles/${req.query.profileId || "campaign"}.json`); - const QuestIDS = require("./responses/stwquests.json"); + var QuestIDS = require("./responses/quests.json"); // do not change any of these or you will end up breaking it var ApplyProfileChanges = []; @@ -1664,6 +1664,14 @@ express.post("/fortnite/api/game/v2/profile/*/client/FortRerollDailyQuest", asyn var QueryRevision = req.query.rvn || -1; var StatChanged = false; + if (req.query.profileId == "profile0" || req.query.profileId == "campaign") { + QuestIDS = QuestIDS.SaveTheWorld + } + + if (req.query.profileId == "athena") { + QuestIDS = QuestIDS.BattleRoyale + } + const NewQuestID = makeid(); const randomNumber = Math.floor(Math.random() * QuestIDS.length); diff --git a/profiles/athena.json b/profiles/athena.json index d481f99..4ffd961 100644 --- a/profiles/athena.json +++ b/profiles/athena.json @@ -58375,6 +58375,51 @@ "favorite": false }, "quantity": 1 + }, + "Quest:AthenaDaily_Outlive_Solo": { + "templateId": "Quest:AthenaDaily_Outlive_Solo", + "attributes": { + "quest_state": "Active", + "last_state_change_time": "2017-12-25T02:06:00.508Z", + "completion_complete": 0, + "max_level_bonus": 0, + "level": -1, + "item_seen": true, + "xp": 0, + "sent_new_notification": true, + "favorite": false + }, + "quantity": 1 + }, + "Quest:AthenaDailyQuest_InteractTreasureChest": { + "templateId": "Quest:AthenaDailyQuest_InteractTreasureChest", + "attributes": { + "quest_state": "Active", + "last_state_change_time": "2017-12-25T02:06:00.508Z", + "completion_complete": 0, + "max_level_bonus": 0, + "level": -1, + "item_seen": true, + "xp": 0, + "sent_new_notification": true, + "favorite": false + }, + "quantity": 1 + }, + "Quest:AthenaDailyQuest_PlayerElimination": { + "templateId": "Quest:AthenaDailyQuest_PlayerElimination", + "attributes": { + "quest_state": "Active", + "last_state_change_time": "2017-12-25T02:06:00.508Z", + "completion_complete": 0, + "max_level_bonus": 0, + "level": -1, + "item_seen": true, + "xp": 0, + "sent_new_notification": true, + "favorite": false + }, + "quantity": 1 } }, "stats": { diff --git a/responses/quests.json b/responses/quests.json new file mode 100644 index 0000000..7e7a668 --- /dev/null +++ b/responses/quests.json @@ -0,0 +1,47 @@ +{ + "SaveTheWorld": [ + "Quest:Daily_DestroyTVs", + "Quest:Daily_DestroyTransformers", + "Quest:Daily_DestroyServerRacks", + "Quest:Daily_DestroySeesaws", + "Quest:Daily_DestroyPropaneTanks", + "Quest:Daily_DestroyGnomes", + "Quest:Daily_DestroyFireTrucks", + "Quest:Daily_DestroyBears", + "Quest:Daily_DestroyArcadeMachines", + "Quest:Daily_PartyOf50", + "Quest:Daily_Mission_Specialist_TwinePeaks", + "Quest:Daily_Mission_Specialist_Stonewood", + "Quest:Daily_Mission_Specialist_Soldier", + "Quest:Daily_Mission_Specialist_Plankerton", + "Quest:Daily_Mission_Specialist_Outlander", + "Quest:Daily_Mission_Specialist_Ninja", + "Quest:Daily_Mission_Specialist_Constructor", + "Quest:Daily_Mission_Specialist_CannyValley", + "Quest:Daily_HuskExtermination_Soldier", + "Quest:Daily_HuskExtermination_Outlander", + "Quest:Daily_HuskExtermination_Ninja", + "Quest:Daily_HuskExtermination_Constructor", + "Quest:Daily_HuskExtermination_AnyHero", + "Quest:Daily_High_Priority", + "Quest:Daily_GateCrasher", + "Quest:Daily_DataRetrieval", + "Quest:Daily_ALittleVanThatCould" + ], + "BattleRoyale": [ + "Quest:AthenaDaily_Outlive_Solo", + "Quest:AthenaDaily_Outlive_Squad", + "Quest:AthenaDaily_Outlive", + "Quest:AthenaDaily_PlayMatches", + "Quest:AthenaDaily_Solo_Top25", + "Quest:AthenaDaily_Squad_Top6", + "Quest:AthenaDailyQuest_InteractAmmoCrate", + "Quest:AthenaDailyQuest_InteractTreasureChest", + "Quest:AthenaDailyQuest_PlayerElimination", + "Quest:AthenaDailyQuest_PlayerEliminationAssaultRifles", + "Quest:AthenaDailyQuest_PlayerEliminationPistols", + "Quest:AthenaDailyQuest_PlayerEliminationShotguns", + "Quest:AthenaDailyQuest_PlayerEliminationSMGs", + "Quest:AthenaDailyQuest_PlayerEliminationSniperRifles" + ] +} \ No newline at end of file diff --git a/responses/stwquests.json b/responses/stwquests.json deleted file mode 100644 index b06e897..0000000 --- a/responses/stwquests.json +++ /dev/null @@ -1 +0,0 @@ -["Quest:Daily_DestroyTVs", "Quest:Daily_DestroyTransformers", "Quest:Daily_DestroyServerRacks", "Quest:Daily_DestroySeesaws", "Quest:Daily_DestroyPropaneTanks", "Quest:Daily_DestroyGnomes", "Quest:Daily_DestroyFireTrucks", "Quest:Daily_DestroyBears", "Quest:Daily_DestroyArcadeMachines", "Quest:Daily_PartyOf50", "Quest:Daily_Mission_Specialist_TwinePeaks", "Quest:Daily_Mission_Specialist_Stonewood", "Quest:Daily_Mission_Specialist_Soldier", "Quest:Daily_Mission_Specialist_Plankerton", "Quest:Daily_Mission_Specialist_Outlander", "Quest:Daily_Mission_Specialist_Ninja", "Quest:Daily_Mission_Specialist_Constructor", "Quest:Daily_Mission_Specialist_CannyValley", "Quest:Daily_HuskExtermination_Soldier", "Quest:Daily_HuskExtermination_Outlander", "Quest:Daily_HuskExtermination_Ninja", "Quest:Daily_HuskExtermination_Constructor", "Quest:Daily_HuskExtermination_AnyHero", "Quest:Daily_High_Priority", "Quest:Daily_GateCrasher", "Quest:Daily_DataRetrieval", "Quest:Daily_ALittleVanThatCould"] \ No newline at end of file From b5e395b04b0529f172d3cbe50058d9f07232e9ed Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Sun, 9 Jan 2022 19:32:08 +0100 Subject: [PATCH 6/6] Added Daily Quest Replacing to the Readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5b50f4b..b39f5eb 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ - Changing banner icon and banner color - Changing items edit styles - Support a Creator with specific codes +- Daily Quest replacing ### Battle Royale: - CloudStorage and ClientSettings (Settings saving) @@ -48,6 +49,7 @@ - Changing banner icon and banner color - Changing items edit styles - Support a Creator with specific codes +- Daily Quest replacing ## How to use? 1) Install [NodeJS](https://nodejs.org/en/)