Stop slayer kills desync for Grotesque Guardians with Double Trouble reward active (#5983)
Correctly reduce task amount by 2 if killing Grotesque Guardians with the Double Trouble slayer reward enabled Fixes #4336
This commit is contained in:
@@ -49,6 +49,8 @@ import net.runelite.api.ItemID;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import static net.runelite.api.Skill.SLAYER;
|
||||
import net.runelite.api.SlayerUnlock;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.ExperienceChanged;
|
||||
@@ -102,6 +104,8 @@ public class SlayerPlugin extends Plugin
|
||||
//Reward UI
|
||||
private static final Pattern REWARD_POINTS = Pattern.compile("Reward points: ((?:\\d+,)*\\d+)");
|
||||
|
||||
private static final int GROTESQUE_GUARDIANS_REGION = 6727;
|
||||
|
||||
private static final int EXPEDITIOUS_CHARGE = 30;
|
||||
private static final int SLAUGHTER_CHARGE = 30;
|
||||
|
||||
@@ -490,6 +494,11 @@ public class SlayerPlugin extends Plugin
|
||||
}
|
||||
|
||||
amount--;
|
||||
if (doubleTroubleExtraKill())
|
||||
{
|
||||
amount--;
|
||||
}
|
||||
|
||||
config.amount(amount); // save changed value
|
||||
|
||||
if (!config.showInfobox())
|
||||
@@ -503,6 +512,12 @@ public class SlayerPlugin extends Plugin
|
||||
infoTimer = Instant.now();
|
||||
}
|
||||
|
||||
private boolean doubleTroubleExtraKill()
|
||||
{
|
||||
return WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID() == GROTESQUE_GUARDIANS_REGION &&
|
||||
SlayerUnlock.GROTESQUE_GARDIAN_DOUBLE_COUNT.isEnabled(client);
|
||||
}
|
||||
|
||||
private boolean isTarget(NPC npc)
|
||||
{
|
||||
if (targetNames.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user