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

Ruins of Camdozaal #5431

Merged
merged 36 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7c5a427
Camdozzal application option
nwjgit Oct 13, 2023
fa15a70
Camdozaal WIP
nwjgit Oct 14, 2023
e07cf20
Camdozaal WIP
nwjgit Oct 14, 2023
c79b1ad
camdozaal fishing works WIP
nwjgit Oct 14, 2023
9540e15
add camdozaal creatables and golems
nwjgit Oct 14, 2023
0c782d6
Camdozaal smithing
nwjgit Oct 14, 2023
5018c2a
fix fishing giving wrong xp
nwjgit Oct 14, 2023
f9bc9b6
fix notes
nwjgit Oct 14, 2023
6296e70
typo fix
nwjgit Oct 14, 2023
6a1e5b1
test
nwjgit Oct 14, 2023
902adaf
update snapshot tests
nwjgit Oct 14, 2023
d224096
adjust xp rates and fix repeat trip issue
nwjgit Oct 15, 2023
1e7cd3a
removed empty file & addressed feedback
nwjgit Oct 16, 2023
23dc0d3
fix error and remove guppy lvl check
nwjgit Oct 16, 2023
0871e10
camdozaalFishing fix
nwjgit Oct 16, 2023
39a7938
Rework camdozaal mining to use mining.ts
nwjgit Oct 17, 2023
0f57890
add clues to camdozaal mining
nwjgit Oct 17, 2023
7653bce
Merge branch 'master' into Ruins-of-Camdozaal
nwjgit Oct 17, 2023
dc5396c
redo how smithing checks for items
nwjgit Oct 17, 2023
d6a50c3
grammar fix
nwjgit Oct 17, 2023
c40aefc
wording fix
nwjgit Oct 17, 2023
a2850bf
more spelling fixes
nwjgit Oct 17, 2023
f5bce67
slayer fix
nwjgit Oct 17, 2023
b423858
mining xp fix
nwjgit Oct 17, 2023
01dad31
rework camdozaal fishing
nwjgit Oct 17, 2023
aa08f1c
fix heron pet
nwjgit Oct 17, 2023
f35d2ce
reformat clue chance
nwjgit Oct 17, 2023
1b67676
few grammar fixes
nwjgit Oct 17, 2023
194967c
simplify loot code, add amulet of glory to mining
nwjgit Oct 18, 2023
59425e7
Music cape requirement
nwjgit Oct 27, 2023
120dceb
Merge branch 'master' into Ruins-of-Camdozaal
nwjgit Oct 27, 2023
8f2f04b
Merge branch 'master' into Ruins-of-Camdozaal
nwjgit Nov 9, 2023
5d9d949
update osjs
nwjgit Nov 9, 2023
b6e31b0
update clsnapshot
nwjgit Nov 9, 2023
50b5627
Merge branch 'master' into Ruins-of-Camdozaal
gc Dec 10, 2023
6f23db2
Update Task.ts
gc Dec 10, 2023
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
6 changes: 6 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ enum XpGainSource {
MahoganyHomes
AerialFishing
CleaningHerbsWhileFarming
CamdozaalMining
CamdozaalSmithing
CamdozaalFishing
}

