timers plugin: add abyssal sire stun timer

This commit is contained in:
John Pettenger
2018-07-21 19:31:55 -05:00
committed by Adam
parent 899ad1c78a
commit 8943d1d106
3 changed files with 42 additions and 3 deletions

View File

@@ -74,7 +74,8 @@ enum GameTimer
ANTIPOISON(ItemID.ANTIPOISON4, GameTimerImageType.ITEM, "Antipoison", 90, ChronoUnit.SECONDS),
SUPERANTIPOISON(ItemID.SUPERANTIPOISON4, GameTimerImageType.ITEM, "Superantipoison", 346, ChronoUnit.SECONDS),
CHARGE(SpriteID.SPELL_CHARGE, GameTimerImageType.SPRITE, "Charge", 6, ChronoUnit.MINUTES),
STAFF_OF_THE_DEAD(ItemID.STAFF_OF_THE_DEAD, GameTimerImageType.ITEM, "Staff of the Dead", 1, ChronoUnit.MINUTES);
STAFF_OF_THE_DEAD(ItemID.STAFF_OF_THE_DEAD, GameTimerImageType.ITEM, "Staff of the Dead", 1, ChronoUnit.MINUTES),
ABYSSAL_SIRE_STUN(ItemID.ABYSSAL_ORPHAN, GameTimerImageType.ITEM, "Abyssal Sire Stun", 30, ChronoUnit.SECONDS);
@Getter
private final Duration duration;

View File

@@ -294,4 +294,15 @@ public interface TimersConfig extends Config
{
return true;
}
@ConfigItem(
position = 24,
keyName = "showAbyssalSireStun",
name = "Abyssal Sire Stun Timer",
description = "Configures whether Abyssal Sire stun timer is displayed"
)
default boolean showAbyssalSireStun()
{
return true;
}
}

View File

@@ -54,6 +54,7 @@ import net.runelite.client.game.ItemManager;
import net.runelite.client.game.SpriteManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import static net.runelite.client.plugins.timers.GameTimer.ABYSSAL_SIRE_STUN;
import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUS;
import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUSPLUS;
import static net.runelite.client.plugins.timers.GameTimer.ANTIFIRE;
@@ -94,7 +95,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
@PluginDescriptor(
name = "Timers",
description = "Show various timers in an infobox",
tags = {"combat", "items", "magic", "potions", "prayer", "overlay"}
tags = {"combat", "items", "magic", "potions", "prayer", "overlay", "abyssal", "sire"}
)
public class TimersPlugin extends Plugin
{
@@ -464,6 +465,32 @@ public class TimersPlugin extends Plugin
{
Actor actor = event.getActor();
if (config.showAbyssalSireStun()
&& actor instanceof NPC)
{
int npcId = ((NPC)actor).getId();
switch (npcId)
{
// Show the countdown when the Sire enters the stunned state.
case NpcID.ABYSSAL_SIRE_5887:
createGameTimer(ABYSSAL_SIRE_STUN);
break;
// Hide the countdown if the Sire isn't in the stunned state.
// This is necessary because the Sire leaves the stunned
// state early once all all four respiratory systems are killed.
case NpcID.ABYSSAL_SIRE:
case NpcID.ABYSSAL_SIRE_5888:
case NpcID.ABYSSAL_SIRE_5889:
case NpcID.ABYSSAL_SIRE_5890:
case NpcID.ABYSSAL_SIRE_5891:
case NpcID.ABYSSAL_SIRE_5908:
removeGameTimer(ABYSSAL_SIRE_STUN);
break;
}
}
if (actor != client.getLocalPlayer())
{
return;
@@ -631,4 +658,4 @@ public class TimersPlugin extends Plugin
{
infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer() == timer);
}
}
}