mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 02:42:22 +01:00
33
index.js
33
index.js
@@ -1393,11 +1393,14 @@ express.post("/fortnite/api/game/v2/profile/*/client/PurchaseHomebaseNode", asyn
|
||||
res.end();
|
||||
});
|
||||
|
||||
// Open gift 19.01
|
||||
// Open Winterfest presents (11.31 & 19.01)
|
||||
express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (req, res) => {
|
||||
const profile = require(`./profiles/${req.query.profileId || "athena"}.json`);
|
||||
const common_core = require("./profiles/common_core.json");
|
||||
const WinterFestIDS = require("./responses/winterfest2021rewards.json");
|
||||
const WinterFestIDS = require("./responses/winterfestrewards.json");
|
||||
const seasondata = require("./season.json");
|
||||
const seasonchecker = require("./seasonchecker.js");
|
||||
seasonchecker(req, seasondata);
|
||||
|
||||
// do not change any of these or you will end up breaking it
|
||||
var ApplyProfileChanges = [];
|
||||
@@ -1405,12 +1408,13 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
||||
var BaseRevision = profile.rvn || 0;
|
||||
var QueryRevision = req.query.rvn || -1;
|
||||
var StatChanged = false;
|
||||
var Season = "Season" + seasondata.season;
|
||||
|
||||
const ID = makeid();
|
||||
const GiftID = makeid();
|
||||
|
||||
if (req.body.nodeId && req.body.rewardGraphId) {
|
||||
if (WinterFestIDS[req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) {
|
||||
if (WinterFestIDS[Season][req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) {
|
||||
MultiUpdate.push({
|
||||
"profileRevision": common_core.rvn || 0,
|
||||
"profileId": "common_core",
|
||||
@@ -1420,7 +1424,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
||||
})
|
||||
|
||||
common_core.items[ID] = {
|
||||
"templateId": WinterFestIDS[req.body.nodeId],
|
||||
"templateId": WinterFestIDS[Season][req.body.nodeId],
|
||||
"attributes": {
|
||||
"max_level_bonus": 0,
|
||||
"level": 1,
|
||||
@@ -1445,9 +1449,9 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
||||
MultiUpdate[0].profileCommandRevision = common_core.commandRevision || 0;
|
||||
}
|
||||
|
||||
if (!WinterFestIDS[req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) {
|
||||
if (!WinterFestIDS[Season][req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) {
|
||||
profile.items[ID] = {
|
||||
"templateId": WinterFestIDS[req.body.nodeId],
|
||||
"templateId": WinterFestIDS[Season][req.body.nodeId],
|
||||
"attributes": {
|
||||
"max_level_bonus": 0,
|
||||
"level": 1,
|
||||
@@ -1466,7 +1470,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
||||
})
|
||||
}
|
||||
|
||||
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[{"itemType":WinterFestIDS[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[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_nodes_claimed.push(req.body.nodeId);
|
||||
|
||||
@@ -1532,6 +1536,21 @@ express.post("/fortnite/api/game/v2/profile/*/client/RemoveGiftBox", async (req,
|
||||
var QueryRevision = req.query.rvn || -1;
|
||||
var StatChanged = false;
|
||||
|
||||
// Gift box ID on 11.31
|
||||
if (req.body.giftBoxItemId) {
|
||||
var id = req.body.giftBoxItemId;
|
||||
|
||||
delete profile.items[id];
|
||||
|
||||
ApplyProfileChanges.push({
|
||||
"changeType": "itemRemoved",
|
||||
"itemId": id
|
||||
})
|
||||
|
||||
StatChanged = true;
|
||||
}
|
||||
|
||||
// Gift box ID on 19.01
|
||||
if (req.body.giftBoxItemIds) {
|
||||
for (var i = 0; i < req.body.giftBoxItemIds.length; i++) {
|
||||
var id = req.body.giftBoxItemIds[i];
|
||||
|
||||
@@ -3195,7 +3195,7 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"GIFTS": {
|
||||
"S19_GIFTS": {
|
||||
"templateId": "AthenaRewardGraph:s19_winterfest",
|
||||
"attributes": {
|
||||
"reward_nodes_claimed": [],
|
||||
@@ -3217,7 +3217,7 @@
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"GIFT_KEY": {
|
||||
"S19_GIFT_KEY": {
|
||||
"templateId": "Token:athena_s19_winterfest_key",
|
||||
"attributes": {
|
||||
"max_level_bonus": 0,
|
||||
@@ -3228,6 +3228,39 @@
|
||||
},
|
||||
"quantity": 14
|
||||
},
|
||||
"S11_GIFTS": {
|
||||
"templateId": "AthenaRewardGraph:winterfest",
|
||||
"attributes": {
|
||||
"reward_nodes_claimed": [],
|
||||
"unlock_epoch": "2021-12-16T13:52:10.000Z",
|
||||
"unlock_keys_used": 0,
|
||||
"player_random_seed": -2143043306,
|
||||
"item_seen": false,
|
||||
"player_state": [],
|
||||
"reward_graph_purchased_timestamp": 1639693875638,
|
||||
"reward_graph_purchased": true,
|
||||
"reward_keys": [
|
||||
{
|
||||
"static_key_template_id": "Token:athenawinterfest_key",
|
||||
"static_key_max_count": 14,
|
||||
"static_key_initial_count": 1,
|
||||
"unlock_keys_used": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"quantity": 1
|
||||
},
|
||||
"S11_GIFT_KEY": {
|
||||
"templateId": "Token:athenawinterfest_key",
|
||||
"attributes": {
|
||||
"max_level_bonus": 0,
|
||||
"level": 1,
|
||||
"item_seen": false,
|
||||
"xp": 0,
|
||||
"favorite": false
|
||||
},
|
||||
"quantity": 14
|
||||
},
|
||||
"AthenaMusicPack:MusicPack_013_RoboTrack": {
|
||||
"templateId": "AthenaMusicPack:MusicPack_013_RoboTrack",
|
||||
"attributes": {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"author": "List made by PRO100KatYT",
|
||||
"ERG.Node.B.1": "AthenaDance:emoji_s19_animwinterfest2021",
|
||||
"ERG.Node.C.1": "AthenaGlider:glider_id_335_logarithm_40qgl",
|
||||
"ERG.Node.A.2": "HomebaseBannerIcon:brs19_winterfest2021",
|
||||
"ERG.Node.A.3": "AthenaSkyDiveContrail:trails_id_137_turtleneckcrystal",
|
||||
"ERG.Node.A.4": "AthenaItemWrap:wrap_429_holidaysweater",
|
||||
"ERG.Node.A.5": "AthenaLoadingScreen:lsid_393_winterfest2021",
|
||||
"ERG.Node.A.6": "AthenaMusicPack:musicpack_117_winterfest2021",
|
||||
"ERG.Node.A.7": "AthenaDance:eid_epicyarn",
|
||||
"ERG.Node.A.8": "AthenaCharacter:cid_a_310_athena_commando_F_scholarfestive",
|
||||
"ERG.Node.A.9": "AthenaPickaxe:pickaxe_id_731_scholarfestivefemale1h",
|
||||
"ERG.Node.A.10": "AthenaItemWrap:wrap_430_winterlights",
|
||||
"ERG.Node.A.11": "AthenaDance:spid_346_winterfest_2021",
|
||||
"ERG.Node.A.12": "AthenaPickaxe:pickaxe_ID_732_shovelmale"
|
||||
}
|
||||
36
responses/winterfestrewards.json
Normal file
36
responses/winterfestrewards.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"author": "List made by PRO100KatYT",
|
||||
"Season11": {
|
||||
"ERG.Node.A.1": "AthenaCharacter:cid_645_athena_commando_f_wolly",
|
||||
"ERG.Node.B.1": "AthenaGlider:glider_id_188_galileorocket_g7oki",
|
||||
"ERG.Node.C.1": "AthenaBackpack:bid_430_galileospeedboat_9rxe3",
|
||||
"ERG.Node.D.1": "AthenaCharacter:cid_643_athena_commando_m_ornamentsoldier",
|
||||
"ERG.Node.A.2": "AthenaPickaxe:pickaxe_id_329_gingerbreadcookie1h",
|
||||
"ERG.Node.A.3": "AthenaPickaxe:pickaxe_id_332_mintminer",
|
||||
"ERG.Node.A.4": "AthenaDance:eid_snowglobe",
|
||||
"ERG.Node.A.5": "AthenaGlider:glider_id_191_pinetree",
|
||||
"ERG.Node.A.6": "AthenaItemWrap:wrap_188_wrappingpaper",
|
||||
"ERG.Node.A.7": "AthenaItemWrap:wrap_183_newyear2020",
|
||||
"ERG.Node.A.8": "AthenaSkyDiveContrail:trails_id_082_holidaygarland",
|
||||
"ERG.Node.A.9": "AthenaMusicPack:musicpack_040_xmaschiptunes",
|
||||
"ERG.Node.A.10": "AthenaLoadingScreen:lsid_208_smpattern",
|
||||
"ERG.Node.A.11": "AthenaLoadingScreen:lsid_209_akcrackshot"
|
||||
},
|
||||
"Season19": {
|
||||
"ERG.Node.A.1": "Token:14daysoffortnite_small_giftbox",
|
||||
"ERG.Node.B.1": "AthenaDance:emoji_s19_animwinterfest2021",
|
||||
"ERG.Node.C.1": "AthenaGlider:glider_id_335_logarithm_40qgl",
|
||||
"ERG.Node.D.1": "AthenaCharacter:cid_a_323_athena_commando_m_bananawinter",
|
||||
"ERG.Node.A.2": "HomebaseBannerIcon:brs19_winterfest2021",
|
||||
"ERG.Node.A.3": "AthenaSkyDiveContrail:trails_id_137_turtleneckcrystal",
|
||||
"ERG.Node.A.4": "AthenaItemWrap:wrap_429_holidaysweater",
|
||||
"ERG.Node.A.5": "AthenaLoadingScreen:lsid_393_winterfest2021",
|
||||
"ERG.Node.A.6": "AthenaMusicPack:musicpack_117_winterfest2021",
|
||||
"ERG.Node.A.7": "AthenaDance:eid_epicyarn",
|
||||
"ERG.Node.A.8": "AthenaCharacter:cid_a_310_athena_commando_F_scholarfestive",
|
||||
"ERG.Node.A.9": "AthenaPickaxe:pickaxe_id_731_scholarfestivefemale1h",
|
||||
"ERG.Node.A.10": "AthenaItemWrap:wrap_430_winterlights",
|
||||
"ERG.Node.A.11": "AthenaDance:spid_346_winterfest_2021",
|
||||
"ERG.Node.A.12": "AthenaPickaxe:pickaxe_ID_732_shovelmale"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user