osrs-tools 0.2.2 → 0.2.3

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.
Files changed (167) hide show
  1. package/dist/Requirement.d.ts +64 -0
  2. package/dist/Requirement.js +105 -0
  3. package/dist/account/OsrsAccount.d.ts +31 -0
  4. package/dist/account/OsrsAccount.js +64 -0
  5. package/dist/account/Skill.d.ts +25 -0
  6. package/dist/account/Skill.js +29 -0
  7. package/dist/misc/Item.d.ts +7 -0
  8. package/dist/misc/Item.js +12 -0
  9. package/dist/quest/Quest.d.ts +45 -0
  10. package/dist/quest/Quest.js +10 -0
  11. package/dist/quest/QuestTool.d.ts +51 -0
  12. package/dist/quest/QuestTool.js +78 -0
  13. package/dist/quest/all/APorcineOfInterest.d.ts +3 -0
  14. package/dist/quest/all/APorcineOfInterest.js +42 -0
  15. package/dist/quest/all/ASoulsBane.d.ts +3 -0
  16. package/dist/quest/all/ASoulsBane.js +36 -0
  17. package/dist/quest/all/ATailOfTwoCats.d.ts +3 -0
  18. package/dist/quest/all/ATailOfTwoCats.js +36 -0
  19. package/dist/quest/all/ATasteOfHope.d.ts +3 -0
  20. package/dist/quest/all/ATasteOfHope.js +36 -0
  21. package/dist/quest/all/AnimalMagnetism.d.ts +3 -0
  22. package/dist/quest/all/AnimalMagnetism.js +36 -0
  23. package/dist/quest/all/AnotherSliceOfHAM.d.ts +3 -0
  24. package/dist/quest/all/AnotherSliceOfHAM.js +36 -0
  25. package/dist/quest/all/BelowIceMountain.d.ts +3 -0
  26. package/dist/quest/all/BelowIceMountain.js +44 -0
  27. package/dist/quest/all/BetweenARock.d.ts +3 -0
  28. package/dist/quest/all/BetweenARock.js +36 -0
  29. package/dist/quest/all/BigChompyBirdHunting.d.ts +3 -0
  30. package/dist/quest/all/BigChompyBirdHunting.js +36 -0
  31. package/dist/quest/all/Biohazard.d.ts +3 -0
  32. package/dist/quest/all/Biohazard.js +36 -0
  33. package/dist/quest/all/BlackKnightsFortress.d.ts +3 -0
  34. package/dist/quest/all/BlackKnightsFortress.js +36 -0
  35. package/dist/quest/all/BoneVoyage.d.ts +3 -0
  36. package/dist/quest/all/BoneVoyage.js +36 -0
  37. package/dist/quest/all/CabinFever.d.ts +3 -0
  38. package/dist/quest/all/CabinFever.js +36 -0
  39. package/dist/quest/all/ClientOfKourend.d.ts +3 -0
  40. package/dist/quest/all/ClientOfKourend.js +36 -0
  41. package/dist/quest/all/ClockTower.d.ts +3 -0
  42. package/dist/quest/all/ClockTower.js +36 -0
  43. package/dist/quest/all/ColdWar.d.ts +3 -0
  44. package/dist/quest/all/ColdWar.js +36 -0
  45. package/dist/quest/all/Contact.d.ts +3 -0
  46. package/dist/quest/all/Contact.js +36 -0
  47. package/dist/quest/all/CookAssistant.d.ts +3 -0
  48. package/dist/quest/all/CookAssistant.js +46 -0
  49. package/dist/quest/all/CooksAssistant.d.ts +3 -0
  50. package/dist/quest/all/CooksAssistant.js +36 -0
  51. package/dist/quest/all/CreatureOfFenkenstrain.d.ts +3 -0
  52. package/dist/quest/all/CreatureOfFenkenstrain.js +36 -0
  53. package/dist/quest/all/DarknessOfHallowvale.d.ts +3 -0
  54. package/dist/quest/all/DarknessOfHallowvale.js +36 -0
  55. package/dist/quest/all/DeathPlateau.d.ts +3 -0
  56. package/dist/quest/all/DeathPlateau.js +36 -0
  57. package/dist/quest/all/DeathToTheDorgeshuun.d.ts +3 -0
  58. package/dist/quest/all/DeathToTheDorgeshuun.js +36 -0
  59. package/dist/quest/all/DemonSlayer.d.ts +3 -0
  60. package/dist/quest/all/DemonSlayer.js +36 -0
  61. package/dist/quest/all/DeviousMinds.d.ts +3 -0
  62. package/dist/quest/all/DeviousMinds.js +36 -0
  63. package/dist/quest/all/DoricsQuest.d.ts +3 -0
  64. package/dist/quest/all/DoricsQuest.js +36 -0
  65. package/dist/quest/all/DragonSlayer.d.ts +3 -0
  66. package/dist/quest/all/DragonSlayer.js +36 -0
  67. package/dist/quest/all/DragonSlayerII.d.ts +3 -0
  68. package/dist/quest/all/DragonSlayerII.js +36 -0
  69. package/dist/quest/all/DruidicRitual.d.ts +3 -0
  70. package/dist/quest/all/DruidicRitual.js +36 -0
  71. package/dist/quest/all/DwarfCannon.d.ts +3 -0
  72. package/dist/quest/all/DwarfCannon.js +36 -0
  73. package/dist/quest/all/EadgarsRuse.d.ts +3 -0
  74. package/dist/quest/all/EadgarsRuse.js +36 -0
  75. package/dist/quest/all/EaglesPeak.d.ts +3 -0
  76. package/dist/quest/all/EaglesPeak.js +36 -0
  77. package/dist/quest/all/ElementalWorkshopI.d.ts +3 -0
  78. package/dist/quest/all/ElementalWorkshopI.js +36 -0
  79. package/dist/quest/all/ElementalWorkshopII.d.ts +3 -0
  80. package/dist/quest/all/ElementalWorkshopII.js +36 -0
  81. package/dist/quest/all/EnakhrasLament.d.ts +3 -0
  82. package/dist/quest/all/EnakhrasLament.js +36 -0
  83. package/dist/quest/all/EnlightenedJourney.d.ts +3 -0
  84. package/dist/quest/all/EnlightenedJourney.js +36 -0
  85. package/dist/quest/all/FairytaleIGrowingPains.d.ts +3 -0
  86. package/dist/quest/all/FairytaleIGrowingPains.js +36 -0
  87. package/dist/quest/all/FairytaleIICureAQueen.d.ts +3 -0
  88. package/dist/quest/all/FairytaleIICureAQueen.js +36 -0
  89. package/dist/quest/all/FamilyCrest.d.ts +3 -0
  90. package/dist/quest/all/FamilyCrest.js +36 -0
  91. package/dist/quest/all/FightArena.d.ts +3 -0
  92. package/dist/quest/all/FightArena.js +36 -0
  93. package/dist/quest/all/FishingContest.d.ts +3 -0
  94. package/dist/quest/all/FishingContest.js +36 -0
  95. package/dist/quest/all/ForgettableTale.d.ts +3 -0
  96. package/dist/quest/all/ForgettableTale.js +36 -0
  97. package/dist/quest/all/GardenOfTranquillity.d.ts +3 -0
  98. package/dist/quest/all/GardenOfTranquillity.js +36 -0
  99. package/dist/quest/all/GertrudesCat.d.ts +3 -0
  100. package/dist/quest/all/GertrudesCat.js +36 -0
  101. package/dist/quest/all/GettingAhead.d.ts +3 -0
  102. package/dist/quest/all/GettingAhead.js +36 -0
  103. package/dist/quest/all/GhostsAhoy.d.ts +3 -0
  104. package/dist/quest/all/GhostsAhoy.js +36 -0
  105. package/dist/quest/all/GoblinDiplomacy.d.ts +3 -0
  106. package/dist/quest/all/GoblinDiplomacy.js +36 -0
  107. package/dist/quest/all/GrimTales.d.ts +3 -0
  108. package/dist/quest/all/GrimTales.js +36 -0
  109. package/dist/quest/all/HauntedMine.d.ts +3 -0
  110. package/dist/quest/all/HauntedMine.js +36 -0
  111. package/dist/quest/all/HazeelCult.d.ts +3 -0
  112. package/dist/quest/all/HazeelCult.js +36 -0
  113. package/dist/quest/all/HeroesQuest.d.ts +3 -0
  114. package/dist/quest/all/HeroesQuest.js +57 -0
  115. package/dist/quest/all/HolyGrail.d.ts +3 -0
  116. package/dist/quest/all/HolyGrail.js +44 -0
  117. package/dist/quest/all/HorrorFromTheDeep.d.ts +3 -0
  118. package/dist/quest/all/HorrorFromTheDeep.js +44 -0
  119. package/dist/quest/all/IcthlarinsLittleHelper.d.ts +3 -0
  120. package/dist/quest/all/IcthlarinsLittleHelper.js +36 -0
  121. package/dist/quest/all/ImpCatcher.d.ts +3 -0
  122. package/dist/quest/all/ImpCatcher.js +36 -0
  123. package/dist/quest/all/InAidOfTheMyreque.d.ts +3 -0
  124. package/dist/quest/all/InAidOfTheMyreque.js +42 -0
  125. package/dist/quest/all/InSearchOfTheMyreque.d.ts +3 -0
  126. package/dist/quest/all/InSearchOfTheMyreque.js +46 -0
  127. package/dist/quest/all/JunglePotion.d.ts +3 -0
  128. package/dist/quest/all/JunglePotion.js +37 -0
  129. package/dist/quest/all/KingsRansom.d.ts +3 -0
  130. package/dist/quest/all/KingsRansom.js +44 -0
  131. package/dist/slayer/Assignment.d.ts +17 -0
  132. package/dist/slayer/Assignment.js +28 -0
  133. package/dist/slayer/Masters.d.ts +10 -0
  134. package/dist/slayer/Masters.js +100 -0
  135. package/dist/slayer/SlayerBuys.d.ts +3 -0
  136. package/dist/slayer/SlayerBuys.js +34 -0
  137. package/dist/slayer/SlayerData.d.ts +13 -0
  138. package/dist/slayer/SlayerData.js +42 -0
  139. package/dist/slayer/SlayerExtends.d.ts +23 -0
  140. package/dist/slayer/SlayerExtends.js +184 -0
  141. package/dist/slayer/SlayerMaster.d.ts +67 -0
  142. package/dist/slayer/SlayerMaster.js +112 -0
  143. package/dist/slayer/SlayerReward.d.ts +33 -0
  144. package/dist/slayer/SlayerReward.js +30 -0
  145. package/dist/slayer/SlayerUnlock.d.ts +7 -0
  146. package/dist/slayer/SlayerUnlock.js +67 -0
  147. package/dist/slayer/Task.d.ts +85 -0
  148. package/dist/slayer/Task.js +117 -0
  149. package/dist/slayer/task/ChaelderTasks.d.ts +3 -0
  150. package/dist/slayer/task/ChaelderTasks.js +78 -0
  151. package/dist/slayer/task/DuradelTasks.d.ts +2 -0
  152. package/dist/slayer/task/DuradelTasks.js +18 -0
  153. package/dist/slayer/task/KonarTasks.d.ts +3 -0
  154. package/dist/slayer/task/KonarTasks.js +5 -0
  155. package/dist/slayer/task/MazchnaTasks.d.ts +3 -0
  156. package/dist/slayer/task/MazchnaTasks.js +4 -0
  157. package/dist/slayer/task/NieveTasks.d.ts +3 -0
  158. package/dist/slayer/task/NieveTasks.js +78 -0
  159. package/dist/slayer/task/ReadTasks.d.ts +1 -0
  160. package/dist/slayer/task/ReadTasks.js +63 -0
  161. package/dist/slayer/task/SpriaTasks.d.ts +2 -0
  162. package/dist/slayer/task/SpriaTasks.js +117 -0
  163. package/dist/slayer/task/Tureal.d.ts +3 -0
  164. package/dist/slayer/task/Tureal.js +125 -0
  165. package/dist/slayer/task/VannakaTasks.d.ts +2 -0
  166. package/dist/slayer/task/VannakaTasks.js +78 -0
  167. package/package.json +2 -4
