diff --git a/data/plugins/consumables/potions.rb b/data/plugins/consumables/potions.rb index 3ec4c8a0..71505929 100644 --- a/data/plugins/consumables/potions.rb +++ b/data/plugins/consumables/potions.rb @@ -4,14 +4,21 @@ java_import 'org.apollo.game.model.entity.Skill' private -DRINK_POTION_SOUND = 334 -EMPTY_VIAL_ID = 229 +module Constants + + # The sound made when drinking a potion. + DRINK_POTION_SOUND = 334 + + # The id of an empty vial. + EMPTY_VIAL_ID = 229 + +end # A drinkable potion. class Potion < Consumable def initialize(id, name, doses) - super(name, id, DRINK_POTION_SOUND) + super(name, id, Constants::DRINK_POTION_SOUND) @doses = doses end @@ -24,7 +31,7 @@ class Potion < Consumable player.send_message("You have #{ @doses.length - index } dose#{ "s" unless index == 3 } of potion left.", true) else player.send_message('You drink the last of your potion.', true) - player.inventory.add(EMPTY_VIAL_ID) + player.inventory.add(Constants::EMPTY_VIAL_ID) end drink(player) diff --git a/data/plugins/skill/herblore/potion.rb b/data/plugins/skill/herblore/potion.rb index 1603f0a1..b99415be 100644 --- a/data/plugins/skill/herblore/potion.rb +++ b/data/plugins/skill/herblore/potion.rb @@ -7,6 +7,8 @@ java_import 'org.apollo.game.model.def.ItemDefinition' java_import 'org.apollo.game.model.inter.EnterAmountListener' java_import 'org.apollo.game.model.inter.dialogue.DialogueAdapter' +private + WATER_VIAL_ID = 227 EMPTY_VIAL_ID = 229