model XPGain {
Expand Down Expand Up @@ -932,6 +935,9 @@ enum activity_type_enum {
UnderwaterAgilityThieving
StrongholdOfSecurity
SpecificQuest
CamdozaalFishing
CamdozaalMining
CamdozaalSmithing
}

enum xp_gains_skill_enum {
Expand Down
8 changes: 7 additions & 1 deletion src/lib/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import { agilityTask } from '../tasks/minions/agilityActivity';
import { alchingTask } from '../tasks/minions/alchingActivity';
import { butlerTask } from '../tasks/minions/butlerActivity';
import { camdozaalFishingTask } from '../tasks/minions/camdozaalActivity/camdozaalFishingActivity';
import { camdozaalMiningTask } from '../tasks/minions/camdozaalActivity/camdozaalMiningActivity';
import { camdozaalSmithingTask } from '../tasks/minions/camdozaalActivity/camdozaalSmithingActivity';
import { castingTask } from '../tasks/minions/castingActivity';
import { clueTask } from '../tasks/minions/clueActivity';
import { collectingTask } from '../tasks/minions/collectingActivity';
Expand Down Expand Up @@ -176,14 +179,17 @@
toaTask,
underwaterAgilityThievingTask,
strongholdTask,
specificQuestTask
specificQuestTask,
camdozaalMiningTask,
camdozaalSmithingTask,
camdozaalFishingTask
];

export async function processPendingActivities() {
const activities: Activity[] = await prisma.activity.findMany({
where: {
completed: false,
finish_date: production

Check warning on line 192 in src/lib/Task.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
? {
lt: new Date()
}
Expand All @@ -206,7 +212,7 @@
return activities;
}
export async function syncActivityCache() {
const tasks = await prisma.activity.findMany({ where: { completed: false } });

Check warning on line 215 in src/lib/Task.ts

View workflow job for this annotation

GitHub Actions / ESLint

'tasks' is already declared in the upper scope on line 97 column 14

minionActivityCache.clear();
for (const task of tasks) {
Expand All @@ -223,7 +229,7 @@
}

const task = tasks.find(i => i.type === activity.type)!;
if (!task) {

Check warning on line 232 in src/lib/Task.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected object value in conditional. The condition is always true
throw new Error('Missing task');
}

Expand Down
4 changes: 4 additions & 0 deletions src/lib/data/creatablesTable.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1848,4 +1848,8 @@
║ Sturdy harness │ 45x Steel nails, 3x Adamantite bar, 2x Rope, 1x Log brace │ 1x Sturdy harness │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Clothes pouch │ 1x Thread, 1x Leather, 1x Clothes pouch blueprint │ 1x Clothes pouch │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Barronite mace │ 1,500x Barronite shards, 1x Barronite head, 1x Barronite handle, 1x Barronite guard │ 1x Barronite mace │ 0 ║
╟─────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────╢
║ Imcando hammer │ 1,500x Barronite shards, 1x Imcando hammer (broken) │ 1x Imcando hammer │ 0 ║
╚═════════════════════════════════════════════════╧══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╧══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╧═════════╝
23 changes: 22 additions & 1 deletion src/lib/data/createables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,26 @@ const hunterClothing: Createable[] = [
}
];

const camdozaalItems: Createable[] = [
{
name: 'Barronite mace',
inputItems: new Bank({
'Barronite handle': 1,
'Barronite guard': 1,
'Barronite head': 1,
'Barronite shards': 1500
}),
outputItems: new Bank({ 'Barronite mace ': 1 }),
noCl: false
},
{
name: 'Imcando hammer',
inputItems: new Bank({ 'Imcando hammer (broken)': 1, 'Barronite shards': 1500 }),
outputItems: new Bank({ 'Imcando hammer': 1 }),
noCl: false
}
];

const metamorphPets: Createable[] = [
{
name: 'Midnight',
Expand Down Expand Up @@ -2352,7 +2372,8 @@ const Createables: Createable[] = [
...swampBarkCreatables,
...dtCreatables,
...caCreatables,
...forestryCreatables
...forestryCreatables,
...camdozaalItems
];

export default Createables;
49 changes: 49 additions & 0 deletions src/lib/minions/data/killableMonsters/camdozaalMonsters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Time } from 'e';
import { Monsters } from 'oldschooljs';

import { KillableMonster } from '../../types';

export const camdozaalMonsters: KillableMonster[] = [
{
id: Monsters.FlawedGolem.id,
name: Monsters.FlawedGolem.name,
aliases: Monsters.FlawedGolem.aliases,
timeToFinish: Time.Second * 15,
table: Monsters.FlawedGolem,
wildy: false,
difficultyRating: 0,
qpRequired: 17
},
{
id: Monsters.MindGolem.id,
name: Monsters.MindGolem.name,
aliases: Monsters.MindGolem.aliases,
timeToFinish: Time.Second * 18,
table: Monsters.MindGolem,
wildy: false,
difficultyRating: 1,
qpRequired: 17
},
{
id: Monsters.BodyGolem.id,
name: Monsters.BodyGolem.name,
aliases: Monsters.BodyGolem.aliases,
timeToFinish: Time.Second * 22,
table: Monsters.BodyGolem,
wildy: false,
difficultyRating: 1,
qpRequired: 17
},
{
id: Monsters.ChaosGolem.id,
name: Monsters.ChaosGolem.name,
aliases: Monsters.ChaosGolem.aliases,
timeToFinish: Time.Second * 30,
table: Monsters.ChaosGolem,
wildy: false,
difficultyRating: 2,
qpRequired: 17
}
];

export default camdozaalMonsters;
2 changes: 2 additions & 0 deletions src/lib/minions/data/killableMonsters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import resolveItems, { deepResolveItems } from '../../../util/resolveItems';
import { KillableMonster } from '../../types';
import { NIGHTMARES_HP } from './../../../constants';
import bosses from './bosses';
import { camdozaalMonsters } from './camdozaalMonsters';
import { chaeldarMonsters } from './chaeldarMonsters';
import { creatureCreationCreatures } from './creatureCreation';
import { konarMonsters } from './konarMonsters';
Expand All @@ -26,6 +27,7 @@ const killableMonsters: KillableMonster[] = [
...chaeldarMonsters,
...konarMonsters,
...krystiliaMonsters,
...camdozaalMonsters,
...mazchnaMonsters,
...nieveMonsters,
...turaelMonsters,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/musicCape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
.add('Brittle key')
.add('Revenant ether')
})
// .add({
// name: '750 Barronite shards to unlock Race Against the Clock inside the Camdozaal Vault',
// clRequirement: new Bank().add('Barronite shards', 750)
// })
.add({
name: '750 Barronite shards to access the Camdozaal Vault',
clRequirement: new Bank().add('Barronite shards', 750)
})
.add({
kcRequirement: {
[MIMIC_MONSTER_ID]: 1,
Expand Down Expand Up @@ -212,7 +212,7 @@

const notDoneRandomEvents = RandomEvents.filter(i => {
if (i.outfit && i.outfit.every(id => user.cl.has(id))) return false;
return !eventBank[i.id];

Check warning on line 215 in src/lib/musicCape.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected number value in conditional. An explicit zero/NaN check is required
}).map(i => i.name);

if (notDoneRandomEvents.length > 0) {
Expand Down Expand Up @@ -242,7 +242,7 @@
const results: RequirementFailure[] = [];
const favour = user.kourendFavour;

const notDoneFavours = Object.entries(favour).filter(([_, value]) => value < 25);

Check warning on line 245 in src/lib/musicCape.ts

View workflow job for this annotation

GitHub Actions / ESLint

'_' is defined but never used

if (notDoneFavours.length > 0) {
results.push({ reason: `You need atleast 25% favour in ${notDoneFavours.map(i => i[0]).join(', ')}.` });
Expand Down
41 changes: 41 additions & 0 deletions src/lib/skilling/skills/fishing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,46 @@ const fishes: Fish[] = [
}
];

// Types of fish in camdozaal
const camdozaalFishes: Fish[] = [
{
level: 7,
xp: 8,
id: itemID('Raw guppy'),
name: 'Raw guppy',
petChance: 257_770,
timePerFish: 5.5,
clueScrollChance: 257_770
},
{
level: 20,
xp: 16,
id: itemID('Raw cavefish'),
name: 'Raw cavefish',
petChance: 257_770,
timePerFish: 5.5,
clueScrollChance: 257_770
},
{
level: 33,
xp: 24,
id: itemID('Raw tetra'),
name: 'Raw tetra',
petChance: 257_770,
timePerFish: 5.5,
clueScrollChance: 257_770
},
{
level: 46,
xp: 33,
id: itemID('Raw catfish'),
name: 'Raw catfish',
petChance: 257_770,
timePerFish: 5.5,
clueScrollChance: 257_770
}
];

const anglerItems: { [key: number]: number } = {
[itemID('Angler hat')]: 0.4,
[itemID('Angler top')]: 0.8,
Expand All @@ -246,6 +286,7 @@ const anglerItems: { [key: number]: number } = {
const Fishing = {
aliases: ['fishing'],
Fishes: fishes,
camdozaalFishes,
id: SkillsEnum.Fishing,
emoji: Emoji.Fishing,
anglerItems,
Expand Down
15 changes: 15 additions & 0 deletions src/lib/skilling/skills/mining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,20 @@ const MotherlodeMine: Ore = {
petChance: 247_200
};

// Uses determineMiningTime function, therefore Ore object and id -1
const CamdozaalMine: Ore = {
level: 14,
xp: 16,
id: -1,
name: 'Barronite rocks',
respawnTime: 3,
bankingTime: 20,
slope: 0.082_71,
intercept: 30.872,
petChance: 741_600,
clueScrollChance: 741_600
};

const prospectorItems: { [key: number]: number } = {
[itemID('Prospector helmet')]: 0.4,
[itemID('Prospector jacket')]: 0.8,
Expand All @@ -270,6 +284,7 @@ const Mining = {
aliases: ['mining'],
Ores: ores,
MotherlodeMine,
CamdozaalMine,
GemRockTable,
GraniteRockTable,
SandstoneRockTable,
Expand Down
5 changes: 4 additions & 1 deletion src/lib/types/minions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export interface ActivityTaskOptionsWithQuantity extends ActivityTaskOptions {
| 'WealthCharging'
| 'GloryCharging'
| 'AerialFishing'
| 'FishingTrawler';
| 'FishingTrawler'
| 'CamdozaalFishing'
| 'CamdozaalMining'
| 'CamdozaalSmithing';
quantity: number;
}

Expand Down
12 changes: 12 additions & 0 deletions src/lib/util/minionStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
case 'Agility': {
const data = currentTask as AgilityActivityTaskOptions;

const course = Agility.Courses.find(course => course.name === data.courseID);

Check warning on line 130 in src/lib/util/minionStatus.ts

View workflow job for this annotation

GitHub Actions / ESLint

'course' is already declared in the upper scope on line 130 column 10

return `${name} is currently running ${data.quantity}x ${course!.name} laps. ${formattedDuration} Your ${
Emoji.Agility
Expand All @@ -137,7 +137,7 @@
case 'Cooking': {
const data = currentTask as CookingActivityTaskOptions;

const cookable = Cooking.Cookables.find(cookable => cookable.id === data.cookableID);

Check warning on line 140 in src/lib/util/minionStatus.ts

View workflow job for this annotation

GitHub Actions / ESLint

'cookable' is already declared in the upper scope on line 140 column 10

return `${name} is currently cooking ${data.quantity}x ${cookable!.name}. ${formattedDuration} Your ${
Emoji.Cooking
Expand All @@ -147,7 +147,7 @@
case 'Fishing': {
const data = currentTask as FishingActivityTaskOptions;

const fish = Fishing.Fishes.find(fish => fish.id === data.fishID);

Check warning on line 150 in src/lib/util/minionStatus.ts

View workflow job for this annotation

GitHub Actions / ESLint

'fish' is already declared in the upper scope on line 150 column 10

return `${name} is currently fishing ${data.quantity}x ${fish!.name}. ${formattedDuration} Your ${
Emoji.Fishing
Expand All @@ -157,7 +157,7 @@
case 'Mining': {
const data = currentTask as MiningActivityTaskOptions;

const ore = Mining.Ores.find(ore => ore.id === data.oreID);

Check warning on line 160 in src/lib/util/minionStatus.ts

View workflow job for this annotation

GitHub Actions / ESLint

'ore' is already declared in the upper scope on line 160 column 10

return `${name} is currently mining ${ore!.name}. ${
data.fakeDurationMax === data.fakeDurationMin
Expand Down Expand Up @@ -187,7 +187,7 @@
case 'Smelting': {
const data = currentTask as SmeltingActivityTaskOptions;

const bar = Smithing.Bars.find(bar => bar.id === data.barID);

Check warning on line 190 in src/lib/util/minionStatus.ts

View workflow job for this annotation

GitHub Actions / ESLint

'bar' is already declared in the upper scope on line 190 column 10

return `${name} is currently smelting ${data.quantity}x ${bar!.name}. ${formattedDuration} Your ${
Emoji.Smithing
Expand Down Expand Up @@ -368,6 +368,18 @@
return `${name} is currently fighting cyclopes in the Warriors' Guild. ${formattedDuration}`;
}

case 'CamdozaalFishing': {
return `${name} is currently Fishing in the Ruins of Camdozaal. ${formattedDuration}`;
}

case 'CamdozaalMining': {
return `${name} is currently Mining in the Ruins of Camdozaal. ${formattedDuration}`;
}

case 'CamdozaalSmithing': {
return `${name} is currently Smithing in the Ruins of Camdozaal. ${formattedDuration}`;
}

case 'Sepulchre': {
const data = currentTask as SepulchreActivityTaskOptions;

Expand Down
18 changes: 18 additions & 0 deletions src/lib/util/repeatStoredTrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@ export const tripHandlers = {
warriors_guild: { action: 'tokens', quantity: data.quantity }
})
},
[activity_type_enum.CamdozaalMining]: {
commandName: 'activities',
args: (data: ActivityTaskOptionsWithQuantity) => ({
camdozaal: { action: 'mining', quantity: data.quantity }
})
},
[activity_type_enum.CamdozaalSmithing]: {
commandName: 'activities',
args: (data: ActivityTaskOptionsWithQuantity) => ({
camdozaal: { action: 'smithing', quantity: data.quantity }
})
},
[activity_type_enum.CamdozaalFishing]: {
commandName: 'activities',
args: (data: ActivityTaskOptionsWithQuantity) => ({
camdozaal: { action: 'fishing', quantity: data.quantity }
})
},
[activity_type_enum.BarbarianAssault]: {
commandName: 'minigames',
args: () => ({ barb_assault: { start: {} } })
Expand Down
26 changes: 26 additions & 0 deletions src/mahoji/commands/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { alchCommand } from '../lib/abstracted_commands/alchCommand';
import { birdhouseCheckCommand, birdhouseHarvestCommand } from '../lib/abstracted_commands/birdhousesCommand';
import { buryCommand } from '../lib/abstracted_commands/buryCommand';
import { butlerCommand } from '../lib/abstracted_commands/butlerCommand';
import { camdozaalCommand } from '../lib/abstracted_commands/camdozaalCommand';
import { castCommand } from '../lib/abstracted_commands/castCommand';
import { championsChallengeCommand } from '../lib/abstracted_commands/championsChallenge';
import { chargeGloriesCommand } from '../lib/abstracted_commands/chargeGloriesCommand';
Expand Down Expand Up @@ -113,6 +114,27 @@ export const activitiesCommand: OSBMahojiCommand = {
}
]
},
{
type: ApplicationCommandOptionType.Subcommand,
name: 'camdozaal',
description: 'Send your minion to do activities inside the Ruins of Camdozaal',
options: [
{
type: ApplicationCommandOptionType.String,
name: 'action',
description: 'Start mining, smithing, or fishing inside the Ruins of Camdozaal',
choices: ['mining', 'smithing', 'fishing'].map(i => ({ name: i, value: i })),
required: true
},
{
type: ApplicationCommandOptionType.Integer,
name: 'quantity',
description: 'The quantity you want to do (optional).',
required: false,
min_value: 1
}
]
},
{
type: ApplicationCommandOptionType.Subcommand,
name: 'collect',
Expand Down Expand Up @@ -501,6 +523,7 @@ export const activitiesCommand: OSBMahojiCommand = {
chompy_hunt?: { action: 'start' | 'claim' };
champions_challenge?: {};
warriors_guild?: { action: string; quantity?: number };
camdozaal?: { action: string; quantity?: number };
collect?: { item: string; quantity?: number; no_stams?: boolean };
quest?: {
name?: string;
Expand Down Expand Up @@ -573,6 +596,9 @@ export const activitiesCommand: OSBMahojiCommand = {
options.warriors_guild.quantity
);
}
if (options.camdozaal) {
return camdozaalCommand(user, channelID, options.camdozaal.action, options.camdozaal.quantity);
}
if (options.collect) {
return collectCommand(
user,
Expand Down
Loading