forked from OpenWF/SpaceNinjaServer
		
	feat: give skiajati and umbra mods alongside umbra, with max rank and potatoes (#2442)
Not 100% sure if the response format is correct and if this is even the correct time/place to do it, but impossible to say without a log from live. Closes #1054 Reviewed-on: OpenWF/SpaceNinjaServer#2442 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									a35572e306
								
							
						
					
					
						commit
						5a75d88385
					
				@ -14,7 +14,9 @@ import {
 | 
				
			|||||||
    addRecipes,
 | 
					    addRecipes,
 | 
				
			||||||
    occupySlot,
 | 
					    occupySlot,
 | 
				
			||||||
    combineInventoryChanges,
 | 
					    combineInventoryChanges,
 | 
				
			||||||
    addKubrowPetPrint
 | 
					    addKubrowPetPrint,
 | 
				
			||||||
 | 
					    addPowerSuit,
 | 
				
			||||||
 | 
					    addEquipment
 | 
				
			||||||
} from "@/src/services/inventoryService";
 | 
					} from "@/src/services/inventoryService";
 | 
				
			||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
					import { IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
				
			||||||
import { InventorySlot, IPendingRecipeDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					import { InventorySlot, IPendingRecipeDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
@ -22,7 +24,7 @@ import { toOid2 } from "@/src/helpers/inventoryHelpers";
 | 
				
			|||||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
					import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
 | 
				
			||||||
import { IRecipe } from "warframe-public-export-plus";
 | 
					import { IRecipe } from "warframe-public-export-plus";
 | 
				
			||||||
import { config } from "@/src/services/configService";
 | 
					import { config } from "@/src/services/configService";
 | 
				
			||||||
import { IEquipmentClient, Status } from "@/src/types/equipmentTypes";
 | 
					import { EquipmentFeatures, IEquipmentClient, Status } from "@/src/types/equipmentTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface IClaimCompletedRecipeRequest {
 | 
					interface IClaimCompletedRecipeRequest {
 | 
				
			||||||
    RecipeIds: IOid[];
 | 
					    RecipeIds: IOid[];
 | 
				
			||||||
@ -124,17 +126,122 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
 | 
				
			|||||||
            const pet = inventory.KubrowPets.id(pendingRecipe.KubrowPet!)!;
 | 
					            const pet = inventory.KubrowPets.id(pendingRecipe.KubrowPet!)!;
 | 
				
			||||||
            addKubrowPetPrint(inventory, pet, InventoryChanges);
 | 
					            addKubrowPetPrint(inventory, pet, InventoryChanges);
 | 
				
			||||||
        } else if (recipe.secretIngredientAction != "SIA_UNBRAND") {
 | 
					        } else if (recipe.secretIngredientAction != "SIA_UNBRAND") {
 | 
				
			||||||
            InventoryChanges = {
 | 
					            if (recipe.resultType == "/Lotus/Powersuits/Excalibur/ExcaliburUmbra") {
 | 
				
			||||||
                ...InventoryChanges,
 | 
					                // Quite the special case here...
 | 
				
			||||||
                ...(await addItem(
 | 
					                // We don't just get Umbra, but also Skiajati and Umbra Mods. Both items are max rank, potatoed, and with the mods are pre-installed.
 | 
				
			||||||
 | 
					                // Source: https://wiki.warframe.com/w/The_Sacrifice, https://wiki.warframe.com/w/Excalibur/Umbra, https://wiki.warframe.com/w/Skiajati
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                const umbraModA = (
 | 
				
			||||||
 | 
					                    await addItem(
 | 
				
			||||||
 | 
					                        inventory,
 | 
				
			||||||
 | 
					                        "/Lotus/Upgrades/Mods/Sets/Umbra/WarframeUmbraModA",
 | 
				
			||||||
 | 
					                        1,
 | 
				
			||||||
 | 
					                        false,
 | 
				
			||||||
 | 
					                        undefined,
 | 
				
			||||||
 | 
					                        `{"lvl":5}`
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                ).Upgrades![0];
 | 
				
			||||||
 | 
					                const umbraModB = (
 | 
				
			||||||
 | 
					                    await addItem(
 | 
				
			||||||
 | 
					                        inventory,
 | 
				
			||||||
 | 
					                        "/Lotus/Upgrades/Mods/Sets/Umbra/WarframeUmbraModB",
 | 
				
			||||||
 | 
					                        1,
 | 
				
			||||||
 | 
					                        false,
 | 
				
			||||||
 | 
					                        undefined,
 | 
				
			||||||
 | 
					                        `{"lvl":5}`
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                ).Upgrades![0];
 | 
				
			||||||
 | 
					                const umbraModC = (
 | 
				
			||||||
 | 
					                    await addItem(
 | 
				
			||||||
 | 
					                        inventory,
 | 
				
			||||||
 | 
					                        "/Lotus/Upgrades/Mods/Sets/Umbra/WarframeUmbraModC",
 | 
				
			||||||
 | 
					                        1,
 | 
				
			||||||
 | 
					                        false,
 | 
				
			||||||
 | 
					                        undefined,
 | 
				
			||||||
 | 
					                        `{"lvl":5}`
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                ).Upgrades![0];
 | 
				
			||||||
 | 
					                const sacrificeModA = (
 | 
				
			||||||
 | 
					                    await addItem(
 | 
				
			||||||
 | 
					                        inventory,
 | 
				
			||||||
 | 
					                        "/Lotus/Upgrades/Mods/Sets/Sacrifice/MeleeSacrificeModA",
 | 
				
			||||||
 | 
					                        1,
 | 
				
			||||||
 | 
					                        false,
 | 
				
			||||||
 | 
					                        undefined,
 | 
				
			||||||
 | 
					                        `{"lvl":5}`
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                ).Upgrades![0];
 | 
				
			||||||
 | 
					                const sacrificeModB = (
 | 
				
			||||||
 | 
					                    await addItem(
 | 
				
			||||||
 | 
					                        inventory,
 | 
				
			||||||
 | 
					                        "/Lotus/Upgrades/Mods/Sets/Sacrifice/MeleeSacrificeModB",
 | 
				
			||||||
 | 
					                        1,
 | 
				
			||||||
 | 
					                        false,
 | 
				
			||||||
 | 
					                        undefined,
 | 
				
			||||||
 | 
					                        `{"lvl":5}`
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                ).Upgrades![0];
 | 
				
			||||||
 | 
					                InventoryChanges.Upgrades ??= [];
 | 
				
			||||||
 | 
					                InventoryChanges.Upgrades.push(umbraModA, umbraModB, umbraModC, sacrificeModA, sacrificeModB);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                await addPowerSuit(
 | 
				
			||||||
                    inventory,
 | 
					                    inventory,
 | 
				
			||||||
                    recipe.resultType,
 | 
					                    "/Lotus/Powersuits/Excalibur/ExcaliburUmbra",
 | 
				
			||||||
                    recipe.num,
 | 
					                    {
 | 
				
			||||||
                    false,
 | 
					                        Configs: [
 | 
				
			||||||
                    undefined,
 | 
					                            {
 | 
				
			||||||
                    pendingRecipe.TargetFingerprint
 | 
					                                Upgrades: [
 | 
				
			||||||
                ))
 | 
					                                    "",
 | 
				
			||||||
            };
 | 
					                                    "",
 | 
				
			||||||
 | 
					                                    "",
 | 
				
			||||||
 | 
					                                    "",
 | 
				
			||||||
 | 
					                                    "",
 | 
				
			||||||
 | 
					                                    umbraModA.ItemId.$oid,
 | 
				
			||||||
 | 
					                                    umbraModB.ItemId.$oid,
 | 
				
			||||||
 | 
					                                    umbraModC.ItemId.$oid
 | 
				
			||||||
 | 
					                                ]
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        ],
 | 
				
			||||||
 | 
					                        XP: 900_000,
 | 
				
			||||||
 | 
					                        Features: EquipmentFeatures.DOUBLE_CAPACITY
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                    InventoryChanges
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                inventory.XPInfo.push({
 | 
				
			||||||
 | 
					                    ItemType: "/Lotus/Powersuits/Excalibur/ExcaliburUmbra",
 | 
				
			||||||
 | 
					                    XP: 900_000
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                addEquipment(
 | 
				
			||||||
 | 
					                    inventory,
 | 
				
			||||||
 | 
					                    "Melee",
 | 
				
			||||||
 | 
					                    "/Lotus/Weapons/Tenno/Melee/Swords/UmbraKatana/UmbraKatana",
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Configs: [
 | 
				
			||||||
 | 
					                            { Upgrades: ["", "", "", "", "", "", sacrificeModA.ItemId.$oid, sacrificeModB.ItemId.$oid] }
 | 
				
			||||||
 | 
					                        ],
 | 
				
			||||||
 | 
					                        XP: 450_000,
 | 
				
			||||||
 | 
					                        Features: EquipmentFeatures.DOUBLE_CAPACITY
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                    InventoryChanges
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                inventory.XPInfo.push({
 | 
				
			||||||
 | 
					                    ItemType: "/Lotus/Weapons/Tenno/Melee/Swords/UmbraKatana/UmbraKatana",
 | 
				
			||||||
 | 
					                    XP: 450_000
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                InventoryChanges = {
 | 
				
			||||||
 | 
					                    ...InventoryChanges,
 | 
				
			||||||
 | 
					                    ...(await addItem(
 | 
				
			||||||
 | 
					                        inventory,
 | 
				
			||||||
 | 
					                        recipe.resultType,
 | 
				
			||||||
 | 
					                        recipe.num,
 | 
				
			||||||
 | 
					                        false,
 | 
				
			||||||
 | 
					                        undefined,
 | 
				
			||||||
 | 
					                        pendingRecipe.TargetFingerprint
 | 
				
			||||||
 | 
					                    ))
 | 
				
			||||||
 | 
					                };
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (
 | 
					        if (
 | 
				
			||||||
            config.claimingBlueprintRefundsIngredients &&
 | 
					            config.claimingBlueprintRefundsIngredients &&
 | 
				
			||||||
 | 
				
			|||||||
@ -482,11 +482,14 @@ export const addItem = async (
 | 
				
			|||||||
            if (quantity != 1) {
 | 
					            if (quantity != 1) {
 | 
				
			||||||
                logger.warn(`adding 1 of ${typeName} ${targetFingerprint} even tho quantity ${quantity} was requested`);
 | 
					                logger.warn(`adding 1 of ${typeName} ${targetFingerprint} even tho quantity ${quantity} was requested`);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            inventory.Upgrades.push({
 | 
					            const upgrade =
 | 
				
			||||||
                ItemType: typeName,
 | 
					                inventory.Upgrades[
 | 
				
			||||||
                UpgradeFingerprint: targetFingerprint
 | 
					                    inventory.Upgrades.push({
 | 
				
			||||||
            });
 | 
					                        ItemType: typeName,
 | 
				
			||||||
            return {}; // there's not exactly a common "InventoryChanges" format for these
 | 
					                        UpgradeFingerprint: targetFingerprint
 | 
				
			||||||
 | 
					                    }) - 1
 | 
				
			||||||
 | 
					                ];
 | 
				
			||||||
 | 
					            return { Upgrades: [upgrade.toJSON<IUpgradeClient>()] };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        const changes = [
 | 
					        const changes = [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
				
			|||||||
@ -8,7 +8,8 @@ import {
 | 
				
			|||||||
    IRecentVendorPurchaseClient,
 | 
					    IRecentVendorPurchaseClient,
 | 
				
			||||||
    TEquipmentKey,
 | 
					    TEquipmentKey,
 | 
				
			||||||
    ICrewMemberClient,
 | 
					    ICrewMemberClient,
 | 
				
			||||||
    IKubrowPetPrintClient
 | 
					    IKubrowPetPrintClient,
 | 
				
			||||||
 | 
					    IUpgradeClient
 | 
				
			||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export enum PurchaseSource {
 | 
					export enum PurchaseSource {
 | 
				
			||||||
@ -80,6 +81,7 @@ export type IInventoryChanges = {
 | 
				
			|||||||
    RecentVendorPurchases?: IRecentVendorPurchaseClient; // < 38.5.0
 | 
					    RecentVendorPurchases?: IRecentVendorPurchaseClient; // < 38.5.0
 | 
				
			||||||
    CrewMembers?: ICrewMemberClient[];
 | 
					    CrewMembers?: ICrewMemberClient[];
 | 
				
			||||||
    KubrowPetPrints?: IKubrowPetPrintClient[];
 | 
					    KubrowPetPrints?: IKubrowPetPrintClient[];
 | 
				
			||||||
 | 
					    Upgrades?: IUpgradeClient[]; // TOVERIFY
 | 
				
			||||||
} & Record<
 | 
					} & Record<
 | 
				
			||||||
        Exclude<
 | 
					        Exclude<
 | 
				
			||||||
            string,
 | 
					            string,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user