From 4817d8bdcdccb84d814d399cbf30b04c0bc57289 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 13 May 2020 16:34:46 -0400 Subject: [PATCH] screenshot plugin: block untradeable drops within the Gauntlet Co-authored-by: Jordan Atwood --- .../client/plugins/screenshot/ScreenshotPlugin.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java index 7d402bcafc..26a612456a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java @@ -94,6 +94,8 @@ public class ScreenshotPlugin extends Plugin { private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!"; private static final Map CHEST_LOOT_EVENTS = ImmutableMap.of(12127, "The Gauntlet"); + private static final int GAUNTLET_REGION = 7512; + private static final int CORRUPTED_GAUNTLET_REGION = 7768; private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)"); private static final Pattern LEVEL_UP_PATTERN = Pattern.compile(".*Your ([a-zA-Z]+) (?:level is|are)? now (\\d+)\\."); private static final Pattern BOSSKILL_MESSAGE_PATTERN = Pattern.compile("Your (.+) kill count is: (\\d+)."); @@ -401,7 +403,7 @@ public class ScreenshotPlugin extends Plugin } } - if (config.screenshotUntradeableDrop()) + if (config.screenshotUntradeableDrop() && !isInsideGauntlet()) { Matcher m = UNTRADEABLE_DROP_PATTERN.matcher(chatMessage); if (m.matches()) @@ -638,6 +640,14 @@ public class ScreenshotPlugin extends Plugin imageCapture.takeScreenshot(screenshot, fileName, subDir, config.notifyWhenTaken(), config.uploadScreenshot()); } + private boolean isInsideGauntlet() + { + return this.client.isInInstancedRegion() + && this.client.getMapRegions().length > 0 + && (this.client.getMapRegions()[0] == GAUNTLET_REGION + || this.client.getMapRegions()[0] == CORRUPTED_GAUNTLET_REGION); + } + @VisibleForTesting int getClueNumber() {