From f1cab8f6dc5a57ad68e1de0d16408fe114bae08f Mon Sep 17 00:00:00 2001 From: Regenleif Date: Sun, 27 Mar 2022 07:07:56 +0000 Subject: [PATCH] In the Prince Ali Rescue quest players can now use a Jug of Water (in addition to bucket of water) to make skin paste --- .../game/content/dialogue/AggieDialogue.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Server/src/main/java/core/game/content/dialogue/AggieDialogue.java b/Server/src/main/java/core/game/content/dialogue/AggieDialogue.java index 5a97e4a79..af4e639be 100644 --- a/Server/src/main/java/core/game/content/dialogue/AggieDialogue.java +++ b/Server/src/main/java/core/game/content/dialogue/AggieDialogue.java @@ -24,7 +24,14 @@ public final class AggieDialogue extends DialoguePlugin { /** * Represents the ingredients needed to make paste. */ - private static final Item[] PASTE_INGREDIENTS = new Item[] { new Item(592), new Item(1951), new Item(1929), new Item(1933) }; + + private static final Item ASHES = new Item(592); + private static final Item POT_OF_FLOUR = new Item(1933); + private static final Item REDBERRIES_SINGLE= new Item(1951); // specifying single because 3 redberries are needed for the red dye + private static final Item[] PASTE_SOLID_INGREDIENTS = new Item[] { ASHES, REDBERRIES_SINGLE, POT_OF_FLOUR }; + + private static final Item BUCKET_OF_WATER = new Item(1929); + private static final Item JUG_OF_WATER = new Item(1937); // Jug of Water is meant to be substitutable with the Bucket of Water /** * Represents the cauldron location @@ -200,7 +207,8 @@ public final class AggieDialogue extends DialoguePlugin { stage = 732; break; case 732: - if (player.getInventory().remove(PASTE_INGREDIENTS)) { + // remove the solid ingredients and one of the water ingredients + if (player.getInventory().remove(PASTE_SOLID_INGREDIENTS) && (player.getInventory().remove(BUCKET_OF_WATER) || player.getInventory().remove(JUG_OF_WATER))) { interpreter.sendDialogue("You hand the ash, flour, water and redberries to Aggie.", "Aggie tips the ingredients into a cauldron", "and mutters some words."); stage = 733; } @@ -389,11 +397,16 @@ public final class AggieDialogue extends DialoguePlugin { * @return {@code True} if so. */ private final boolean hasIngredients(final Player player) { - for (Item i : PASTE_INGREDIENTS) { + // check if the player has all the solid ingredients + for (Item i : PASTE_SOLID_INGREDIENTS) { if (!player.getInventory().containsItem(i)) { return false; } } + // check if the player has a bucket or jug of water + if (!(player.getInventory().containsItem(BUCKET_OF_WATER) || player.getInventory().containsItem(JUG_OF_WATER))) { + return false; + } return true; }