Merge pull request #4079 from deathbeam/fix-sotd-sol

Make SOTD/SOTL timer use chat messsage
This commit is contained in:
Tomas Slusny
2018-06-29 14:38:19 +02:00
committed by GitHub
2 changed files with 12 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ public enum GameTimer
ANTIPOISON("antipoison", "Antipoison", 90, ChronoUnit.SECONDS),
SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS),
CHARGE("charge", "Charge", 6, ChronoUnit.MINUTES),
STAFF_OF_THE_DEAD("staffofthedead", "Staff of the Dead", GraphicID.STAFF_OF_THE_DEAD, 1, ChronoUnit.MINUTES);
STAFF_OF_THE_DEAD("staffofthedead", "Staff of the Dead", 1, ChronoUnit.MINUTES);
@Getter
private final String imageResource;

View File

@@ -429,10 +429,20 @@ public class TimersPlugin extends Plugin
createGameTimer(CHARGE);
}
if (event.getMessage().equals("<col=ef1020>Your magical charge fades away.</col>"))
if (config.showCharge() && event.getMessage().equals("<col=ef1020>Your magical charge fades away.</col>"))
{
removeGameTimer(CHARGE);
}
if (config.showStaffOfTheDead() && event.getMessage().contains("Spirits of deceased evildoers offer you their protection"))
{
createGameTimer(STAFF_OF_THE_DEAD);
}
if (config.showStaffOfTheDead() && event.getMessage().contains("Your protection fades away"))
{
removeGameTimer(STAFF_OF_THE_DEAD);
}
}
@Subscribe
@@ -474,11 +484,6 @@ public class TimersPlugin extends Plugin
createGameTimer(VENGEANCE);
}
if (config.showStaffOfTheDead() && actor.getGraphic() == STAFF_OF_THE_DEAD.getGraphicId())
{
createGameTimer(STAFF_OF_THE_DEAD);
}
if (config.showFreezes())
{
if (actor.getGraphic() == BIND.getGraphicId())