UNPKG

osrs-tools

Version:

A JavaScript package to provide JSON data for all current Old School RuneScape quests. This package aims to help junior software developers create tools related to Old School RuneScape. It's a work in progress, and issues should be reported to jamescer@ha

68 lines (67 loc) 2.29 kB
import { Task } from "./Task"; /** * SlayerMaster class represents a Slayer Master in the game. * It encapsulates the properties and methods related to a Slayer Master, * including the tasks they assign, their location, level requirements, * and the ability to generate random assignments. * Reference: https://oldschool.runescape.wiki/w/Duradel * */ declare class SlayerMaster { name: string; totalWeight: number; location: string; minimumCombatLevel: number; tasks: Task[]; wikiUrl: string; taskPoints: Record<number, number>; eliteDiaryTaskPoints?: Record<number, number>; constructor(name: string, tasks: Task[], location: string, levelRequirement: number, url: string, taskPoints: Record<number, number>, // Pass the task points mapping in the constructor eliteDiaryTaskPoints?: Record<number, number>); /** * Calculate the total weight of all tasks assigned to this Slayer Master. * @returns {number} The total weight of all tasks assigned to this Slayer Master. */ calculateTotalWeight(): number; /** * Get the points awarded for completing a task based on the interval. * @param {number} taskInterval - The interval of the task (e.g., 1 for every task, 10 for every 10th task, etc.). * @returns {number} The points awarded for the given task interval. */ getPointsForTaskInterval(taskInterval: number): number; /** * Get the location of the Slayer Master */ getLocation(): string; /** * Get the minimum combat level of the Slayer Master */ getMinimumCombatLevel(): number; /** * Get the wiki URL of the Slayer Master */ getWikiUrl(): string; /** * Get a random task based on the weighting system of the tasks. * Tasks with higher weights have a higher chance of being selected. * @returns {Task | null} A randomly selected task or null if no tasks are available. */ getRandomTask(): Task | null; /** * Get the total weight of tasks */ getTotalWeight(): number; /** * Get Name of Slayer Master */ getName(): string; /** * Get Tasks */ getTasks(): Task[]; /** * toString function */ toString(): string; } export { SlayerMaster };