Added support for multi-item Winterfest presents.

This commit is contained in:
PRO100KatYT
2022-12-21 17:29:17 +01:00
parent d27c124659
commit b811be6769
2 changed files with 140 additions and 129 deletions

View File

@@ -1,52 +1,52 @@
{ {
"author": "List made by PRO100KatYT", "author": "List made by PRO100KatYT",
"Season11": { "Season11": {
"ERG.Node.A.1": "AthenaCharacter:cid_645_athena_commando_f_wolly", "ERG.Node.A.1": ["AthenaCharacter:cid_645_athena_commando_f_wolly"],
"ERG.Node.B.1": "AthenaGlider:glider_id_188_galileorocket_g7oki", "ERG.Node.B.1": ["AthenaGlider:glider_id_188_galileorocket_g7oki"],
"ERG.Node.C.1": "AthenaBackpack:bid_430_galileospeedboat_9rxe3", "ERG.Node.C.1": ["AthenaBackpack:bid_430_galileospeedboat_9rxe3"],
"ERG.Node.D.1": "AthenaCharacter:cid_643_athena_commando_m_ornamentsoldier", "ERG.Node.D.1": ["AthenaCharacter:cid_643_athena_commando_m_ornamentsoldier"],
"ERG.Node.A.2": "AthenaPickaxe:pickaxe_id_329_gingerbreadcookie1h", "ERG.Node.A.2": ["AthenaPickaxe:pickaxe_id_329_gingerbreadcookie1h"],
"ERG.Node.A.3": "AthenaPickaxe:pickaxe_id_332_mintminer", "ERG.Node.A.3": ["AthenaPickaxe:pickaxe_id_332_mintminer"],
"ERG.Node.A.4": "AthenaDance:eid_snowglobe", "ERG.Node.A.4": ["AthenaDance:eid_snowglobe"],
"ERG.Node.A.5": "AthenaGlider:glider_id_191_pinetree", "ERG.Node.A.5": ["AthenaGlider:glider_id_191_pinetree"],
"ERG.Node.A.6": "AthenaItemWrap:wrap_188_wrappingpaper", "ERG.Node.A.6": ["AthenaItemWrap:wrap_188_wrappingpaper"],
"ERG.Node.A.7": "AthenaItemWrap:wrap_183_newyear2020", "ERG.Node.A.7": ["AthenaItemWrap:wrap_183_newyear2020"],
"ERG.Node.A.8": "AthenaSkyDiveContrail:trails_id_082_holidaygarland", "ERG.Node.A.8": ["AthenaSkyDiveContrail:trails_id_082_holidaygarland"],
"ERG.Node.A.9": "AthenaMusicPack:musicpack_040_xmaschiptunes", "ERG.Node.A.9": ["AthenaMusicPack:musicpack_040_xmaschiptunes"],
"ERG.Node.A.10": "AthenaLoadingScreen:lsid_208_smpattern", "ERG.Node.A.10": ["AthenaLoadingScreen:lsid_208_smpattern"],
"ERG.Node.A.11": "AthenaLoadingScreen:lsid_209_akcrackshot" "ERG.Node.A.11": ["AthenaLoadingScreen:lsid_209_akcrackshot"]
}, },
"Season19": { "Season19": {
"ERG.Node.A.1": "Token:14daysoffortnite_small_giftbox", "ERG.Node.A.1": ["Token:14daysoffortnite_small_giftbox"],
"ERG.Node.B.1": "AthenaDance:emoji_s19_animwinterfest2021", "ERG.Node.B.1": ["AthenaDance:emoji_s19_animwinterfest2021"],
"ERG.Node.C.1": "AthenaGlider:glider_id_335_logarithm_40qgl", "ERG.Node.C.1": ["AthenaGlider:glider_id_335_logarithm_40qgl"],
"ERG.Node.D.1": "AthenaCharacter:cid_a_323_athena_commando_m_bananawinter", "ERG.Node.D.1": ["AthenaCharacter:cid_a_323_athena_commando_m_bananawinter"],
"ERG.Node.A.2": "HomebaseBannerIcon:brs19_winterfest2021", "ERG.Node.A.2": ["HomebaseBannerIcon:brs19_winterfest2021"],
"ERG.Node.A.3": "AthenaSkyDiveContrail:trails_id_137_turtleneckcrystal", "ERG.Node.A.3": ["AthenaSkyDiveContrail:trails_id_137_turtleneckcrystal"],
"ERG.Node.A.4": "AthenaItemWrap:wrap_429_holidaysweater", "ERG.Node.A.4": ["AthenaItemWrap:wrap_429_holidaysweater"],
"ERG.Node.A.5": "AthenaLoadingScreen:lsid_393_winterfest2021", "ERG.Node.A.5": ["AthenaLoadingScreen:lsid_393_winterfest2021"],
"ERG.Node.A.6": "AthenaMusicPack:musicpack_117_winterfest2021", "ERG.Node.A.6": ["AthenaMusicPack:musicpack_117_winterfest2021"],
"ERG.Node.A.7": "AthenaDance:eid_epicyarn", "ERG.Node.A.7": ["AthenaDance:eid_epicyarn"],
"ERG.Node.A.8": "AthenaCharacter:cid_a_310_athena_commando_F_scholarfestive", "ERG.Node.A.8": ["AthenaCharacter:cid_a_310_athena_commando_F_scholarfestive"],
"ERG.Node.A.9": "AthenaPickaxe:pickaxe_id_731_scholarfestivefemale1h", "ERG.Node.A.9": ["AthenaPickaxe:pickaxe_id_731_scholarfestivefemale1h"],
"ERG.Node.A.10": "AthenaItemWrap:wrap_430_winterlights", "ERG.Node.A.10": ["AthenaItemWrap:wrap_430_winterlights"],
"ERG.Node.A.11": "AthenaDance:spid_346_winterfest_2021", "ERG.Node.A.11": ["AthenaDance:spid_346_winterfest_2021"],
"ERG.Node.A.12": "AthenaPickaxe:pickaxe_ID_732_shovelmale" "ERG.Node.A.12": ["AthenaPickaxe:pickaxe_ID_732_shovelmale"]
}, },
"Season23": { "Season23": {
"ERG.Node.A.1": "AthenaCharacter:character_sportsfashion_winter", "ERG.Node.A.1": ["AthenaCharacter:character_sportsfashion_winter"],
"ERG.Node.B.1": "AthenaCharacter:character_cometdeer", "ERG.Node.B.1": ["AthenaCharacter:character_cometdeer"],
"ERG.Node.A.2": "AthenaGlider:glider_default_jolly", "ERG.Node.A.2": ["AthenaGlider:glider_default_jolly"],
"ERG.Node.A.3": "AthenaDance:eid_dashing", "ERG.Node.A.3": ["AthenaDance:eid_dashing"],
"ERG.Node.A.4": "AthenaDance:spray_guffholidaytree_winterfest2022", "ERG.Node.A.4": ["AthenaDance:spray_guffholidaytree_winterfest2022", "AthenaDance:spray_winterreindeer_winterfest2022", "AthenaDance:spray_defacedsnowman_winterfest2022"],
"ERG.Node.A.5": "AthenaDance:emoji_s23_winterfest_2022", "ERG.Node.A.5": ["AthenaDance:emoji_s23_winterfest_2022"],
"ERG.Node.A.6": "AthenaMusicPack:musicpack_164_redpepper_winterfest", "ERG.Node.A.6": ["AthenaMusicPack:musicpack_164_redpepper_winterfest"],
"ERG.Node.A.7": "AthenaItemWrap:wrap_winter_pal", "ERG.Node.A.7": ["AthenaItemWrap:wrap_winter_pal"],
"ERG.Node.A.8": "AthenaPickaxe:pickaxe_jollytroll", "ERG.Node.A.8": ["AthenaPickaxe:pickaxe_jollytroll"],
"ERG.Node.A.9": "AthenaGlider:glider_jollytroll", "ERG.Node.A.9": ["AthenaGlider:glider_jollytroll"],
"ERG.Node.A.10": "AthenaBackpack:backpack_jollytroll", "ERG.Node.A.10": ["AthenaBackpack:backpack_jollytroll"],
"ERG.Node.A.11": "AthenaMusicPack:musicpack_163_winterfest_2022", "ERG.Node.A.11": ["AthenaMusicPack:musicpack_163_winterfest_2022", "AthenaMusicPack:musicpack_157_radish_nightnight"],
"ERG.Node.A.12": "AthenaItemWrap:wrap_cometwinter", "ERG.Node.A.12": ["AthenaItemWrap:wrap_cometwinter"],
"ERG.Node.A.13": "AthenaSkyDiveContrail:contrail_jollytroll" "ERG.Node.A.13": ["AthenaSkyDiveContrail:contrail_jollytroll"]
} }
} }

