Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Larren's & Brimstone openable #5691

Merged
merged 6 commits into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions src/lib/openables.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { formatOrdinal } from '@oldschoolgg/toolkit';
import { Bank, LootTable, Openables } from 'oldschooljs';
import { Item } from 'oldschooljs/dist/meta/types';
import { SkillsEnum } from 'oldschooljs/dist/constants';
import { Item, OpenableOpenOptions } from 'oldschooljs/dist/meta/types';
import { Mimic } from 'oldschooljs/dist/simulation/misc';
import BrimstoneChest, { BrimstoneChestOpenable } from 'oldschooljs/dist/simulation/openables/BrimstoneChest';
import { HallowedSackTable } from 'oldschooljs/dist/simulation/openables/HallowedSack';
import { Implings } from 'oldschooljs/dist/simulation/openables/Implings';
import LarransChest, { LarransChestOpenable } from 'oldschooljs/dist/simulation/openables/LarransChest';

import { ClueTiers } from './clues/clueTiers';
import { Emoji, Events, MIMIC_MONSTER_ID } from './constants';
Expand Down Expand Up @@ -92,10 +95,10 @@
openedItem: casketItem,
aliases: [clueTier.name.toLowerCase()],
output: async ({ quantity, user, self }) => {
const clueTier = ClueTiers.find(c => c.id === self.id)!;

Check warning on line 98 in src/lib/openables.ts

View workflow job for this annotation

GitHub Actions / ESLint

'clueTier' is already declared in the upper scope on line 90 column 12
let loot = new Bank(clueTier.table.open(quantity));
let mimicNumber = 0;
if (clueTier.mimicChance) {

Check warning on line 101 in src/lib/openables.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected value in conditional. A boolean expression is required
for (let i = 0; i < quantity; i++) {
if (roll(clueTier.mimicChance)) {
loot.add(Mimic.open(clueTier.name as 'master' | 'elite'));
Expand Down Expand Up @@ -162,7 +165,20 @@
id: 23_083,
openedItem: getOSItem(23_083),
aliases: ['brimstone chest', 'brimstone'],
output: Openables.BrimstoneChest.table,
output: async (
args: OpenArgs
): Promise<{
bank: Bank;
}> => {
const chest = new BrimstoneChestOpenable(BrimstoneChest);
const fishLvl = args.user.skillLevel(SkillsEnum.Fishing);
const brimstoneOptions: OpenableOpenOptions = {
fishLvl
};
const openLoot: Bank = chest.open(args.quantity, brimstoneOptions);

return { bank: openLoot };
},
allItems: Openables.BrimstoneChest.table.allItems
},
{
Expand Down Expand Up @@ -234,7 +250,21 @@
'larrans small chest',
"larran's small chest"
],
output: Openables.LarransChest.table,
output: async (
args: OpenArgs
): Promise<{
bank: Bank;
}> => {
const chest = new LarransChestOpenable(LarransChest);
const fishLvl = args.user.skillLevel(SkillsEnum.Fishing);
const larransOptions: OpenableOpenOptions = {
fishLvl,
chestSize: 'big'
};
const openLoot: Bank = chest.open(args.quantity, larransOptions);

return { bank: openLoot };
},
allItems: Openables.LarransChest.table.allItems
},
{
Expand Down
Loading