timers: add dodgy necklace protection to pickpocket stun timer

This commit is contained in:
Krazune
2021-12-08 15:18:21 +00:00
committed by GitHub
parent a54b3d149f
commit 517dc2b504

View File

@@ -124,6 +124,7 @@ public class TimersPlugin extends Plugin
private static final String RESURRECT_THRALL_DISAPPEAR_MESSAGE_END = " thrall returns to the grave.</col>";
private static final String WARD_OF_ARCEUUS_MESSAGE = ">Your defence against Arceuus magic has been strengthened.</col>";
private static final String PICKPOCKET_FAILURE_MESSAGE = "You fail to pick the ";
private static final String DODGY_NECKLACE_PROTECTION_MESSAGE = "Your dodgy necklace protects you.";
private static final Pattern TELEBLOCK_PATTERN = Pattern.compile("A Tele Block spell has been cast on you(?: by .+)?\\. It will expire in (?<mins>\\d+) minutes?(?:, (?<secs>\\d+) seconds?)?\\.");
private static final Pattern DIVINE_POTION_PATTERN = Pattern.compile("You drink some of your divine (.+) potion\\.");
@@ -508,6 +509,11 @@ public class TimersPlugin extends Plugin
return;
}
if (message.contains(DODGY_NECKLACE_PROTECTION_MESSAGE))
{
removeGameTimer(PICKPOCKET_STUN);
}
if (message.contains(PICKPOCKET_FAILURE_MESSAGE) && config.showPickpocketStun() && message.contains("pocket"))
{
if (message.contains("hero") || message.contains("elf"))