From 8fd363a43c35b221c99355678e528a0c1401f5f9 Mon Sep 17 00:00:00 2001 From: Beck <2421110-beckrickert@users.noreply.gitlab.com> Date: Sun, 19 Apr 2026 09:36:32 +0000 Subject: [PATCH] Falconry Glove is now removed when leaving area --- .../skill/hunter/falconry/FalconryZone.kt | 13 +++++++ .../hunter/falconry/PiscFalconryListener.kt | 36 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Server/src/main/content/global/skill/hunter/falconry/FalconryZone.kt create mode 100644 Server/src/main/content/global/skill/hunter/falconry/PiscFalconryListener.kt diff --git a/Server/src/main/content/global/skill/hunter/falconry/FalconryZone.kt b/Server/src/main/content/global/skill/hunter/falconry/FalconryZone.kt new file mode 100644 index 000000000..6256604de --- /dev/null +++ b/Server/src/main/content/global/skill/hunter/falconry/FalconryZone.kt @@ -0,0 +1,13 @@ +package content.global.skill.hunter.falconry + +import core.game.node.Node +import core.game.world.map.zone.ZoneBorders + +/** + * Used to define the zoneBorders for an MapArea listener + */ +object FalconryZone { + val piscatorisFalconryZones = arrayOf( + ZoneBorders(2364, 3573, 2394, 3620, 0) + ) +} \ No newline at end of file diff --git a/Server/src/main/content/global/skill/hunter/falconry/PiscFalconryListener.kt b/Server/src/main/content/global/skill/hunter/falconry/PiscFalconryListener.kt new file mode 100644 index 000000000..c226a4fab --- /dev/null +++ b/Server/src/main/content/global/skill/hunter/falconry/PiscFalconryListener.kt @@ -0,0 +1,36 @@ +package content.global.skill.hunter.falconry + +import core.api.* +import core.api.MapArea +import core.game.activity.ActivityManager +import core.game.node.entity.Entity +import core.game.world.map.zone.ZoneBorders +import core.game.node.entity.player.Player +import org.rs09.consts.Items + +class PiscFalconryListener: MapArea { + override fun defineAreaBorders(): Array { + return FalconryZone.piscatorisFalconryZones + } + + /** + * When player leaves by any method other than logout/disconnect. + */ + override fun areaLeave(entity: Entity, logout: Boolean) { + if (entity is Player) { + if (!logout) { + // Legacy compatibility of FalconryActivityPlugin.java + removeAttribute(entity, "falconry") + + // Compatibility with StileShortcut.kt + ActivityManager.getActivity("falconry").leave(entity, false) + + removeAll(entity, Items.FALCONERS_GLOVE_10023) + removeAll(entity, Items.FALCONERS_GLOVE_10023, Container.EQUIPMENT) + + removeAll(entity, Items.FALCONERS_GLOVE_10024) + removeAll(entity, Items.FALCONERS_GLOVE_10024, Container.EQUIPMENT) + } + } + } +} \ No newline at end of file