From 320df09e5424fecf3931ca3a379e4fe101c6ec09 Mon Sep 17 00:00:00 2001 From: Zoinkwiz Date: Fri, 18 Oct 2024 15:44:19 +0100 Subject: [PATCH] fix: Updated widgets for Pirate's Treasure --- .../piratestreasure/PiratesTreasure.java | 3 +-- .../piratestreasure/RumSmugglingStep.java | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java b/src/main/java/com/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java index 00e32f80cd..45c700d9c4 100644 --- a/src/main/java/com/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java +++ b/src/main/java/com/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java @@ -78,8 +78,7 @@ public Map loadSteps() speakToRedbeard = new NpcStep(this, NpcID.REDBEARD_FRANK, new WorldPoint(3053, 3251, 0), "Talk to Redbeard Frank in Port Sarim."); - speakToRedbeard.addDialogStep("I'm in search of treasure."); - speakToRedbeard.addDialogStep("Ok, I will bring you some Karamja Rum."); + speakToRedbeard.addDialogSteps("I'm in search of treasure.", "Yes."); steps.put(0, speakToRedbeard); diff --git a/src/main/java/com/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java b/src/main/java/com/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java index a641a137fc..989f5bd3a7 100644 --- a/src/main/java/com/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java +++ b/src/main/java/com/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java @@ -26,6 +26,7 @@ import com.questhelper.collections.ItemCollections; import com.questhelper.requirements.ChatMessageRequirement; +import com.questhelper.requirements.MesBoxRequirement; import com.questhelper.requirements.Requirement; import com.questhelper.requirements.zone.ZoneRequirement; import com.questhelper.requirements.npc.DialogRequirement; @@ -146,36 +147,37 @@ private void setupConditions() hasRumOffKaramja = new Conditions(LogicType.AND, karamjanRum, offKaramja); hadRumOffKaramja = new Conditions(true, karamjanRum, offKaramja); - lostRum = new Conditions(LogicType.AND, inPirateTreasureMenu, new WidgetTextRequirement(119, 8, "I seem to have lost it.")); + lostRum = new Conditions(LogicType.AND, inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "I seem to have lost it.")); - Requirement haveRumFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(119, 8, "I should take it to")); + Requirement haveRumFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "I should take it to")); Requirement agreedToGetRum = new DialogRequirement("Ok, I will bring you some rum."); - Requirement atStartFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(119, 8, "I need to go to")); + Requirement atStartFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "I need to go to")); atStart = new Conditions(true, LogicType.OR, agreedToGetRum, atStartFromWidget, lostRum, hadRumOffKaramja, haveRumFromWidget); crateSent = new ChatMessageRequirement("Luthas hands you 30 coins."); - Requirement employedFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(119, 8, "I have taken employment")); + Requirement employedFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "I have taken employment")); /* Filled crate but not sent it and employed */ - Requirement employedByWydinFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(119, 8, "I have taken a job at")); + Requirement employedByWydinFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "I have taken a job at")); Requirement employedFromDialog = new Conditions(new DialogRequirement("If you could fill it up with bananas, I'll pay you 30 gold.", "Have you completed your task yet?", "you should see the old crate")); employed = new Conditions(true, LogicType.OR, employedFromDialog, employedFromWidget, employedByWydinFromWidget); - Requirement stashedRumFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(119, 12, "I have hidden my")); - Requirement stashedRumFromDialog = new Conditions(new WidgetTextRequirement(229, 1, "You stash the rum in the crate.")); + Requirement stashedRumFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "I have hidden my")); + Requirement stashedRumFromDialog = new MesBoxRequirement("You stash the rum in the crate."); Requirement stashedRumFromChat = new Conditions(new ChatMessageRequirement("There is also some rum stashed in here too.", "There's already some rum in here...", "There is some rum in here, although with no bananas to cover it. It is a little obvious.")); stashedRum = new Conditions(true, LogicType.OR, stashedRumFromDialog, stashedRumFromWidget, stashedRumFromChat, employedByWydinFromWidget); - Requirement fillCrateBananas = new Conditions(new WidgetTextRequirement(229, 1, "You fill the crate with bananas.")); + MesBoxRequirement fillCrateBananas = new MesBoxRequirement("You fill the crate with bananas.", "You pack all your bananas into the crate."); + fillCrateBananas.setInvalidateRequirement(new ChatMessageRequirement("Have you completed your task yet?")); fillCrateWithBananasChat = new ChatMessageRequirement("The crate is full of bananas.", "The crate is already full."); Requirement filledCrateWithBananas = new Conditions(false, LogicType.OR, fillCrateWithBananasChat, fillCrateBananas); filledCrateWithBananasAndRum = new Conditions(true, LogicType.AND, filledCrateWithBananas, stashedRum); - Requirement shippedRumFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(119, 15, "the crate has been shipped")); + Requirement shippedRumFromWidget = new Conditions(inPirateTreasureMenu, new WidgetTextRequirement(ComponentID.DIARY_TEXT, true, "the crate has been shipped")); Requirement shippedRumFromDialog = new Conditions(stashedRum, crateSent); Requirement shippedRumFromChat = new ChatMessageRequirement("There is already some rum in Wydin's store, I should go and get that first."); haveShippedRum = new Conditions(true, LogicType.OR, shippedRumFromWidget, shippedRumFromDialog, shippedRumFromChat); @@ -192,6 +194,7 @@ private void setupSteps() talkToZambo = new NpcStep(getQuestHelper(), NpcID.ZEMBO, new WorldPoint(2929, 3145, 0), "Talk to Zembo in the Karamja Wines, Spirits and Beers bar. Buy one Karamjan rum.", new ItemRequirement("Coins", ItemCollections.COINS, 30)); talkToZambo.addDialogStep("Yes please."); + talkToZambo.addWidgetHighlightWithItemIdRequirement(300, 16, ItemID.KARAMJAN_RUM, true); talkToLuthas = new NpcStep(getQuestHelper(), NpcID.LUTHAS, new WorldPoint(2938, 3154, 0), "Pick 10 bananas nearby, and then talk to Luthas about working for him.",