Added Zanaris Evil Chicken Lair

This commit is contained in:
Jordan
2024-03-03 05:23:34 +00:00
committed by Ryan
parent 98ee184652
commit 2714448c61
2 changed files with 57 additions and 5 deletions
@@ -0,0 +1,48 @@
package content.region.misc.zanaris.handlers
import core.api.*
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.item.Item
import core.game.system.task.Pulse
import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
import org.rs09.consts.Items
import org.rs09.consts.Scenery
class EvilChickenLairListener: InteractionListener {
override fun defineListeners() {
addClimbDest(Location.create(2441, 4381, 0), Location.create(2457, 4380, 0))
addClimbDest(Location.create(2455, 4380, 0), Location.create(2441, 4381, 0))
onUseWith(IntType.SCENERY, Items.RAW_CHICKEN_2138, Scenery.CHICKEN_SHRINE_12093) { player, _, _ ->
if (!hasRequirement(player, "Legend's Quest"))
return@onUseWith false
if(removeItem(player,(Item(Items.RAW_CHICKEN_2138)))){
animate(player, Animation(10100))
submitWorldPulse(object : Pulse(1, player) {
override fun pulse(): Boolean {
teleport(player, Location.create(2461, 4356, 0))
animate(player, Animation(9013))
return true
}
})
}
return@onUseWith true
}
onUseWith(IntType.SCENERY, Items.ROPE_954, Scenery.TUNNEL_ENTRANCE_12253) { player, _, node ->
if(removeItem(player, Item(Items.ROPE_954)))
replaceScenery(node as core.game.node.scenery.Scenery, Scenery.TUNNEL_ENTRANCE_12254, 100)
return@onUseWith true
}
on(Scenery.PORTAL_12260, IntType.SCENERY, "use") { player, _ ->
teleport(player, Location.create(2453, 4476, 0))
return@on true
}
}
}