diff --git a/src/services/serversideVendorsService.ts b/src/services/serversideVendorsService.ts index 1c947197..c3397414 100644 --- a/src/services/serversideVendorsService.ts +++ b/src/services/serversideVendorsService.ts @@ -23,7 +23,6 @@ import MaskSalesmanManifest from "@/static/fixed_responses/getVendorInfo/MaskSal import Nova1999ConquestShopManifest from "@/static/fixed_responses/getVendorInfo/Nova1999ConquestShopManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; import SolarisDebtTokenVendorRepossessionsManifest from "@/static/fixed_responses/getVendorInfo/SolarisDebtTokenVendorRepossessionsManifest.json"; -import Temple1999VendorManifest from "@/static/fixed_responses/getVendorInfo/Temple1999VendorManifest.json"; import ZarimanCommisionsManifestArchimedean from "@/static/fixed_responses/getVendorInfo/ZarimanCommisionsManifestArchimedean.json"; const rawVendorManifests: IVendorManifest[] = [ @@ -43,7 +42,6 @@ const rawVendorManifests: IVendorManifest[] = [ Nova1999ConquestShopManifest, OstronPetVendorManifest, SolarisDebtTokenVendorRepossessionsManifest, - Temple1999VendorManifest, ZarimanCommisionsManifestArchimedean ]; @@ -297,31 +295,30 @@ const generateVendorManifest = (vendorInfo: IGeneratableVendorInfo): IVendorMani } // Add counted offers - if (manifest.numItems) { - const useRng = manifest.numItems.minValue != manifest.numItems.maxValue; - const numItemsTarget = - numUncountedOffers + - (useRng - ? rng.randomInt(manifest.numItems.minValue, manifest.numItems.maxValue) - : manifest.numItems.minValue); - let i = 0; - while (info.ItemManifest.length + offersToAdd.length < numItemsTarget) { - const item = useRng ? rng.randomElement(manifest.items)! : manifest.items[i++]; - if ( - !item.alwaysOffered && - remainingItemCapacity[getOfferId(item)] != 0 && - (numOffersThatNeedToMatchABin == 0 || missingItemsPerBin[item.bin]) - ) { - remainingItemCapacity[getOfferId(item)] -= 1; - if (missingItemsPerBin[item.bin]) { - missingItemsPerBin[item.bin] -= 1; - numOffersThatNeedToMatchABin -= 1; - } - offersToAdd.splice(offset, 0, item); - } - if (i == manifest.items.length) { - i = 0; + const useRng = manifest.numItems && manifest.numItems.minValue != manifest.numItems.maxValue; + const numItemsTarget = manifest.numItems + ? numUncountedOffers + + (useRng + ? rng.randomInt(manifest.numItems.minValue, manifest.numItems.maxValue) + : manifest.numItems.minValue) + : manifest.items.length; + let i = 0; + while (info.ItemManifest.length + offersToAdd.length < numItemsTarget) { + const item = useRng ? rng.randomElement(manifest.items)! : manifest.items[i++]; + if ( + !item.alwaysOffered && + remainingItemCapacity[getOfferId(item)] != 0 && + (numOffersThatNeedToMatchABin == 0 || missingItemsPerBin[item.bin]) + ) { + remainingItemCapacity[getOfferId(item)] -= 1; + if (missingItemsPerBin[item.bin]) { + missingItemsPerBin[item.bin] -= 1; + numOffersThatNeedToMatchABin -= 1; } + offersToAdd.splice(offset, 0, item); + } + if (i == manifest.items.length) { + i = 0; } } } else { @@ -465,4 +462,10 @@ if (isDev) { ) { logger.warn(`self test failed for /Lotus/Types/Game/VendorManifests/Hubs/RailjackCrewMemberVendorManifest`); } + + const temple = getVendorManifestByTypeName("/Lotus/Types/Game/VendorManifests/TheHex/Temple1999VendorManifest")! + .VendorInfo.ItemManifest; + if (!temple.find(x => x.StoreItem == "/Lotus/StoreItems/Types/Items/MiscItems/Kuva")) { + logger.warn(`self test failed for /Lotus/Types/Game/VendorManifests/TheHex/Temple1999VendorManifest`); + } } diff --git a/static/fixed_responses/getVendorInfo/Temple1999VendorManifest.json b/static/fixed_responses/getVendorInfo/Temple1999VendorManifest.json deleted file mode 100644 index 6309363f..00000000 --- a/static/fixed_responses/getVendorInfo/Temple1999VendorManifest.json +++ /dev/null @@ -1,459 +0,0 @@ -{ - "VendorInfo": { - "_id": { - "$oid": "67dadc30e4b6e0e5979c8d56" - }, - "TypeName": "/Lotus/Types/Game/VendorManifests/TheHex/Temple1999VendorManifest", - "ItemManifest": [ - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TempleBlueprint", - "ItemPrices": [ - { - "ItemCount": 195, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c18c" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TempleSystemsBlueprint", - "ItemPrices": [ - { - "ItemCount": 65, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c18d" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TempleChassisBlueprint", - "ItemPrices": [ - { - "ItemCount": 65, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c18e" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TempleHelmetBlueprint", - "ItemPrices": [ - { - "ItemCount": 65, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c18f" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/Weapons/1999EntHybridPistolBlueprint", - "ItemPrices": [ - { - "ItemCount": 120, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c190" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/Weapons/WeaponParts/1999EntHybridPistolBarrelBlueprint", - "ItemPrices": [ - { - "ItemCount": 60, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c191" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/Weapons/WeaponParts/1999EntHybridPistolReceiverBlueprint", - "ItemPrices": [ - { - "ItemCount": 60, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c192" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Recipes/Weapons/WeaponParts/1999EntHybridPistolStockBlueprint", - "ItemPrices": [ - { - "ItemCount": 60, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c193" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumDrumCoreKitA", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c194" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumDrumCymbalA", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c195" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumDrumFloorTomA", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c196" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumDrumSnareA", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c197" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumEquipmentCaseA", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c198" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumEquipmentCaseB", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c199" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumEquipmentCaseC", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c19a" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumEquipmentCaseD", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c19b" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumEquipmentCaseE", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c19c" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumEquipmentCaseF", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c19d" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/Hollvania/LASxStadiumSynthKeyboardA", - "ItemPrices": [ - { - "ItemCount": 30, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c19e" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/PhotoBooth/Vania/PhotoboothTileVaniaObjTempleDefense", - "ItemPrices": [ - { - "ItemCount": 100, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 1, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "AllowMultipurchase": false, - "Id": { - "$oid": "67dadc30641da66dc5c1c19f" - } - }, - { - "StoreItem": "/Lotus/StoreItems/Types/Items/MiscItems/Kuva", - "ItemPrices": [ - { - "ItemCount": 110, - "ItemType": "/Lotus/Types/Gameplay/1999Wf/Resources/1999ResourceDefense", - "ProductCategory": "MiscItems" - } - ], - "Bin": "BIN_0", - "QuantityMultiplier": 6000, - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - }, - "PurchaseQuantityLimit": 7, - "AllowMultipurchase": true, - "Id": { - "$oid": "67dadc30641da66dc5c1c1a5" - } - } - ], - "PropertyTextHash": "20B13D9EB78FEC80EA32D0687F5BA1AE", - "RequiredGoalTag": "", - "Expiry": { - "$date": { - "$numberLong": "2051240400000" - } - } - } -}