View File

@@ -321,111 +321,120 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
var BaseRevision = profile.rvn || 0; var BaseRevision = profile.rvn || 0;
var QueryRevision = req.query.rvn || -1; var QueryRevision = req.query.rvn || -1;
var StatChanged = false; var StatChanged = false;
var CommonCoreChanged = false;
var ItemExists = false; var ItemExists = false;
var Season = "Season" + memory.season; var Season = "Season" + memory.season;
var ID = functions.MakeID();
const GiftID = functions.MakeID(); const GiftID = functions.MakeID();
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[],"level":1,"item_seen":false,"xp":0,"giftedOn":new Date().toISOString(),"params":{"SubGame":"Athena","winterfestGift":"true"},"favorite":false},"quantity":1};
if (req.body.nodeId && req.body.rewardGraphId) { if (req.body.nodeId && req.body.rewardGraphId) {
if (WinterFestIDS[Season][req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) { for (var i = 0; i < WinterFestIDS[Season][req.body.nodeId].length; i++) {
MultiUpdate.push({ var ID = functions.MakeID();
"profileRevision": common_core.rvn || 0, Reward = WinterFestIDS[Season][req.body.nodeId][i]
"profileId": "common_core",
"profileChangesBaseRevision": common_core.rvn || 0,
"profileChanges": [],
"profileCommandRevision": common_core.commandRevision || 0,
})
for (var key in common_core.items) { if (Reward.toLowerCase().startsWith("homebasebannericon:")) {
if (common_core.items[key].templateId.toLowerCase() == WinterFestIDS[Season][req.body.nodeId].toLowerCase()) { if (CommonCoreChanged == false) {
common_core.items[key].attributes.item_seen = false; MultiUpdate.push({
ID = key; "profileRevision": common_core.rvn || 0,
ItemExists = true; "profileId": "common_core",
"profileChangesBaseRevision": common_core.rvn || 0,
"profileChanges": [],
"profileCommandRevision": common_core.commandRevision || 0,
})
CommonCoreChanged = true;
}
for (var key in common_core.items) {
if (common_core.items[key].templateId.toLowerCase() == Reward.toLowerCase()) {
common_core.items[key].attributes.item_seen = false;
ID = key;
ItemExists = true;
MultiUpdate[0].profileChanges.push({
"changeType": "itemAttrChanged",
"itemId": key,
"attributeName": "item_seen",
"attributeValue": common_core.items[key].attributes.item_seen
})
}
}
if (ItemExists == false) {
common_core.items[ID] = {
"templateId": Reward,
"attributes": {
"max_level_bonus": 0,
"level": 1,
"item_seen": false,
"xp": 0,
"variants": [],
"favorite": false
},
"quantity": 1
};
MultiUpdate[0].profileChanges.push({ MultiUpdate[0].profileChanges.push({
"changeType": "itemAttrChanged", "changeType": "itemAdded",
"itemId": key, "itemId": ID,
"attributeName": "item_seen", "item": common_core.items[ID]
"attributeValue": common_core.items[key].attributes.item_seen
}) })
} }
ItemExists = false;
common_core.rvn += 1;
common_core.commandRevision += 1;
MultiUpdate[0].profileRevision = common_core.rvn || 0;
MultiUpdate[0].profileCommandRevision = common_core.commandRevision || 0;
profile.items[GiftID].attributes.lootList.push({"itemType":Reward,"itemGuid":ID,"itemProfile":"common_core","attributes":{"creation_time":new Date().toISOString()},"quantity":1})
} }
if (ItemExists == false) { if (!Reward.toLowerCase().startsWith("homebasebannericon:")) {
common_core.items[ID] = { for (var key in profile.items) {
"templateId": WinterFestIDS[Season][req.body.nodeId], if (profile.items[key].templateId.toLowerCase() == Reward.toLowerCase()) {
"attributes": { profile.items[key].attributes.item_seen = false;
"max_level_bonus": 0, ID = key;
"level": 1, ItemExists = true;
"item_seen": false,
"xp": 0,
"variants": [],
"favorite": false
},
"quantity": 1
};
MultiUpdate[0].profileChanges.push({ ApplyProfileChanges.push({
"changeType": "itemAdded", "changeType": "itemAttrChanged",
"itemId": ID, "itemId": key,
"item": common_core.items[ID] "attributeName": "item_seen",
}) "attributeValue": profile.items[key].attributes.item_seen
} })
}
}
ItemExists = false; if (ItemExists == false) {
profile.items[ID] = {
common_core.rvn += 1; "templateId": Reward,
common_core.commandRevision += 1; "attributes": {
"max_level_bonus": 0,
MultiUpdate[0].profileRevision = common_core.rvn || 0; "level": 1,
MultiUpdate[0].profileCommandRevision = common_core.commandRevision || 0; "item_seen": false,
"xp": 0,
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[{"itemType":WinterFestIDS[Season][req.body.nodeId],"itemGuid":ID,"itemProfile":"common_core","attributes":{"creation_time":new Date().toISOString()},"quantity":1}],"level":1,"item_seen":false,"xp":0,"giftedOn":new Date().toISOString(),"params":{"SubGame":"Athena","winterfestGift":"true"},"favorite":false},"quantity":1}; "variants": [],
} "favorite": false
},
if (!WinterFestIDS[Season][req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) { "quantity": 1
for (var key in profile.items) { };
if (profile.items[key].templateId.toLowerCase() == WinterFestIDS[Season][req.body.nodeId].toLowerCase()) {
profile.items[key].attributes.item_seen = false;
ID = key;
ItemExists = true;
ApplyProfileChanges.push({ ApplyProfileChanges.push({
"changeType": "itemAttrChanged", "changeType": "itemAdded",
"itemId": key, "itemId": ID,
"attributeName": "item_seen", "item": profile.items[ID]
"attributeValue": profile.items[key].attributes.item_seen
}) })
} }
ItemExists = false;
profile.items[GiftID].attributes.lootList.push({"itemType":Reward,"itemGuid":ID,"itemProfile":"athena","attributes":{"creation_time":new Date().toISOString()},"quantity":1})
} }
if (ItemExists == false) {
profile.items[ID] = {
"templateId": WinterFestIDS[Season][req.body.nodeId],
"attributes": {
"max_level_bonus": 0,
"level": 1,
"item_seen": false,
"xp": 0,
"variants": [],
"favorite": false
},
"quantity": 1
};
ApplyProfileChanges.push({
"changeType": "itemAdded",
"itemId": ID,
"item": profile.items[ID]
})
}
ItemExists = false;
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[{"itemType":WinterFestIDS[Season][req.body.nodeId],"itemGuid":ID,"itemProfile":"athena","attributes":{"creation_time":new Date().toISOString()},"quantity":1}],"level":1,"item_seen":false,"xp":0,"giftedOn":new Date().toISOString(),"params":{"SubGame":"Athena","winterfestGift":"true"},"favorite":false},"quantity":1};
} }
profile.items[req.body.rewardGraphId].attributes.reward_keys[0].unlock_keys_used += 1; profile.items[req.body.rewardGraphId].attributes.reward_keys[0].unlock_keys_used += 1;
profile.items[req.body.rewardGraphId].attributes.reward_nodes_claimed.push(req.body.nodeId); profile.items[req.body.rewardGraphId].attributes.reward_nodes_claimed.push(req.body.nodeId);
@@ -457,7 +466,9 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
}) })
fs.writeFileSync(`./profiles/${req.query.profileId || "athena"}.json`, JSON.stringify(profile, null, 2)); fs.writeFileSync(`./profiles/${req.query.profileId || "athena"}.json`, JSON.stringify(profile, null, 2));
fs.writeFileSync("./profiles/common_core.json", JSON.stringify(common_core, null, 2)); if (CommonCoreChanged == true) {
fs.writeFileSync("./profiles/common_core.json", JSON.stringify(common_core, null, 2));
}
} }
// this doesn't work properly on version v12.20 and above but whatever // this doesn't work properly on version v12.20 and above but whatever