Added StW Item Transform

This commit is contained in:
PRO100KatYT
2022-04-02 12:19:15 +02:00
parent 915bf3d2bb
commit a70ff30031
3 changed files with 83 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ bUseConfigDisplayName=false # If this is set to false, it will use the email to
displayName=LawinServer # Your fortnite display name. displayName=LawinServer # Your fortnite display name.
[Profile] [Profile]
bCompletedSeasonalQuests=false # If this is set to true, every seasonal quest will be on complete. Works from Season 3 to Season 18. bCompletedSeasonalQuests=false # If this is set to true, every seasonal quest will be on complete. Works from Season 3 to Season 19.
[GameServer] [GameServer]
# Matchmaker gameserver config, you can use this to connect to gameservers like rift (titanium), fortmp, etc... (they have to be hosting though). # Matchmaker gameserver config, you can use this to connect to gameservers like rift (titanium), fortmp, etc... (they have to be hosting though).

View File

@@ -40,6 +40,7 @@
- Changing items edit styles - Changing items edit styles
- Support a Creator with specific codes - Support a Creator with specific codes
- Fully working daily challenges system (New daily challenge every day, replacing daily challenges, etc...) - Fully working daily challenges system (New daily challenge every day, replacing daily challenges, etc...)
- Item transformation
### Battle Royale: ### Battle Royale:
- CloudStorage and ClientSettings (Settings saving) - CloudStorage and ClientSettings (Settings saving)

View File

@@ -1955,6 +1955,87 @@ express.post("/fortnite/api/game/v2/profile/*/client/PromoteItem", async (req, r
res.end(); res.end();
}); });
// Transform items STW
express.post("/fortnite/api/game/v2/profile/*/client/TransmogItem", async (req, res) => {
const profile = require(`./../profiles/${req.query.profileId || "campaign"}.json`);
const ItemIDS = require("./../responses/ItemIDS.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;
if (req.body.sacrificeItemIds) {
for (var i in req.body.sacrificeItemIds) {
var id = req.body.sacrificeItemIds[i];
delete profile.items[id];
ApplyProfileChanges.push({
"changeType": "itemRemoved",
"itemId": id
})
}
StatChanged = true;
}
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
const randomNumber = Math.floor(Math.random() * ItemIDS.length);
const ID = functions.MakeID();
var Item = {"templateId":ItemIDS[randomNumber],"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":1};
profile.items[ID] = Item
Notifications.push({
"type": "transmogResult",
"primary": true,
"transmoggedItems": [
{
"itemType": profile.items[ID].templateId,
"itemGuid": ID,
"itemProfile": req.query.profileId || "campaign",
"attributes": profile.items[ID].attributes,
"quantity": 1
}
]
})
ApplyProfileChanges.push({
"changeType": "itemAdded",
"itemId": ID,
"item": Item
})
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();
});
// Craft item STW (Guns, melees and traps only) // Craft item STW (Guns, melees and traps only)
express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req, res) => {
functions.GetVersionInfo(req, memory); functions.GetVersionInfo(req, memory);