Skip to content

Commit

Permalink
add quest req
Browse files Browse the repository at this point in the history
  • Loading branch information
DayV-git committed Dec 7, 2024
1 parent e772a1a commit 96bdd99
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/lib/slayer/slayerUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function userCanUseTask(user: MUser, task: AssignableSlayerTask, master: SlayerM
if (myLastTask === task.monster.id) return false;
if (task.combatLevel && task.combatLevel > user.combatLevel) return false;
if (task.questPoints && task.questPoints > user.QP) return false;
if (task.requiredQuests?.find(quest => !user.user.finished_quest_ids.includes(quest))) return false;
if (task.slayerLevel && task.slayerLevel > user.skillLevel(SkillsEnum.Slayer)) return false;
if (task.levelRequirements && !user.hasSkillReqs(task.levelRequirements)) return false;
const myBlockList = user.user.slayer_blocked_ids ?? [];
Expand Down Expand Up @@ -175,7 +176,7 @@ function userCanUseTask(user: MUser, task: AssignableSlayerTask, master: SlayerM
)
return false;

if (stringMatches(lmon, 'warped tortoise') && !myUnlocks.includes(SlayerTaskUnlocksEnum.WarpedReality))
if (stringMatches(lmon, 'warped terrorbird') && !myUnlocks.includes(SlayerTaskUnlocksEnum.WarpedReality))
return false;
return true;
}
Expand Down
4 changes: 3 additions & 1 deletion src/lib/slayer/tasks/chaeldarTasks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Monsters } from 'oldschooljs';

import { QuestID } from '../../minions/data/quests';
import { SlayerTaskUnlocksEnum } from '../slayerUnlocks';
import type { AssignableSlayerTask } from '../types';
import { bossTasks } from './bossTasks';
Expand Down Expand Up @@ -403,7 +404,8 @@ export const chaeldarTasks: AssignableSlayerTask[] = [
weight: 6,
monsters: [Monsters.WarpedTerrorbird.id, Monsters.WarpedTortoise.id],
unlocked: false,
slayerLevel: 56
slayerLevel: 56,
requiredQuests: [QuestID.ThePathOfGlouphrie]
},
...bossTasks
];
4 changes: 3 additions & 1 deletion src/lib/slayer/tasks/duradelTasks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Monsters } from 'oldschooljs';

import killableMonsters from '../../minions/data/killableMonsters';
import { QuestID } from '../../minions/data/quests';
import { SlayerTaskUnlocksEnum } from '../slayerUnlocks';
import type { AssignableSlayerTask } from '../types';
import { bossTasks } from './bossTasks';
Expand Down Expand Up @@ -478,7 +479,8 @@ export const duradelTasks: AssignableSlayerTask[] = [
weight: 8,
monsters: [Monsters.WarpedTerrorbird.id, Monsters.WarpedTortoise.id],
unlocked: false,
slayerLevel: 56
slayerLevel: 56,
requiredQuests: [QuestID.ThePathOfGlouphrie]
},
...bossTasks
];
4 changes: 3 additions & 1 deletion src/lib/slayer/tasks/konarTasks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Monsters } from 'oldschooljs';

import killableMonsters from '../../minions/data/killableMonsters';
import { QuestID } from '../../minions/data/quests';
import { SlayerTaskUnlocksEnum } from '../slayerUnlocks';
import type { AssignableSlayerTask } from '../types';
import { bossTasks } from './bossTasks';
Expand Down Expand Up @@ -447,7 +448,8 @@ export const konarTasks: AssignableSlayerTask[] = [
weight: 4,
monsters: [Monsters.WarpedTerrorbird.id, Monsters.WarpedTortoise.id],
unlocked: false,
slayerLevel: 56
slayerLevel: 56,
requiredQuests: [QuestID.ThePathOfGlouphrie]
},
...bossTasks
];
4 changes: 3 additions & 1 deletion src/lib/slayer/tasks/nieveTasks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Monsters } from 'oldschooljs';

import killableMonsters from '../../minions/data/killableMonsters';
import { QuestID } from '../../minions/data/quests';
import { SlayerTaskUnlocksEnum } from '../slayerUnlocks';
import type { AssignableSlayerTask } from '../types';
import { bossTasks } from './bossTasks';
Expand Down Expand Up @@ -497,7 +498,8 @@ export const nieveTasks: AssignableSlayerTask[] = [
weight: 6,
monsters: [Monsters.WarpedTerrorbird.id, Monsters.WarpedTortoise.id],
unlocked: false,
slayerLevel: 56
slayerLevel: 56,
requiredQuests: [QuestID.ThePathOfGlouphrie]
},
...bossTasks
];
2 changes: 2 additions & 0 deletions src/lib/slayer/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Item, Monster, MonsterSlayerMaster } from 'oldschooljs';

import type { QuestID } from '../minions/data/quests';
import type { LevelRequirements } from '../skilling/types';

export interface AssignableSlayerTask {
Expand All @@ -17,6 +18,7 @@ export interface AssignableSlayerTask {
extendedAmount?: [number, number];
extendedUnlockId?: number;
wilderness?: boolean;
requiredQuests?: QuestID[];
}

export interface SlayerMaster {
Expand Down

0 comments on commit 96bdd99

Please sign in to comment.