From 8cb45edecf2eb7b2bab93d005bb7da3e5923dc2d Mon Sep 17 00:00:00 2001 From: Rheon <38576432+Rheon-D@users.noreply.github.com> Date: Tue, 8 May 2018 21:16:43 +0930 Subject: [PATCH] Add spade req, fix item reqs for emote clues (#1753) - Add spade requirement for map clues - Fix some map clue coordinates - Fix item requirements for emote clues - Add range of items to emote clues --- .../plugins/cluescrolls/ClueScrollPlugin.java | 10 ++++++++++ .../plugins/cluescrolls/clues/AnagramClue.java | 2 +- .../plugins/cluescrolls/clues/CipherClue.java | 2 +- .../plugins/cluescrolls/clues/CoordinateClue.java | 14 ++++++++++++++ .../plugins/cluescrolls/clues/EmoteClue.java | 5 +++-- .../client/plugins/cluescrolls/clues/MapClue.java | 6 ++++-- .../clues/emote/SlotLimitationRequirement.java | 3 +-- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java index f59a968e11..dfc93c429e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java @@ -335,6 +335,16 @@ public class ClueScrollPlugin extends Plugin } } + if (clue instanceof CoordinateClue) + { + ItemContainer container = client.getItemContainer(InventoryID.INVENTORY); + + if (container != null) + { + equippedItems = container.getItems(); + } + } + ClueScroll clue = findClueScroll(); if (clue == null && this.clue != null) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java index 747099d8d3..5cef2fd2bc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java @@ -65,7 +65,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("This anagram reveals who to speak to next: CAR IF ICES", "Sacrifice", new WorldPoint(2209, 3056, 0), "Zul-Andra"), new AnagramClue("This anagram reveals who to speak to next: CAREER IN MOON", "Oneiromancer", new WorldPoint(2150, 3866, 0), "Astral altar", "25"), new AnagramClue("This anagram reveals who to speak to next: C ON GAME HOC", "Gnome Coach", new WorldPoint(2395, 3486, 0), "Gnome Ball course", "6"), - new AnagramClue("This anagram reveals who to speak to next: COOL NERD", "Old Crone", new WorldPoint(3462, 3557, 0), "East of the Slayer Tower", "619"), + new AnagramClue("This anagram reveals who to speak to next: COOL NERD", "Old crone", new WorldPoint(3462, 3557, 0), "East of the Slayer Tower", "619"), new AnagramClue("This anagram reveals who to speak to next: COPPER ORE CRYPTS", "Prospector Percy", new WorldPoint(3061, 3377, 0), "Motherlode Mine", "12"), new AnagramClue("This anagram reveals who to speak to next: DED WAR", "Edward", new WorldPoint(3284, 3943, 0), "Inside Rogue's Castle"), new AnagramClue("This anagram reveals who to speak to next: DEKAGRAM", "Dark Mage", new WorldPoint(3039, 4835, 0), "Centre of the Abyss", "13"), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CipherClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CipherClue.java index d8cb19c9db..31e7494ff7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CipherClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CipherClue.java @@ -50,7 +50,7 @@ public class CipherClue extends ClueScroll implements TextClueScroll, NpcClueScr new CipherClue("The cipher reveals who to speak to next: ZHLUG ROG PDQ", "Weird Old Man", new WorldPoint(3224, 3112, 0), "Kalphite Lair entrance", "150"), new CipherClue("The cipher reveals who to speak to next: ECRVCKP MJCNGF", "Captain Khaled", new WorldPoint(1845, 3754, 0), "Large eastern building in Piscarilius House", "5"), new CipherClue("The cipher reveals who to speak to next: OVEXON", "Eluned", new WorldPoint(2289, 3144, 0), "Outside Lletya", "53,000"), - new CipherClue("The cipher reveals who to speak to next: VTYR APCNTGLW", "King Percival", new WorldPoint(2638, 4686, 0), "Fisher Realm", "5"), + new CipherClue("The cipher reveals who to speak to next: VTYR APCNTGLW", "King Percival", new WorldPoint(2634, 4682, 1), "Fisher Realm, 2nd floor", "5"), new CipherClue("The cipher reveals who to speak to next: UZZU MUJHRKYYKJ", "Otto Godblessed", new WorldPoint(2501, 3487, 0), "Otto's Grotto", "3"), new CipherClue("The cipher reveals who to speak to next: USBJCPSO", "Traiborn", new WorldPoint(3112, 3162, 0), "First floor of Wizards Tower", "3150"), new CipherClue("The cipher reveals who to speak to next: HCKTA IQFHCVJGT", "Fairy Godfather", new WorldPoint(2446, 4428, 0), "Zanaris throne room", "64"), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index 17fa236687..92764f8ed8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -28,10 +28,13 @@ import java.awt.Color; import java.awt.Graphics2D; import lombok.AllArgsConstructor; import lombok.Getter; +import net.runelite.api.ItemID; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; import static net.runelite.client.plugins.cluescrolls.ClueScrollPlugin.SPADE_IMAGE; +import net.runelite.client.plugins.cluescrolls.clues.emote.ItemRequirement; +import net.runelite.client.plugins.cluescrolls.clues.emote.SingleItemRequirement; import net.runelite.client.ui.overlay.OverlayUtil; import net.runelite.client.ui.overlay.components.LineComponent; import net.runelite.client.ui.overlay.components.PanelComponent; @@ -43,14 +46,25 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati { private String text; private WorldPoint location; + private static final ItemRequirement HAS_SPADE = new SingleItemRequirement(ItemID.SPADE); @Override public void makeOverlayHint(PanelComponent panelComponent, ClueScrollPlugin plugin) { panelComponent.getChildren().add(TitleComponent.builder().text("Coordinate Clue").build()); + panelComponent.getChildren().add(LineComponent.builder() .left("Travel to the marked out destination to see a marker for where you should dig.") .build()); + + if (plugin.getEquippedItems() != null) + { + if (!HAS_SPADE.fulfilledBy(plugin.getEquippedItems())) + { + panelComponent.getChildren().add(LineComponent.builder().left("").build()); + panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build()); + } + } } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java index f08311dfe4..7220a550e2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java @@ -444,7 +444,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Bow outside the entrance to the Legends' Guild. Equip iron platelegs, an emerald amulet and an oak longbow.", new WorldPoint(2729, 3349, 0), BOW, item(IRON_PLATELEGS), item(OAK_LONGBOW), item(EMERALD_AMULET)), new EmoteClue("Bow on the ground floor of the Legend's guild. Equip Legend's cape, a dragon battleaxe and an amulet of glory.", new WorldPoint(2728, 3377, 0), BOW, item(CAPE_OF_LEGENDS), item(DRAGON_BATTLEAXE), item(AMULET_OF_GLORY)), new EmoteClue("Bow in the ticket office of the Duel Arena. Equip an iron chain body, leather chaps and coif.", new WorldPoint(3314, 3241, 0), BOW, item(IRON_CHAINBODY), item(LEATHER_CHAPS), item(COIF)), - new EmoteClue("Bow at the top of the lighthouse. Beware of double agents! Equip a blue dragonhide body, blue dragonhide vambraces and no jewelry.", new WorldPoint(2511, 3641, 2), BOW, item(BLUE_DHIDE_BODY), item(BLUE_DHIDE_VAMB)), + new EmoteClue("Bow at the top of the lighthouse. Beware of double agents! Equip a blue dragonhide body, blue dragonhide vambraces and no jewelry.", new WorldPoint(2511, 3641, 2), BOW, item(BLUE_DHIDE_BODY), item(BLUE_DHIDE_VAMB), emptySlot("No jewelry", AMULET, RING)), new EmoteClue("Blow a kiss between the tables in Shilo Village bank. Beware of double agents! Equip a blue mystic hat, bone spear and rune platebody.", new WorldPoint(2851, 2954, 0), BLOW_KISS, item(MYSTIC_HAT), item(BONE_SPEAR), item(RUNE_PLATEBODY)), new EmoteClue("Blow a kiss in the heart of the lava maze. Equip black dragonhide chaps, a spotted cape and a rolling pin.", new WorldPoint(3069, 3861, 0), BLOW_KISS, item(BLACK_DHIDE_CHAPS), any("Spotted cape", item(SPOTTED_CAPE), item(SPOTTED_CAPE_10073)), item(ROLLING_PIN)), new EmoteClue("Blow a kiss outside K'ril Tsutsaroth's chamber. Beware of double agents! Equip a zamorak full helm and the shadow sword.", new WorldPoint(2925, 5333, 0), BLOW_KISS, item(ZAMORAK_FULL_HELM), item(SHADOW_SWORD)), @@ -481,7 +481,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Jump for joy at the beehives. Equip a desert shirt, green gnome robe bottoms and a steel axe.", new WorldPoint(2759, 3445, 0), JUMP_FOR_JOY, item(DESERT_SHIRT), item(GREEN_ROBE_BOTTOMS), item(STEEL_AXE)), new EmoteClue("Jump for joy in Yanille bank. Dance a jig before you talk to me. Equip a brown apron, adamantite medium helmet and snakeskin chaps.", new WorldPoint(2610, 3092, 0), JUMP_FOR_JOY, JIG, item(BROWN_APRON), item(ADAMANT_MED_HELM), item(SNAKESKIN_CHAPS)), new EmoteClue("Jump for joy in the TzHaar sword shop. Shrug before you talk to me. Equip a Steel longsword, Blue D'hide body and blue mystic gloves.", new WorldPoint(2477, 5146, 0), JUMP_FOR_JOY, SHRUG, item(STEEL_LONGSWORD), item(BLUE_DHIDE_BODY), item(MYSTIC_GLOVES)), - new EmoteClue("Jump for joy in the Ancient Cavern. Equip a granite shield, splitbark body, and any rune heraldic helm.", new WorldPoint(2339, 6787, 0), JUMP_FOR_JOY, item(GRANITE_SHIELD), item(SPLITBARK_BODY), range("Any rune heraldic helm", RUNE_HELM_H1, RUNE_HELM_H5)), + new EmoteClue("Jump for joy in the Ancient Cavern. Equip a granite shield, splitbark body and any rune heraldic helm.", new WorldPoint(2339, 6787, 0), JUMP_FOR_JOY, item(GRANITE_SHIELD), item(SPLITBARK_BODY), range("Any rune heraldic helm", RUNE_HELM_H1, RUNE_HELM_H5)), new EmoteClue("Jump for joy at the Neitiznot rune rock. Equip Rune boots, a proselyte hauberk and a dragonstone ring.", new WorldPoint(2375, 3850, 0), JUMP_FOR_JOY, item(RUNE_BOOTS), item(PROSELYTE_HAUBERK), item(DRAGONSTONE_RING)), new EmoteClue("Jump for joy in the centre of Zul-Andra. Beware of double agents! Equip a dragon 2h sword, bandos boots and an obsidian cape.", new WorldPoint(2199, 3056, 0), JUMP_FOR_JOY, item(DRAGON_2H_SWORD), item(BANDOS_BOOTS), item(OBSIDIAN_CAPE)), new EmoteClue("Laugh by the fountain of heroes. Equip splitbark legs, dragon boots and a Rune longsword.", new WorldPoint(2716, 6584, 0), LAUGH, item(SPLITBARK_LEGS), item(DRAGON_BOOTS), item(RUNE_LONGSWORD)), @@ -627,6 +627,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu .right(found ? "X" : "-") .rightColor(found ? Color.GREEN : Color.RED) .build()); + } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java index 40e8c9fd61..106d016c6f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/MapClue.java @@ -72,17 +72,19 @@ public class MapClue extends ClueScroll implements ObjectClueScroll new MapClue(CLUE_SCROLL_MEDIUM_7290, new WorldPoint(2454, 3230, 0)), new MapClue(CLUE_SCROLL_MEDIUM_7292, new WorldPoint(2578, 3597, 0)), new MapClue(CLUE_SCROLL_MEDIUM_7294, new WorldPoint(2666, 3562, 0)), - new MapClue(CLUE_SCROLL_HARD, new WorldPoint(3309, 3502, 0), CRATE_2620), + new MapClue(CLUE_SCROLL_HARD, new WorldPoint(3309, 3503, 0), CRATE_2620), new MapClue(CLUE_SCROLL_HARD_2729, new WorldPoint(3190, 3963, 0)), new MapClue(CLUE_SCROLL_HARD_3520, new WorldPoint(2616, 3077, 0)), new MapClue(CLUE_SCROLL_HARD_3522, new WorldPoint(2488, 3308, 0)), - new MapClue(CLUE_SCROLL_HARD_3524, new WorldPoint(3458, 3182, 0), CRATE_18506), + new MapClue(CLUE_SCROLL_HARD_3524, new WorldPoint(2457, 3182, 0), CRATE_18506), new MapClue(CLUE_SCROLL_HARD_3525, new WorldPoint(3026, 3629, 0), CRATE_354), new MapClue(CLUE_SCROLL_HARD_7239, new WorldPoint(3021, 3912, 0)), new MapClue(CLUE_SCROLL_HARD_7241, new WorldPoint(2722, 3338, 0)), new MapClue(CLUE_SCROLL_ELITE_12130, new WorldPoint(2449, 3130, 0)), + new MapClue(CLUE_SCROLL_ELITE_19782, new WorldPoint(2953, 9523, 1)), new MapClue(CLUE_SCROLL_ELITE_19783, new WorldPoint(2202, 3062, 0)), new MapClue(CLUE_SCROLL_ELITE_19784, new WorldPoint(1815, 3852, 0)) + ); private int itemId; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/SlotLimitationRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/SlotLimitationRequirement.java index 422ce61c22..36e9183970 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/SlotLimitationRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/emote/SlotLimitationRequirement.java @@ -44,10 +44,9 @@ public class SlotLimitationRequirement implements ItemRequirement { for (EquipmentInventorySlot slot : slots) { - // The items array resizes as different slots are filled if (slot.getSlotIdx() >= items.length) { - return false; + continue; //We can't check the slot, because there is nothing in it, the array hasn't been resized } if (items[slot.getSlotIdx()].getId() != -1)