Skip to content

Commit

Permalink
Merge branch 'bso' of https://github.com/gc/oldschoolbot-secret into bso
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Nov 13, 2024
2 parents 0af1b20 + d49964c commit 42b2e50
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 222 deletions.
132 changes: 0 additions & 132 deletions src/lib/bso/halloween2024.ts

This file was deleted.

8 changes: 2 additions & 6 deletions src/lib/customItems/customItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12922,9 +12922,7 @@ setCustomItem(
'Bronze full helm',
{
customItemData: {
cantDropFromMysteryBoxes: true,
superTradeableButTradeableOnGE: true,
isSuperUntradeable: true
cantDropFromMysteryBoxes: true
}
},
100_000
Expand Down Expand Up @@ -13044,9 +13042,7 @@ setCustomItem(
'Herbi',
{
customItemData: {
cantDropFromMysteryBoxes: true,
isSuperUntradeable: true,
superTradeableButTradeableOnGE: true
cantDropFromMysteryBoxes: true
}
},
500_000
Expand Down
32 changes: 1 addition & 31 deletions src/lib/util/handleTripFinish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
type ButtonBuilder,
type MessageCollector,
type MessageCreateOptions,
bold,
italic
bold
} from 'discord.js';
import { Bank } from 'oldschooljs';

Expand All @@ -19,7 +18,6 @@ import { handleTriggerShootingStar } from '../../mahoji/lib/abstracted_commands/
import { updateClientGPTrackSetting, userStatsBankUpdate, userStatsUpdate } from '../../mahoji/mahojiSettings';
import { PortentID, chargePortentIfHasCharges, getAllPortentCharges } from '../bso/divination';
import { gods } from '../bso/divineDominion';
import { handleHalloweenEvent } from '../bso/halloween2024';
import { MysteryBoxes } from '../bsoOpenables';
import { ClueTiers } from '../clues/clueTiers';
import { buildClueButtons } from '../clues/clueUtils';
Expand Down Expand Up @@ -576,34 +574,6 @@ export async function handleTripFinish(
if (components.length > 0) {
message.components = makeComponents(components);
}
if (roll(3) && !user.cl.has('Spookling token')) {
const img = await mahojiChatHead({
head: 'pumpkin',
content:
'Halt! Do you care for a treat? Or maybe a trick? Avoid my Spooklings unless you want to feel my wrath...'
});
message.content += `\n\n${bold('Pumpkinhead appears! All of Gielenor turns into a pumpkin patch before your very eyes!')}`;
if (roll(10)) {
message.content += `\n\n${italic('Collect enough Spookling tokens, and who knows? You might just find... 10% more Mini PH! (Or maybe a few more than that...)')}`;
}
await user.addItemsToBank({ items: new Bank().add('Spookling token'), collectionLog: true });
if (!message.files) message.files = img.files;
else message.files = [...message.files, ...img.files];
} else if (user.cl.has('Spookling token')) {
const spookResult = handleHalloweenEvent(user, data.duration);
if (spookResult.message !== '') {
const img = await mahojiChatHead({ head: 'spookling', content: spookResult.message });
if (!message.files) message.files = img.files;
else message.files = [...message.files, ...img.files];
}
if (spookResult.loot) {
await user.addItemsToBank({ items: spookResult.loot, collectionLog: true });
if (spookResult.loot.has('Polterpup')) {
message.content += `\n\n${bold('A chill settles beside you, an eerie presence that clings to you no matter where you go. You have a feeling it’s here to stay, watching... and waiting.')}`;
}
message.content += `\nReceived: ${spookResult.loot}`;
}
}

if (!user.owns('Mysterious clue (1)') && roll(10) && !user.bitfield.includes(BitField.HasUnlockedYeti)) {
const img = await mahojiChatHead({
Expand Down
34 changes: 3 additions & 31 deletions src/mahoji/commands/halloween.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { type CommandRunOptions, formatDuration, mentionCommand } from '@oldschoolgg/toolkit';
import type { CommandRunOptions } from '@oldschoolgg/toolkit';
import { ApplicationCommandOptionType } from 'discord.js';
import { Bank } from 'oldschooljs';

import { roll } from 'e';
import { getFarmingInfoFromUser } from '../../lib/skilling/functions/getFarmingInfo';
import type { OSBMahojiCommand } from '../lib/util';

export const halloweenCommand: OSBMahojiCommand = {
Expand Down Expand Up @@ -31,8 +30,6 @@ export const halloweenCommand: OSBMahojiCommand = {
hand_in?: {};
}>) => {
const user = await mUserFetch(userID);
const farming = getFarmingInfoFromUser(user.user);
const plantedCrop = farming.patchesDetailed.find(p => p.patchName === 'allotment');

if (options.hand_in) {
if (user.bank.amount('Jack-o-lantern') < 1) {
Expand All @@ -50,37 +47,12 @@ export const halloweenCommand: OSBMahojiCommand = {
return str;
}
if (options.check) {
if (!user.owns('Pumpkin carving knife')) {
await user.addItemsToBank({
items: new Bank().add('Pumpkin carving knife').add('Pumpkin seed', 30),
collectionLog: true
});
return `You have received a Pumpkin carving knife, and 30 Pumpkin seeds. To start the event, grow some pumpkins, and if you find a Heirloom pumpkin, use your Pumpkin carving knife on it (using the /use command) to turn it into a Jack-o-lantern, and hand it in for a reward.
Use this command again to check your progress, or for information.`;
}

let allotmentStr = '';
if (!plantedCrop || plantedCrop.plant?.name !== 'Pumpkin') {
allotmentStr = `You don't have pumpkins planted in your allotment patches, plant some pumpkin seeds! ${mentionCommand(globalClient, 'farming', 'plant')}`;
} else if (!plantedCrop.ready) {
allotmentStr = `You have pumpkins planted, they'll be ready to harvest in ${formatDuration(plantedCrop.readyIn!)}.`;
} else {
allotmentStr = `Your pumpkins are ready to harvest! ${mentionCommand(globalClient, 'farming', 'harvest')}`;
}

return `**Halloween Event 2024**
1. Grow and harvest pumpkin seeds, and if you're lucky you'll get *Heirloom pumpkins*, which are big enough to carve into jack-o-lanterns: ${mentionCommand(globalClient, 'farming', 'plant')}.
2. Use your Pumpkin carving knife on Heirloom pumpkins to make them into jack-o-lanterns: ${mentionCommand(globalClient, 'use')}.
3. Hand them in using: ${mentionCommand(globalClient, 'halloween', 'hand_in')}, and you'll receive a reward.
The event is over! Hand in your remaining jack-o-lanterns now before this command is removed.
You have...
**Pumpkin seeds:** ${user.bank.amount('Pumpkin seed')} (You get some when you start, and more from each Jack-o-lantern you hand in)
**Heirloom pumpkins:** ${user.bank.amount('Heirloom pumpkin')}
**Jack-o-lanterns:** ${user.bank.amount('Jack-o-lantern')}
${allotmentStr}
`;
**Jack-o-lanterns:** ${user.bank.amount('Jack-o-lantern')}`;
}

return 'Invalid options.';
Expand Down
5 changes: 0 additions & 5 deletions src/mahoji/commands/k.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ export const autocompleteMonsters = [
name: 'Colosseum',
aliases: ['colo', 'colosseum'],
id: -1
},
{
name: 'Pumpkinhead',
aliases: ['ph'],
id: -1
}
];

Expand Down
2 changes: 0 additions & 2 deletions src/mahoji/lib/abstracted_commands/minionKill/minionKill.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ChatInputCommandInteraction, InteractionReplyOptions } from 'discord.js';

import { killPumpkinhead } from '../../../../lib/bso/halloween2024';
import { handleDTD } from '../../../../lib/bso/handleDTD';
import { colosseumCommand } from '../../../../lib/colosseum';
import type { PvMMethod } from '../../../../lib/constants';
Expand Down Expand Up @@ -55,7 +54,6 @@ export async function minionKillCommand(
});
name = 'Ogress Warrior';
}
if (stringMatches(name, 'pumpkinhead')) return killPumpkinhead(user);
if (stringMatches(name, 'colosseum')) return colosseumCommand(user, channelID, inputQuantity);
if (stringMatches(name, 'zalcano')) return zalcanoCommand(user, channelID, inputQuantity);
if (stringMatches(name, 'tempoross')) return temporossCommand(user, channelID, inputQuantity);
Expand Down
15 changes: 0 additions & 15 deletions src/tasks/minions/farmingActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,21 +499,6 @@ export const farmingTask: MinionTask = {
if (hesporiSeeds > 0) loot.add('Hespori seed', hesporiSeeds);
}

if (plantToHarvest.name === 'Pumpkin') {
for (let i = 0; i < alivePlants; i++) {
if (roll(24)) {
const heirLoomPumpkinLoot = new Bank().add('Heirloom pumpkin');
await user.addItemsToBank({ items: heirLoomPumpkinLoot, collectionLog: true });
infoStr.push('🟣 **You found an Heirloom pumpkin**');
}
if (roll(600)) {
await user.addItemsToBank({ items: new Bank().add('Mumpkin'), collectionLog: true });
infoStr.push(
`🟣 **You've found a little red panda eating your pumpkins. You've adopted it and named it Mumpkin.**`
);
}
}
}
if (loot.has('Tangleroot')) {
infoStr.push('\n```diff');
infoStr.push("\n- You have a funny feeling you're being followed...");
Expand Down

0 comments on commit 42b2e50

Please sign in to comment.