From e3552eec7b042ae524b9cef0cfbcf8d96a9ed1b1 Mon Sep 17 00:00:00 2001 From: Henning Berge Date: Sat, 17 Oct 2020 17:10:58 +0200 Subject: [PATCH] add level req to craft normal runes --- src/plugins/skills/runecrafting/runecrafting-crafting.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/skills/runecrafting/runecrafting-crafting.ts b/src/plugins/skills/runecrafting/runecrafting-crafting.ts index 82bd56384..9372bc2f0 100644 --- a/src/plugins/skills/runecrafting/runecrafting-crafting.ts +++ b/src/plugins/skills/runecrafting/runecrafting-crafting.ts @@ -22,8 +22,13 @@ import { cache } from '@server/game-server'; const craftRune: objectAction = (details: ObjectActionDetails) => { const {player, object} = details; const rune = getEntityByAttr(runes, 'altar.craftingId', object.objectId); - const level = player.skills.get(Skill.RUNECRAFTING).level; + const runeDetails = cache.itemDefinitions.get(rune.id); + const level = player.skills.get(Skill.RUNECRAFTING).level; + if (level < rune.level) { + player.sendMessage(`You need a runecrafting level of ${rune.level} to craft ${runeDetails.name}.`); + return; + } let essenceAvailable = 0; rune.essence.forEach((essenceId) => { essenceAvailable += player.inventory.findAll(essenceId).length;