Repository: runelite/runelite
Pull request #19002 (2025-05-16 07:08:03)

timers: update death charge for yama changes
Updated the death charge timer for the changes observed after Yama release.
- Death charge timer will now properly appear whether or not you've used the [Rite of vile transference](https://oldschool.runescape.wiki/w/Rite_of_vile_transference).
- Removed the variable death charge time as it was observed that death charge lasted a full minute on both an account with 99 mage as well as one with 81 mage.


Patch:
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java
index 832645afe..16fc76489 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java
@@ -217,11 +217,6 @@ public class LootTrackerPlugin extends Plugin
 		put(ObjectID.SHADECHEST_GOLD_PURPLE, "Gold key purple").
 		build();
 
-	// Hallow Sepulchre Coffin handling
-	private static final String COFFIN_LOOTED_MESSAGE = "You push the coffin lid aside.";
-	private static final String HALLOWED_SEPULCHRE_COFFIN_EVENT = "Coffin (Hallowed Sepulchre)";
-	private static final Set<Integer> HALLOWED_SEPULCHRE_MAP_REGIONS = ImmutableSet.of(8797, 10077, 9308, 10074, 9050); // one map region per floor
-
 	private static final String HALLOWED_SACK_EVENT = "Hallowed Sack";
 
 	// Last man standing map regions
@@ -911,13 +906,6 @@ public class LootTrackerPlugin extends Plugin
 			return;
 		}
 
