Skip to content

Commit

Permalink
fix: consider galvek rematches as safe deaths (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy authored Nov 4, 2023
1 parent e0db3dd commit a71d706
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Minor: Include owned pets in login notification metadata. (#347)
- Minor: Include individual skill XP in login notification metadata. (#345)
- Bugfix: Classify reminisced Galvek deaths as safe. (#351)
- Bugfix: Improve handling of queued notifications upon concurrent config changes. (#355)

## 1.6.4
Expand Down
19 changes: 18 additions & 1 deletion src/main/java/dinkplugin/util/WorldUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.WorldType;
import net.runelite.api.annotations.Varbit;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
Expand All @@ -24,6 +25,7 @@ public class WorldUtils {
private final Set<Integer> CASTLE_WARS_REGIONS = ImmutableSet.of(9520, 9620);
private final Set<Integer> CLAN_WARS_REGIONS = ImmutableSet.of(12621, 12622, 12623, 13130, 13131, 13133, 13134, 13135, 13386, 13387, 13390, 13641, 13642, 13643, 13644, 13645, 13646, 13647, 13899, 13900, 14155, 14156);
private final Set<Integer> COX_REGIONS = ImmutableSet.of(12889, 13136, 13137, 13138, 13139, 13140, 13141, 13145, 13393, 13394, 13395, 13396, 13397, 13401);
private final Set<Integer> GALVEK_REGIONS = ImmutableSet.of(6486, 6487, 6488, 6489, 6742, 6743, 6744, 6745);
private final Set<Integer> GAUNTLET_REGIONS = ImmutableSet.of(7512, 7768, 12127); // includes CG
private final Set<Integer> LMS_REGIONS = ImmutableSet.of(13658, 13659, 13660, 13914, 13915, 13916, 13918, 13919, 13920, 14174, 14175, 14176, 14430, 14431, 14432);
private final Set<Integer> POH_REGIONS = ImmutableSet.of(7257, 7513, 7514, 7769, 7770, 8025, 8026);
Expand All @@ -35,6 +37,16 @@ public class WorldUtils {
private final int TZHAAR_CAVE = 9551;
public final @VisibleForTesting int TZHAAR_PIT = 9552;

/**
* @see <a href="https://oldschool.runescape.wiki/w/RuneScape:Varbit/6104">Wiki</a>
*/
private final @Varbit int DRAGON_SLAYER_II_PROGRESS = 6104;

/**
* @see <a href="https://chisel.weirdgloop.org/varbs/display?varbit=6104#ChangeFrequencyTitle">Chisel</a>
*/
private final int DRAGON_SLAYER_II_COMPLETED = 215;

public static WorldPoint getLocation(Client client) {
return getLocation(client, client.getLocalPlayer());
}
Expand Down Expand Up @@ -79,6 +91,10 @@ public boolean isClanWars(int regionId) {
return CLAN_WARS_REGIONS.contains(regionId);
}

public boolean isGalvekRematch(Client client, int regionId) {
return GALVEK_REGIONS.contains(regionId) && client.getVarbitValue(DRAGON_SLAYER_II_PROGRESS) >= DRAGON_SLAYER_II_COMPLETED;
}

public boolean isGauntlet(int regionId) {
return GAUNTLET_REGIONS.contains(regionId);
}
Expand Down Expand Up @@ -125,7 +141,8 @@ public boolean isSafeArea(Client client) {
}

if (isBarbarianAssault(regionId) || isChambersOfXeric(regionId) || isInferno(regionId) ||
isNightmareZone(regionId) || isTzHaarFightCave(regionId) || isPestControl(client)) {
isNightmareZone(regionId) || isTzHaarFightCave(regionId) || isPestControl(client) ||
isGalvekRematch(client, regionId)) {
// All PvM activities are dangerous for Hardcore group iron players
return Utils.getAccountType(client) != AccountType.HARDCORE_GROUP_IRONMAN;
}
Expand Down

0 comments on commit a71d706

Please sign in to comment.