From 2714448c617cd12a9e99436d98a1d5f431e4b56c Mon Sep 17 00:00:00 2001 From: Jordan <1419329-J23t@users.noreply.gitlab.com> Date: Sun, 3 Mar 2024 05:23:34 +0000 Subject: [PATCH] Added Zanaris Evil Chicken Lair --- Server/data/configs/npc_spawns.json | 14 ++++-- .../handlers/EvilChickenLairListener.kt | 48 +++++++++++++++++++ 2 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 Server/src/main/content/region/misc/zanaris/handlers/EvilChickenLairListener.kt diff --git a/Server/data/configs/npc_spawns.json b/Server/data/configs/npc_spawns.json index cd6750499..5c3861cbd 100644 --- a/Server/data/configs/npc_spawns.json +++ b/Server/data/configs/npc_spawns.json @@ -6381,7 +6381,7 @@ }, { "npc_id": "3376", - "loc_data": "{3313,5453,0,1,3}-{3312,5452,0,1,3}-{3310,5452,0,1,6}-{3311,5462,0,1,5}-{3313,5554,0,1,6}-{3297,5562,0,1,1}-{3305,5554,0,1,1}-{3300,5540,0,1,1}" + "loc_data": "{3313,5453,0,1,3}-{3312,5452,0,1,3}-{3310,5452,0,1,6}-{3311,5462,0,1,5}-{3313,5554,0,1,6}-{3297,5562,0,1,1}-{3305,5554,0,1,1}-{3300,5540,0,1,1}-{2438,4393,0,1,1}" }, { "npc_id": "3384", @@ -7394,15 +7394,19 @@ }, { "npc_id": "4673", - "loc_data": "{2829,9827,0,1,0}" - }, + "loc_data": "{2829,9827,0,1,0}-{2454,4368,0,1,0}" + }, + { + "npc_id": "4674", + "loc_data": "{2464,4365,0,1,4}" + }, { "npc_id": "4675", - "loc_data": "{3048,10266,0,1,4}" + "loc_data": "{3048,10266,0,1,4}-{2460,4374,0,1,4}" }, { "npc_id": "4676", - "loc_data": "{3054,10269,0,1,4}" + "loc_data": "{3054,10269,0,1,4}-{2451,4362,0,1,4}" }, { "npc_id": "4677", diff --git a/Server/src/main/content/region/misc/zanaris/handlers/EvilChickenLairListener.kt b/Server/src/main/content/region/misc/zanaris/handlers/EvilChickenLairListener.kt new file mode 100644 index 000000000..a023e5b30 --- /dev/null +++ b/Server/src/main/content/region/misc/zanaris/handlers/EvilChickenLairListener.kt @@ -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 + } + + } +}