loot tracker: use chest events for gauntlet loot

This commit is contained in:
Alexsuperfly
2020-05-11 14:14:14 -04:00
committed by Adam
parent 67813eb8fb
commit e852ba8194

View File

@@ -136,21 +136,17 @@ public class LootTrackerPlugin extends Plugin
private static final String HESPORI_EVENT = "Hespori"; private static final String HESPORI_EVENT = "Hespori";
private static final int HESPORI_REGION = 5021; private static final int HESPORI_REGION = 5021;
// Gauntlet loot handling
private static final String GAUNTLET_LOOTED_MESSAGE = "You open the chest.";
private static final String GAUNTLET_EVENT = "The Gauntlet";
private static final int GAUNTLET_LOBBY_REGION = 12127;
// Chest loot handling // Chest loot handling
private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!"; private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!";
private static final Pattern LARRAN_LOOTED_PATTERN = Pattern.compile("You have opened Larran's (big|small) chest .*"); private static final Pattern LARRAN_LOOTED_PATTERN = Pattern.compile("You have opened Larran's (big|small) chest .*");
private static final Map<Integer, String> CHEST_EVENT_TYPES = ImmutableMap.of( private static final Map<Integer, String> CHEST_EVENT_TYPES = new ImmutableMap.Builder<Integer, String>().
5179, "Brimstone Chest", put(5179, "Brimstone Chest").
11573, "Crystal Chest", put(11573, "Crystal Chest").
12093, "Larran's big chest", put(12093, "Larran's big chest").
13113, "Larran's small chest", put(12127, "The Gauntlet").
13151, "Elven Crystal Chest" put(13113, "Larran's small chest").
); put(13151, "Elven Crystal Chest").
build();
// Last man standing map regions // Last man standing map regions
private static final Set<Integer> LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916); private static final Set<Integer> LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916);
@@ -558,14 +554,6 @@ public class LootTrackerPlugin extends Plugin
return; return;
} }
if (GAUNTLET_LOBBY_REGION == regionID && message.equals(GAUNTLET_LOOTED_MESSAGE))
{
eventType = GAUNTLET_EVENT;
lootRecordType = LootRecordType.EVENT;
takeInventorySnapshot();
return;
}
final Matcher pickpocketMatcher = PICKPOCKET_REGEX.matcher(message); final Matcher pickpocketMatcher = PICKPOCKET_REGEX.matcher(message);
if (pickpocketMatcher.matches()) if (pickpocketMatcher.matches())
{ {
@@ -634,7 +622,6 @@ public class LootTrackerPlugin extends Plugin
if (CHEST_EVENT_TYPES.containsValue(eventType) if (CHEST_EVENT_TYPES.containsValue(eventType)
|| HERBIBOAR_EVENT.equals(eventType) || HERBIBOAR_EVENT.equals(eventType)
|| HESPORI_EVENT.equals(eventType) || HESPORI_EVENT.equals(eventType)
|| GAUNTLET_EVENT.equals(eventType)
|| lootRecordType == LootRecordType.PICKPOCKET) || lootRecordType == LootRecordType.PICKPOCKET)
{ {
processInventoryLoot(eventType, lootRecordType, event.getItemContainer()); processInventoryLoot(eventType, lootRecordType, event.getItemContainer());