don't randomise the free stickers pack
All checks were successful
Build / build (18) (push) Successful in 42s
Build / build (20) (push) Successful in 1m7s
Build / build (22) (push) Successful in 1m17s
Build / build (20) (pull_request) Successful in 1m9s
Build / build (18) (pull_request) Successful in 42s
Build / build (22) (pull_request) Successful in 1m25s

This commit is contained in:
Sainan 2025-03-23 01:23:08 +01:00
parent 88982efc90
commit 15e1586ae8

View File

@ -415,16 +415,26 @@ const handleBoosterPackPurchase = async (
"attempt to roll over 100 booster packs in a single go. possible but unlikely to be desirable for the user or the server."
);
}
for (let i = 0; i != quantity; ++i) {
for (const weights of pack.rarityWeightsPerRoll) {
const result = getRandomWeightedRewardUc(pack.components, weights);
if (result) {
logger.debug(`booster pack rolled`, result);
purchaseResponse.BoosterPackItems += toStoreItem(result.Item) + ',{"lvl":0};';
combineInventoryChanges(
purchaseResponse.InventoryChanges,
(await addItem(inventory, result.Item, 1)).InventoryChanges
);
if (typeName == "/Lotus/Types/BoosterPacks/1999StickersPackEchoesArchimedeaFixed") {
for (const result of pack.components) {
purchaseResponse.BoosterPackItems += toStoreItem(result.Item) + ',{"lvl":0};';
combineInventoryChanges(
purchaseResponse.InventoryChanges,
(await addItem(inventory, result.Item, 1)).InventoryChanges
);
}
} else {
for (let i = 0; i != quantity; ++i) {
for (const weights of pack.rarityWeightsPerRoll) {
const result = getRandomWeightedRewardUc(pack.components, weights);
if (result) {
logger.debug(`booster pack rolled`, result);
purchaseResponse.BoosterPackItems += toStoreItem(result.Item) + ',{"lvl":0};';
combineInventoryChanges(
purchaseResponse.InventoryChanges,
(await addItem(inventory, result.Item, 1)).InventoryChanges
);
}
}
}
}