UNPKG

osrs-tools

Version:

A comprehensive TypeScript library for Old School RuneScape (OSRS) data and utilities, including quest data, skill requirements, and game item information

101 lines 4.29 kB
import { Requirement } from '../Requirement'; export interface TaskJson { name: string; amountMin: number; amountMax: number; extendedAmountMin?: number | null; extendedAmountMax?: number | null; requirements: Requirement[]; alternatives?: string[]; weight: number; combatLevels: number[]; slayerExp: number; locations: string[]; wildernessLevels: number[]; bosses: string[]; } /** * Represents a Slayer task in the game. This class encapsulates all the properties and methods related to a Slayer task. * A Slayer task defines the monsters that players can be assigned to kill, the amount of those monsters, and various other attributes. * A Task is not an assignment, but rather a template for an assignment. * The assignment is the actual task given to a player, which is based on the Task. */ declare class Task { name: string; weight: number; amountMin: number; amountMax: number; requirements: Requirement[]; extendedAmountMin?: number | null; extendedAmountMax?: number | null; alternatives?: string[]; combatLevels: number[]; slayerExp: number; locations: string[]; wildernessLevels: number[]; bosses: string[]; /** * Constructor for the Task class. * @param name - Name of the task * @param amountMin - Minimum amount of monsters to kill for this task * @param amountMax - Maximum amount of monsters to kill for this task * @param requirements - Array of requirements for this task * @param extendedAmountMin - Minimum amount for extended tasks (optional) * @param extendedAmountMax - Maximum amount for extended tasks (optional) * @param weight - Weight of the task (default is 1) * @param alternatives - Array of alternatives for this task (optional) * @param combatLevels - Array of combat levels for this task * @param SlayerExp - Slayer experience gained from this task * @param locations - Array of locations where this task can be found * @param wildernessLevels - Array of wilderness levels for this task * @param bosses - Array of bosses for this task */ constructor(name: string, amountMin: number, amountMax: number, requirements: Requirement[], extendedAmountMin?: number | null, extendedAmountMax?: number | null, alternatives?: string[], weight?: number, combatLevels?: number[], SlayerExp?: number, locations?: string[], wildernessLevels?: number[], bosses?: string[]); static fromJSON(json: TaskJson): Task; /** * Get the name of the task. * @example * const task = new Task("Goblin", 10, 20, [], 0, null, [], 1); * console.log(task.getName()); // "Goblin" * @returns */ getName(): string; /** * Get the weight of the task. The weight is used to determine the likelihood of being assigned this task compared to others. * @returns {number} The weight of the task, which can be used to determine the likelihood of being assigned this task compared to others. */ getWeight(): number; /** * Get the minimum and maximum amount of monsters to kill for this task. * The amountMin and amountMax properties define the range of monsters that can be assigned for this task. * @returns {number} The minimum amount of monsters to kill for this task. */ getAmountMin(): number; /** * Get the maximum amount of monsters to kill for this task. * @returns {number} The maximum amount of monsters to kill for this task. */ getAmountMax(): number; /** * */ getRequirements(): Requirement[]; /** * * @returns {string[]} An array of alternatives for this task. If alternatives are defined as an object, it flattens the values into a single array. */ getAlternatives(): string[]; /** * * @returns */ toJSON(): TaskJson; /** * Returns a string representation of the Task object. * This method is useful for debugging and logging purposes, providing a quick overview of the task's name and other properties. * @returns {string} A string representation of the Task object, useful for debugging and logging purposes. */ toString(): string; } export { Task }; //# sourceMappingURL=Task.d.ts.map