From c3f8ceedbdc12eeef205451ac345893bd7ac321f Mon Sep 17 00:00:00 2001 From: gc <30398469+gc@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:06:00 +1100 Subject: [PATCH] commit --- src/lib/data/globalDroprates.ts | 9 ++++++++ .../data/killableMonsters/custom/SunMoon.ts | 6 ++++- src/lib/skilling/skills/farming/zygomites.ts | 21 +++++++++++++---- src/lib/skilling/types.ts | 2 +- src/lib/util/handleTripFinish.ts | 15 ++++++++---- src/mahoji/commands/rates.ts | 23 ++++++++++++++++++- src/tasks/minions/farmingActivity.ts | 4 ++-- 7 files changed, 66 insertions(+), 14 deletions(-) diff --git a/src/lib/data/globalDroprates.ts b/src/lib/data/globalDroprates.ts index cd9e0167c9..9378d6d1fa 100644 --- a/src/lib/data/globalDroprates.ts +++ b/src/lib/data/globalDroprates.ts @@ -116,5 +116,14 @@ export const globalDroprates = { rolledPer: 'kill', notes: ['Received from killing Vladimir Drakan'], item: getOSItem('Echo') + }, + fungo: { + name: 'Fungo (pet)', + baseRate: 50, + clIncrease: 1.5, + minLength: false, + rolledPer: 'harvest', + notes: ['Received from harvesting any planted zygomite'], + item: getOSItem('Fungo') } }; diff --git a/src/lib/minions/data/killableMonsters/custom/SunMoon.ts b/src/lib/minions/data/killableMonsters/custom/SunMoon.ts index 58dff549db..dab08985f3 100644 --- a/src/lib/minions/data/killableMonsters/custom/SunMoon.ts +++ b/src/lib/minions/data/killableMonsters/custom/SunMoon.ts @@ -97,7 +97,11 @@ export const Celestara: CustomMonster = { aliases: ['celestara'], timeToFinish: Time.Minute * 100, hp: 3330, - table: new LootTable().every('Lunite', [10, 60]).tertiary(300, 'Moonlight essence').tertiary(300, 'Noom'), + table: new LootTable() + .every('Lunite', [10, 60]) + .tertiary(300, 'Moonlight essence') + .tertiary(300, 'Moondash charm') + .tertiary(300, 'Noom'), difficultyRating: 5, qpRequired: 1500, healAmountNeeded: 250 * 200, diff --git a/src/lib/skilling/skills/farming/zygomites.ts b/src/lib/skilling/skills/farming/zygomites.ts index e0ca673b39..71ab2b004d 100644 --- a/src/lib/skilling/skills/farming/zygomites.ts +++ b/src/lib/skilling/skills/farming/zygomites.ts @@ -2,10 +2,15 @@ import { roll } from 'e'; import { Bank, LootTable } from 'oldschooljs'; import { MysteryBoxes } from '../../../bsoOpenables'; +import { globalDroprates } from '../../../data/globalDroprates'; +import { clAdjustedDroprate } from '../../../util'; import getOSItem from '../../../util/getOSItem'; import resolveItems from '../../../util/resolveItems'; import { Plant } from '../../types'; +export const zygomiteSeedMutChance = 10; +export const zygomiteMutSurvivalChance = 19; + export const zygomiteFarmingSource = [ { name: 'Herbal zygomite', @@ -75,10 +80,18 @@ export const zygomitePlants: Plant[] = zygomiteFarmingSource.map(src => ({ additionalPatchesByFarmGuildAndLvl: [], timePerPatchTravel: 10, timePerHarvest: 5, - onHarvest: ({ loot }) => { - loot.add(src.lootTable.roll()); - if (roll(1000)) { - loot.add('Fungo'); + onHarvest: ({ loot, user, quantity }) => { + const dropRate = clAdjustedDroprate( + user, + 'Fungo', + globalDroprates.fungo.baseRate, + globalDroprates.fungo.clIncrease + ); + for (let i = 0; i < quantity; i++) { + loot.add(src.lootTable.roll()); + if (roll(dropRate)) { + loot.add('Fungo'); + } } } })); diff --git a/src/lib/skilling/types.ts b/src/lib/skilling/types.ts index b51cb9da45..670f85d522 100644 --- a/src/lib/skilling/types.ts +++ b/src/lib/skilling/types.ts @@ -277,7 +277,7 @@ export interface Plant { additionalPatchesByFarmGuildAndLvl: number[][]; timePerPatchTravel: number; timePerHarvest: number; - onHarvest?: (options: { user: MUser; loot: Bank }) => unknown; + onHarvest?: (options: { user: MUser; loot: Bank; quantity: number }) => unknown; } export enum HunterTechniqueEnum { diff --git a/src/lib/util/handleTripFinish.ts b/src/lib/util/handleTripFinish.ts index 87219eab8e..0d2d37714e 100644 --- a/src/lib/util/handleTripFinish.ts +++ b/src/lib/util/handleTripFinish.ts @@ -23,7 +23,11 @@ import { mysteriousStepData } from '../mysteryTrail'; import { triggerRandomEvent } from '../randomEvents'; import { RuneTable, WilvusTable, WoodTable } from '../simulation/seedTable'; import { DougTable, PekyTable } from '../simulation/sharedTables'; -import { zygomiteFarmingSource } from '../skilling/skills/farming/zygomites'; +import { + zygomiteFarmingSource, + zygomiteMutSurvivalChance, + zygomiteSeedMutChance +} from '../skilling/skills/farming/zygomites'; import { SkillsEnum } from '../skilling/types'; import { getUsersCurrentSlayerInfo } from '../slayer/slayerUtil'; import { ActivityTaskData } from '../types/minions'; @@ -440,12 +444,13 @@ const tripFinishEffects: TripFinishEffect[] = [ const minutes = Math.floor(data.duration / Time.Minute); if (minutes < 1) return; for (let i = 0; i < minutes; i++) { - if (roll(766)) { - loot.add(randomZyg.seedItem); - } - if (roll(10)) { + if (roll(zygomiteSeedMutChance)) { const ownedSeed = shuffleArr(randomZyg.mutatedFromItems).find(seed => user.bank.has(seed)); cost.add(ownedSeed); + + if (roll(zygomiteMutSurvivalChance)) { + loot.add(randomZyg.seedItem); + } } } diff --git a/src/mahoji/commands/rates.ts b/src/mahoji/commands/rates.ts index 446fa7d0c7..5a3e509768 100644 --- a/src/mahoji/commands/rates.ts +++ b/src/mahoji/commands/rates.ts @@ -15,6 +15,7 @@ import { calcMaxFloorUserCanDo, numberOfGorajanOutfitsEquipped } from '../../lib/skilling/skills/dung/dungDbFunctions'; +import { zygomiteMutSurvivalChance, zygomiteSeedMutChance } from '../../lib/skilling/skills/farming/zygomites'; import Hunter from '../../lib/skilling/skills/hunter/hunter'; import Mining from '../../lib/skilling/skills/mining'; import Smithing from '../../lib/skilling/skills/smithing'; @@ -108,6 +109,18 @@ export const ratesCommand: OSBMahojiCommand = { ] } ] + }, + { + type: ApplicationCommandOptionType.SubcommandGroup, + name: 'misc', + description: 'Miscelleanous rates.', + options: [ + { + type: ApplicationCommandOptionType.Subcommand, + name: 'zygomite_seeds', + description: 'Check zygomite seeds.' + } + ] } ], run: async ({ @@ -118,10 +131,18 @@ export const ratesCommand: OSBMahojiCommand = { xphr?: { divination_memory_harvesting?: {}; agility?: {}; dungeoneering?: {}; mining?: {}; hunter?: {} }; monster?: { monster?: { name: string } }; tames?: { eagle?: {} }; + misc?: { zygomite_seeds?: {} }; }>) => { await deferInteraction(interaction); const user = await mUserFetch(userID); - + if (options.misc?.zygomite_seeds) { + const mutationChancePerMinute = 1 / zygomiteSeedMutChance; + const survivalChancePerMutation = 1 / zygomiteMutSurvivalChance; + const chancePerMinuteBoth = mutationChancePerMinute * survivalChancePerMutation; + const averageMinutesToGetBoth = 1 / chancePerMinuteBoth; + const averageHoursToGetBoth = averageMinutesToGetBoth / 60; + return `For every minute in any trip, a random, valid seed from your bank has a 1 in ${zygomiteSeedMutChance} chance of mutating, and then that mutated seed has a 1 in ${zygomiteMutSurvivalChance} chance of surviving. ${averageHoursToGetBoth} hours on average to get a zygomite seed.`; + } if (options.tames?.eagle) { let results = `${['Support Level', 'Clue Tier', 'Clues/hr', 'Kibble/hr', 'GMC/Hr'].join('\t')}\n`; for (const tameLevel of [50, 60, 70, 75, 80, 85, 90, 95, 100]) { diff --git a/src/tasks/minions/farmingActivity.ts b/src/tasks/minions/farmingActivity.ts index 552402f0cf..20e5f8d789 100644 --- a/src/tasks/minions/farmingActivity.ts +++ b/src/tasks/minions/farmingActivity.ts @@ -219,7 +219,7 @@ export const farmingTask: MinionTask = { await farmingLootBoosts(user, 'plant', plant, loot, infoStr); if ('onHarvest' in plant && plant.onHarvest) { - plant.onHarvest({ user, loot }); + plant.onHarvest({ user, loot, quantity }); } if (loot.has('Plopper')) { @@ -573,7 +573,7 @@ export const farmingTask: MinionTask = { await farmingLootBoosts(user, 'harvest', plantToHarvest, loot, infoStr); if ('onHarvest' in plant && plant.onHarvest) { - plant.onHarvest({ user, loot }); + plant.onHarvest({ user, loot, quantity }); } if (plantToHarvest.name === 'Mysterious tree') {