Some crafting fixes

This commit is contained in:
PRO100KatYT
2022-08-04 10:20:17 +02:00
parent 207231028d
commit c7c44e3d99

View File

@@ -2495,23 +2495,33 @@ express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req
Item = JSON.parse(Body); Item = JSON.parse(Body);
var ItemType = 'Weapon:'; var ItemType = 'Weapon:';
var ItemIDType = 'WID'; var ItemIDType = 'WID_';
if (Item.templateId.split("_")[1].split("_")[0].toLowerCase() == "wall") { if (Item.templateId.split("_")[1].split("_")[0].toLowerCase() == "wall") {
ItemType = "Trap:"; ItemType = "Trap:";
ItemIDType = "TID"; ItemIDType = "TID_";
} }
if (Item.templateId.split("_")[1].split("_")[0].toLowerCase() == "floor") { if (Item.templateId.split("_")[1].split("_")[0].toLowerCase() == "floor") {
ItemType = "Trap:"; ItemType = "Trap:";
ItemIDType = "TID"; ItemIDType = "TID_";
} }
if (Item.templateId.split("_")[1].split("_")[0].toLowerCase() == "ceiling") { if (Item.templateId.split("_")[1].split("_")[0].toLowerCase() == "ceiling") {
ItemType = "Trap:"; ItemType = "Trap:";
ItemIDType = "TID"; ItemIDType = "TID_";
}
// Fixes for items that have a slightly different WID from the SID
// Lightning Pistol
if (Item.templateId.toLowerCase().startsWith("schematic:sid_pistol_vacuumtube_auto_")) {
Item.templateId = `Schematic:SID_Pistol_Auto_VacuumTube_${Item.templateId.substring(37)}`
}
// Snowball Launcher
if (Item.templateId.toLowerCase().startsWith("schematic:sid_launcher_grenade_winter_")) {
Item.templateId = `Schematic:SID_Launcher_WinterGrenade_${Item.templateId.substring(38)}`
} }
Item.quantity = req.body.numTimesToCraft || 1;
Item.templateId = Item.templateId.replace(/schematic:/ig, ItemType); Item.templateId = Item.templateId.replace(/schematic:/ig, ItemType);
Item.templateId = Item.templateId.replace(/sid/ig, ItemIDType); Item.templateId = Item.templateId.replace(/sid_/ig, ItemIDType);
Item.quantity = req.body.numTimesToCraft || 1;
if (req.body.targetSchematicTier) { if (req.body.targetSchematicTier) {
switch (req.body.targetSchematicTier.toLowerCase()) { switch (req.body.targetSchematicTier.toLowerCase()) {
@@ -2520,7 +2530,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req
Item.attributes.level = 10; Item.attributes.level = 10;
} }
Item.templateId = Item.templateId.substring(0, Item.templateId.length-3) + "T01" Item.templateId = Item.templateId.substring(0, Item.templateId.length-3) + "T01"
Item.templateId = Item.templateId.replace(/crystal/ig, "Ore") Item.templateId = Item.templateId.replace(/_crystal_/ig, "_Ore_")
break; break;
case "ii": case "ii":
@@ -2528,7 +2538,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req
Item.attributes.level = 20; Item.attributes.level = 20;
} }
Item.templateId = Item.templateId.substring(0, Item.templateId.length-3) + "T02" Item.templateId = Item.templateId.substring(0, Item.templateId.length-3) + "T02"
Item.templateId = Item.templateId.replace(/crystal/ig, "Ore") Item.templateId = Item.templateId.replace(/_crystal_/ig, "_Ore_")
break; break;
case "iii": case "iii":
@@ -2536,7 +2546,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/CraftWorldItem", async (req
Item.attributes.level = 30; Item.attributes.level = 30;
} }
Item.templateId = Item.templateId.substring(0, Item.templateId.length-3) + "T03" Item.templateId = Item.templateId.substring(0, Item.templateId.length-3) + "T03"
Item.templateId = Item.templateId.replace(/crystal/ig, "Ore") Item.templateId = Item.templateId.replace(/_crystal_/ig, "_Ore_")
break; break;
case "iv": case "iv":