Skip to content

Commit

Permalink
Change to jars
Browse files Browse the repository at this point in the history
  • Loading branch information
TastyPumPum committed Mar 13, 2024
1 parent 8e5a452 commit 78392a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/lib/skilling/skills/hunter/creatures/butterflyNetting.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Bank, Openables } from 'oldschooljs';
import { Bank } from 'oldschooljs';
import LootTable from 'oldschooljs/dist/structures/LootTable';

import { Creature, HunterTechniqueEnum } from '../../../types';
Expand Down Expand Up @@ -62,7 +62,7 @@ const butterflyNettingCreatures: Creature[] = [
aliases: ['cimp', 'crystal imp', 'c imp', 'crystal impling'],
level: 90,
hunterXP: 280,
table: Openables.CrystalImpling.table,
table: new LootTable().every('Crystal impling jar'),
huntTechnique: HunterTechniqueEnum.ButterflyNetting,
catchTime: 600,
slope: 0,
Expand Down
33 changes: 8 additions & 25 deletions src/tasks/minions/HunterActivity/hunterActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { HunterActivityTaskOptions } from '../../../lib/types/minions';
import { roll, skillingPetDropRate, stringMatches } from '../../../lib/util';
import { handleTripFinish } from '../../../lib/util/handleTripFinish';
import itemID from '../../../lib/util/itemID';
import { makeBankImage } from '../../../lib/util/makeBankImage';
import { updateBankSetting } from '../../../lib/util/updateBankSetting';
import { userHasGracefulEquipped } from '../../../mahoji/mahojiSettings';
import { BLACK_CHIN_ID, HERBIBOAR_ID } from './../../../lib/constants';
Expand Down Expand Up @@ -167,7 +166,7 @@ export const hunterTask: MinionTask = {
}

await user.incrementCreatureScore(creature.id, Math.floor(successfulQuantity));
const { previousCL, itemsAdded } = await transactItems({
await transactItems({
userID: user.id,
collectionLog: true,
itemsToAdd: loot
Expand All @@ -184,11 +183,7 @@ export const hunterTask: MinionTask = {
: `${quantity}x times, due to clever creatures you missed out on ${
quantity - successfulQuantity
}x catches. `
}${xpStr}`;

if (!crystalImpling) {
str += `\n\nYou received: ${itemsAdded}.${magicSecStr.length > 1 ? magicSecStr : ''}`;
}
}${xpStr}\n\nYou received: ${loot}.${magicSecStr.length > 1 ? magicSecStr : ''}`;

if (gotPked && !died) {
str += `\n${pkStr}`;
Expand All @@ -198,35 +193,25 @@ export const hunterTask: MinionTask = {
str += `\n${diedStr}`;
}

if (itemsAdded.amount('Baby chinchompa') > 0 || itemsAdded.amount('Herbi') > 0) {
if (loot.amount('Baby chinchompa') > 0 || loot.amount('Herbi') > 0) {
str += "\n\n**You have a funny feeling like you're being followed....**";
globalClient.emit(
Events.ServerNotification,
`**${user.usernameOrMention}'s** minion, ${user.minionName}, just received a ${
itemsAdded.amount('Baby chinchompa') > 0
loot.amount('Baby chinchompa') > 0
? '**Baby chinchompa** <:Baby_chinchompa_red:324127375539306497>'
: '**Herbi** <:Herbi:357773175318249472>'
} while hunting a ${creature.name}, their Hunter level is ${currentLevel}!`
);
}

const image =
itemsAdded.length === 0
? undefined
: await makeBankImage({
bank: itemsAdded,
title: `Loot From ${successfulQuantity} ${creature.name}:`,
user,
previousCL
});

updateBankSetting('hunter_loot', itemsAdded);
updateBankSetting('hunter_loot', loot);

Check warning on line 208 in src/tasks/minions/HunterActivity/hunterActivity.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 208 in src/tasks/minions/HunterActivity/hunterActivity.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
await trackLoot({
id: creature.name,
changeType: 'loot',
duration,
kc: quantity,
totalLoot: itemsAdded,
totalLoot: loot,
type: 'Skilling',
users: [
{
Expand All @@ -236,9 +221,7 @@ export const hunterTask: MinionTask = {
}
]
});
if (crystalImpling) {
return handleTripFinish(user, channelID, str, image?.file.attachment, data, itemsAdded);
}
handleTripFinish(user, channelID, str, undefined, data, itemsAdded);

handleTripFinish(user, channelID, str, undefined, data, loot);

Check warning on line 225 in src/tasks/minions/HunterActivity/hunterActivity.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 225 in src/tasks/minions/HunterActivity/hunterActivity.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
};

0 comments on commit 78392a2

Please sign in to comment.