Can now fill empty sacks with hay.
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user