diff --git a/Server/src/main/content/global/skill/herblore/HerblorePulse.java b/Server/src/main/content/global/skill/herblore/HerblorePulse.java index 800efe53e..2e45fb35b 100644 --- a/Server/src/main/content/global/skill/herblore/HerblorePulse.java +++ b/Server/src/main/content/global/skill/herblore/HerblorePulse.java @@ -6,6 +6,10 @@ import core.game.node.entity.player.Player; import core.game.node.item.Item; import core.game.world.update.flag.context.Animation; import core.tools.StringUtils; +import content.global.skill.skillcapeperks.*; +import content.data.consumables.Consumables; +import core.tools.RandomFunction; + /** * Represents the skill pulse used to handle the creating of potions. @@ -130,7 +134,15 @@ public final class HerblorePulse extends SkillPulse { */ public void handleFinished() { if ((player.getInventory().containsItem(potion.getBase()) && player.getInventory().containsItem(potion.getIngredient())) && player.getInventory().remove(potion.getBase(), potion.getIngredient())) { - final Item item = potion.getProduct(); + Item item = potion.getProduct(); + if (SkillcapePerks.isActive (SkillcapePerks.BREWMASTER, player)) { + if (RandomFunction.random(100) < 15) { + Consumables consum = Consumables.getConsumableById (item.getId()); + if (consum != null) + item = new Item (consum.getConsumable().getIds()[0], item.getAmount()); + player.sendMessage ("Due to your expertise, you manage to make an extra dose."); + } + } player.getInventory().add(item); player.getSkills().addExperience(Skills.HERBLORE, potion.getExperience(), true); player.getPacketDispatch().sendMessage("You mix the " + potion.getIngredient().getName().toLowerCase() + " into your potion."); diff --git a/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt b/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt index b67471560..38cb62792 100644 --- a/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt +++ b/Server/src/main/content/global/skill/skillcapeperks/SkillcapePerks.kt @@ -77,7 +77,8 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? }), HASTY_COOKING("cape_perks:hasty-cooking"), SMOOTH_HANDS("cape_perks:smooth-hands"), - PET_MASTERY("cape_perks.pet-mastery"), + PET_MASTERY("cape_perks:pet-mastery"), + BREWMASTER("cape_perks:brewmaster"), NONE("cape_perks:none") ; @@ -98,7 +99,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? Skillcape.RUNECRAFTING -> ABYSS_WARPING Skillcape.HITPOINTS -> DAMAGE_SPONG Skillcape.AGILITY -> MARATHON_RUNNER - Skillcape.HERBLORE -> NONE + Skillcape.HERBLORE -> BREWMASTER Skillcape.THIEVING -> SMOOTH_HANDS Skillcape.CRAFTING -> NONE Skillcape.FLETCHING -> NONE