osrs-tools 0.2.0 → 0.2.1
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 -19
- 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
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// import { QuestTool } from './questTool.js';
|
|
4
|
+
const QuestTool_1 = require("./model/quest/QuestTool");
|
|
5
|
+
const SlayerTool_1 = require("./model/slayer/SlayerTool");
|
|
6
|
+
const OsrsAccount_1 = require("./model/account/OsrsAccount");
|
|
7
|
+
exports.default = {
|
|
8
|
+
QuestTool: QuestTool_1.QuestTool,
|
|
9
|
+
OsrsAccount: OsrsAccount_1.OsrsAccount,
|
|
10
|
+
SlayerTool: SlayerTool_1.SlayerTool
|
|
11
|
+
};
|
|
12
|
+
// export default
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
interface Requirement {
|
|
2
|
+
description: string;
|
|
3
|
+
isMet(): boolean;
|
|
4
|
+
}
|
|
5
|
+
declare class LevelRequirement implements Requirement {
|
|
6
|
+
type: RequirementType;
|
|
7
|
+
skillName: string;
|
|
8
|
+
level: number;
|
|
9
|
+
boostable: boolean;
|
|
10
|
+
constructor(skillName: string, level: number, boostable?: boolean);
|
|
11
|
+
get description(): string;
|
|
12
|
+
isMet(): boolean;
|
|
13
|
+
}
|
|
14
|
+
declare enum RequirementType {
|
|
15
|
+
SlayerLevel = "SlayerLevel",
|
|
16
|
+
Level = "Level",
|
|
17
|
+
CombatLevel = "CombatLevel",
|
|
18
|
+
Quest = "Quest",
|
|
19
|
+
Item = "Item",
|
|
20
|
+
Location = "Location",
|
|
21
|
+
SlayerUnlock = "SlayerUnlock"
|
|
22
|
+
}
|
|
23
|
+
declare class SlayerUnlockRequirement implements Requirement {
|
|
24
|
+
type: RequirementType;
|
|
25
|
+
name: string;
|
|
26
|
+
constructor(name: string);
|
|
27
|
+
get description(): string;
|
|
28
|
+
isMet(): boolean;
|
|
29
|
+
}
|
|
30
|
+
declare class SlayerLevelRequirement implements Requirement {
|
|
31
|
+
type: RequirementType;
|
|
32
|
+
level: number;
|
|
33
|
+
constructor(level: number);
|
|
34
|
+
get description(): string;
|
|
35
|
+
isMet(): boolean;
|
|
36
|
+
}
|
|
37
|
+
declare class CombatLevelRequirement implements Requirement {
|
|
38
|
+
type: RequirementType;
|
|
39
|
+
level: number;
|
|
40
|
+
constructor(level: number);
|
|
41
|
+
get description(): string;
|
|
42
|
+
isMet(): boolean;
|
|
43
|
+
}
|
|
44
|
+
declare class QuestRequirement implements Requirement {
|
|
45
|
+
type: RequirementType;
|
|
46
|
+
questName: string;
|
|
47
|
+
constructor(questName: string);
|
|
48
|
+
get description(): string;
|
|
49
|
+
isMet(): boolean;
|
|
50
|
+
}
|
|
51
|
+
declare class ItemRequirement implements Requirement {
|
|
52
|
+
type: RequirementType;
|
|
53
|
+
itemName: string;
|
|
54
|
+
constructor(itemName: string);
|
|
55
|
+
get description(): string;
|
|
56
|
+
isMet(): boolean;
|
|
57
|
+
}
|
|
58
|
+
declare class LocationRequirement implements Requirement {
|
|
59
|
+
type: RequirementType;
|
|
60
|
+
locationName: string;
|
|
61
|
+
constructor(locationName: string);
|
|
62
|
+
get description(): string;
|
|
63
|
+
isMet(): boolean;
|
|
64
|
+
}
|
|
65
|
+
export { CombatLevelRequirement, ItemRequirement, LevelRequirement, LocationRequirement, QuestRequirement, Requirement, RequirementType, SlayerLevelRequirement, SlayerUnlockRequirement, };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlayerUnlockRequirement = exports.SlayerLevelRequirement = exports.RequirementType = exports.QuestRequirement = exports.LocationRequirement = exports.LevelRequirement = exports.ItemRequirement = exports.CombatLevelRequirement = void 0;
|
|
4
|
+
// TODO: Add a requirement type for all "levels" (combat, slayer, farming, crafting etc.)
|
|
5
|
+
class LevelRequirement {
|
|
6
|
+
constructor(skillName, level, boostable = false) {
|
|
7
|
+
this.type = RequirementType.Level;
|
|
8
|
+
this.boostable = false; // Indicates if the level can be boosted
|
|
9
|
+
this.boostable = boostable;
|
|
10
|
+
this.skillName = skillName;
|
|
11
|
+
this.level = level;
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return `Level ${this.level}`;
|
|
15
|
+
}
|
|
16
|
+
isMet() {
|
|
17
|
+
// Replace with actual logic to check the player's level
|
|
18
|
+
return false; // TODO
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.LevelRequirement = LevelRequirement;
|
|
22
|
+
// Enum for requirement types
|
|
23
|
+
var RequirementType;
|
|
24
|
+
(function (RequirementType) {
|
|
25
|
+
RequirementType["SlayerLevel"] = "SlayerLevel";
|
|
26
|
+
RequirementType["Level"] = "Level";
|
|
27
|
+
RequirementType["CombatLevel"] = "CombatLevel";
|
|
28
|
+
RequirementType["Quest"] = "Quest";
|
|
29
|
+
RequirementType["Item"] = "Item";
|
|
30
|
+
RequirementType["Location"] = "Location";
|
|
31
|
+
RequirementType["SlayerUnlock"] = "SlayerUnlock";
|
|
32
|
+
})(RequirementType || (exports.RequirementType = RequirementType = {}));
|
|
33
|
+
// Slayer Unlock requirement
|
|
34
|
+
class SlayerUnlockRequirement {
|
|
35
|
+
constructor(name) {
|
|
36
|
+
this.type = RequirementType.SlayerUnlock;
|
|
37
|
+
this.name = name;
|
|
38
|
+
}
|
|
39
|
+
get description() {
|
|
40
|
+
return `Slayer unlock: ${this.name}`;
|
|
41
|
+
}
|
|
42
|
+
isMet() {
|
|
43
|
+
// Replace with actual logic to check the player's Slayer level
|
|
44
|
+
return false; // TODO
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.SlayerUnlockRequirement = SlayerUnlockRequirement;
|
|
48
|
+
// Slayer level requirement
|
|
49
|
+
class SlayerLevelRequirement {
|
|
50
|
+
constructor(level) {
|
|
51
|
+
this.type = RequirementType.SlayerLevel;
|
|
52
|
+
this.level = level;
|
|
53
|
+
}
|
|
54
|
+
get description() {
|
|
55
|
+
return `Slayer level ${this.level}`;
|
|
56
|
+
}
|
|
57
|
+
isMet() {
|
|
58
|
+
// Replace with actual logic to check the player's Slayer level
|
|
59
|
+
return false; // TODO
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.SlayerLevelRequirement = SlayerLevelRequirement;
|
|
63
|
+
// Combat level requirement
|
|
64
|
+
class CombatLevelRequirement {
|
|
65
|
+
constructor(level) {
|
|
66
|
+
this.type = RequirementType.CombatLevel;
|
|
67
|
+
this.level = level;
|
|
68
|
+
}
|
|
69
|
+
get description() {
|
|
70
|
+
return `Combat level ${this.level}`;
|
|
71
|
+
}
|
|
72
|
+
isMet() {
|
|
73
|
+
// Replace with actual logic to check the player's Combat level
|
|
74
|
+
return false; // TODO
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.CombatLevelRequirement = CombatLevelRequirement;
|
|
78
|
+
// Quest requirement
|
|
79
|
+
class QuestRequirement {
|
|
80
|
+
constructor(questName) {
|
|
81
|
+
this.type = RequirementType.Quest;
|
|
82
|
+
this.questName = questName;
|
|
83
|
+
}
|
|
84
|
+
get description() {
|
|
85
|
+
return `Completed quest: ${this.questName}`;
|
|
86
|
+
}
|
|
87
|
+
isMet() {
|
|
88
|
+
// Replace with actual logic to check if the quest is completed
|
|
89
|
+
return false; // TODO
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.QuestRequirement = QuestRequirement;
|
|
93
|
+
// Item requirement
|
|
94
|
+
class ItemRequirement {
|
|
95
|
+
constructor(itemName) {
|
|
96
|
+
this.type = RequirementType.Item;
|
|
97
|
+
this.itemName = itemName;
|
|
98
|
+
}
|
|
99
|
+
get description() {
|
|
100
|
+
return `Has item: ${this.itemName}`;
|
|
101
|
+
}
|
|
102
|
+
isMet() {
|
|
103
|
+
// Replace with actual logic to check if the player has the item
|
|
104
|
+
return false; // TODO
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.ItemRequirement = ItemRequirement;
|
|
108
|
+
// Location requirement
|
|
109
|
+
class LocationRequirement {
|
|
110
|
+
constructor(locationName) {
|
|
111
|
+
this.type = RequirementType.Location;
|
|
112
|
+
this.locationName = locationName;
|
|
113
|
+
}
|
|
114
|
+
get description() {
|
|
115
|
+
return `Access to location: ${this.locationName}`;
|
|
116
|
+
}
|
|
117
|
+
isMet() {
|
|
118
|
+
// Replace with actual logic to check if the player is in the location
|
|
119
|
+
return false; // TODO
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.LocationRequirement = LocationRequirement;
|
|
123
|
+
// Example usage: Array of requirements for a monster
|
|
124
|
+
const monsterRequirements = [
|
|
125
|
+
new SlayerLevelRequirement(44),
|
|
126
|
+
new CombatLevelRequirement(5),
|
|
127
|
+
new QuestRequirement("Dragon Slayer"),
|
|
128
|
+
new ItemRequirement("Anti-dragon shield"),
|
|
129
|
+
new LocationRequirement("Taverley Dungeon"),
|
|
130
|
+
];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface OsrsAccountObject {
|
|
2
|
+
name: string;
|
|
3
|
+
main: {
|
|
4
|
+
combatLevel: number;
|
|
5
|
+
questPoints: number;
|
|
6
|
+
skills: {
|
|
7
|
+
[skillName: string]: {
|
|
8
|
+
level: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare class OsrsAccount {
|
|
14
|
+
private osrsAccount;
|
|
15
|
+
constructor(accountObject: OsrsAccountObject | null);
|
|
16
|
+
getName(): string | undefined;
|
|
17
|
+
toString(): string;
|
|
18
|
+
getSkills(): {
|
|
19
|
+
[skillName: string]: {
|
|
20
|
+
level: number;
|
|
21
|
+
};
|
|
22
|
+
} | undefined;
|
|
23
|
+
getSkill(skillName: string): {
|
|
24
|
+
level: number;
|
|
25
|
+
} | undefined;
|
|
26
|
+
getQuestPoints(): number | undefined;
|
|
27
|
+
setQuestPoints(x: number): void;
|
|
28
|
+
getCombatLevel(): number | undefined;
|
|
29
|
+
setCombatLevel(): void;
|
|
30
|
+
}
|
|
31
|
+
export { OsrsAccount };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OsrsAccount = void 0;
|
|
4
|
+
class OsrsAccount {
|
|
5
|
+
constructor(accountObject) {
|
|
6
|
+
this.osrsAccount = accountObject ? accountObject : null;
|
|
7
|
+
this.setQuestPoints(0);
|
|
8
|
+
this.setCombatLevel();
|
|
9
|
+
}
|
|
10
|
+
getName() {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = this.osrsAccount) === null || _a === void 0 ? void 0 : _a.name;
|
|
13
|
+
}
|
|
14
|
+
toString() {
|
|
15
|
+
var _a, _b, _c, _d;
|
|
16
|
+
return (((_b = (_a = this.osrsAccount) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "") +
|
|
17
|
+
": \nCombat Level: " +
|
|
18
|
+
((_d = (_c = this.osrsAccount) === null || _c === void 0 ? void 0 : _c.main.combatLevel) !== null && _d !== void 0 ? _d : "") +
|
|
19
|
+
"\nQuestPoints: " +
|
|
20
|
+
this.getQuestPoints());
|
|
21
|
+
}
|
|
22
|
+
getSkills() {
|
|
23
|
+
var _a;
|
|
24
|
+
return (_a = this.osrsAccount) === null || _a === void 0 ? void 0 : _a.main.skills;
|
|
25
|
+
}
|
|
26
|
+
getSkill(skillName) {
|
|
27
|
+
var _a;
|
|
28
|
+
return (_a = this.osrsAccount) === null || _a === void 0 ? void 0 : _a.main.skills[skillName.toLowerCase()];
|
|
29
|
+
}
|
|
30
|
+
getQuestPoints() {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = this.osrsAccount) === null || _a === void 0 ? void 0 : _a.main.questPoints;
|
|
33
|
+
}
|
|
34
|
+
setQuestPoints(x) {
|
|
35
|
+
if (x >= 0 && this.osrsAccount) {
|
|
36
|
+
this.osrsAccount.main.questPoints = x;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
getCombatLevel() {
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = this.osrsAccount) === null || _a === void 0 ? void 0 : _a.main.combatLevel;
|
|
42
|
+
}
|
|
43
|
+
setCombatLevel() {
|
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
45
|
+
if (this.osrsAccount) {
|
|
46
|
+
const attklvl = (_b = (_a = this.osrsAccount.main.skills.attack) === null || _a === void 0 ? void 0 : _a.level) !== null && _b !== void 0 ? _b : 1;
|
|
47
|
+
const strlvl = (_d = (_c = this.osrsAccount.main.skills.strength) === null || _c === void 0 ? void 0 : _c.level) !== null && _d !== void 0 ? _d : 1;
|
|
48
|
+
const deflvl = (_f = (_e = this.osrsAccount.main.skills.defence) === null || _e === void 0 ? void 0 : _e.level) !== null && _f !== void 0 ? _f : 1;
|
|
49
|
+
const rangedlvl = (_h = (_g = this.osrsAccount.main.skills.ranged) === null || _g === void 0 ? void 0 : _g.level) !== null && _h !== void 0 ? _h : 1;
|
|
50
|
+
const magiclvl = (_k = (_j = this.osrsAccount.main.skills.magic) === null || _j === void 0 ? void 0 : _j.level) !== null && _k !== void 0 ? _k : 1;
|
|
51
|
+
const praylvl = (_m = (_l = this.osrsAccount.main.skills.prayer) === null || _l === void 0 ? void 0 : _l.level) !== null && _m !== void 0 ? _m : 1;
|
|
52
|
+
const hplvl = (_p = (_o = this.osrsAccount.main.skills.hitpoints) === null || _o === void 0 ? void 0 : _o.level) !== null && _p !== void 0 ? _p : 10;
|
|
53
|
+
const x = [
|
|
54
|
+
0.325 * (attklvl + strlvl),
|
|
55
|
+
0.325 * ((3 * rangedlvl) / 2),
|
|
56
|
+
0.325 * ((3 * magiclvl) / 2),
|
|
57
|
+
];
|
|
58
|
+
const cbMax = Math.max(...x);
|
|
59
|
+
this.osrsAccount.main.combatLevel =
|
|
60
|
+
0.25 * (deflvl + hplvl + praylvl / 2) + cbMax;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.OsrsAccount = OsrsAccount;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface SkillRequirement {
|
|
2
|
+
level: number;
|
|
3
|
+
isBoostable: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface Quest {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
difficulty: string;
|
|
9
|
+
skillRequirements: {
|
|
10
|
+
[skill: string]: SkillRequirement;
|
|
11
|
+
};
|
|
12
|
+
status: "Not Started" | "In Progress" | "Completed";
|
|
13
|
+
miniquest: boolean;
|
|
14
|
+
shortName: string;
|
|
15
|
+
url: string;
|
|
16
|
+
series: string;
|
|
17
|
+
members: boolean;
|
|
18
|
+
questPoints: number;
|
|
19
|
+
length: string;
|
|
20
|
+
age: string;
|
|
21
|
+
startLocation: string;
|
|
22
|
+
difficultyLevel: string;
|
|
23
|
+
officialDifficulty: string;
|
|
24
|
+
officialLength: string;
|
|
25
|
+
officialAge: string;
|
|
26
|
+
itemRequirements: string[];
|
|
27
|
+
recommendedItems: string[];
|
|
28
|
+
recommendedSkills: {
|
|
29
|
+
[skill: string]: number;
|
|
30
|
+
};
|
|
31
|
+
recommendedPrayers: string[];
|
|
32
|
+
questRequirements: string[];
|
|
33
|
+
rewards: {
|
|
34
|
+
experience?: {
|
|
35
|
+
[skill: string]: number;
|
|
36
|
+
};
|
|
37
|
+
items?: string[];
|
|
38
|
+
areas?: string[];
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export { Quest };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OsrsAccount } from "../account/OsrsAccount";
|
|
2
|
+
import { Quest } from "./Quest";
|
|
3
|
+
declare class QuestTool {
|
|
4
|
+
private questObject;
|
|
5
|
+
private questArray;
|
|
6
|
+
private subQuestArray;
|
|
7
|
+
private osrsAccount;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* to string func
|
|
11
|
+
* @todo Implement this function
|
|
12
|
+
* @return {String} The string representation of the class object.
|
|
13
|
+
*/
|
|
14
|
+
toString(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Get the data for a quest
|
|
17
|
+
* @param {String} questName The name of the quest
|
|
18
|
+
* @return {Object} The data for the input quest in a JSON object.
|
|
19
|
+
* */
|
|
20
|
+
getQuest(questName: string): Quest | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Get the data for a quest
|
|
23
|
+
* @param {String} questName The name of the quest
|
|
24
|
+
* @return {Object} The data for the input quest in a JSON object.
|
|
25
|
+
* */
|
|
26
|
+
getQuestByName(questName: string): Quest | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Get the data for a quest
|
|
29
|
+
* @param {String} subQuestName The name of the subquest
|
|
30
|
+
* @return {Object} The data for the input subquest in a JSON object.
|
|
31
|
+
* */
|
|
32
|
+
getSubQuest(subQuestName: string): any | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Add two numbers together
|
|
35
|
+
* @todo Need to implement Recipe for disaster functionality
|
|
36
|
+
* @param {String} quest The either string or quest object of the quest to be determined completeable or not.
|
|
37
|
+
* @return {Boolean} If the account currently tied to the tool can complete the quest.
|
|
38
|
+
* */
|
|
39
|
+
canCompleteQuest(quest: string | Quest | undefined): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Set the account to be used in this quest tool
|
|
42
|
+
* @param {OsrsAccount} acc1 The osrs Account to be associated with this class object.
|
|
43
|
+
* */
|
|
44
|
+
setOsrsAccount(acc1: OsrsAccount): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get the osrs account associated with this quest tool
|
|
47
|
+
* @return {OsrsAccount | undefined} The osrs Account associated with this class object.
|
|
48
|
+
* */
|
|
49
|
+
getOsrsAccount(): OsrsAccount | undefined;
|
|
50
|
+
}
|
|
51
|
+
export { QuestTool };
|
|
@@ -1,96 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class QuestTool {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Get the data for a quest
|
|
40
|
-
* @param {String}
|
|
41
|
-
* @return {Object} The data for the input
|
|
42
|
-
* */
|
|
43
|
-
|
|
44
|
-
return this.
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
* @
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// Define
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Define other methods, implementation omitted for brevity
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get the osrs account associated with this quest tool
|
|
87
|
-
* @return {OsrsAccount | undefined} The osrs Account associated with this class object.
|
|
88
|
-
* */
|
|
89
|
-
getOsrsAccount(): OsrsAccount | undefined {
|
|
90
|
-
return this.osrsAccount;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Define other getters, implementation omitted for brevity
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { QuestTool };
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestTool = void 0;
|
|
4
|
+
class QuestTool {
|
|
5
|
+
constructor() {
|
|
6
|
+
// todo need to import these data from a typescript file where its defined/stored
|
|
7
|
+
this.questObject = [];
|
|
8
|
+
this.questArray = [];
|
|
9
|
+
this.subQuestArray = [];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* to string func
|
|
13
|
+
* @todo Implement this function
|
|
14
|
+
* @return {String} The string representation of the class object.
|
|
15
|
+
*/
|
|
16
|
+
toString() {
|
|
17
|
+
return "QuestTool :) WIP";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the data for a quest
|
|
21
|
+
* @param {String} questName The name of the quest
|
|
22
|
+
* @return {Object} The data for the input quest in a JSON object.
|
|
23
|
+
* */
|
|
24
|
+
getQuest(questName) {
|
|
25
|
+
if (typeof questName === "string" && this.questObject[questName]) {
|
|
26
|
+
// return new Quest(this.questObject[questName]); TODO
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the data for a quest
|
|
32
|
+
* @param {String} questName The name of the quest
|
|
33
|
+
* @return {Object} The data for the input quest in a JSON object.
|
|
34
|
+
* */
|
|
35
|
+
getQuestByName(questName) {
|
|
36
|
+
return this.getQuest(questName);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the data for a quest
|
|
40
|
+
* @param {String} subQuestName The name of the subquest
|
|
41
|
+
* @return {Object} The data for the input subquest in a JSON object.
|
|
42
|
+
* */
|
|
43
|
+
getSubQuest(subQuestName) {
|
|
44
|
+
return this.subQuestArray.find((x) => x.name === subQuestName);
|
|
45
|
+
}
|
|
46
|
+
// Define highestBoost method, switch case omitted for brevity
|
|
47
|
+
/**
|
|
48
|
+
* Add two numbers together
|
|
49
|
+
* @todo Need to implement Recipe for disaster functionality
|
|
50
|
+
* @param {String} quest The either string or quest object of the quest to be determined completeable or not.
|
|
51
|
+
* @return {Boolean} If the account currently tied to the tool can complete the quest.
|
|
52
|
+
* */
|
|
53
|
+
canCompleteQuest(quest) {
|
|
54
|
+
// Implementation omitted for brevity
|
|
55
|
+
return true; // Placeholder return value
|
|
56
|
+
}
|
|
57
|
+
// Define completableQuests method, implementation omitted for brevity
|
|
58
|
+
/**
|
|
59
|
+
* Set the account to be used in this quest tool
|
|
60
|
+
* @param {OsrsAccount} acc1 The osrs Account to be associated with this class object.
|
|
61
|
+
* */
|
|
62
|
+
setOsrsAccount(acc1) {
|
|
63
|
+
if (acc1) {
|
|
64
|
+
// this.osrsAccount = new OsrsAccount(acc1); TODO
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
// Define other methods, implementation omitted for brevity
|
|
70
|
+
/**
|
|
71
|
+
* Get the osrs account associated with this quest tool
|
|
72
|
+
* @return {OsrsAccount | undefined} The osrs Account associated with this class object.
|
|
73
|
+
* */
|
|
74
|
+
getOsrsAccount() {
|
|
75
|
+
return this.osrsAccount;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.QuestTool = QuestTool;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Requirement } from "../Requirement";
|
|
2
|
+
export declare class Assignment {
|
|
3
|
+
name: string;
|
|
4
|
+
quantity: number;
|
|
5
|
+
requirements: Requirement[];
|
|
6
|
+
extendedAmountMin?: number | null;
|
|
7
|
+
extendedAmountMax?: number | null;
|
|
8
|
+
constructor(name: string, quantity: number, requirements: Requirement[], extendedAmountMin?: number | null, extendedAmountMax?: number | null);
|
|
9
|
+
/**
|
|
10
|
+
* Get the task name
|
|
11
|
+
*/
|
|
12
|
+
getName(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Get the quantity of the task
|
|
15
|
+
*/
|
|
16
|
+
getQuantity(): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Assignment = void 0;
|
|
4
|
+
// A Class that represents an assignment of a task to a player.
|
|
5
|
+
// An assignment is a specific instance of a task, with a specific quantity and requirements.
|
|
6
|
+
// The assignment is the actual task given to a player, which is based on the Task.
|
|
7
|
+
class Assignment {
|
|
8
|
+
constructor(name, quantity, requirements, extendedAmountMin, extendedAmountMax) {
|
|
9
|
+
this.name = name;
|
|
10
|
+
this.quantity = quantity;
|
|
11
|
+
this.requirements = requirements;
|
|
12
|
+
this.extendedAmountMin = extendedAmountMin !== null && extendedAmountMin !== void 0 ? extendedAmountMin : null;
|
|
13
|
+
this.extendedAmountMax = extendedAmountMax !== null && extendedAmountMax !== void 0 ? extendedAmountMax : null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the task name
|
|
17
|
+
*/
|
|
18
|
+
getName() {
|
|
19
|
+
return this.name;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the quantity of the task
|
|
23
|
+
*/
|
|
24
|
+
getQuantity() {
|
|
25
|
+
return this.quantity;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Assignment = Assignment;
|