Skip to content

Commit

Permalink
add level req to craft normal runes
Browse files Browse the repository at this point in the history
  • Loading branch information
Promises committed Oct 17, 2020
1 parent 177c263 commit e3552ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/skills/runecrafting/runecrafting-crafting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e3552ee

Please sign in to comment.