Merge pull request #76 from PRO100KatYT/main

Item Transform
This commit is contained in:
Lawin0129
2022-04-03 16:25:20 +01:00
committed by GitHub
6 changed files with 4632 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.
[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]
# 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
- Support a Creator with specific codes
- Fully working daily challenges system (New daily challenge every day, replacing daily challenges, etc...)
- Item transformation
### Battle Royale:
- CloudStorage and ClientSettings (Settings saving)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1955,6 +1955,94 @@ express.post("/fortnite/api/game/v2/profile/*/client/PromoteItem", async (req, r
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`);
var transformItemIDS = require("./../responses/transformItemIDS.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 && req.body.transmogKeyTemplateId) {
for (var i in req.body.sacrificeItemIds) {
var id = req.body.sacrificeItemIds[i];
delete profile.items[id];
ApplyProfileChanges.push({
"changeType": "itemRemoved",
"itemId": id
})
}
if (transformItemIDS.hasOwnProperty(req.body.transmogKeyTemplateId)) {
transformItemIDS = transformItemIDS[req.body.transmogKeyTemplateId]
}
else {
transformItemIDS = require("./../responses/ItemIDS.json");
}
StatChanged = true;
}
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
const randomNumber = Math.floor(Math.random() * transformItemIDS.length);
const ID = functions.MakeID();
var Item = {"templateId":transformItemIDS[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)
express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req, res) => {
functions.GetVersionInfo(req, memory);