From 1fbb9058c0c600d3ae0be1cf56cbb030a4e2910f Mon Sep 17 00:00:00 2001 From: whaevr Date: Wed, 17 Jun 2020 14:06:43 -0400 Subject: [PATCH] loot tracker: add coffins from Hallowed Sepulchre --- .../loottracker/LootTrackerPlugin.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index c2dd8508cf..807e96172d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -112,7 +112,6 @@ import net.runelite.http.api.loottracker.LootAggregate; import net.runelite.http.api.loottracker.LootRecord; import net.runelite.http.api.loottracker.LootRecordType; import net.runelite.http.api.loottracker.LootTrackerClient; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.text.WordUtils; @PluginDescriptor( @@ -179,6 +178,11 @@ public class LootTrackerPlugin extends Plugin put(ObjectID.SILVER_CHEST_4130, "Silver key purple"). build(); + // Hallow Sepulchre Coffin handling + private static final String COFFIN_LOOTED_MESSAGE = "You push the coffin lid aside."; + private static final String HALLOWED_SEPULCHRE_COFFIN_EVENT = "Coffin (Hallowed Sepulchre)"; + private static final Set HALLOWED_SEPULCHRE_MAP_REGIONS = ImmutableSet.of(8797, 10077, 9308, 10074, 9050); // one map region per floor + // Last man standing map regions private static final Set LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916); @@ -447,7 +451,7 @@ public class LootTrackerPlugin extends Plugin public void onPlayerLootReceived(final PlayerLootReceived playerLootReceived) { // Ignore Last Man Standing player loots - if (isAtLMS()) + if (isPlayerWithinMapRegion(LAST_MAN_STANDING_REGIONS)) { return; } @@ -572,6 +576,15 @@ public class LootTrackerPlugin extends Plugin return; } + if (message.equals(COFFIN_LOOTED_MESSAGE) && + isPlayerWithinMapRegion(HALLOWED_SEPULCHRE_MAP_REGIONS)) + { + eventType = HALLOWED_SEPULCHRE_COFFIN_EVENT; + lootRecordType = LootRecordType.EVENT; + takeInventorySnapshot(); + return; + } + if (message.equals(HERBIBOAR_LOOTED_MESSAGE)) { if (processHerbiboarHerbSackLoot(event.getTimestamp())) @@ -668,6 +681,7 @@ public class LootTrackerPlugin extends Plugin if (CHEST_EVENT_TYPES.containsValue(eventType) || SHADE_CHEST_OBJECTS.containsValue(eventType) + || HALLOWED_SEPULCHRE_COFFIN_EVENT.equals(eventType) || HERBIBOAR_EVENT.equals(eventType) || HESPORI_EVENT.equals(eventType) || SEEDPACK_EVENT.equals(eventType) @@ -895,15 +909,15 @@ public class LootTrackerPlugin extends Plugin } /** - * Is player at the Last Man Standing minigame + * Is player currently within the provided map regions */ - private boolean isAtLMS() + private boolean isPlayerWithinMapRegion(Set definedMapRegions) { final int[] mapRegions = client.getMapRegions(); - for (int region : LAST_MAN_STANDING_REGIONS) + for (int region : mapRegions) { - if (ArrayUtils.contains(mapRegions, region)) + if (definedMapRegions.contains(region)) { return true; }