From 46dee8fa958c56529bbb4e0648ee8c5b622be14f Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Sun, 26 Dec 2021 00:20:21 +0000 Subject: [PATCH] Add mort myre stems and pears to bloom's effect, and add the sound effect for bloom. --- CHANGELOG | 1 + .../object/FieldPickingPlugin.java | 13 ++++++++---- .../quest/members/naturespirit/NSListeners.kt | 20 ++++++++++++++++--- .../quest/members/naturespirit/NSUtils.kt | 15 +++++++++++++- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 357b00e27..3abbbef28 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -78,3 +78,4 @@ - Fishing and fishing trawler now use closer-to-empirical formulae. - Server configuration language has been changed from JSON to TOML. - Add Family Crest quest. +- Add mort myre stems and pears to bloom's effect, and add the sound effect for bloom. diff --git a/Server/src/main/java/core/game/interaction/object/FieldPickingPlugin.java b/Server/src/main/java/core/game/interaction/object/FieldPickingPlugin.java index 8901916ba..6e421b064 100644 --- a/Server/src/main/java/core/game/interaction/object/FieldPickingPlugin.java +++ b/Server/src/main/java/core/game/interaction/object/FieldPickingPlugin.java @@ -36,6 +36,7 @@ public final class FieldPickingPlugin extends OptionHandler { for(PickingPlant p : PickingPlant.values()){ SceneryDefinition.forId(p.objectId).getHandlers().put("option:pick",this); } + SceneryDefinition.forId(3511).getHandlers().put("option:take-cutting",this); return this; } @@ -88,11 +89,14 @@ public final class FieldPickingPlugin extends OptionHandler { full = object.transform(2073); SceneryBuilder.replace(object, full); } - if (plant == PickingPlant.FUNGI_ON_LOG) { - full = object.transform(3508); + boolean isBloomPlant = plant == PickingPlant.FUNGI_ON_LOG + || plant == PickingPlant.BUDDING_BRANCH + || plant == PickingPlant.GOLDEN_PEAR_BUSH; + if (isBloomPlant) { + full = object.transform(object.getId() - 1); SceneryBuilder.replace(object, full); } - if (plant != PickingPlant.FUNGI_ON_LOG) { + if (!isBloomPlant) { SceneryBuilder.replace(plant == PickingPlant.BANANA_TREE_4 ? full : object, object.transform(banana ? plant.respawn : 0), banana ? 300 : plant.respawn); } if (!plant.name().startsWith("NETTLES")) { @@ -189,7 +193,8 @@ public final class FieldPickingPlugin extends OptionHandler { ONION_0(3366, 1957, 30), ONION_1(5538, 1957, 30), FUNGI_ON_LOG(3509, 2970, -1), - GOLDEN_PEAR_BUSH(3513, 2974, 30), + BUDDING_BRANCH(3511, 2972, -1), + GOLDEN_PEAR_BUSH(3513, 2974, -1), GLOWING_FUNGUS_0(4932, 4075, 30), GLOWING_FUNGUS_1(4933, 4075, 30), RARE_FLOWERS(5006, 2460, 30), diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSListeners.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSListeners.kt index 2f132f764..971d04a4a 100644 --- a/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSListeners.kt +++ b/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSListeners.kt @@ -35,6 +35,8 @@ class NSListeners : InteractionListener() { val SPELLCARD = Items.DRUIDIC_SPELL_2968 val USED_SPELLCARD = Items.A_USED_SPELL_2969 val FUNGUS = Items.MORT_MYRE_FUNGUS_2970 + val STEM = Items.MORT_MYRE_STEM_2972 + val PEAR = Items.MORT_MYRE_PEAR_2974 val MIRROR_TAKEN = "/save:ns:mirror_taken" val GROTTO_SEARCHED = "/save:ns:grotto_searched" val WISHING_WELL = 28715 @@ -139,11 +141,23 @@ class NSListeners : InteractionListener() { on(intArrayOf(DRUID_POUCH, DRUID_POUCH_EMPTY), ITEM, "fill"){player, node -> if(player.questRepository.getStage("Nature Spirit") >= 75) { - if (amountInInventory(player, Items.MORT_MYRE_FUNGUS_2970) >= 3) { + if (amountInInventory(player, PEAR) >= 3) { if (node.id != Items.DRUID_POUCH_2958) { removeItem(player, node, Container.INVENTORY) } - removeItem(player, Item(Items.MORT_MYRE_FUNGUS_2970, 3), Container.INVENTORY) + removeItem(player, Item(PEAR, 3), Container.INVENTORY) + addItem(player, Items.DRUID_POUCH_2958, 9 ) + } else if (amountInInventory(player, STEM) >= 3) { + if (node.id != Items.DRUID_POUCH_2958) { + removeItem(player, node, Container.INVENTORY) + } + removeItem(player, Item(STEM, 3), Container.INVENTORY) + addItem(player, Items.DRUID_POUCH_2958, 6) + } else if (amountInInventory(player, FUNGUS) >= 3) { + if (node.id != Items.DRUID_POUCH_2958) { + removeItem(player, node, Container.INVENTORY) + } + removeItem(player, Item(FUNGUS, 3), Container.INVENTORY) addItem(player, Items.DRUID_POUCH_2958, 3) } else { sendDialogue(player, "You need 3 fungus before you can do that.") @@ -230,4 +244,4 @@ class CompleteSpellPulse(val player: Player) : Pulse(2){ } return false } -} \ No newline at end of file +} diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSUtils.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSUtils.kt index 752b70d18..711197a4e 100644 --- a/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSUtils.kt +++ b/Server/src/main/kotlin/rs09/game/content/quest/members/naturespirit/NSUtils.kt @@ -104,6 +104,18 @@ object NSUtils { success = true } } + if (obj.name.equals("Rotting branch", ignoreCase = true) && player.skills.prayerPoints >= 1) { + if (player.location.withinDistance(obj.location, 2)) { + SceneryBuilder.replace(obj, obj.transform(3511)) + success = true + } + } + if (obj.name.equals("A small bush", ignoreCase = true) && player.skills.prayerPoints >= 1) { + if (player.location.withinDistance(obj.location, 2)) { + SceneryBuilder.replace(obj, obj.transform(3513)) + success = true + } + } } } return success @@ -115,6 +127,7 @@ object NSUtils { */ private fun handleVisuals(player: Player) { player.skills.decrementPrayerPoints(RandomFunction.random(1, 3).toDouble()) + player.audioManager.send(1493) val AROUND_YOU = player.location.surroundingTiles for (location in AROUND_YOU) { // The graphic is meant to play on a 3x3 radius around you, but not @@ -122,4 +135,4 @@ object NSUtils { player.packetDispatch.sendGlobalPositionGraphic(263, location) } } -} \ No newline at end of file +}