osrs-tools 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12 -0
- package/dist/jest.config.dev.js +7 -0
- package/dist/model/Requirement.d.ts +65 -0
- package/dist/model/Requirement.js +130 -0
- package/dist/model/account/OsrsAccount.d.ts +31 -0
- package/dist/model/account/OsrsAccount.js +64 -0
- package/dist/model/quest/Quest.d.ts +41 -0
- package/dist/model/quest/Quest.js +2 -0
- package/dist/model/quest/QuestTool.d.ts +51 -0
- package/{src/model/quest/QuestTool.ts → dist/model/quest/QuestTool.js} +78 -96
- package/dist/model/slayer/Assignment.d.ts +17 -0
- package/dist/model/slayer/Assignment.js +28 -0
- package/dist/model/slayer/SlayerMaster.d.ts +67 -0
- package/dist/model/slayer/SlayerMaster.js +112 -0
- package/dist/model/slayer/SlayerReward.d.ts +33 -0
- package/dist/model/slayer/SlayerReward.js +30 -0
- package/dist/model/slayer/Task.d.ts +85 -0
- package/dist/model/slayer/Task.js +117 -0
- package/dist/resources/slayer/Masters.d.ts +10 -0
- package/dist/resources/slayer/Masters.js +100 -0
- package/dist/resources/slayer/SlayerData.d.ts +13 -0
- package/dist/resources/slayer/SlayerData.js +42 -0
- package/dist/resources/slayer/SlayerExtends.d.ts +23 -0
- package/dist/resources/slayer/SlayerExtends.js +184 -0
- package/dist/resources/slayer/SlayerUnlock.d.ts +7 -0
- package/dist/resources/slayer/SlayerUnlock.js +67 -0
- package/dist/resources/slayer/slayerBuys.d.ts +3 -0
- package/dist/resources/slayer/slayerBuys.js +34 -0
- package/dist/resources/slayer/tasks/ChaelderTasks.d.ts +3 -0
- package/dist/resources/slayer/tasks/ChaelderTasks.js +78 -0
- package/dist/resources/slayer/tasks/DuradelTasks.d.ts +2 -0
- package/dist/resources/slayer/tasks/DuradelTasks.js +18 -0
- package/{src/resources/slayer/tasks/KonarTasks.ts → dist/resources/slayer/tasks/KonarTasks.d.ts} +3 -6
- package/dist/resources/slayer/tasks/KonarTasks.js +5 -0
- package/dist/resources/slayer/tasks/MazchnaTasks.d.ts +3 -0
- package/dist/resources/slayer/tasks/MazchnaTasks.js +4 -0
- package/dist/resources/slayer/tasks/NieveTasks.d.ts +3 -0
- package/dist/resources/slayer/tasks/NieveTasks.js +78 -0
- package/dist/resources/slayer/tasks/ReadTasks.d.ts +1 -0
- package/dist/resources/slayer/tasks/ReadTasks.js +63 -0
- package/dist/resources/slayer/tasks/SpriaTasks.d.ts +2 -0
- package/dist/resources/slayer/tasks/SpriaTasks.js +117 -0
- package/dist/resources/slayer/tasks/Tureal.d.ts +3 -0
- package/dist/resources/slayer/tasks/Tureal.js +125 -0
- package/dist/resources/slayer/tasks/VannakaTasks.d.ts +3 -0
- package/dist/resources/slayer/tasks/VannakaTasks.js +78 -0
- package/package.json +22 -25
- package/src/index.ts +0 -11
- package/src/model/Requirement.ts +0 -173
- package/src/model/account/OsrsAccount.ts +0 -82
- package/src/model/quest/Quest.ts +0 -44
- package/src/model/slayer/Assignment.ts +0 -40
- package/src/model/slayer/SlayerMaster.ts +0 -137
- package/src/model/slayer/SlayerReward.ts +0 -39
- package/src/model/slayer/Task.ts +0 -168
- package/src/resources/QuestData.json +0 -754
- package/src/resources/quest/diaries.json +0 -1171
- package/src/resources/quest/diariesArray.json +0 -0
- package/src/resources/quest/exp.json +0 -1333
- package/src/resources/quest/questData.js +0 -5628
- package/src/resources/quest/questData.json +0 -5790
- package/src/resources/quest/questDataArray.js +0 -5489
- package/src/resources/quest/questDataArray.json +0 -5489
- package/src/resources/quest/subquestArray.js +0 -58
- package/src/resources/quest/subquestArray.json +0 -58
- package/src/resources/quest/testObj.json +0 -5682
- package/src/resources/quest/testarray.json +0 -5589
- package/src/resources/quests/CooksAssistant.json +0 -34
- package/src/resources/slayer/Masters.ts +0 -180
- package/src/resources/slayer/SlayerData.ts +0 -45
- package/src/resources/slayer/SlayerExtends.ts +0 -218
- package/src/resources/slayer/SlayerUnlock.ts +0 -194
- package/src/resources/slayer/slayer.json +0 -3581
- package/src/resources/slayer/slayerBuys.ts +0 -38
- package/src/resources/slayer/slayerData.json +0 -4431
- package/src/resources/slayer/tasks/ChaelderTasks.ts +0 -235
- package/src/resources/slayer/tasks/DuradelTasks.ts +0 -75
- package/src/resources/slayer/tasks/MazchnaTasks.ts +0 -5
- package/src/resources/slayer/tasks/NieveTasks.ts +0 -235
- package/src/resources/slayer/tasks/ReadTasks.ts +0 -55
- package/src/resources/slayer/tasks/SpriaTasks.ts +0 -344
- package/src/resources/slayer/tasks/Tureal.ts +0 -436
- package/src/resources/slayer/tasks/VannakaTasks.ts +0 -236
- package/src/resources/slayer/tasks/json/Chaeldar.json +0 -348
- package/src/resources/slayer/tasks/json/Duradel.json +0 -541
- package/src/resources/slayer/tasks/json/Krystilia.json +0 -2
- package/src/resources/slayer/tasks/json/Mazchna.json +0 -379
- package/src/resources/slayer/tasks/json/Neive.json +0 -320
- package/src/resources/slayer/tasks/json/Spria.json +0 -345
- package/src/resources/slayer/tasks/json/Tureal.json +0 -341
- package/src/resources/slayer/tasks/json/Vannaka.json +0 -547
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Task } from "./Task";
|
|
2
|
+
/**
|
|
3
|
+
* SlayerMaster class represents a Slayer Master in the game.
|
|
4
|
+
* It encapsulates the properties and methods related to a Slayer Master,
|
|
5
|
+
* including the tasks they assign, their location, level requirements,
|
|
6
|
+
* and the ability to generate random assignments.
|
|
7
|
+
* Reference: https://oldschool.runescape.wiki/w/Duradel
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare class SlayerMaster {
|
|
11
|
+
name: string;
|
|
12
|
+
totalWeight: number;
|
|
13
|
+
location: string;
|
|
14
|
+
minimumCombatLevel: number;
|
|
15
|
+
tasks: Task[];
|
|
16
|
+
wikiUrl: string;
|
|
17
|
+
taskPoints: Record<number, number>;
|
|
18
|
+
eliteDiaryTaskPoints?: Record<number, number>;
|
|
19
|
+
constructor(name: string, tasks: Task[], location: string, levelRequirement: number, url: string, taskPoints: Record<number, number>, // Pass the task points mapping in the constructor
|
|
20
|
+
eliteDiaryTaskPoints?: Record<number, number>);
|
|
21
|
+
/**
|
|
22
|
+
* Calculate the total weight of all tasks assigned to this Slayer Master.
|
|
23
|
+
* @returns {number} The total weight of all tasks assigned to this Slayer Master.
|
|
24
|
+
*/
|
|
25
|
+
calculateTotalWeight(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Get the points awarded for completing a task based on the interval.
|
|
28
|
+
* @param {number} taskInterval - The interval of the task (e.g., 1 for every task, 10 for every 10th task, etc.).
|
|
29
|
+
* @returns {number} The points awarded for the given task interval.
|
|
30
|
+
*/
|
|
31
|
+
getPointsForTaskInterval(taskInterval: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* Get the location of the Slayer Master
|
|
34
|
+
*/
|
|
35
|
+
getLocation(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the minimum combat level of the Slayer Master
|
|
38
|
+
*/
|
|
39
|
+
getMinimumCombatLevel(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Get the wiki URL of the Slayer Master
|
|
42
|
+
*/
|
|
43
|
+
getWikiUrl(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get a random task based on the weighting system of the tasks.
|
|
46
|
+
* Tasks with higher weights have a higher chance of being selected.
|
|
47
|
+
* @returns {Task | null} A randomly selected task or null if no tasks are available.
|
|
48
|
+
*/
|
|
49
|
+
getRandomTask(): Task | null;
|
|
50
|
+
/**
|
|
51
|
+
* Get the total weight of tasks
|
|
52
|
+
*/
|
|
53
|
+
getTotalWeight(): number;
|
|
54
|
+
/**
|
|
55
|
+
* Get Name of Slayer Master
|
|
56
|
+
*/
|
|
57
|
+
getName(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Get Tasks
|
|
60
|
+
*/
|
|
61
|
+
getTasks(): Task[];
|
|
62
|
+
/**
|
|
63
|
+
* toString function
|
|
64
|
+
*/
|
|
65
|
+
toString(): string;
|
|
66
|
+
}
|
|
67
|
+
export { SlayerMaster };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlayerMaster = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* SlayerMaster class represents a Slayer Master in the game.
|
|
6
|
+
* It encapsulates the properties and methods related to a Slayer Master,
|
|
7
|
+
* including the tasks they assign, their location, level requirements,
|
|
8
|
+
* and the ability to generate random assignments.
|
|
9
|
+
* Reference: https://oldschool.runescape.wiki/w/Duradel
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
class SlayerMaster {
|
|
13
|
+
// Constructor for the SlayerMaster class
|
|
14
|
+
constructor(name, tasks, location, levelRequirement, url, taskPoints, // Pass the task points mapping in the constructor
|
|
15
|
+
eliteDiaryTaskPoints) {
|
|
16
|
+
this.location = ""; // Location of the Slayer Master (optional, can be set later if needed)
|
|
17
|
+
this.minimumCombatLevel = 0; // Level requirement to access this Slayer Master (optional, can be set later if needed)
|
|
18
|
+
this.wikiUrl = ""; // URL for the Slayer Master (optional, can be set later if needed)
|
|
19
|
+
this.name = name;
|
|
20
|
+
this.tasks = tasks; // Array of tasks assigned to this Slayer Master
|
|
21
|
+
this.tasks.forEach((task) => {
|
|
22
|
+
task.weight = task.weight || 0; // Default weight to 0 if not provided
|
|
23
|
+
}); // Initialize the tasks array
|
|
24
|
+
this.totalWeight = this.calculateTotalWeight(); // Calculate the total weight of the tasks
|
|
25
|
+
this.location = location; // Default to an empty string if not provided
|
|
26
|
+
this.minimumCombatLevel = levelRequirement; // Default to 0 if not provided
|
|
27
|
+
this.wikiUrl = url; // Default to an empty string if not provided
|
|
28
|
+
this.taskPoints = taskPoints; // Initialize the task points mapping
|
|
29
|
+
this.eliteDiaryTaskPoints = eliteDiaryTaskPoints; // Optional mapping for elite diary task points
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Calculate the total weight of all tasks assigned to this Slayer Master.
|
|
33
|
+
* @returns {number} The total weight of all tasks assigned to this Slayer Master.
|
|
34
|
+
*/
|
|
35
|
+
calculateTotalWeight() {
|
|
36
|
+
if (this.tasks.length === 0)
|
|
37
|
+
return 0; // Return 0 if there are no tasks
|
|
38
|
+
return this.tasks.reduce((total, task) => {
|
|
39
|
+
return total + (task.weight || 0); // Sum up the weights of all tasks
|
|
40
|
+
}, 0);
|
|
41
|
+
throw new Error("Method not implemented.");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the points awarded for completing a task based on the interval.
|
|
45
|
+
* @param {number} taskInterval - The interval of the task (e.g., 1 for every task, 10 for every 10th task, etc.).
|
|
46
|
+
* @returns {number} The points awarded for the given task interval.
|
|
47
|
+
*/
|
|
48
|
+
getPointsForTaskInterval(taskInterval) {
|
|
49
|
+
return this.taskPoints[taskInterval] || 0; // Return the points for the interval or 0 if not defined
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get the location of the Slayer Master
|
|
53
|
+
*/
|
|
54
|
+
getLocation() {
|
|
55
|
+
return this.location;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the minimum combat level of the Slayer Master
|
|
59
|
+
*/
|
|
60
|
+
getMinimumCombatLevel() {
|
|
61
|
+
return this.minimumCombatLevel;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get the wiki URL of the Slayer Master
|
|
65
|
+
*/
|
|
66
|
+
getWikiUrl() {
|
|
67
|
+
return this.wikiUrl;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get a random task based on the weighting system of the tasks.
|
|
71
|
+
* Tasks with higher weights have a higher chance of being selected.
|
|
72
|
+
* @returns {Task | null} A randomly selected task or null if no tasks are available.
|
|
73
|
+
*/
|
|
74
|
+
getRandomTask() {
|
|
75
|
+
if (this.tasks.length === 0)
|
|
76
|
+
return null; // Return null if there are no tasks
|
|
77
|
+
const randomWeight = Math.random() * this.totalWeight; // Generate a random number between 0 and totalWeight
|
|
78
|
+
let cumulativeWeight = 0;
|
|
79
|
+
for (const task of this.tasks) {
|
|
80
|
+
cumulativeWeight += task.weight || 0; // Add the task's weight to the cumulative weight
|
|
81
|
+
if (randomWeight <= cumulativeWeight) {
|
|
82
|
+
return task; // Return the task if the random weight falls within its range
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return null; // Fallback in case no task is selected (shouldn't happen if weights are correct)
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get the total weight of tasks
|
|
89
|
+
*/
|
|
90
|
+
getTotalWeight() {
|
|
91
|
+
return this.totalWeight;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get Name of Slayer Master
|
|
95
|
+
*/
|
|
96
|
+
getName() {
|
|
97
|
+
return this.name;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get Tasks
|
|
101
|
+
*/
|
|
102
|
+
getTasks() {
|
|
103
|
+
return this.tasks;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* toString function
|
|
107
|
+
*/
|
|
108
|
+
toString() {
|
|
109
|
+
return `SlayerMaster :) WIP SlayerMaster:{\nname: ${this.name}\n}`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.SlayerMaster = SlayerMaster;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare class SlayerUnlock {
|
|
2
|
+
name: string;
|
|
3
|
+
cost: number;
|
|
4
|
+
description: string;
|
|
5
|
+
constructor({ cost, description, name, }: {
|
|
6
|
+
name: string;
|
|
7
|
+
cost: number;
|
|
8
|
+
description: string;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
declare class SlayerExtend {
|
|
12
|
+
name: string;
|
|
13
|
+
cost: number;
|
|
14
|
+
notes: string;
|
|
15
|
+
constructor({ cost, name, notes, }: {
|
|
16
|
+
name: string;
|
|
17
|
+
cost: number;
|
|
18
|
+
notes: string;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
declare class SlayerBuy {
|
|
22
|
+
item: string;
|
|
23
|
+
priceSoldAt: number;
|
|
24
|
+
notes: string;
|
|
25
|
+
constructor({ item, notes, priceSoldAt, }: {
|
|
26
|
+
item: string;
|
|
27
|
+
priceSoldAt: number;
|
|
28
|
+
notes: string;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
declare class SlayerReward {
|
|
32
|
+
}
|
|
33
|
+
export { SlayerBuy, SlayerExtend, SlayerReward, SlayerUnlock };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlayerUnlock = exports.SlayerReward = exports.SlayerExtend = exports.SlayerBuy = void 0;
|
|
4
|
+
class SlayerUnlock {
|
|
5
|
+
constructor({ cost, description, name, }) {
|
|
6
|
+
this.name = name;
|
|
7
|
+
this.cost = cost;
|
|
8
|
+
this.description = description;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.SlayerUnlock = SlayerUnlock;
|
|
12
|
+
class SlayerExtend {
|
|
13
|
+
constructor({ cost, name, notes, }) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.cost = cost;
|
|
16
|
+
this.notes = notes;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.SlayerExtend = SlayerExtend;
|
|
20
|
+
class SlayerBuy {
|
|
21
|
+
constructor({ item, notes, priceSoldAt, }) {
|
|
22
|
+
this.item = item;
|
|
23
|
+
this.priceSoldAt = priceSoldAt;
|
|
24
|
+
this.notes = notes;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.SlayerBuy = SlayerBuy;
|
|
28
|
+
class SlayerReward {
|
|
29
|
+
}
|
|
30
|
+
exports.SlayerReward = SlayerReward;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Requirement } from "../Requirement";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Slayer task in the game. This class encapsulates all the properties and methods related to a Slayer task.
|
|
4
|
+
* A Slayer task defines the monsters that players can be assigned to kill, the amount of those monsters, and various other attributes.
|
|
5
|
+
* A Task is not an assignment, but rather a template for an assignment.
|
|
6
|
+
* The assignment is the actual task given to a player, which is based on the Task.
|
|
7
|
+
*/
|
|
8
|
+
declare class Task {
|
|
9
|
+
name: string;
|
|
10
|
+
weight: number;
|
|
11
|
+
amountMin: number;
|
|
12
|
+
amountMax: number;
|
|
13
|
+
requirements: Requirement[];
|
|
14
|
+
extendedAmountMin?: number | null;
|
|
15
|
+
extendedAmountMax?: number | null;
|
|
16
|
+
alternatives?: any[] | null;
|
|
17
|
+
CombatLevels: number[];
|
|
18
|
+
SlayerExp: number;
|
|
19
|
+
locations: string[];
|
|
20
|
+
WildernessLevels: number[];
|
|
21
|
+
bosses: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Constructor for the Task class.
|
|
24
|
+
* @param name - Name of the task
|
|
25
|
+
* @param amountMin - Minimum amount of monsters to kill for this task
|
|
26
|
+
* @param amountMax - Maximum amount of monsters to kill for this task
|
|
27
|
+
* @param requirements - Array of requirements for this task
|
|
28
|
+
* @param extendedAmountMin - Minimum amount for extended tasks (optional)
|
|
29
|
+
* @param extendedAmountMax - Maximum amount for extended tasks (optional)
|
|
30
|
+
* @param weight - Weight of the task (default is 1)
|
|
31
|
+
* @param alternatives - Array of alternatives for this task (optional)
|
|
32
|
+
* @param CombatLevels - Array of combat levels for this task
|
|
33
|
+
* @param SlayerExp - Slayer experience gained from this task
|
|
34
|
+
* @param locations - Array of locations where this task can be found
|
|
35
|
+
* @param WildernessLevels - Array of wilderness levels for this task
|
|
36
|
+
* @param bosses - Array of bosses for this task
|
|
37
|
+
*/
|
|
38
|
+
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[]);
|
|
39
|
+
static fromJSON(json: any): Task;
|
|
40
|
+
/**
|
|
41
|
+
* Get the name of the task.
|
|
42
|
+
* @example
|
|
43
|
+
* const task = new Task("Goblin", 10, 20, [], 0, null, [], 1);
|
|
44
|
+
* console.log(task.getName()); // "Goblin"
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
getName(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get the weight of the task. The weight is used to determine the likelihood of being assigned this task compared to others.
|
|
50
|
+
* @returns {number} The weight of the task, which can be used to determine the likelihood of being assigned this task compared to others.
|
|
51
|
+
*/
|
|
52
|
+
getWeight(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Get the minimum and maximum amount of monsters to kill for this task.
|
|
55
|
+
* The amountMin and amountMax properties define the range of monsters that can be assigned for this task.
|
|
56
|
+
* @returns {number} The minimum amount of monsters to kill for this task.
|
|
57
|
+
*/
|
|
58
|
+
getAmountMin(): number;
|
|
59
|
+
/**
|
|
60
|
+
* Get the maximum amount of monsters to kill for this task.
|
|
61
|
+
* @returns {number} The maximum amount of monsters to kill for this task.
|
|
62
|
+
*/
|
|
63
|
+
getAmountMax(): number;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
getRequirements(): Requirement[];
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @returns {any[]} An array of alternatives for this task. If alternatives are defined as an object, it flattens the values into a single array.
|
|
71
|
+
*/
|
|
72
|
+
getAlternatives(): any[];
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
77
|
+
toJSON(): any;
|
|
78
|
+
/**
|
|
79
|
+
* Returns a string representation of the Task object.
|
|
80
|
+
* This method is useful for debugging and logging purposes, providing a quick overview of the task's name and other properties.
|
|
81
|
+
* @returns {string} A string representation of the Task object, useful for debugging and logging purposes.
|
|
82
|
+
*/
|
|
83
|
+
toString(): string;
|
|
84
|
+
}
|
|
85
|
+
export { Task };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Task = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents a Slayer task in the game. This class encapsulates all the properties and methods related to a Slayer task.
|
|
6
|
+
* A Slayer task defines the monsters that players can be assigned to kill, the amount of those monsters, and various other attributes.
|
|
7
|
+
* A Task is not an assignment, but rather a template for an assignment.
|
|
8
|
+
* The assignment is the actual task given to a player, which is based on the Task.
|
|
9
|
+
*/
|
|
10
|
+
class Task {
|
|
11
|
+
/**
|
|
12
|
+
* Constructor for the Task class.
|
|
13
|
+
* @param name - Name of the task
|
|
14
|
+
* @param amountMin - Minimum amount of monsters to kill for this task
|
|
15
|
+
* @param amountMax - Maximum amount of monsters to kill for this task
|
|
16
|
+
* @param requirements - Array of requirements for this task
|
|
17
|
+
* @param extendedAmountMin - Minimum amount for extended tasks (optional)
|
|
18
|
+
* @param extendedAmountMax - Maximum amount for extended tasks (optional)
|
|
19
|
+
* @param weight - Weight of the task (default is 1)
|
|
20
|
+
* @param alternatives - Array of alternatives for this task (optional)
|
|
21
|
+
* @param CombatLevels - Array of combat levels for this task
|
|
22
|
+
* @param SlayerExp - Slayer experience gained from this task
|
|
23
|
+
* @param locations - Array of locations where this task can be found
|
|
24
|
+
* @param WildernessLevels - Array of wilderness levels for this task
|
|
25
|
+
* @param bosses - Array of bosses for this task
|
|
26
|
+
*/
|
|
27
|
+
constructor(name, amountMin, amountMax, requirements, extendedAmountMin, extendedAmountMax, alternatives = [], weight = 1, CombatLevels = [], SlayerExp = 0, locations = [], WildernessLevels = [], bosses = []) {
|
|
28
|
+
this.name = name;
|
|
29
|
+
this.weight = weight;
|
|
30
|
+
this.amountMin = amountMin;
|
|
31
|
+
this.amountMax = amountMax;
|
|
32
|
+
this.requirements = requirements;
|
|
33
|
+
this.extendedAmountMin = extendedAmountMin !== null && extendedAmountMin !== void 0 ? extendedAmountMin : null;
|
|
34
|
+
this.extendedAmountMax = extendedAmountMax !== null && extendedAmountMax !== void 0 ? extendedAmountMax : null;
|
|
35
|
+
this.alternatives = alternatives !== null && alternatives !== void 0 ? alternatives : [];
|
|
36
|
+
this.CombatLevels = CombatLevels;
|
|
37
|
+
this.SlayerExp = SlayerExp;
|
|
38
|
+
this.locations = locations;
|
|
39
|
+
this.WildernessLevels = WildernessLevels;
|
|
40
|
+
this.bosses = bosses;
|
|
41
|
+
}
|
|
42
|
+
static fromJSON(json) {
|
|
43
|
+
return new Task(json.name, json.amountMin, json.amountMax, json.extendedAmountMin, json.extendedAmountMax, json.requirements, json.alternatives, json.weight, json.CombatLevels, json.SlayerExp, json.locations, json.WildernessLevels, json.bosses);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get the name of the task.
|
|
47
|
+
* @example
|
|
48
|
+
* const task = new Task("Goblin", 10, 20, [], 0, null, [], 1);
|
|
49
|
+
* console.log(task.getName()); // "Goblin"
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
getName() {
|
|
53
|
+
return this.name;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the weight of the task. The weight is used to determine the likelihood of being assigned this task compared to others.
|
|
57
|
+
* @returns {number} The weight of the task, which can be used to determine the likelihood of being assigned this task compared to others.
|
|
58
|
+
*/
|
|
59
|
+
getWeight() {
|
|
60
|
+
return this.weight;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the minimum and maximum amount of monsters to kill for this task.
|
|
64
|
+
* The amountMin and amountMax properties define the range of monsters that can be assigned for this task.
|
|
65
|
+
* @returns {number} The minimum amount of monsters to kill for this task.
|
|
66
|
+
*/
|
|
67
|
+
getAmountMin() {
|
|
68
|
+
return this.amountMin;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the maximum amount of monsters to kill for this task.
|
|
72
|
+
* @returns {number} The maximum amount of monsters to kill for this task.
|
|
73
|
+
*/
|
|
74
|
+
getAmountMax() {
|
|
75
|
+
return this.amountMax;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
getRequirements() {
|
|
81
|
+
return this.requirements;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @returns {any[]} An array of alternatives for this task. If alternatives are defined as an object, it flattens the values into a single array.
|
|
86
|
+
*/
|
|
87
|
+
getAlternatives() {
|
|
88
|
+
return this.alternatives
|
|
89
|
+
? Array.isArray(this.alternatives)
|
|
90
|
+
? this.alternatives
|
|
91
|
+
: Object.values(this.alternatives).flat()
|
|
92
|
+
: [];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
toJSON() {
|
|
99
|
+
return {
|
|
100
|
+
alternatives: this.alternatives,
|
|
101
|
+
amountMax: this.amountMax,
|
|
102
|
+
amountMin: this.amountMin,
|
|
103
|
+
name: this.name,
|
|
104
|
+
unlockRequirements: this.requirements,
|
|
105
|
+
weight: this.weight,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns a string representation of the Task object.
|
|
110
|
+
* This method is useful for debugging and logging purposes, providing a quick overview of the task's name and other properties.
|
|
111
|
+
* @returns {string} A string representation of the Task object, useful for debugging and logging purposes.
|
|
112
|
+
*/
|
|
113
|
+
toString() {
|
|
114
|
+
return `Task{ name: ${this.name} }`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.Task = Task;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SlayerMaster } from "../../model/slayer/SlayerMaster";
|
|
2
|
+
export declare const Mazchna: SlayerMaster;
|
|
3
|
+
export declare const Spria: SlayerMaster;
|
|
4
|
+
export declare const Turael: SlayerMaster;
|
|
5
|
+
export declare const Vannaka: SlayerMaster;
|
|
6
|
+
export declare const KonarQuoMaten: SlayerMaster;
|
|
7
|
+
export declare const Krystilia: SlayerMaster;
|
|
8
|
+
export declare const Nieve: SlayerMaster;
|
|
9
|
+
export declare const Duradel: SlayerMaster;
|
|
10
|
+
export declare const Chaeldar: SlayerMaster;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Chaeldar = exports.Duradel = exports.Nieve = exports.Krystilia = exports.KonarQuoMaten = exports.Vannaka = exports.Turael = exports.Spria = exports.Mazchna = void 0;
|
|
4
|
+
const SlayerMaster_1 = require("../../model/slayer/SlayerMaster");
|
|
5
|
+
const DuradelTasks_1 = require("./tasks/DuradelTasks");
|
|
6
|
+
const NieveTasks_1 = require("./tasks/NieveTasks");
|
|
7
|
+
const SpriaTasks_1 = require("./tasks/SpriaTasks");
|
|
8
|
+
const Tureal_1 = require("./tasks/Tureal");
|
|
9
|
+
const VannakaTasks_1 = require("./tasks/VannakaTasks");
|
|
10
|
+
// TODO: Add the rest of the tasks for each master
|
|
11
|
+
// TODO: Add the rest of the masters
|
|
12
|
+
// TODO: Ensure points are correct
|
|
13
|
+
// Mazchna: https://oldschool.runescape.wiki/w/Mazchna
|
|
14
|
+
exports.Mazchna = new SlayerMaster_1.SlayerMaster("Mazchna", [], "Canifis", 0, "https://oldschool.runescape.wiki/w/Mazchna", {
|
|
15
|
+
1: 2,
|
|
16
|
+
10: 5,
|
|
17
|
+
100: 50,
|
|
18
|
+
1000: 100,
|
|
19
|
+
250: 70,
|
|
20
|
+
50: 15,
|
|
21
|
+
}, undefined);
|
|
22
|
+
// Spria: https://oldschool.runescape.wiki/w/Spria
|
|
23
|
+
exports.Spria = new SlayerMaster_1.SlayerMaster("Spria", SpriaTasks_1.SpriaTasks, "Draynor Village", 0, "https://oldschool.runescape.wiki/w/Spria", {
|
|
24
|
+
1: 2,
|
|
25
|
+
10: 5,
|
|
26
|
+
100: 50,
|
|
27
|
+
1000: 100,
|
|
28
|
+
250: 70,
|
|
29
|
+
50: 15,
|
|
30
|
+
}, undefined);
|
|
31
|
+
// Tureal: https://oldschool.runescape.wiki/w/Turael
|
|
32
|
+
exports.Turael = new SlayerMaster_1.SlayerMaster("Turael", Tureal_1.turealTasks, "Burthope", 0, "https://oldschool.runescape.wiki/w/Turael", {
|
|
33
|
+
1: 2,
|
|
34
|
+
10: 5,
|
|
35
|
+
100: 50,
|
|
36
|
+
1000: 100,
|
|
37
|
+
250: 70,
|
|
38
|
+
50: 15,
|
|
39
|
+
}, undefined);
|
|
40
|
+
// Vannaka: https://oldschool.runescape.wiki/w/Vannaka
|
|
41
|
+
exports.Vannaka = new SlayerMaster_1.SlayerMaster("Vannaka", VannakaTasks_1.VannakaTasks, "Edgeville Dungeon", 0, "https://oldschool.runescape.wiki/w/Vannaka", {
|
|
42
|
+
1: 2,
|
|
43
|
+
10: 5,
|
|
44
|
+
100: 50,
|
|
45
|
+
1000: 100,
|
|
46
|
+
250: 70,
|
|
47
|
+
50: 15,
|
|
48
|
+
}, undefined);
|
|
49
|
+
// Konar Quo Maten: https://oldschool.runescape.wiki/w/Konar_Quo_Maten
|
|
50
|
+
exports.KonarQuoMaten = new SlayerMaster_1.SlayerMaster("Konar Quo Maten", [], "Mount Karuulm", 0, "https://oldschool.runescape.wiki/w/Konar_Quo_Maten", {
|
|
51
|
+
1: 2,
|
|
52
|
+
10: 5,
|
|
53
|
+
100: 50,
|
|
54
|
+
1000: 100,
|
|
55
|
+
250: 70,
|
|
56
|
+
50: 15,
|
|
57
|
+
}, undefined);
|
|
58
|
+
// Krystilia: https://oldschool.runescape.wiki/w/Krystilia
|
|
59
|
+
exports.Krystilia = new SlayerMaster_1.SlayerMaster("Krystilia", [], "Edgeville", 0, "https://oldschool.runescape.wiki/w/Krystilia", {
|
|
60
|
+
1: 2,
|
|
61
|
+
10: 5,
|
|
62
|
+
100: 50,
|
|
63
|
+
1000: 100,
|
|
64
|
+
250: 70,
|
|
65
|
+
50: 15,
|
|
66
|
+
}, undefined);
|
|
67
|
+
// Nieve: https://oldschool.runescape.wiki/w/Nieve
|
|
68
|
+
exports.Nieve = new SlayerMaster_1.SlayerMaster("Nieve", NieveTasks_1.NieveTasks, "Nieve's Cave", 0, "https://oldschool.runescape.wiki/w/Nieve", {
|
|
69
|
+
1: 12,
|
|
70
|
+
10: 60,
|
|
71
|
+
100: 300,
|
|
72
|
+
1000: 600,
|
|
73
|
+
250: 420,
|
|
74
|
+
50: 180,
|
|
75
|
+
}, {
|
|
76
|
+
1: 15,
|
|
77
|
+
10: 75,
|
|
78
|
+
100: 375,
|
|
79
|
+
1000: 750,
|
|
80
|
+
250: 525,
|
|
81
|
+
50: 225,
|
|
82
|
+
});
|
|
83
|
+
// Duradel: https://oldschool.runescape.wiki/w/Duradel
|
|
84
|
+
exports.Duradel = new SlayerMaster_1.SlayerMaster("Duradel", DuradelTasks_1.DuradelTasks, "Shilo Village", 85, "https://oldschool.runescape.wiki/w/Duradel", {
|
|
85
|
+
1: 15,
|
|
86
|
+
10: 75,
|
|
87
|
+
100: 375,
|
|
88
|
+
1000: 750,
|
|
89
|
+
250: 525,
|
|
90
|
+
50: 225,
|
|
91
|
+
}, undefined);
|
|
92
|
+
// Chaeldar: https://oldschool.runescape.wiki/w/Chaeldar
|
|
93
|
+
exports.Chaeldar = new SlayerMaster_1.SlayerMaster("Chaeldar", [], "Zanaris", 0, "https://oldschool.runescape.wiki/w/Chaeldar", {
|
|
94
|
+
1: 10,
|
|
95
|
+
10: 50,
|
|
96
|
+
100: 250,
|
|
97
|
+
1000: 500,
|
|
98
|
+
250: 350,
|
|
99
|
+
50: 150,
|
|
100
|
+
}, undefined);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SlayerMaster } from "../../model/slayer/SlayerMaster";
|
|
2
|
+
import { Duradel, KonarQuoMaten, Krystilia, Mazchna, Nieve, Spria, Turael, Vannaka } from "./Masters";
|
|
3
|
+
type SlayerData = Record<string, SlayerMaster>;
|
|
4
|
+
declare const SlayerData: SlayerData;
|
|
5
|
+
export declare function getSlayerMasterByName(name: string): SlayerMaster | undefined;
|
|
6
|
+
export declare class SlayerTool {
|
|
7
|
+
private slayerMasters;
|
|
8
|
+
constructor(slayerMasters: SlayerData);
|
|
9
|
+
getSlayerMaster(name: string): SlayerMaster | undefined;
|
|
10
|
+
getAllSlayerMasters(): SlayerMaster[];
|
|
11
|
+
}
|
|
12
|
+
export default SlayerData;
|
|
13
|
+
export { Duradel, KonarQuoMaten, Krystilia, Mazchna, Nieve, Spria, Turael, Vannaka, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Vannaka = exports.Turael = exports.Spria = exports.Nieve = exports.Mazchna = exports.Krystilia = exports.KonarQuoMaten = exports.Duradel = exports.SlayerTool = void 0;
|
|
4
|
+
exports.getSlayerMasterByName = getSlayerMasterByName;
|
|
5
|
+
const Masters_1 = require("./Masters");
|
|
6
|
+
Object.defineProperty(exports, "Duradel", { enumerable: true, get: function () { return Masters_1.Duradel; } });
|
|
7
|
+
Object.defineProperty(exports, "KonarQuoMaten", { enumerable: true, get: function () { return Masters_1.KonarQuoMaten; } });
|
|
8
|
+
Object.defineProperty(exports, "Krystilia", { enumerable: true, get: function () { return Masters_1.Krystilia; } });
|
|
9
|
+
Object.defineProperty(exports, "Mazchna", { enumerable: true, get: function () { return Masters_1.Mazchna; } });
|
|
10
|
+
Object.defineProperty(exports, "Nieve", { enumerable: true, get: function () { return Masters_1.Nieve; } });
|
|
11
|
+
Object.defineProperty(exports, "Spria", { enumerable: true, get: function () { return Masters_1.Spria; } });
|
|
12
|
+
Object.defineProperty(exports, "Turael", { enumerable: true, get: function () { return Masters_1.Turael; } });
|
|
13
|
+
Object.defineProperty(exports, "Vannaka", { enumerable: true, get: function () { return Masters_1.Vannaka; } });
|
|
14
|
+
// Gerenate the SlayerData object
|
|
15
|
+
const SlayerData = {
|
|
16
|
+
Duradel: Masters_1.Duradel,
|
|
17
|
+
KonarQuoMaten: Masters_1.KonarQuoMaten,
|
|
18
|
+
Krystilia: Masters_1.Krystilia,
|
|
19
|
+
Mazchna: Masters_1.Mazchna,
|
|
20
|
+
Nieve: Masters_1.Nieve,
|
|
21
|
+
Spria: Masters_1.Spria,
|
|
22
|
+
Turael: Masters_1.Turael,
|
|
23
|
+
Vannaka: Masters_1.Vannaka,
|
|
24
|
+
};
|
|
25
|
+
// Function to get a SlayerMaster by name
|
|
26
|
+
function getSlayerMasterByName(name) {
|
|
27
|
+
return SlayerData[name];
|
|
28
|
+
}
|
|
29
|
+
class SlayerTool {
|
|
30
|
+
constructor(slayerMasters) {
|
|
31
|
+
this.slayerMasters = slayerMasters;
|
|
32
|
+
}
|
|
33
|
+
getSlayerMaster(name) {
|
|
34
|
+
return this.slayerMasters[name];
|
|
35
|
+
}
|
|
36
|
+
getAllSlayerMasters() {
|
|
37
|
+
return Object.values(this.slayerMasters);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.SlayerTool = SlayerTool;
|
|
41
|
+
// Export the SlayerData object for use in other parts of the application
|
|
42
|
+
exports.default = SlayerData;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class SlayerExtend {
|
|
2
|
+
name: string;
|
|
3
|
+
cost: number;
|
|
4
|
+
notes: string;
|
|
5
|
+
constructor({ cost, name, notes, }: {
|
|
6
|
+
name: string;
|
|
7
|
+
cost: number;
|
|
8
|
+
notes: string;
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Get the name of the Slayer Extend
|
|
12
|
+
*/
|
|
13
|
+
getName(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get the cost of the Slayer Extend
|
|
16
|
+
*/
|
|
17
|
+
getCost(): number;
|
|
18
|
+
/**
|
|
19
|
+
* Get the notes of the Slayer Extend
|
|
20
|
+
*/
|
|
21
|
+
getNotes(): string;
|
|
22
|
+
}
|
|
23
|
+
export declare const SlayerExtends: SlayerExtend[];
|