From 3975b7ef0ff85e5a2eb57b6962442724c03eb983 Mon Sep 17 00:00:00 2001 From: ceikry Date: Thu, 15 Jul 2021 07:17:16 -0500 Subject: [PATCH] Can now fill empty sacks with hay. --- .../interaction/item/withobject/SackOnHay.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Server/src/main/kotlin/rs09/game/interaction/item/withobject/SackOnHay.kt diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withobject/SackOnHay.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withobject/SackOnHay.kt new file mode 100644 index 000000000..0de84caa7 --- /dev/null +++ b/Server/src/main/kotlin/rs09/game/interaction/item/withobject/SackOnHay.kt @@ -0,0 +1,21 @@ +package rs09.game.interaction.item.withobject + +import api.Container +import api.ContentAPI +import org.rs09.consts.Items +import rs09.game.interaction.InteractionListener + +class SackOnHay : InteractionListener() { + val SACK = Items.EMPTY_SACK_5418 + val HAY = intArrayOf(36892, 36894, 36896, 300, 34593, 298, 299) + + override fun defineListeners() { + onUseWith(SCENERY, SACK, *HAY){player, used, _ -> + if(ContentAPI.removeItem(player, used.asItem(), Container.INVENTORY)){ + ContentAPI.addItem(player, Items.HAY_SACK_6057, 1) + ContentAPI.sendMessage(player, "You fill the sack with hay.") + } + return@onUseWith true + } + } +} \ No newline at end of file