-		if (message.equals(COFFIN_LOOTED_MESSAGE) &&
-			isPlayerWithinMapRegion(HALLOWED_SEPULCHRE_MAP_REGIONS))
-		{
-			onInvChange(collectInvAndGroundItems(LootRecordType.EVENT, HALLOWED_SEPULCHRE_COFFIN_EVENT));
-			return;
-		}
-
 		if (message.equals(HERBIBOAR_LOOTED_MESSAGE))
 		{
 			if (processHerbiboarHerbSackLoot(event.getTimestamp()))
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/GameTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/GameTimer.java
index 8d72a1b54..f21f913f8 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/GameTimer.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/GameTimer.java
@@ -82,7 +82,7 @@ enum GameTimer
 	SHADOW_VEIL(SpriteID.SPELL_SHADOW_VEIL, GameTimerImageType.SPRITE, "Shadow veil", true),
 	RESURRECT_THRALL(SpriteID.SPELL_RESURRECT_SUPERIOR_SKELETON, GameTimerImageType.SPRITE, "Resurrect thrall", false),
 	WARD_OF_ARCEUUS(SpriteID.SPELL_WARD_OF_ARCEUUS, GameTimerImageType.SPRITE, "Ward of Arceuus", true),
-	DEATH_CHARGE(SpriteID.SPELL_DEATH_CHARGE, GameTimerImageType.SPRITE, "Death charge", false),
+	DEATH_CHARGE(SpriteID.SPELL_DEATH_CHARGE, GameTimerImageType.SPRITE, "Death charge", 60, ChronoUnit.SECONDS, false),
 	MARK_OF_DARKNESS(SpriteID.SPELL_MARK_OF_DARKNESS, GameTimerImageType.SPRITE, "Mark of Darkness", true),
 	SHADOW_VEIL_COOLDOWN(SpriteID.SPELL_SHADOW_VEIL_DISABLED, GameTimerImageType.SPRITE, "Shadow veil cooldown", 30, ChronoUnit.SECONDS),
 	RESURRECT_THRALL_COOLDOWN(SpriteID.SPELL_RESURRECT_SUPERIOR_SKELETON_DISABLED, GameTimerImageType.SPRITE, "Resurrect thrall cooldown", 17, GAME_TICKS),
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPlugin.java
index 04ebe46c5..396fb65f9 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPlugin.java
@@ -143,6 +143,8 @@ public class TimersAndBuffsPlugin extends Plugin
 	private WorldPoint lastPoint;
 	private ElapsedTimer tzhaarTimer;
 
+	private int lastDeathChargeVarb;
+
 	private final Map<GameCounter, BuffCounter> varCounters = new EnumMap<>(GameCounter.class);
 	private static final int ECLIPSE_MOON_REGION_ID = 6038;
 
@@ -186,6 +188,7 @@ public class TimersAndBuffsPlugin extends Plugin
 		nextOverloadRefreshTick = 0;
 		nextAntifireTick = 0;
 		nextSuperAntifireTick = 0;
+		lastDeathChargeVarb = 0;
 		removeTzhaarTimer();
 		varTimers.clear();
 		infoBoxManager.removeIf(buffCounter -> buffCounter instanceof BuffCounter);
@@ -304,14 +307,25 @@ public class TimersAndBuffsPlugin extends Plugin
 
 		if (event.getVarbitId() == VarbitID.ARCEUUS_DEATH_CHARGE_ACTIVE && config.showArceuus())
 		{
-			if (event.getValue() == 1)
-			{
-				createGameTimer(DEATH_CHARGE, Duration.of(client.getRealSkillLevel(Skill.MAGIC), RSTimeUnit.GAME_TICKS));
-			}
-			else
+			final int deathChargeVarb = event.getValue();
+
+			switch (deathChargeVarb)
 			{
-				removeGameTimer(DEATH_CHARGE);
+				case 2:
+					createGameTimer(DEATH_CHARGE);
+					break;
+				case 1:
+					if (lastDeathChargeVarb == 0)
+					{
+						createGameTimer(DEATH_CHARGE);
+					}
+					break;
+				case 0:
+					removeGameTimer(DEATH_CHARGE);
+					break;
 			}
+
+			lastDeathChargeVarb = deathChargeVarb;
 		}
 
 		if (event.getVarbitId() == VarbitID.ARCEUUS_RESURRECTION_ACTIVE && event.getValue() == 0 && config.showArceuus())


Test patch:
diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPluginTest.java
index 8d280fa85..079d2f376 100644
--- a/runelite-client/src/test/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPluginTest.java
+++ b/runelite-client/src/test/java/net/runelite/client/plugins/timersandbuffs/TimersAndBuffsPluginTest.java
@@ -349,7 +349,6 @@ public class TimersAndBuffsPluginTest
 	public void testDeathChargeCast()
 	{
 		when(timersAndBuffsConfig.showArceuus()).thenReturn(true);
-		when(client.getRealSkillLevel(Skill.MAGIC)).thenReturn(50);
 		VarbitChanged varbitChanged = new VarbitChanged();
 		varbitChanged.setVarbitId(VarbitID.ARCEUUS_DEATH_CHARGE_ACTIVE);
 		varbitChanged.setValue(1);
@@ -359,7 +358,21 @@ public class TimersAndBuffsPluginTest
 		verify(infoBoxManager).addInfoBox(ibcaptor.capture());
 		TimerTimer infoBox = (TimerTimer) ibcaptor.getValue();
 		assertEquals(GameTimer.DEATH_CHARGE, infoBox.getTimer());
-		assertEquals(Duration.of(50, RSTimeUnit.GAME_TICKS), infoBox.getDuration());
+	}
+
+	@Test
+	public void testImprovedDeathChargeCast()
+	{
+		when(timersAndBuffsConfig.showArceuus()).thenReturn(true);
+		VarbitChanged varbitChanged = new VarbitChanged();
+		varbitChanged.setVarbitId(VarbitID.ARCEUUS_DEATH_CHARGE_ACTIVE);
+		varbitChanged.setValue(2);
+		timersAndBuffsPlugin.onVarbitChanged(varbitChanged);
+
+		ArgumentCaptor<InfoBox> ibcaptor = ArgumentCaptor.forClass(InfoBox.class);
+		verify(infoBoxManager).addInfoBox(ibcaptor.capture());
+		TimerTimer infoBox = (TimerTimer) ibcaptor.getValue();
+		assertEquals(GameTimer.DEATH_CHARGE, infoBox.getTimer());
 	}
 
 	@Test