Skip to content

Commit

Permalink
fix: Updated widgets for Pirate's Treasure
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoinkwiz committed Oct 18, 2024
1 parent 0401f95 commit 320df09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ public Map<Integer, QuestStep> 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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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.",
Expand Down

0 comments on commit 320df09

Please sign in to comment.