Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Mar 3, 2024
1 parent 67761e0 commit c3f8cee
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 14 deletions.
9 changes: 9 additions & 0 deletions src/lib/data/globalDroprates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
};
6 changes: 5 additions & 1 deletion src/lib/minions/data/killableMonsters/custom/SunMoon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 17 additions & 4 deletions src/lib/skilling/skills/farming/zygomites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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');
}
}
}
}));
2 changes: 1 addition & 1 deletion src/lib/skilling/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 10 additions & 5 deletions src/lib/util/handleTripFinish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}
}
}

Expand Down
23 changes: 22 additions & 1 deletion src/mahoji/commands/rates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 ({
Expand All @@ -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]) {
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/minions/farmingActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit c3f8cee

Please sign in to comment.