mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 02:42:22 +01:00
New feature: Founder's Packs rewards screen (StW)
This commit is contained in:
@@ -7,6 +7,8 @@ displayName=LawinServer
|
||||
[Profile]
|
||||
# If this is set to true, every BR and StW seasonal quest will be on complete. Works for Battle Royale from Season 3 to Season 21 and for Save the World from Season 2 to Season X.
|
||||
bCompletedSeasonalQuests=false
|
||||
# If this is set to true, you will receive all founder's pack rewards upon logging into StW if the account didn't claim them yet.
|
||||
bGrantFoundersPacks=false
|
||||
# If this is set to true, all Save the World events will be displayed in lobby.
|
||||
bAllSTWEventsActivated=false
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
- CloudStorage and ClientSettings (Settings saving)
|
||||
- Llama purchasing and opening with random loot
|
||||
- Every Hero, Weapon, Defender and Resource
|
||||
- All Founder's Packs rewards screen (togglable in the config)
|
||||
- Crafting items in Backpack
|
||||
- Transferring items to and from Storage
|
||||
- Modifying and upgrading Schematic perks
|
||||
|
||||
@@ -375,27 +375,6 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"2515b182-e065-4521-9616-e27bf092fbcd": {
|
||||
"templateId": "Quest:foundersquest_getrewards_0_1",
|
||||
"attributes": {
|
||||
"level": -1,
|
||||
"item_seen": false,
|
||||
"completion_questcomplete_outpostquest_t1_l1": 0,
|
||||
"sent_new_notification": true,
|
||||
"challenge_bundle_id": "",
|
||||
"xp_reward_scalar": 1,
|
||||
"challenge_linked_quest_given": "",
|
||||
"quest_pool": "",
|
||||
"quest_state": "Claimed",
|
||||
"last_state_change_time": "2020-01-25T19:10:38.959Z",
|
||||
"challenge_linked_quest_parent": "",
|
||||
"max_level_bonus": 0,
|
||||
"completion_questcomplete_homebaseonboardingafteroutpost": 1,
|
||||
"xp": 0,
|
||||
"favorite": false
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"7b37f893-1b40-43ba-b4a6-81eb177f3939": {
|
||||
"templateId": "Worker:workerbasic_uc_t01",
|
||||
"attributes": {
|
||||
@@ -3905,27 +3884,6 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"4ccba65b-7221-4391-b562-8e4098693876": {
|
||||
"templateId": "Quest:foundersquest_getrewards_1_2",
|
||||
"attributes": {
|
||||
"level": -1,
|
||||
"item_seen": false,
|
||||
"completion_questcomplete_outpostquest_t1_l1": 0,
|
||||
"sent_new_notification": true,
|
||||
"challenge_bundle_id": "",
|
||||
"xp_reward_scalar": 1,
|
||||
"challenge_linked_quest_given": "",
|
||||
"quest_pool": "",
|
||||
"quest_state": "Claimed",
|
||||
"last_state_change_time": "2020-01-25T19:10:49.382Z",
|
||||
"challenge_linked_quest_parent": "",
|
||||
"max_level_bonus": 0,
|
||||
"completion_questcomplete_homebaseonboardingafteroutpost": 1,
|
||||
"xp": 0,
|
||||
"favorite": false
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"6441c8bd-4f42-4cf8-baac-a07e67d5e6cd": {
|
||||
"templateId": "Quest:genericquest_killmistmonsters_repeatable",
|
||||
"attributes": {
|
||||
@@ -6615,26 +6573,6 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"9dc86b38-6b37-4e98-a7be-38dc30275821": {
|
||||
"templateId": "Quest:foundersquest_getrewards_2_3",
|
||||
"attributes": {
|
||||
"level": -1,
|
||||
"item_seen": false,
|
||||
"completion_questcomplete_outpostquest_t1_l1": 1,
|
||||
"sent_new_notification": false,
|
||||
"challenge_bundle_id": "",
|
||||
"xp_reward_scalar": 1,
|
||||
"challenge_linked_quest_given": "",
|
||||
"quest_pool": "",
|
||||
"quest_state": "Claimed",
|
||||
"last_state_change_time": "2020-07-13T19:16:00.695Z",
|
||||
"challenge_linked_quest_parent": "",
|
||||
"max_level_bonus": 0,
|
||||
"xp": 0,
|
||||
"favorite": false
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"44a35ac7-b556-4b36-af64-4999a3c716c9": {
|
||||
"templateId": "Quest:reactivequest_supplyrun",
|
||||
"attributes": {
|
||||
|
||||
@@ -145,20 +145,6 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"agresdarti48ut387t8bgbgfuckaa": {
|
||||
"templateId": "Quest:FoundersQuest_GetRewards_0_1",
|
||||
"attributes": {
|
||||
"quest_state": "Claimed",
|
||||
"last_state_change_time": "2017-08-29T21:05:57.087Z",
|
||||
"max_level_bonus": 0,
|
||||
"level": -1,
|
||||
"item_seen": false,
|
||||
"xp": 0,
|
||||
"sent_new_notification": true,
|
||||
"favorite": false
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"1fakfgrughfaitcudghudhgdughdughudhgug": {
|
||||
"templateId": "gadget:g_commando_goincommando",
|
||||
"attributes": {
|
||||
@@ -655,21 +641,6 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"2d4ea84f-b6d7-42dc-b193-98bb9a31b3aa": {
|
||||
"templateId": "Quest:foundersquest_getrewards_0_1",
|
||||
"attributes": {
|
||||
"quest_state": "Claimed",
|
||||
"last_state_change_time": "2017-08-29T21:19:45.200Z",
|
||||
"max_level_bonus": 0,
|
||||
"completion_questcomplete_homebaseonboardingafteroutpost": 1,
|
||||
"level": -1,
|
||||
"item_seen": false,
|
||||
"xp": 0,
|
||||
"sent_new_notification": true,
|
||||
"favorite": false
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"d3fa9aa6-df5f-406d-ac40-e884e6b832f3": {
|
||||
"templateId": "Worker:managertrainer_uc_t01",
|
||||
"attributes": {
|
||||
|
||||
1160
responses/Campaign/rewards.json
Normal file
1160
responses/Campaign/rewards.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"author": "This list was created by PRO100KatYT",
|
||||
"fixedAttributes": {
|
||||
"Worker:managerdoctor_c_t01": {
|
||||
"managerSynergy": "Homebase.Manager.IsDoctor"
|
||||
|
||||
185
structure/mcp.js
185
structure/mcp.js
@@ -914,6 +914,53 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClientQuestLogin", async (r
|
||||
QuestCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Grant completed founder's pack quests.
|
||||
if (config.Profile.bGrantFoundersPacks == true) {
|
||||
var QuestsToGrant = [
|
||||
"Quest:foundersquest_getrewards_0_1",
|
||||
"Quest:foundersquest_getrewards_1_2",
|
||||
"Quest:foundersquest_getrewards_2_3",
|
||||
"Quest:foundersquest_getrewards_3_4",
|
||||
"Quest:foundersquest_chooseherobundle",
|
||||
"Quest:foundersquest_getrewards_4_5",
|
||||
"Quest:foundersquest_herobundle_nochoice"
|
||||
]
|
||||
|
||||
for (var i in QuestsToGrant) {
|
||||
var bSkipThisQuest = false;
|
||||
for (var key in profile.items) {
|
||||
if (profile.items[key].templateId.toLowerCase() == QuestsToGrant[i].toLowerCase()) {
|
||||
bSkipThisQuest = true;
|
||||
}
|
||||
}
|
||||
if (bSkipThisQuest == true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var ItemID = functions.MakeID();
|
||||
var Item = {
|
||||
"templateId": QuestsToGrant[i],
|
||||
"attributes": {
|
||||
"creation_time": "min",
|
||||
"quest_state": "Completed",
|
||||
"last_state_change_time": new Date().toISOString(),
|
||||
"level": -1,
|
||||
"sent_new_notification": true,
|
||||
"quest_rarity": "uncommon",
|
||||
"xp_reward_scalar": 1
|
||||
},
|
||||
"quantity": 1
|
||||
}
|
||||
profile.items[ItemID] = Item
|
||||
ApplyProfileChanges.push({
|
||||
"changeType": "itemAdded",
|
||||
"itemId": ItemID,
|
||||
"item": Item
|
||||
})
|
||||
StatChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (req.query.profileId == "athena") {
|
||||
@@ -1852,14 +1899,132 @@ express.post("/fortnite/api/game/v2/profile/*/client/AssignWorkerToSquadBatch",
|
||||
// Claim STW quest reward
|
||||
express.post("/fortnite/api/game/v2/profile/*/client/ClaimQuestReward", async (req, res) => {
|
||||
const profile = require(`./../profiles/${req.query.profileId || "campaign"}.json`);
|
||||
const common_core = require("./../profiles/common_core.json");
|
||||
const theater0 = require("./../profiles/theater0.json");
|
||||
var Rewards = require("./../responses/Campaign/rewards.json").quest;
|
||||
|
||||
// do not change any of these or you will end up breaking it
|
||||
var ApplyProfileChanges = [];
|
||||
var MultiUpdate = [];
|
||||
var Notifications = [];
|
||||
var BaseRevision = profile.rvn || 0;
|
||||
var QueryRevision = req.query.rvn || -1;
|
||||
var StatChanged = false;
|
||||
var TheaterStatChanged = false;
|
||||
var CommonCoreStatChanged = false;
|
||||
|
||||
if (req.body.questId) {
|
||||
var questTemplateId = [];
|
||||
for (var key in profile.items) {
|
||||
if (req.body.questId.toLowerCase() == key.toLowerCase()) {
|
||||
questTemplateId = profile.items[key].templateId.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
if (questTemplateId && Rewards.hasOwnProperty(questTemplateId)) {
|
||||
if (req.body.selectedRewardIndex != -1 && Rewards[questTemplateId].selectableRewards) {
|
||||
Rewards = Rewards[questTemplateId].selectableRewards[req.body.selectedRewardIndex].rewards;
|
||||
}
|
||||
else {
|
||||
Rewards = Rewards[questTemplateId].rewards;
|
||||
}
|
||||
|
||||
MultiUpdate.push({
|
||||
"profileRevision": theater0.rvn || 0,
|
||||
"profileId": "theater0",
|
||||
"profileChangesBaseRevision": theater0.rvn || 0,
|
||||
"profileChanges": [],
|
||||
"profileCommandRevision": theater0.commandRevision || 0,
|
||||
})
|
||||
|
||||
if (req.query.profileId == "campaign") {
|
||||
MultiUpdate.push({
|
||||
"profileRevision": common_core.rvn || 0,
|
||||
"profileId": "common_core",
|
||||
"profileChangesBaseRevision": common_core.rvn || 0,
|
||||
"profileChanges": [],
|
||||
"profileCommandRevision": common_core.commandRevision || 0,
|
||||
})
|
||||
}
|
||||
|
||||
Notifications.push({
|
||||
"type": "questClaim",
|
||||
"primary": true,
|
||||
"questId": questTemplateId,
|
||||
"loot": {
|
||||
"items": []
|
||||
}
|
||||
})
|
||||
|
||||
for (var i in Rewards) {
|
||||
const ID = functions.MakeID();
|
||||
const templateId = Rewards[i].templateId.toLowerCase();
|
||||
|
||||
if (templateId.startsWith("weapon:") || templateId.startsWith("trap:") || templateId.startsWith("ammo:")) {
|
||||
var Item = {"templateId":Rewards[i].templateId,"attributes":{"clipSizeScale": 0,"loadedAmmo": 999,"level": 1,"alterationDefinitions": [],"baseClipSize": 999,"durability": 375,"itemSource": "", "item_seen": false},"quantity":Rewards[i].quantity};
|
||||
|
||||
theater0.items[ID] = Item;
|
||||
|
||||
MultiUpdate[0].profileChanges.push({
|
||||
"changeType": "itemAdded",
|
||||
"itemId": ID,
|
||||
"item": theater0.items[ID]
|
||||
})
|
||||
|
||||
Notifications[0].loot.items.push({
|
||||
"itemType": Rewards[i].templateId,
|
||||
"itemGuid": ID,
|
||||
"itemProfile": "theater0",
|
||||
"quantity": Rewards[i].quantity
|
||||
})
|
||||
|
||||
TheaterStatChanged = true;
|
||||
}
|
||||
else if (req.query.profileId == "campaign" && (templateId.startsWith("homebasebannericon:") || templateId == "token:founderchatunlock")) {
|
||||
var Item = {"templateId":Rewards[i].templateId,"attributes":{"max_level_bonus":0,"level":1,"item_seen":false,"xp":0,"favorite":false},"quantity":Rewards[i].quantity};
|
||||
|
||||
common_core.items[ID] = Item;
|
||||
|
||||
MultiUpdate[1].profileChanges.push({
|
||||
"changeType": "itemAdded",
|
||||
"itemId": ID,
|
||||
"item": common_core.items[ID]
|
||||
})
|
||||
|
||||
Notifications[0].loot.items.push({
|
||||
"itemType": Rewards[i].templateId,
|
||||
"itemGuid": ID,
|
||||
"itemProfile": "common_core",
|
||||
"quantity": Rewards[i].quantity
|
||||
})
|
||||
|
||||
CommonCoreStatChanged = true;
|
||||
}
|
||||
else {
|
||||
var Item = {"templateId":Rewards[i].templateId,"attributes":{"legacy_alterations":[],"max_level_bonus":0,"level":1,"refund_legacy_item":false,"item_seen":false,"alterations":["","","","","",""],"xp":0,"refundable":false,"alteration_base_rarities":[],"favorite":false},"quantity":Rewards[i].quantity};
|
||||
|
||||
if (templateId.startsWith("quest:")) {
|
||||
Item.attributes.quest_state = "Active";
|
||||
}
|
||||
|
||||
profile.items[ID] = Item;
|
||||
|
||||
ApplyProfileChanges.push({
|
||||
"changeType": "itemAdded",
|
||||
"itemId": ID,
|
||||
"item": profile.items[ID]
|
||||
})
|
||||
|
||||
Notifications[0].loot.items.push({
|
||||
"itemType": Rewards[i].templateId,
|
||||
"itemGuid": ID,
|
||||
"itemProfile": req.query.profileId,
|
||||
"quantity": Rewards[i].quantity
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
profile.items[req.body.questId].attributes.quest_state = "Claimed";
|
||||
profile.items[req.body.questId].attributes.last_state_change_time = new Date().toISOString();
|
||||
StatChanged = true;
|
||||
@@ -1869,6 +2034,24 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimQuestReward", async (r
|
||||
profile.rvn += 1;
|
||||
profile.commandRevision += 1;
|
||||
|
||||
if (TheaterStatChanged == true) {
|
||||
theater0.rvn += 1;
|
||||
theater0.commandRevision += 1;
|
||||
MultiUpdate[0].profileRevision = theater0.rvn || 0;
|
||||
MultiUpdate[0].profileCommandRevision = theater0.commandRevision || 0;
|
||||
|
||||
fs.writeFileSync("./profiles/theater0.json", JSON.stringify(theater0, null, 2));
|
||||
}
|
||||
|
||||
if (CommonCoreStatChanged == true) {
|
||||
common_core.rvn += 1;
|
||||
common_core.commandRevision += 1;
|
||||
MultiUpdate[1].profileRevision = common_core.rvn || 0;
|
||||
MultiUpdate[1].profileCommandRevision = common_core.commandRevision || 0;
|
||||
|
||||
fs.writeFileSync("./profiles/common_core.json", JSON.stringify(common_core, null, 2));
|
||||
}
|
||||
|
||||
ApplyProfileChanges.push({
|
||||
"changeType": "itemAttrChanged",
|
||||
"itemId": req.body.questId,
|
||||
@@ -1899,8 +2082,10 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimQuestReward", async (r
|
||||
"profileId": req.query.profileId || "campaign",
|
||||
"profileChangesBaseRevision": BaseRevision,
|
||||
"profileChanges": ApplyProfileChanges,
|
||||
"notifications": Notifications,
|
||||
"profileCommandRevision": profile.commandRevision || 0,
|
||||
"serverTime": new Date().toISOString(),
|
||||
"multiUpdate": MultiUpdate,
|
||||
"responseVersion": 1
|
||||
})
|
||||
res.end();
|
||||
|
||||
Reference in New Issue
Block a user