UNPKG

osrs-tools

Version:

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

58 lines (57 loc) 2.26 kB
import { Npc } from "../Npc"; import { NpcDrop } from "../NpcDrop"; /** * Complete example of an NPC built from OSRS wiki data. * This is based on the Abyssal Demon wiki page: * https://oldschool.runescape.wiki/w/Abyssal_demon */ export const createAbyssalDemon = () => { const drops = [new NpcDrop("Abyssal Whip", 1, "1/512"), new NpcDrop("Dragon Bones", 1, "Always"), new NpcDrop("Clue Scroll (Hard)", 1, "1/256")]; return new Npc({ id: 13454, name: "Abyssal Demon", examine: "A denizen of the Abyss!", members: true, officialWikiUrl: "https://oldschool.runescape.wiki/w/Abyssal_demon", combatLevel: 124, hitpoints: 150, aggressive: true, attackable: true, canPoison: false, poisonous: false, canCannon: false, canThrall: true, canVenom: false, attackStyles: ["Magic"], maxHit: 15, attackSpeed: 4, respawnTime: 30, weaknesses: ["Fire magic"], locations: ["Abyssal Area", "Catacombs of Kourend", "Slayer Tower (3rd floor)", "Slayer Tower (basement)", "Wilderness Slayer Cave"], drops, trivia: [ "The iconic weapon dropped by the abyssal demon, the abyssal whip, is the spine of the creature.", "In combat, abyssal demons are capable of teleporting either themselves or the player around.", "When landing a successful hit on an abyssal demon, it has a 1/6 chance to teleport away.", "Abyssal demons can teleport players up to 20 tiles away.", ], }); }; /** * Alternative syntax - more concise */ export const createAbyssalDemonAlternative = () => { return new Npc({ id: 13454, name: "Abyssal Demon", examine: "A denizen of the Abyss!", members: true, officialWikiUrl: "https://oldschool.runescape.wiki/w/Abyssal_demon", combatLevel: 124, hitpoints: 150, locations: ["Abyssal Area", "Catacombs of Kourend", "Slayer Tower (3rd floor)"], drops: [new NpcDrop("Abyssal Whip", 1, "1/512"), new NpcDrop("Dragon Bones", 1, "Always")], }); }; // Export a singleton instance for use elsewhere export const abyssalDemon = createAbyssalDemon();