Merge pull request #12517 from spatiag/fix-nmz-overload-timer-and-notification

This commit is contained in:
Jordan
2020-10-24 18:57:42 -07:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ public class NightmareZonePlugin extends Plugin
overlayManager.add(overlay); overlayManager.add(overlay);
overlay.removeAbsorptionCounter(); overlay.removeAbsorptionCounter();
absorptionNotificationSend = true;
overloadNotificationSend = false; overloadNotificationSend = false;
} }
@@ -135,6 +136,8 @@ public class NightmareZonePlugin extends Plugin
resetPointsPerHour(); resetPointsPerHour();
} }
overloadNotificationSend = false;
return; return;
} }

View File

@@ -121,6 +121,7 @@ public class TimersPlugin extends Plugin
static final int FIGHT_CAVES_REGION_ID = 9551; static final int FIGHT_CAVES_REGION_ID = 9551;
static final int INFERNO_REGION_ID = 9043; static final int INFERNO_REGION_ID = 9043;
private static final int NMZ_MAP_REGION_ID = 9033;
private static final Pattern TZHAAR_WAVE_MESSAGE = Pattern.compile("Wave: (\\d+)"); private static final Pattern TZHAAR_WAVE_MESSAGE = Pattern.compile("Wave: (\\d+)");
private static final String TZHAAR_DEFEATED_MESSAGE = "You have been defeated!"; private static final String TZHAAR_DEFEATED_MESSAGE = "You have been defeated!";
private static final Pattern TZHAAR_COMPLETE_MESSAGE = Pattern.compile("Your (TzTok-Jad|TzKal-Zuk) kill count is:"); private static final Pattern TZHAAR_COMPLETE_MESSAGE = Pattern.compile("Your (TzTok-Jad|TzKal-Zuk) kill count is:");
@@ -718,6 +719,11 @@ public class TimersPlugin extends Plugin
return client.getMapRegions() != null && ArrayUtils.contains(client.getMapRegions(), INFERNO_REGION_ID); return client.getMapRegions() != null && ArrayUtils.contains(client.getMapRegions(), INFERNO_REGION_ID);
} }
private boolean isInNightmareZone()
{
return client.getLocalPlayer() != null && client.getLocalPlayer().getWorldLocation().getPlane() > 0 && ArrayUtils.contains(client.getMapRegions(), NMZ_MAP_REGION_ID);
}
private void createTzhaarTimer() private void createTzhaarTimer()
{ {
removeTzhaarTimer(); removeTzhaarTimer();
@@ -783,6 +789,11 @@ public class TimersPlugin extends Plugin
switch (gameStateChanged.getGameState()) switch (gameStateChanged.getGameState())
{ {
case LOADING: case LOADING:
if (!isInNightmareZone())
{
removeGameTimer(OVERLOAD);
}
if (tzhaarTimer != null && !isInFightCaves() && !isInInferno()) if (tzhaarTimer != null && !isInFightCaves() && !isInInferno())
{ {
removeTzhaarTimer(); removeTzhaarTimer();