@@ -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[];
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlayerExtends = exports.SlayerExtend = void 0;
4
+ class SlayerExtend {
5
+ constructor({ cost, name, notes, }) {
6
+ this.name = name;
7
+ this.cost = cost;
8
+ this.notes = notes;
9
+ }
10
+ /**
11
+ * Get the name of the Slayer Extend
12
+ */
13
+ getName() {
14
+ return this.name;
15
+ }
16
+ /**
17
+ * Get the cost of the Slayer Extend
18
+ */
19
+ getCost() {
20
+ return this.cost;
21
+ }
22
+ /**
23
+ * Get the notes of the Slayer Extend
24
+ */
25
+ getNotes() {
26
+ return this.notes;
27
+ }
28
+ }
29
+ exports.SlayerExtend = SlayerExtend;
30
+ // Define each SlayerExtend as a const
31
+ const NeedMoreDarkness = new SlayerExtend({
32
+ cost: 100,
33
+ name: "Need more darkness",
34
+ notes: "Number of dark beasts assigned is increased to 100-149.",
35
+ });
36
+ const AnkouVeryMuch = new SlayerExtend({
37
+ cost: 100,
38
+ name: "Ankou very much",
39
+ notes: "Number of ankous assigned is increased to 91-149.",
40
+ });
41
+ const SuqAnotherOne = new SlayerExtend({
42
+ cost: 100,
43
+ name: "Suq-a-nother one",
44
+ notes: "Number of suqahs assigned is increased to 185-250.",
45
+ });
46
+ const FireAndDarkness = new SlayerExtend({
47
+ cost: 50,
48
+ name: "Fire & Darkness",
49
+ notes: "Number of black dragons assigned is increased to 40-60.",
50
+ });
51
+ const PedalToTheMetals = new SlayerExtend({
52
+ cost: 100,
53
+ name: "Pedal to the metals",
54
+ notes: "Number of bronze, iron and steel dragons assigned is increased to 30-50, 60-100 and 40-60, respectively.",
55
+ });
56
+ const IReallyMithYou = new SlayerExtend({
57
+ cost: 120,
58
+ name: "I really mith you",
59
+ notes: "Number of mithril dragons assigned is increased to 20-40.",
60
+ });
61
+ const AdaMindSomeMore = new SlayerExtend({
62
+ cost: 100,
63
+ name: "Ada'mind some more",
64
+ notes: "Number of adamant dragons assigned is increased to 20-30.",
65
+ });
66
+ const Ruuuuune = new SlayerExtend({
67
+ cost: 100,
68
+ name: "RUUUUUNE",
69
+ notes: "Number of rune dragons assigned is increased to 30-60.",
70
+ });
71
+ const SpiritualFervour = new SlayerExtend({
72
+ cost: 100,
73
+ name: "Spiritual fervour",
74
+ notes: "Number of spiritual creatures assigned is increased to 181-250.",
75
+ });
76
+ const BirdsOfAFeather = new SlayerExtend({
77
+ cost: 100,
78
+ name: "Birds of a Feather",
79
+ notes: "Number of aviansies assigned is increased to 130-250.",
80
+ });
81
+ const GreaterChallenge = new SlayerExtend({
82
+ cost: 100,
83
+ name: "Greater challenge",
84
+ notes: "Number of greater demons assigned is increased to 150-200.",
85
+ });
86
+ const ItsDarkInHere = new SlayerExtend({
87
+ cost: 100,
88
+ name: "It's dark in here",
89
+ notes: "Number of black demons assigned is increased to 200-250.",
90
+ });
91
+ const BleedMeDry = new SlayerExtend({
92
+ cost: 75,
93
+ name: "Bleed me dry",
94
+ notes: "Number of bloodvelds assigned is increased to 200-250.",
95
+ });
96
+ const SmellYaLater = new SlayerExtend({
97
+ cost: 100,
98
+ name: "Smell ya later",
99
+ notes: "Number of aberrant spectres assigned is increased to 200-250.",
100
+ });
101
+ const Horrorific = new SlayerExtend({
102
+ cost: 100,
103
+ name: "Horrorific",
104
+ notes: "Number of cave horrors assigned is increased to 200-250.",
105
+ });
106
+ const ToDustYouShallReturn = new SlayerExtend({
107
+ cost: 100,
108
+ name: "To dust you shall return",
109
+ notes: "Number of dust devils assigned is increased to 200-250.",
110
+ });
111
+ const WyverNotherOne = new SlayerExtend({
112
+ cost: 100,
113
+ name: "Wyver-nother one",
114
+ notes: "Number of skeletal Wyverns assigned is increased to 50-75.",
115
+ });
116
+ const GetSmashed = new SlayerExtend({
117
+ cost: 100,
118
+ name: "Get smashed",
119
+ notes: "Number of gargoyles assigned is increased to 200-250.",
120
+ });
121
+ const NechsPlease = new SlayerExtend({
122
+ cost: 100,
123
+ name: "Nechs please",
124
+ notes: "Number of nechryael assigned is increased to 200-250.",
125
+ });
126
+ const AugmentMyAbbies = new SlayerExtend({
127
+ cost: 100,
128
+ name: "Augment my abbies",
129
+ notes: "Number of abyssal demons assigned is increased to 200-250.",
130
+ });
131
+ const KrackOn = new SlayerExtend({
132
+ cost: 100,
133
+ name: "Krack on",
134
+ notes: "Number of cave kraken assigned is increased to 150-200.",
135
+ });
136
+ const GetScabarightOnIt = new SlayerExtend({
137
+ cost: 50,
138
+ name: "Get scabaright on it",
139
+ notes: "Number of scabarites assigned is increased to 130-170.",
140
+ });
141
+ const WyverNotherTwo = new SlayerExtend({
142
+ cost: 100,
143
+ name: "Wyver-nother two",
144
+ notes: "Number of Fossil Island wyverns assigned is increased to 55-75.",
145
+ });
146
+ const Basilonger = new SlayerExtend({
147
+ cost: 100,
148
+ name: "Basilonger",
149
+ notes: "Number of Basilisks assigned is increased to 200-250.",
150
+ });
151
+ const MoreAtStake = new SlayerExtend({
152
+ cost: 100,
153
+ name: "More at stake",
154
+ notes: "Number of Vampyres assigned is increased to 200-250.",
155
+ });
156
+ // Add all defined SlayerExtend objects to the array
157
+ exports.SlayerExtends = [
158
+ NeedMoreDarkness,
159
+ AnkouVeryMuch,
160
+ SuqAnotherOne,
161
+ FireAndDarkness,
162
+ PedalToTheMetals,
163
+ IReallyMithYou,
164
+ AdaMindSomeMore,
165
+ Ruuuuune,
166
+ SpiritualFervour,
167
+ BirdsOfAFeather,
168
+ GreaterChallenge,
169
+ ItsDarkInHere,
170
+ BleedMeDry,
171
+ SmellYaLater,
172
+ Horrorific,
173
+ ToDustYouShallReturn,
174
+ WyverNotherOne,
175
+ GetSmashed,
176
+ NechsPlease,
177
+ AugmentMyAbbies,
178
+ KrackOn,
179
+ GetScabarightOnIt,
180
+ WyverNotherTwo,
181
+ Basilonger,
182
+ MoreAtStake,
183
+ // Add additional SlayerExtend objects here...
184
+ ];
@@ -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,7 @@
1
+ export declare class SlayerUnlock {
2
+ name: string;
3
+ cost: number;
4
+ description: string;
5
+ constructor(name: string, cost: number, description: string);
6
+ }
7
+ export declare const SlayerUnlocks: SlayerUnlock[];
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlayerUnlocks = exports.SlayerUnlock = void 0;
4
+ class SlayerUnlock {
5
+ constructor(name, cost, description) {
6
+ this.name = name;
7
+ this.cost = cost;
8
+ this.description = description;
9
+ }
10
+ }
11
+ exports.SlayerUnlock = SlayerUnlock;
12
+ const WatchTheBirdie = new SlayerUnlock("Watch the birdie", 80, "Konar, Duradel, Nieve and Chaeldar will be able to assign you Aviansie as your task.");
13
+ const GargoyleSmasher = new SlayerUnlock("Gargoyle smasher", 120, "Gargoyles are automatically dealt the finishing blow if the player has a Rock hammer in their inventory.");
14
+ const SlugSalter = new SlayerUnlock("Slug salter", 80, "Rock slugs are automatically dealt the finishing blow if the player has a Bag of salt in their inventory.");
15
+ const ReptileFreezer = new SlayerUnlock("Reptile freezer", 90, "Desert lizards are automatically dealt the finishing blow if the player has an Ice cooler in their inventory.");
16
+ const ShroomSprayer = new SlayerUnlock("Shroom sprayer", 110, "Mutated zygomites are automatically dealt the finishing blow if the player has Fungicide spray & Fungicide.");
17
+ const BroaderFletching = new SlayerUnlock("Broader fletching", 300, "Learn to fletch Broad arrows (level 52 Fletching), Broad bolts (level 55 Fletching), and Amethyst broad bolts (level 76 Fletching).");
18
+ const Malevolent = new SlayerUnlock("Malevolent masquerade", 400, "Learn to assemble a Slayer helmet, which requires level 55 Crafting.");
19
+ const ringbling = new SlayerUnlock("Ring bling", 300, "Learn to craft a Slayer ring, which requires level 75 Crafting.");
20
+ const Seeingred = new SlayerUnlock("Seeing red", 50, "Konar, Duradel and Nieve will be able to assign you Red dragons as your task.");
21
+ const mithme = new SlayerUnlock("I hope you mith me", 80, "Konar, Duradel and Nieve will be able to assign you Mithril dragons as your task.");
22
+ const HotStuff = new SlayerUnlock("Hot stuff", 100, "Duradel, Nieve and Chaeldar will be able to assign TzHaar as your task. You may also be offered a chance to slay TzTok-Jad.");
23
+ const ReptileGotRipped = new SlayerUnlock("Reptile got ripped", 75, "Konar, Duradel, Nieve, and Chaeldar will be able to assign Lizardmen as your task.");
24
+ const LikeABoss = new SlayerUnlock("Like a boss", 200, "Konar, Duradel, Krystilia and Nieve will be able to assign boss monsters as your task, excluding the Corporeal Beast.");
25
+ const BiggerAndBadder = new SlayerUnlock("Bigger and Badder", 150, "Certain slayer monsters will have the chance of spawning a superior version whilst on a slayer task.");
26
+ const KingBlackBonnet = new SlayerUnlock("King black bonnet", 1000, "Learn how to combine a KBD head with your slayer helm to colour it black.");
27
+ const KalphiteKhat = new SlayerUnlock("Kalphite khat", 1000, "Learn how to combine a Kalphite Queen head with your slayer helm to colour it green.");
28
+ const UnholyHelmet = new SlayerUnlock("Unholy helmet", 1000, "Learn how to combine an Abyssal Demon head with your slayer helm to colour it red.");
29
+ const DarkMantle = new SlayerUnlock("Dark Mantle", 1000, "Learn how to combine a Dark Claw with your slayer helm to colour it purple.");
30
+ const UndeadHead = new SlayerUnlock("Undead Head", 1000, "Learn how to combine Vorkath's head with your slayer helm to colour it turquoise.");
31
+ const UseMoreHead = new SlayerUnlock("Use more head", 1000, "Learn how to combine a Hydra head with your slayer helm to theme it like the Alchemical Hydra.");
32
+ const TwistedVision = new SlayerUnlock("Twisted Vision", 1000, "Learn how to combine the Twisted Horns with your slayer helm to theme it like the Great Olm.");
33
+ const DulyNoted = new SlayerUnlock("Duly noted", 200, "Mithril dragons drop mithril bars in banknote form while killed on assignment.");
34
+ const StopTheWyvern = new SlayerUnlock("Stop the Wyvern", 500, "Stops you getting Fossil Island Wyvern tasks, without counting towards your blocked task limit. This does not cancel a current fossil wyvern task.");
35
+ const DoubleTrouble = new SlayerUnlock("Double Trouble", 500, "Slaying Dusk and Dawn now counts for two kills towards your task rather than one.");
36
+ const Basilocked = new SlayerUnlock("Basilocked", 80, "Konar, Duradel and Nieve will be able to assign Basilisks as your task.");
37
+ const ActualVampyreSlayer = new SlayerUnlock("Actual Vampyre Slayer", 80, "Konar, Duradel, Nieve, and Chaeldar will be able to assign Vampyres as your task.");
38
+ const TaskStorage = new SlayerUnlock("Task Storage", 1000, "Gain the ability to store your task for 50 points, allowing you to take it at a later time.");
39
+ exports.SlayerUnlocks = [
40
+ GargoyleSmasher,
41
+ SlugSalter,
42
+ ReptileFreezer,
43
+ ShroomSprayer,
44
+ BroaderFletching,
45
+ Malevolent,
46
+ ringbling,
47
+ Seeingred,
48
+ mithme,
49
+ WatchTheBirdie,
50
+ HotStuff,
51
+ ReptileGotRipped,
52
+ LikeABoss,
53
+ BiggerAndBadder,
54
+ KingBlackBonnet,
55
+ KalphiteKhat,
56
+ UnholyHelmet,
57
+ DarkMantle,
58
+ UndeadHead,
59
+ UseMoreHead,
60
+ TwistedVision,
61
+ DulyNoted,
62
+ StopTheWyvern,
63
+ DoubleTrouble,
64
+ Basilocked,
65
+ ActualVampyreSlayer,
66
+ TaskStorage,
67
+ ];
@@ -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 };