diff --git a/Server/src/main/java/core/game/content/global/action/ClimbActionHandler.java b/Server/src/main/java/core/game/content/global/action/ClimbActionHandler.java index 8e2d403fa..e2e172f95 100644 --- a/Server/src/main/java/core/game/content/global/action/ClimbActionHandler.java +++ b/Server/src/main/java/core/game/content/global/action/ClimbActionHandler.java @@ -1,5 +1,6 @@ package core.game.content.global.action; +import api.ContentAPIKt; import core.game.container.impl.EquipmentContainer; import org.rs09.consts.Items; import core.game.node.entity.player.link.diary.DiaryType; @@ -13,6 +14,8 @@ import core.game.world.map.Location; import core.game.world.map.RegionManager; import core.game.world.update.flag.context.Animation; +import static api.ContentAPIKt.isEquipped; + /** * Handles a ladder climbing reward. * @author Emperor @@ -207,9 +210,9 @@ public final class ClimbActionHandler { } // falador dark wizards tower proselyte if (destination.equals(2908, 3336, 2) - && player.getEquipment().get(EquipmentContainer.SLOT_HAT).getId() == Items.PROSELYTE_SALLET_9672 - && player.getEquipment().get(EquipmentContainer.SLOT_CHEST).getId() == Items.PROSELYTE_HAUBERK_9674 - && player.getEquipment().get(EquipmentContainer.SLOT_LEGS).getId() == Items.PROSELYTE_CUISSE_9676) { + && isEquipped(player, Items.PROSELYTE_SALLET_9672) + && isEquipped(player, Items.PROSELYTE_HAUBERK_9674) + && isEquipped(player, Items.PROSELYTE_CUISSE_9676)) { player.getAchievementDiaryManager().finishTask(player, DiaryType.FALADOR, 2, 0); } // falador enter the mining guild diff --git a/Server/src/main/kotlin/api/ContentAPI.kt b/Server/src/main/kotlin/api/ContentAPI.kt index 08a970a6c..fe9ed4168 100644 --- a/Server/src/main/kotlin/api/ContentAPI.kt +++ b/Server/src/main/kotlin/api/ContentAPI.kt @@ -128,6 +128,13 @@ fun amountInEquipment(player: Player, id: Int): Int{ return player.equipment.getAmount(id) } +/** + * Check that an item is equipped by the given player + */ +fun isEquipped(player: Player, id: Int): Boolean { + return amountInEquipment(player, id) > 0 +} + /** * Remove an item from a player's inventory * @param player the player whose inventory to remove the item from