From 295e8e55adc5ed1c15e4aa8f718820928becf297 Mon Sep 17 00:00:00 2001 From: gc <30398469+gc@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:14:45 +1100 Subject: [PATCH] Crate spawn fixes --- src/lib/util/handleCrateSpawns.ts | 8 ++++++-- src/lib/util/handleTripFinish.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/util/handleCrateSpawns.ts b/src/lib/util/handleCrateSpawns.ts index 8675b1ea15..eacba64caa 100644 --- a/src/lib/util/handleCrateSpawns.ts +++ b/src/lib/util/handleCrateSpawns.ts @@ -2,10 +2,11 @@ import { Time, reduceNumByPercent, roll } from 'e'; import { Bank, resolveItems } from 'oldschooljs'; import getOSItem from './getOSItem'; +import { itemNameFromID } from './smallUtils'; const crateItem = getOSItem('Sinister crate (s7)'); -export function handleCrateSpawns(user: MUser, duration: number) { +export function handleCrateSpawns(user: MUser, duration: number, messages?: string[]) { const accountAge = user.accountAgeInDays(); let dropratePerMinute = 50 * 60; if (accountAge) { @@ -31,7 +32,10 @@ export function handleCrateSpawns(user: MUser, duration: number) { 'Cob' ]); if (hweenPets.some(pet => user.usingPet(pet))) { - dropratePerMinute = Math.ceil(dropratePerMinute / 5); + dropratePerMinute = Math.ceil(dropratePerMinute / 10); + if (messages) { + messages.push(`10x higher droprates for ${itemNameFromID(user.user.minion_equippedPet!)}`); + } } if (user.isIronman) { diff --git a/src/lib/util/handleTripFinish.ts b/src/lib/util/handleTripFinish.ts index ab8ec06726..c3d8729725 100644 --- a/src/lib/util/handleTripFinish.ts +++ b/src/lib/util/handleTripFinish.ts @@ -331,7 +331,7 @@ const tripFinishEffects: TripFinishEffect[] = [ { name: 'Crate Spawns', fn: async ({ data, messages, user }) => { - const crateRes = handleCrateSpawns(user, data.duration); + const crateRes = handleCrateSpawns(user, data.duration, messages); if (crateRes && crateRes.length > 0) { messages.push(bold(`You found ${crateRes}!`)); return {