Merge pull request #3593 from Hydrox6/charge-timer-2

Fix Charge timer showing with every teleport
This commit is contained in:
Adam
2018-06-03 13:34:11 -04:00
committed by GitHub
3 changed files with 12 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ package net.runelite.api;
public class GraphicID
{
public static final int CHARGE = 111;
public static final int TELEPORT = 111;
public static final int ENTANGLE = 179;
public static final int SNARE = 180;
public static final int BIND = 181;

View File

@@ -70,7 +70,7 @@ public enum GameTimer
GOD_WARS_ALTAR("altar", "God wars altar", 10, ChronoUnit.MINUTES),
ANTIPOISON("antipoison", "Antipoison", 90, ChronoUnit.SECONDS),
SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS),
CHARGE("charge", "Charge", GraphicID.CHARGE, 6, ChronoUnit.MINUTES);
CHARGE("charge", "Charge", 6, ChronoUnit.MINUTES);
@Getter
private final String imageResource;

View File

@@ -402,6 +402,16 @@ public class TimersPlugin extends Plugin
{
createGameTimer(PRAYER_ENHANCE);
}
if (config.showCharge() && event.getMessage().equals("<col=ef1020>You feel charged with magic power.</col>"))
{
createGameTimer(CHARGE);
}
if (event.getMessage().equals("<col=ef1020>Your magical charge fades away.</col>"))
{
removeGameTimer(CHARGE);
}
}
@Subscribe
@@ -431,11 +441,6 @@ public class TimersPlugin extends Plugin
return;
}
if (config.showCharge() && actor.getGraphic() == CHARGE.getGraphicId())
{
createGameTimer(CHARGE);
}
if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId())
{
createGameTimer(IMBUEDHEART);