From d6d03ac4733d30c4f56bd0ef706715c2f0c41f1d Mon Sep 17 00:00:00 2001 From: DayV <69717452+DayV-git@users.noreply.github.com> Date: Wed, 27 Nov 2024 00:30:11 +0000 Subject: [PATCH] Add Varlamore Wealthy Citizen Thieving (#6215) --- .../skilling/skills/thieving/stealables.ts | 19 +++++++++++++++++++ src/mahoji/commands/steal.ts | 19 +++++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/lib/skilling/skills/thieving/stealables.ts b/src/lib/skilling/skills/thieving/stealables.ts index cb03a58915..ec61fe44a5 100644 --- a/src/lib/skilling/skills/thieving/stealables.ts +++ b/src/lib/skilling/skills/thieving/stealables.ts @@ -1,6 +1,7 @@ import { Time } from 'e'; import { Monsters } from 'oldschooljs'; import { LootTable } from 'oldschooljs'; +import { QuestID } from '../../../minions/data/quests'; const { BeardedBandit, @@ -23,6 +24,7 @@ const { TzHaarHur, Vyre, WarriorWoman, + WealthyCitizen, YanilleWatchman } = Monsters; @@ -36,6 +38,7 @@ export interface Stealable { xp: number; qpRequired?: number; fireCapeRequired?: boolean; + requiredQuests?: QuestID[]; table: LootTable; id: number; petChance: number; @@ -531,6 +534,22 @@ const pickpocketables: Stealable[] = [ customTickRate: 2.5, petChance: 257_211 }, + { + name: 'Wealthy Citizen', + type: 'pickpockable', + level: 50, + xp: 96, + aliases: ['wealthy', 'varlamore'], + table: WealthyCitizen.pickpocketTable!, + id: WealthyCitizen.id, + stunTime: 5, + stunDamage: 3, + slope: 100.0, //guaranteed + intercept: 0, + customTickRate: 10, // 2 tick thieving for 20s, downtime for ~80s + petChance: 257_211, + requiredQuests: [QuestID.ChildrenOfTheSun] + }, { name: 'Desert Bandit', type: 'pickpockable', diff --git a/src/mahoji/commands/steal.ts b/src/mahoji/commands/steal.ts index 527d5b6a50..aebf5f0ba0 100644 --- a/src/mahoji/commands/steal.ts +++ b/src/mahoji/commands/steal.ts @@ -1,10 +1,10 @@ +import { formatDuration } from '@oldschoolgg/toolkit/util'; import { type CommandRunOptions, stringMatches } from '@oldschoolgg/toolkit'; - -import { ApplicationCommandOptionType, type User } from 'discord.js'; +import { ApplicationCommandOptionType, bold, type User } from 'discord.js'; import { randInt, reduceNumByPercent } from 'e'; -import { formatDuration } from '@oldschoolgg/toolkit/util'; import { ArdougneDiary, userhasDiaryTier } from '../../lib/diaries'; +import { quests } from '../../lib/minions/data/quests'; import removeFoodFromUser from '../../lib/minions/functions/removeFoodFromUser'; import type { Stealable } from '../../lib/skilling/skills/thieving/stealables'; import { stealables } from '../../lib/skilling/skills/thieving/stealables'; @@ -74,6 +74,17 @@ export const stealCommand: OSBMahojiCommand = { } a ${stealable.name}.`; } + if (stealable.requiredQuests) { + const incompleteQuest = stealable.requiredQuests.find( + quest => !user.user.finished_quest_ids.includes(quest) + ); + if (incompleteQuest) { + return `You need to have completed the ${bold( + quests.find(i => i.id === incompleteQuest)!.name + )} quest to steal from ${stealable.name}.`; + } + } + if (stealable.fireCapeRequired) { if (user.cl.amount('Fire cape') === 0) { return `In order to ${ @@ -110,7 +121,7 @@ export const stealCommand: OSBMahojiCommand = { boosts.push('50% boost for Wilvus'); } - const maxTripLength = calcMaxTripLength(user, 'Pickpocket'); + const maxTripLength = (stealable.name === 'Wealthy Citizen' ? 2 : 1) * calcMaxTripLength(user, 'Pickpocket'); let { quantity } = options; if (!quantity) quantity = Math.floor(maxTripLength / timeToTheft);