From 8094465579da7bcecd838214375a913c0088e206 Mon Sep 17 00:00:00 2001 From: randy Date: Thu, 7 Nov 2024 10:02:10 -0700 Subject: [PATCH] Added ability to toggle bonecrusher function on blessed sickle When using "cast bloom", the sickle will grow nearby fungus as usual. If no fungus are grown, it will instead toggle the bone crusher attribute. --- .../region/morytania/quest/naturespirit/NSUtils.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/region/morytania/quest/naturespirit/NSUtils.kt b/Server/src/main/content/region/morytania/quest/naturespirit/NSUtils.kt index 03263c6c4..c47754946 100644 --- a/Server/src/main/content/region/morytania/quest/naturespirit/NSUtils.kt +++ b/Server/src/main/content/region/morytania/quest/naturespirit/NSUtils.kt @@ -85,10 +85,12 @@ object NSUtils { fun castBloom(player: Player): Boolean{ var success = false val region = forId(player.location.regionId) + /* if (player.skills.prayerPoints < 1) { player.packetDispatch.sendMessage("You don't have enough prayer points to do this.") return false } + */ handleVisuals(player) val locs = player.location.surroundingTiles for (o in locs) { @@ -114,6 +116,17 @@ object NSUtils { } } } + if (success) { + player.skills.decrementPrayerPoints(RandomFunction.random(1, 3).toDouble()) + } else { + if (getAttribute(player, "bonecrusher:enabled", false)) { + setAttribute(player, "/save:bonecrusher:enabled",false) + player.packetDispatch.sendMessage("Automatic Bone Burial: Disabled.") + } else { + setAttribute(player, "/save:bonecrusher:enabled",true) + player.packetDispatch.sendMessage("Automatic Bone Burial: Enabled.") + } + } return success } @@ -122,7 +135,6 @@ object NSUtils { * animation. */ private fun handleVisuals(player: Player) { - player.skills.decrementPrayerPoints(RandomFunction.random(1, 3).toDouble()) playAudio(player, Sounds.CAST_BLOOM_1493) val AROUND_YOU = player.location.surroundingTiles for (location in AROUND_YOU) {