diff --git a/Server/src/main/content/global/handlers/item/DustHandPlugin.java b/Server/src/main/content/global/handlers/item/DustHandPlugin.java deleted file mode 100644 index 8e4728040..000000000 --- a/Server/src/main/content/global/handlers/item/DustHandPlugin.java +++ /dev/null @@ -1,42 +0,0 @@ -package content.global.handlers.item; - -import core.cache.def.impl.ItemDefinition; -import core.game.interaction.OptionHandler; -import core.game.node.Node; -import core.game.node.entity.player.Player; -import core.game.node.item.Item; -import core.plugin.Initializable; -import core.plugin.Plugin; - -/** - * Represents the plugin used to dust your hands. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class DustHandPlugin extends OptionHandler { - - @Override - public Plugin newInstance(Object arg) throws Throwable { - ItemDefinition.forId(8865).getHandlers().put("option:dust-hands", this); - return this; - } - - @Override - public boolean handle(Player player, Node node, String option) { - switch (option) { - case "dust-hands": - if (player.getInventory().remove((Item) node)) { - player.getPacketDispatch().sendMessage("You dust your hands with the finely ground ash."); - player.setAttribute("hand_dust", true); - } - break; - } - return true; - } - - @Override - public boolean isWalk() { - return false; - } -} diff --git a/Server/src/main/content/region/asgarnia/burthorpe/handlers/wguild/shot/DustHandListener.kt b/Server/src/main/content/region/asgarnia/burthorpe/handlers/wguild/shot/DustHandListener.kt new file mode 100644 index 000000000..297c29e9c --- /dev/null +++ b/Server/src/main/content/region/asgarnia/burthorpe/handlers/wguild/shot/DustHandListener.kt @@ -0,0 +1,27 @@ +package content.region.asgarnia.burthorpe.handlers.wguild.shot + +import core.api.MapArea +import core.game.interaction.IntType +import core.game.interaction.InteractionListener +import core.game.node.item.Item +import core.game.world.map.Location +import org.rs09.consts.Items + +/** For ShotPutRoom */ +class DustHandListeners : InteractionListener { + override fun defineListeners() { + on(Items.GROUND_ASHES_8865, IntType.ITEM, "dust-hands") { player, node -> + // Check that player is in the shotput throwing areas. + if (!(player.location.withinDistance(Location(2861, 3553, 1), 1) || + player.location.withinDistance(Location(2861, 3547, 1), 1))) { + player.packetDispatch.sendMessage("You may only dust your hands while in the shotput throwing areas.") + return@on true + } + if (player.inventory.remove(node as Item)) { + player.packetDispatch.sendMessage("You dust your hands with the finely ground ash.") + player.setAttribute("hand_dust", true) + } + return@on true + } + } +} \ No newline at end of file