osrs-tools 0.2.1 → 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.
- package/dist/Requirement.d.ts +64 -0
- package/dist/Requirement.js +105 -0
- package/dist/account/OsrsAccount.d.ts +31 -0
- package/dist/account/OsrsAccount.js +64 -0
- package/dist/account/Skill.d.ts +25 -0
- package/dist/account/Skill.js +29 -0
- package/dist/misc/Item.d.ts +7 -0
- package/dist/misc/Item.js +12 -0
- package/dist/quest/Quest.d.ts +45 -0
- package/dist/quest/Quest.js +10 -0
- package/dist/quest/QuestTool.d.ts +51 -0
- package/dist/quest/QuestTool.js +78 -0
- package/dist/quest/all/APorcineOfInterest.d.ts +3 -0
- package/dist/quest/all/APorcineOfInterest.js +42 -0
- package/dist/quest/all/ASoulsBane.d.ts +3 -0
- package/dist/quest/all/ASoulsBane.js +36 -0
- package/dist/quest/all/ATailOfTwoCats.d.ts +3 -0
- package/dist/quest/all/ATailOfTwoCats.js +36 -0
- package/dist/quest/all/ATasteOfHope.d.ts +3 -0
- package/dist/quest/all/ATasteOfHope.js +36 -0
- package/dist/quest/all/AnimalMagnetism.d.ts +3 -0
- package/dist/quest/all/AnimalMagnetism.js +36 -0
- package/dist/quest/all/AnotherSliceOfHAM.d.ts +3 -0
- package/dist/quest/all/AnotherSliceOfHAM.js +36 -0
- package/dist/quest/all/BelowIceMountain.d.ts +3 -0
- package/dist/quest/all/BelowIceMountain.js +44 -0
- package/dist/quest/all/BetweenARock.d.ts +3 -0
- package/dist/quest/all/BetweenARock.js +36 -0
- package/dist/quest/all/BigChompyBirdHunting.d.ts +3 -0
- package/dist/quest/all/BigChompyBirdHunting.js +36 -0
- package/dist/quest/all/Biohazard.d.ts +3 -0
- package/dist/quest/all/Biohazard.js +36 -0
- package/dist/quest/all/BlackKnightsFortress.d.ts +3 -0
- package/dist/quest/all/BlackKnightsFortress.js +36 -0
- package/dist/quest/all/BoneVoyage.d.ts +3 -0
- package/dist/quest/all/BoneVoyage.js +36 -0
- package/dist/quest/all/CabinFever.d.ts +3 -0
- package/dist/quest/all/CabinFever.js +36 -0
- package/dist/quest/all/ClientOfKourend.d.ts +3 -0
- package/dist/quest/all/ClientOfKourend.js +36 -0
- package/dist/quest/all/ClockTower.d.ts +3 -0
- package/dist/quest/all/ClockTower.js +36 -0
- package/dist/quest/all/ColdWar.d.ts +3 -0
- package/dist/quest/all/ColdWar.js +36 -0
- package/dist/quest/all/Contact.d.ts +3 -0
- package/dist/quest/all/Contact.js +36 -0
- package/dist/quest/all/CookAssistant.d.ts +3 -0
- package/dist/quest/all/CookAssistant.js +46 -0
- package/dist/quest/all/CooksAssistant.d.ts +3 -0
- package/dist/quest/all/CooksAssistant.js +36 -0
- package/dist/quest/all/CreatureOfFenkenstrain.d.ts +3 -0
- package/dist/quest/all/CreatureOfFenkenstrain.js +36 -0
- package/dist/quest/all/DarknessOfHallowvale.d.ts +3 -0
- package/dist/quest/all/DarknessOfHallowvale.js +36 -0
- package/dist/quest/all/DeathPlateau.d.ts +3 -0
- package/dist/quest/all/DeathPlateau.js +36 -0
- package/dist/quest/all/DeathToTheDorgeshuun.d.ts +3 -0
- package/dist/quest/all/DeathToTheDorgeshuun.js +36 -0
- package/dist/quest/all/DemonSlayer.d.ts +3 -0
- package/dist/quest/all/DemonSlayer.js +36 -0
- package/dist/quest/all/DeviousMinds.d.ts +3 -0
- package/dist/quest/all/DeviousMinds.js +36 -0
- package/dist/quest/all/DoricsQuest.d.ts +3 -0
- package/dist/quest/all/DoricsQuest.js +36 -0
- package/dist/quest/all/DragonSlayer.d.ts +3 -0
- package/dist/quest/all/DragonSlayer.js +36 -0
- package/dist/quest/all/DragonSlayerII.d.ts +3 -0
- package/dist/quest/all/DragonSlayerII.js +36 -0
- package/dist/quest/all/DruidicRitual.d.ts +3 -0
- package/dist/quest/all/DruidicRitual.js +36 -0
- package/dist/quest/all/DwarfCannon.d.ts +3 -0
- package/dist/quest/all/DwarfCannon.js +36 -0
- package/dist/quest/all/EadgarsRuse.d.ts +3 -0
- package/dist/quest/all/EadgarsRuse.js +36 -0
- package/dist/quest/all/EaglesPeak.d.ts +3 -0
- package/dist/quest/all/EaglesPeak.js +36 -0
- package/dist/quest/all/ElementalWorkshopI.d.ts +3 -0
- package/dist/quest/all/ElementalWorkshopI.js +36 -0
- package/dist/quest/all/ElementalWorkshopII.d.ts +3 -0
- package/dist/quest/all/ElementalWorkshopII.js +36 -0
- package/dist/quest/all/EnakhrasLament.d.ts +3 -0
- package/dist/quest/all/EnakhrasLament.js +36 -0
- package/dist/quest/all/EnlightenedJourney.d.ts +3 -0
- package/dist/quest/all/EnlightenedJourney.js +36 -0
- package/dist/quest/all/FairytaleIGrowingPains.d.ts +3 -0
- package/dist/quest/all/FairytaleIGrowingPains.js +36 -0
- package/dist/quest/all/FairytaleIICureAQueen.d.ts +3 -0
- package/dist/quest/all/FairytaleIICureAQueen.js +36 -0
- package/dist/quest/all/FamilyCrest.d.ts +3 -0
- package/dist/quest/all/FamilyCrest.js +36 -0
- package/dist/quest/all/FightArena.d.ts +3 -0
- package/dist/quest/all/FightArena.js +36 -0
- package/dist/quest/all/FishingContest.d.ts +3 -0
- package/dist/quest/all/FishingContest.js +36 -0
- package/dist/quest/all/ForgettableTale.d.ts +3 -0
- package/dist/quest/all/ForgettableTale.js +36 -0
- package/dist/quest/all/GardenOfTranquillity.d.ts +3 -0
- package/dist/quest/all/GardenOfTranquillity.js +36 -0
- package/dist/quest/all/GertrudesCat.d.ts +3 -0
- package/dist/quest/all/GertrudesCat.js +36 -0
- package/dist/quest/all/GettingAhead.d.ts +3 -0
- package/dist/quest/all/GettingAhead.js +36 -0
- package/dist/quest/all/GhostsAhoy.d.ts +3 -0
- package/dist/quest/all/GhostsAhoy.js +36 -0
- package/dist/quest/all/GoblinDiplomacy.d.ts +3 -0
- package/dist/quest/all/GoblinDiplomacy.js +36 -0
- package/dist/quest/all/GrimTales.d.ts +3 -0
- package/dist/quest/all/GrimTales.js +36 -0
- package/dist/quest/all/HauntedMine.d.ts +3 -0
- package/dist/quest/all/HauntedMine.js +36 -0
- package/dist/quest/all/HazeelCult.d.ts +3 -0
- package/dist/quest/all/HazeelCult.js +36 -0
- package/dist/quest/all/HeroesQuest.d.ts +3 -0
- package/dist/quest/all/HeroesQuest.js +57 -0
- package/dist/quest/all/HolyGrail.d.ts +3 -0
- package/dist/quest/all/HolyGrail.js +44 -0
- package/dist/quest/all/HorrorFromTheDeep.d.ts +3 -0
- package/dist/quest/all/HorrorFromTheDeep.js +44 -0
- package/dist/quest/all/IcthlarinsLittleHelper.d.ts +3 -0
- package/dist/quest/all/IcthlarinsLittleHelper.js +36 -0
- package/dist/quest/all/ImpCatcher.d.ts +3 -0
- package/dist/quest/all/ImpCatcher.js +36 -0
- package/dist/quest/all/InAidOfTheMyreque.d.ts +3 -0
- package/dist/quest/all/InAidOfTheMyreque.js +42 -0
- package/dist/quest/all/InSearchOfTheMyreque.d.ts +3 -0
- package/dist/quest/all/InSearchOfTheMyreque.js +46 -0
- package/dist/quest/all/JunglePotion.d.ts +3 -0
- package/dist/quest/all/JunglePotion.js +37 -0
- package/dist/quest/all/KingsRansom.d.ts +3 -0
- package/dist/quest/all/KingsRansom.js +44 -0
- package/dist/slayer/Assignment.d.ts +17 -0
- package/dist/slayer/Assignment.js +28 -0
- package/dist/slayer/Masters.d.ts +10 -0
- package/dist/slayer/Masters.js +100 -0
- package/dist/slayer/SlayerBuys.d.ts +3 -0
- package/dist/slayer/SlayerBuys.js +34 -0
- package/dist/slayer/SlayerData.d.ts +13 -0
- package/dist/slayer/SlayerData.js +42 -0
- package/dist/slayer/SlayerExtends.d.ts +23 -0
- package/dist/slayer/SlayerExtends.js +184 -0
- package/dist/slayer/SlayerMaster.d.ts +67 -0
- package/dist/slayer/SlayerMaster.js +112 -0
- package/dist/slayer/SlayerReward.d.ts +33 -0
- package/dist/slayer/SlayerReward.js +30 -0
- package/dist/slayer/SlayerUnlock.d.ts +7 -0
- package/dist/slayer/SlayerUnlock.js +67 -0
- package/dist/slayer/Task.d.ts +85 -0
- package/dist/slayer/Task.js +117 -0
- package/dist/slayer/task/ChaelderTasks.d.ts +3 -0
- package/dist/slayer/task/ChaelderTasks.js +78 -0
- package/dist/slayer/task/DuradelTasks.d.ts +2 -0
- package/dist/slayer/task/DuradelTasks.js +18 -0
- package/dist/slayer/task/KonarTasks.d.ts +3 -0
- package/dist/slayer/task/KonarTasks.js +5 -0
- package/dist/slayer/task/MazchnaTasks.d.ts +3 -0
- package/dist/slayer/task/MazchnaTasks.js +4 -0
- package/dist/slayer/task/NieveTasks.d.ts +3 -0
- package/dist/slayer/task/NieveTasks.js +78 -0
- package/dist/slayer/task/ReadTasks.d.ts +1 -0
- package/dist/slayer/task/ReadTasks.js +63 -0
- package/dist/slayer/task/SpriaTasks.d.ts +2 -0
- package/dist/slayer/task/SpriaTasks.js +117 -0
- package/dist/slayer/task/Tureal.d.ts +3 -0
- package/dist/slayer/task/Tureal.js +125 -0
- package/dist/slayer/task/VannakaTasks.d.ts +2 -0
- package/dist/slayer/task/VannakaTasks.js +78 -0
- package/package.json +2 -10
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
interface Requirement {
|
|
2
|
+
description: string;
|
|
3
|
+
}
|
|
4
|
+
declare class LevelRequirement implements Requirement {
|
|
5
|
+
type: RequirementType;
|
|
6
|
+
skillName: string;
|
|
7
|
+
level: number;
|
|
8
|
+
boostable: boolean;
|
|
9
|
+
constructor(skillName: string, level: number, boostable?: boolean);
|
|
10
|
+
get description(): string;
|
|
11
|
+
}
|
|
12
|
+
declare enum RequirementType {
|
|
13
|
+
SlayerLevel = "SlayerLevel",
|
|
14
|
+
Level = "Level",
|
|
15
|
+
CombatLevel = "CombatLevel",
|
|
16
|
+
Quest = "Quest",
|
|
17
|
+
QuestPoint = "QuestPoint",
|
|
18
|
+
Item = "Item",
|
|
19
|
+
Location = "Location",
|
|
20
|
+
SlayerUnlock = "SlayerUnlock"
|
|
21
|
+
}
|
|
22
|
+
declare class SlayerUnlockRequirement implements Requirement {
|
|
23
|
+
type: RequirementType;
|
|
24
|
+
name: string;
|
|
25
|
+
constructor(name: string);
|
|
26
|
+
get description(): string;
|
|
27
|
+
}
|
|
28
|
+
declare class SlayerLevelRequirement implements Requirement {
|
|
29
|
+
type: RequirementType;
|
|
30
|
+
level: number;
|
|
31
|
+
constructor(level: number);
|
|
32
|
+
get description(): string;
|
|
33
|
+
}
|
|
34
|
+
declare class CombatLevelRequirement implements Requirement {
|
|
35
|
+
type: RequirementType;
|
|
36
|
+
level: number;
|
|
37
|
+
constructor(level: number);
|
|
38
|
+
get description(): string;
|
|
39
|
+
}
|
|
40
|
+
declare class QuestRequirement implements Requirement {
|
|
41
|
+
type: RequirementType;
|
|
42
|
+
questName: string;
|
|
43
|
+
constructor(questName: string);
|
|
44
|
+
get description(): string;
|
|
45
|
+
}
|
|
46
|
+
declare class QuestPointRequirement implements Requirement {
|
|
47
|
+
type: RequirementType;
|
|
48
|
+
amount: number;
|
|
49
|
+
constructor(amount: number);
|
|
50
|
+
get description(): string;
|
|
51
|
+
}
|
|
52
|
+
declare class ItemRequirement implements Requirement {
|
|
53
|
+
type: RequirementType;
|
|
54
|
+
itemName: string;
|
|
55
|
+
constructor(itemName: string);
|
|
56
|
+
get description(): string;
|
|
57
|
+
}
|
|
58
|
+
declare class LocationRequirement implements Requirement {
|
|
59
|
+
type: RequirementType;
|
|
60
|
+
locationName: string;
|
|
61
|
+
constructor(locationName: string);
|
|
62
|
+
get description(): string;
|
|
63
|
+
}
|
|
64
|
+
export { CombatLevelRequirement, QuestPointRequirement, ItemRequirement, LevelRequirement, LocationRequirement, QuestRequirement, Requirement, RequirementType, SlayerLevelRequirement, SlayerUnlockRequirement, };
|
|
@@ -0,0 +1,105 @@
|
|
|
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.QuestPointRequirement = 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
|
+
}
|
|
17
|
+
exports.LevelRequirement = LevelRequirement;
|
|
18
|
+
// Enum for requirement types
|
|
19
|
+
var RequirementType;
|
|
20
|
+
(function (RequirementType) {
|
|
21
|
+
RequirementType["SlayerLevel"] = "SlayerLevel";
|
|
22
|
+
RequirementType["Level"] = "Level";
|
|
23
|
+
RequirementType["CombatLevel"] = "CombatLevel";
|
|
24
|
+
RequirementType["Quest"] = "Quest";
|
|
25
|
+
RequirementType["QuestPoint"] = "QuestPoint";
|
|
26
|
+
RequirementType["Item"] = "Item";
|
|
27
|
+
RequirementType["Location"] = "Location";
|
|
28
|
+
RequirementType["SlayerUnlock"] = "SlayerUnlock";
|
|
29
|
+
})(RequirementType || (exports.RequirementType = RequirementType = {}));
|
|
30
|
+
// Slayer Unlock requirement
|
|
31
|
+
class SlayerUnlockRequirement {
|
|
32
|
+
constructor(name) {
|
|
33
|
+
this.type = RequirementType.SlayerUnlock;
|
|
34
|
+
this.name = name;
|
|
35
|
+
}
|
|
36
|
+
get description() {
|
|
37
|
+
return `Slayer unlock: ${this.name}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.SlayerUnlockRequirement = SlayerUnlockRequirement;
|
|
41
|
+
// Slayer level requirement
|
|
42
|
+
class SlayerLevelRequirement {
|
|
43
|
+
constructor(level) {
|
|
44
|
+
this.type = RequirementType.SlayerLevel;
|
|
45
|
+
this.level = level;
|
|
46
|
+
}
|
|
47
|
+
get description() {
|
|
48
|
+
return `Slayer level ${this.level}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.SlayerLevelRequirement = SlayerLevelRequirement;
|
|
52
|
+
// Combat level requirement
|
|
53
|
+
class CombatLevelRequirement {
|
|
54
|
+
constructor(level) {
|
|
55
|
+
this.type = RequirementType.CombatLevel;
|
|
56
|
+
this.level = level;
|
|
57
|
+
}
|
|
58
|
+
get description() {
|
|
59
|
+
return `Combat level ${this.level}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.CombatLevelRequirement = CombatLevelRequirement;
|
|
63
|
+
// Quest requirement
|
|
64
|
+
class QuestRequirement {
|
|
65
|
+
constructor(questName) {
|
|
66
|
+
this.type = RequirementType.Quest;
|
|
67
|
+
this.questName = questName;
|
|
68
|
+
}
|
|
69
|
+
get description() {
|
|
70
|
+
return `Completed quest: ${this.questName}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.QuestRequirement = QuestRequirement;
|
|
74
|
+
class QuestPointRequirement {
|
|
75
|
+
constructor(amount) {
|
|
76
|
+
this.type = RequirementType.Quest;
|
|
77
|
+
this.amount = amount;
|
|
78
|
+
}
|
|
79
|
+
get description() {
|
|
80
|
+
return `Quest Points Needed: ${this.amount}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.QuestPointRequirement = QuestPointRequirement;
|
|
84
|
+
// Item requirement
|
|
85
|
+
class ItemRequirement {
|
|
86
|
+
constructor(itemName) {
|
|
87
|
+
this.type = RequirementType.Item;
|
|
88
|
+
this.itemName = itemName;
|
|
89
|
+
}
|
|
90
|
+
get description() {
|
|
91
|
+
return `Has item: ${this.itemName}`;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.ItemRequirement = ItemRequirement;
|
|
95
|
+
// Location requirement
|
|
96
|
+
class LocationRequirement {
|
|
97
|
+
constructor(locationName) {
|
|
98
|
+
this.type = RequirementType.Location;
|
|
99
|
+
this.locationName = locationName;
|
|
100
|
+
}
|
|
101
|
+
get description() {
|
|
102
|
+
return `Access to location: ${this.locationName}`;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.LocationRequirement = LocationRequirement;
|
|
@@ -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,25 @@
|
|
|
1
|
+
export declare enum Skill {
|
|
2
|
+
Attack = "Attack",
|
|
3
|
+
Defence = "Defence",
|
|
4
|
+
Strength = "Strength",
|
|
5
|
+
Hitpoints = "Hitpoints",
|
|
6
|
+
Ranged = "Ranged",
|
|
7
|
+
Prayer = "Prayer",
|
|
8
|
+
Magic = "Magic",
|
|
9
|
+
Cooking = "Cooking",
|
|
10
|
+
Woodcutting = "Woodcutting",
|
|
11
|
+
Fletching = "Fletching",
|
|
12
|
+
Fishing = "Fishing",
|
|
13
|
+
Firemaking = "Firemaking",
|
|
14
|
+
Crafting = "Crafting",
|
|
15
|
+
Smithing = "Smithing",
|
|
16
|
+
Mining = "Mining",
|
|
17
|
+
Herblore = "Herblore",
|
|
18
|
+
Agility = "Agility",
|
|
19
|
+
Thieving = "Thieving",
|
|
20
|
+
Slayer = "Slayer",
|
|
21
|
+
Farming = "Farming",
|
|
22
|
+
Runecraft = "Runecraft",
|
|
23
|
+
Hunter = "Hunter",
|
|
24
|
+
Construction = "Construction"
|
|
25
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Skill = void 0;
|
|
4
|
+
var Skill;
|
|
5
|
+
(function (Skill) {
|
|
6
|
+
Skill["Attack"] = "Attack";
|
|
7
|
+
Skill["Defence"] = "Defence";
|
|
8
|
+
Skill["Strength"] = "Strength";
|
|
9
|
+
Skill["Hitpoints"] = "Hitpoints";
|
|
10
|
+
Skill["Ranged"] = "Ranged";
|
|
11
|
+
Skill["Prayer"] = "Prayer";
|
|
12
|
+
Skill["Magic"] = "Magic";
|
|
13
|
+
Skill["Cooking"] = "Cooking";
|
|
14
|
+
Skill["Woodcutting"] = "Woodcutting";
|
|
15
|
+
Skill["Fletching"] = "Fletching";
|
|
16
|
+
Skill["Fishing"] = "Fishing";
|
|
17
|
+
Skill["Firemaking"] = "Firemaking";
|
|
18
|
+
Skill["Crafting"] = "Crafting";
|
|
19
|
+
Skill["Smithing"] = "Smithing";
|
|
20
|
+
Skill["Mining"] = "Mining";
|
|
21
|
+
Skill["Herblore"] = "Herblore";
|
|
22
|
+
Skill["Agility"] = "Agility";
|
|
23
|
+
Skill["Thieving"] = "Thieving";
|
|
24
|
+
Skill["Slayer"] = "Slayer";
|
|
25
|
+
Skill["Farming"] = "Farming";
|
|
26
|
+
Skill["Runecraft"] = "Runecraft";
|
|
27
|
+
Skill["Hunter"] = "Hunter";
|
|
28
|
+
Skill["Construction"] = "Construction";
|
|
29
|
+
})(Skill || (exports.Skill = Skill = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Item = void 0;
|
|
4
|
+
class Item {
|
|
5
|
+
constructor(id, name, description, value) {
|
|
6
|
+
this.id = id;
|
|
7
|
+
this.name = name;
|
|
8
|
+
this.description = description;
|
|
9
|
+
this.value = value;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Item = Item;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Requirement } from '../Requirement';
|
|
2
|
+
interface Quest {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
difficulty: string;
|
|
7
|
+
steps: string[];
|
|
8
|
+
requirements: Requirement[];
|
|
9
|
+
status: QuestStatus;
|
|
10
|
+
miniquest: boolean;
|
|
11
|
+
shortName: string;
|
|
12
|
+
url: string;
|
|
13
|
+
series?: string | undefined | null;
|
|
14
|
+
members: boolean;
|
|
15
|
+
questPoints: number;
|
|
16
|
+
length: string;
|
|
17
|
+
age: string;
|
|
18
|
+
startLocation: string;
|
|
19
|
+
difficultyLevel: string;
|
|
20
|
+
officialDifficulty: string;
|
|
21
|
+
officialLength: string;
|
|
22
|
+
officialAge: string;
|
|
23
|
+
recommendedItems: string[];
|
|
24
|
+
recommendedSkills: {
|
|
25
|
+
[skill: string]: number;
|
|
26
|
+
};
|
|
27
|
+
recommendedPrayers: string[];
|
|
28
|
+
rewards: {
|
|
29
|
+
experience?: {
|
|
30
|
+
[skill: string]: number;
|
|
31
|
+
};
|
|
32
|
+
items?: string[];
|
|
33
|
+
questPoints: number;
|
|
34
|
+
areas?: string[];
|
|
35
|
+
grants?: string[];
|
|
36
|
+
};
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}
|
|
39
|
+
export { Quest };
|
|
40
|
+
export declare enum QuestStatus {
|
|
41
|
+
NotStarted = "NotStarted",
|
|
42
|
+
InProgress = "InProgress",
|
|
43
|
+
Completed = "Completed",
|
|
44
|
+
Failed = "Failed"
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestStatus = void 0;
|
|
4
|
+
var QuestStatus;
|
|
5
|
+
(function (QuestStatus) {
|
|
6
|
+
QuestStatus["NotStarted"] = "NotStarted";
|
|
7
|
+
QuestStatus["InProgress"] = "InProgress";
|
|
8
|
+
QuestStatus["Completed"] = "Completed";
|
|
9
|
+
QuestStatus["Failed"] = "Failed";
|
|
10
|
+
})(QuestStatus || (exports.QuestStatus = QuestStatus = {}));
|
|
@@ -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 };
|
|
@@ -0,0 +1,78 @@
|
|
|
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,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Quest_1 = require("../Quest");
|
|
4
|
+
const APorcineOfInterest = {
|
|
5
|
+
id: 0, // Assign a unique ID if available
|
|
6
|
+
name: "A Porcine of Interest",
|
|
7
|
+
members: true,
|
|
8
|
+
difficulty: 'Novice',
|
|
9
|
+
length: 'Short',
|
|
10
|
+
requirements: [],
|
|
11
|
+
questPoints: 1,
|
|
12
|
+
startLocation: "Read the town notice board in Draynor Village, behind Fortunato's Wine Shop.",
|
|
13
|
+
description: "Ah, the Falador Farm - filled with cabbages, cows, and even a sleepy sheepdog. A peaceful place, where you can learn to churn butter, give a dog a bone, or purchase various Farming supplies. What was once a place of happiness, joy and wholesome dairy goods has of late become dominated by a vile presence. Each morning Sarah wakes to find her crops destroyed, her cows cowering, and her loyal sheepdog looking... sheepish. She's had enough, but she thinks she's got the culprit on the trot. Can you help her track down... A Porcine of Interest?",
|
|
14
|
+
steps: [],
|
|
15
|
+
status: Quest_1.QuestStatus.NotStarted,
|
|
16
|
+
miniquest: false,
|
|
17
|
+
shortName: "aPorcineOfInterest",
|
|
18
|
+
url: 'https://oldschool.runescape.wiki/w/A_Porcine_of_Interest',
|
|
19
|
+
series: null,
|
|
20
|
+
age: '',
|
|
21
|
+
difficultyLevel: 'Novice',
|
|
22
|
+
officialDifficulty: 'Novice',
|
|
23
|
+
officialLength: 'Short',
|
|
24
|
+
officialAge: '',
|
|
25
|
+
recommendedItems: [
|
|
26
|
+
"Charged amulet of glory",
|
|
27
|
+
"Explorer's ring 2 or above",
|
|
28
|
+
"Stamina potion",
|
|
29
|
+
"Combat equipment",
|
|
30
|
+
"Some food for lower levels"
|
|
31
|
+
],
|
|
32
|
+
recommendedSkills: {},
|
|
33
|
+
recommendedPrayers: [],
|
|
34
|
+
rewards: {
|
|
35
|
+
experience: { Slayer: 1000 },
|
|
36
|
+
questPoints: 1,
|
|
37
|
+
items: [],
|
|
38
|
+
areas: [],
|
|
39
|
+
grants: ["30 Slayer Rewards Points", "Some Reinforced Goggles"],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
exports.default = APorcineOfInterest;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Quest_1 = require("../Quest");
|
|
4
|
+
const ASoulsBane = {
|
|
5
|
+
id: 0, // Assign a unique ID if available
|
|
6
|
+
name: "A Soul's Bane",
|
|
7
|
+
members: true,
|
|
8
|
+
difficulty: 'Novice',
|
|
9
|
+
length: 'Medium',
|
|
10
|
+
requirements: [], // No skill or quest requirements
|
|
11
|
+
questPoints: 1,
|
|
12
|
+
startLocation: '', // Not specified in JSON
|
|
13
|
+
description: '', // Not specified in JSON
|
|
14
|
+
steps: [], // Not specified in JSON
|
|
15
|
+
status: Quest_1.QuestStatus.NotStarted,
|
|
16
|
+
miniquest: false,
|
|
17
|
+
shortName: "aSoulsBane",
|
|
18
|
+
url: 'https://oldschool.runescape.wiki/w/A_Soul%27s_Bane',
|
|
19
|
+
series: null,
|
|
20
|
+
age: '',
|
|
21
|
+
difficultyLevel: 'Novice',
|
|
22
|
+
officialDifficulty: 'Novice',
|
|
23
|
+
officialLength: 'Medium',
|
|
24
|
+
officialAge: '',
|
|
25
|
+
recommendedItems: [],
|
|
26
|
+
recommendedSkills: {},
|
|
27
|
+
recommendedPrayers: [],
|
|
28
|
+
rewards: {
|
|
29
|
+
experience: { Defence: 500, Hitpoints: 500 },
|
|
30
|
+
questPoints: 1,
|
|
31
|
+
items: [],
|
|
32
|
+
areas: [],
|
|
33
|
+
grants: [],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
exports.default = ASoulsBane;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Quest_1 = require("../Quest");
|
|
4
|
+
const ATailOfTwoCats = {
|
|
5
|
+
id: 0, // Assign a unique ID if available
|
|
6
|
+
name: "A Tail of Two Cats",
|
|
7
|
+
members: true,
|
|
8
|
+
difficulty: 'Intermediate',
|
|
9
|
+
length: 'Long',
|
|
10
|
+
requirements: [], // Only quest requirement: Icthlarin's Little Helper
|
|
11
|
+
questPoints: 2,
|
|
12
|
+
startLocation: '',
|
|
13
|
+
description: '',
|
|
14
|
+
steps: [],
|
|
15
|
+
status: Quest_1.QuestStatus.NotStarted,
|
|
16
|
+
miniquest: false,
|
|
17
|
+
shortName: "aTailOfTwoCats",
|
|
18
|
+
url: 'https://oldschool.runescape.wiki/w/A_Tail_of_Two_Cats',
|
|
19
|
+
series: 'Dragonkin',
|
|
20
|
+
age: '',
|
|
21
|
+
difficultyLevel: 'Intermediate',
|
|
22
|
+
officialDifficulty: 'Intermediate',
|
|
23
|
+
officialLength: 'Long',
|
|
24
|
+
officialAge: '',
|
|
25
|
+
recommendedItems: [],
|
|
26
|
+
recommendedSkills: {},
|
|
27
|
+
recommendedPrayers: [],
|
|
28
|
+
rewards: {
|
|
29
|
+
experience: {},
|
|
30
|
+
questPoints: 2,
|
|
31
|
+
items: [],
|
|
32
|
+
areas: [],
|
|
33
|
+
grants: [],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
exports.default = ATailOfTwoCats;
|