Updated GWDEntranceRopeUsage plugin to listener (Note: this handles only the case where a rope is used directly on the hole; using the tie-rope option is handled by a separate plugin)

This commit is contained in:
Byte
2022-10-21 15:05:35 +00:00
committed by Ryan
parent eae259d2ec
commit c74048425c
2 changed files with 28 additions and 35 deletions
@@ -0,0 +1,28 @@
package rs09.game.interaction.item.withobject
import api.removeItem
import api.setVarbit
import org.rs09.consts.Items
import org.rs09.consts.Scenery
import rs09.game.interaction.IntType
import rs09.game.interaction.InteractionListener
/**
* Listener for using a rope directly on the GWD entrance hole
* @author Byte
*/
@Suppress("unused")
class GWDEntranceRopeListener : InteractionListener {
override fun defineListeners() {
onUseWith(IntType.SCENERY, Items.ROPE_954, Scenery.HOLE_26340) { player, used, _ ->
if (!removeItem(player, used)) {
return@onUseWith false
}
setVarbit(player,1048,0,1,true)
return@onUseWith true
}
}
}