Merge pull request #3215 from SRLJustin/1506-upstream
project: upstream merge
This commit is contained in:
@@ -145,7 +145,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
|
|||||||
any("Water Rune x15", xOfItem(ItemID.WATER_RUNE, 15), xOfItem(ItemID.MIST_RUNE, 15), xOfItem(ItemID.MUD_RUNE, 15), xOfItem(ItemID.STEAM_RUNE, 15), item(ItemID.STAFF_OF_WATER), item(ItemID.WATER_BATTLESTAFF), item(ItemID.MYSTIC_WATER_STAFF), item(ItemID.MUD_BATTLESTAFF), item(ItemID.MYSTIC_MUD_STAFF), item(ItemID.MIST_BATTLESTAFF), item(ItemID.MYSTIC_MIST_STAFF), item(ItemID.STEAM_BATTLESTAFF), item(ItemID.MYSTIC_STEAM_STAFF), item(ItemID.STEAM_BATTLESTAFF_12795), item(ItemID.MYSTIC_STEAM_STAFF_12796), item(ItemID.KODAI_WAND), item(ItemID.TOME_OF_WATER)),
|
any("Water Rune x15", xOfItem(ItemID.WATER_RUNE, 15), xOfItem(ItemID.MIST_RUNE, 15), xOfItem(ItemID.MUD_RUNE, 15), xOfItem(ItemID.STEAM_RUNE, 15), item(ItemID.STAFF_OF_WATER), item(ItemID.WATER_BATTLESTAFF), item(ItemID.MYSTIC_WATER_STAFF), item(ItemID.MUD_BATTLESTAFF), item(ItemID.MYSTIC_MUD_STAFF), item(ItemID.MIST_BATTLESTAFF), item(ItemID.MYSTIC_MIST_STAFF), item(ItemID.STEAM_BATTLESTAFF), item(ItemID.MYSTIC_STEAM_STAFF), item(ItemID.STEAM_BATTLESTAFF_12795), item(ItemID.MYSTIC_STEAM_STAFF_12796), item(ItemID.KODAI_WAND), item(ItemID.TOME_OF_WATER)),
|
||||||
any("Earth Rune x15", xOfItem(ItemID.EARTH_RUNE, 15), xOfItem(ItemID.DUST_RUNE, 15), xOfItem(ItemID.MUD_RUNE, 15), xOfItem(ItemID.LAVA_RUNE, 15), item(ItemID.STAFF_OF_EARTH), item(ItemID.EARTH_BATTLESTAFF), item(ItemID.MYSTIC_EARTH_STAFF), item(ItemID.MUD_BATTLESTAFF), item(ItemID.MYSTIC_MUD_STAFF), item(ItemID.DUST_BATTLESTAFF), item(ItemID.MYSTIC_DUST_STAFF), item(ItemID.LAVA_BATTLESTAFF), item(ItemID.MYSTIC_LAVA_STAFF), item(ItemID.LAVA_BATTLESTAFF_21198), item(ItemID.MYSTIC_LAVA_STAFF_21200)),
|
any("Earth Rune x15", xOfItem(ItemID.EARTH_RUNE, 15), xOfItem(ItemID.DUST_RUNE, 15), xOfItem(ItemID.MUD_RUNE, 15), xOfItem(ItemID.LAVA_RUNE, 15), item(ItemID.STAFF_OF_EARTH), item(ItemID.EARTH_BATTLESTAFF), item(ItemID.MYSTIC_EARTH_STAFF), item(ItemID.MUD_BATTLESTAFF), item(ItemID.MYSTIC_MUD_STAFF), item(ItemID.DUST_BATTLESTAFF), item(ItemID.MYSTIC_DUST_STAFF), item(ItemID.LAVA_BATTLESTAFF), item(ItemID.MYSTIC_LAVA_STAFF), item(ItemID.LAVA_BATTLESTAFF_21198), item(ItemID.MYSTIC_LAVA_STAFF_21200)),
|
||||||
any("Unenchanted Dragonstone Jewellery", item(ItemID.DRAGONSTONE_RING), item(ItemID.DRAGON_NECKLACE), item(ItemID.DRAGONSTONE_BRACELET), item(ItemID.DRAGONSTONE_AMULET))),
|
any("Unenchanted Dragonstone Jewellery", item(ItemID.DRAGONSTONE_RING), item(ItemID.DRAGON_NECKLACE), item(ItemID.DRAGONSTONE_BRACELET), item(ItemID.DRAGONSTONE_AMULET))),
|
||||||
new SkillChallengeClue("Craft a nature rune.", item(ItemID.PURE_ESSENCE)),
|
new SkillChallengeClue("Craft a nature rune.", any("Pure essence or Daeyalt essence", item(ItemID.PURE_ESSENCE), item(ItemID.DAEYALT_ESSENCE))),
|
||||||
new SkillChallengeClue("Catch a mottled eel with aerial fishing in Lake Molch.", any("Fish chunks or King worms", item(ItemID.FISH_CHUNKS), item(ItemID.KING_WORM)), emptySlot("No Gloves", EquipmentInventorySlot.GLOVES), any("No Weapon", emptySlot("", EquipmentInventorySlot.WEAPON), item(ItemID.CORMORANTS_GLOVE), item(ItemID.CORMORANTS_GLOVE_22817)), emptySlot("No Shield", EquipmentInventorySlot.SHIELD)),
|
new SkillChallengeClue("Catch a mottled eel with aerial fishing in Lake Molch.", any("Fish chunks or King worms", item(ItemID.FISH_CHUNKS), item(ItemID.KING_WORM)), emptySlot("No Gloves", EquipmentInventorySlot.GLOVES), any("No Weapon", emptySlot("", EquipmentInventorySlot.WEAPON), item(ItemID.CORMORANTS_GLOVE), item(ItemID.CORMORANTS_GLOVE_22817)), emptySlot("No Shield", EquipmentInventorySlot.SHIELD)),
|
||||||
new SkillChallengeClue("Score a goal in skullball.", true, any("Ring of Charos", item(ItemID.RING_OF_CHAROS), item(ItemID.RING_OF_CHAROSA))),
|
new SkillChallengeClue("Score a goal in skullball.", true, any("Ring of Charos", item(ItemID.RING_OF_CHAROS), item(ItemID.RING_OF_CHAROSA))),
|
||||||
new SkillChallengeClue("Complete a lap of Ape atoll agility course.", true, any("Ninja Monkey Greegree", item(ItemID.NINJA_MONKEY_GREEGREE), item(ItemID.NINJA_MONKEY_GREEGREE_4025), item(ItemID.KRUK_MONKEY_GREEGREE))),
|
new SkillChallengeClue("Complete a lap of Ape atoll agility course.", true, any("Ninja Monkey Greegree", item(ItemID.NINJA_MONKEY_GREEGREE), item(ItemID.NINJA_MONKEY_GREEGREE_4025), item(ItemID.KRUK_MONKEY_GREEGREE))),
|
||||||
@@ -198,7 +198,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
|
|||||||
new SkillChallengeClue("Fix a magical lamp in Dorgesh-Kaan.", new String[] { "Broken lamp" }, new int[] { 10834, 10835 }, item(ItemID.LIGHT_ORB)),
|
new SkillChallengeClue("Fix a magical lamp in Dorgesh-Kaan.", new String[] { "Broken lamp" }, new int[] { 10834, 10835 }, item(ItemID.LIGHT_ORB)),
|
||||||
new SkillChallengeClue("Burn a yew log.", item(ItemID.YEW_LOGS), item(ItemID.TINDERBOX)),
|
new SkillChallengeClue("Burn a yew log.", item(ItemID.YEW_LOGS), item(ItemID.TINDERBOX)),
|
||||||
new SkillChallengeClue("Cook a swordfish", "cook a swordfish", item(ItemID.RAW_SWORDFISH)),
|
new SkillChallengeClue("Cook a swordfish", "cook a swordfish", item(ItemID.RAW_SWORDFISH)),
|
||||||
new SkillChallengeClue("Craft multiple cosmic runes from a single essence.", item(ItemID.PURE_ESSENCE)),
|
new SkillChallengeClue("Craft multiple cosmic runes from a single essence.", any("Pure essence or Daeyalt essence", item(ItemID.PURE_ESSENCE), item(ItemID.DAEYALT_ESSENCE))),
|
||||||
new SkillChallengeClue("Plant a watermelon seed.", item(ItemID.RAKE), item(ItemID.SEED_DIBBER), xOfItem(ItemID.WATERMELON_SEED, 3)),
|
new SkillChallengeClue("Plant a watermelon seed.", item(ItemID.RAKE), item(ItemID.SEED_DIBBER), xOfItem(ItemID.WATERMELON_SEED, 3)),
|
||||||
new SkillChallengeClue("Activate the Chivalry prayer."),
|
new SkillChallengeClue("Activate the Chivalry prayer."),
|
||||||
new SkillChallengeClue("Hand in a Tier 2 or higher set of Shayzien supply armour. (Requires 11 lovakite bars)", "take the lovakengj armourers a boxed set of shayzien supply armour at tier 2 or above.", any("Shayzien Supply Set (Tier 2 or higher)", item(ItemID.SHAYZIEN_SUPPLY_SET_2), item(ItemID.SHAYZIEN_SUPPLY_SET_3), item(ItemID.SHAYZIEN_SUPPLY_SET_4), item(ItemID.SHAYZIEN_SUPPLY_SET_5))),
|
new SkillChallengeClue("Hand in a Tier 2 or higher set of Shayzien supply armour. (Requires 11 lovakite bars)", "take the lovakengj armourers a boxed set of shayzien supply armour at tier 2 or above.", any("Shayzien Supply Set (Tier 2 or higher)", item(ItemID.SHAYZIEN_SUPPLY_SET_2), item(ItemID.SHAYZIEN_SUPPLY_SET_3), item(ItemID.SHAYZIEN_SUPPLY_SET_4), item(ItemID.SHAYZIEN_SUPPLY_SET_5))),
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public interface ItemChargeConfig extends Config
|
|||||||
String KEY_EXPLORERS_RING = "explorerRing";
|
String KEY_EXPLORERS_RING = "explorerRing";
|
||||||
String KEY_RING_OF_FORGING = "ringOfForging";
|
String KEY_RING_OF_FORGING = "ringOfForging";
|
||||||
String KEY_BLOOD_ESSENCE = "bloodEssence";
|
String KEY_BLOOD_ESSENCE = "bloodEssence";
|
||||||
|
String KEY_BRACELET_OF_CLAY = "braceletOfClay";
|
||||||
|
|
||||||
@ConfigSection(
|
@ConfigSection(
|
||||||
name = "Charge Settings",
|
name = "Charge Settings",
|
||||||
@@ -428,4 +429,28 @@ public interface ItemChargeConfig extends Config
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showBraceletOfClayCharges",
|
||||||
|
name = "Bracelet of Clay Charges",
|
||||||
|
description = "Show Bracelet of Clay item charges",
|
||||||
|
position = 31,
|
||||||
|
section = chargesSection
|
||||||
|
)
|
||||||
|
default boolean showBraceletOfClayCharges()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "braceletOfClayNotification",
|
||||||
|
name = "Bracelet of Clay Notification",
|
||||||
|
description = "Send a notification when a Bracelet of Clay breaks",
|
||||||
|
position = 32,
|
||||||
|
section = notificationSection
|
||||||
|
)
|
||||||
|
default boolean braceletOfClayNotification()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,6 +137,11 @@ public class ItemChargePlugin extends Plugin
|
|||||||
"You manage to extract power from the Blood Essence and craft (\\d{1,3}) extra runes?\\."
|
"You manage to extract power from the Blood Essence and craft (\\d{1,3}) extra runes?\\."
|
||||||
);
|
);
|
||||||
private static final String BLOOD_ESSENCE_ACTIVATE_TEXT = "You activate the blood essence.";
|
private static final String BLOOD_ESSENCE_ACTIVATE_TEXT = "You activate the blood essence.";
|
||||||
|
private static final String BRACELET_OF_CLAY_USE_TEXT = "You manage to mine some clay.";
|
||||||
|
private static final String BRACELET_OF_CLAY_BREAK_TEXT = "Your bracelet of clay crumbles to dust.";
|
||||||
|
private static final Pattern BRACELET_OF_CLAY_CHECK_PATTERN = Pattern.compile(
|
||||||
|
"You can mine (\\d{1,2}) more pieces? of soft clay before your bracelet crumbles to dust\\."
|
||||||
|
);
|
||||||
|
|
||||||
private static final int MAX_DODGY_CHARGES = 10;
|
private static final int MAX_DODGY_CHARGES = 10;
|
||||||
private static final int MAX_BINDING_CHARGES = 16;
|
private static final int MAX_BINDING_CHARGES = 16;
|
||||||
@@ -146,6 +151,7 @@ public class ItemChargePlugin extends Plugin
|
|||||||
private static final int MAX_AMULET_OF_BOUNTY_CHARGES = 10;
|
private static final int MAX_AMULET_OF_BOUNTY_CHARGES = 10;
|
||||||
private static final int MAX_SLAYER_BRACELET_CHARGES = 30;
|
private static final int MAX_SLAYER_BRACELET_CHARGES = 30;
|
||||||
private static final int MAX_BLOOD_ESSENCE_CHARGES = 1000;
|
private static final int MAX_BLOOD_ESSENCE_CHARGES = 1000;
|
||||||
|
private static final int MAX_BRACELET_OF_CLAY_CHARGES = 28;
|
||||||
|
|
||||||
private int lastExplorerRingCharge = -1;
|
private int lastExplorerRingCharge = -1;
|
||||||
|
|
||||||
@@ -237,6 +243,7 @@ public class ItemChargePlugin extends Plugin
|
|||||||
Matcher expeditiousCheckMatcher = EXPEDITIOUS_BRACELET_CHECK_PATTERN.matcher(message);
|
Matcher expeditiousCheckMatcher = EXPEDITIOUS_BRACELET_CHECK_PATTERN.matcher(message);
|
||||||
Matcher bloodEssenceCheckMatcher = BLOOD_ESSENCE_CHECK_PATTERN.matcher(message);
|
Matcher bloodEssenceCheckMatcher = BLOOD_ESSENCE_CHECK_PATTERN.matcher(message);
|
||||||
Matcher bloodEssenceExtractMatcher = BLOOD_ESSENCE_EXTRACT_PATTERN.matcher(message);
|
Matcher bloodEssenceExtractMatcher = BLOOD_ESSENCE_EXTRACT_PATTERN.matcher(message);
|
||||||
|
Matcher braceletOfClayCheckMatcher = BRACELET_OF_CLAY_CHECK_PATTERN.matcher(message);
|
||||||
|
|
||||||
if (config.recoilNotification() && message.contains(RING_OF_RECOIL_BREAK_MESSAGE))
|
if (config.recoilNotification() && message.contains(RING_OF_RECOIL_BREAK_MESSAGE))
|
||||||
{
|
{
|
||||||
@@ -439,6 +446,29 @@ public class ItemChargePlugin extends Plugin
|
|||||||
{
|
{
|
||||||
updateBloodEssenceCharges(MAX_BLOOD_ESSENCE_CHARGES);
|
updateBloodEssenceCharges(MAX_BLOOD_ESSENCE_CHARGES);
|
||||||
}
|
}
|
||||||
|
else if (braceletOfClayCheckMatcher.find())
|
||||||
|
{
|
||||||
|
updateBraceletOfClayCharges(Integer.parseInt(braceletOfClayCheckMatcher.group(1)));
|
||||||
|
}
|
||||||
|
else if (message.equals(BRACELET_OF_CLAY_USE_TEXT))
|
||||||
|
{
|
||||||
|
final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||||
|
|
||||||
|
// Determine if the player mined with a Bracelet of Clay equipped.
|
||||||
|
if (equipment != null && equipment.contains(ItemID.BRACELET_OF_CLAY))
|
||||||
|
{
|
||||||
|
int charges = Ints.constrainToRange(getItemCharges(ItemChargeConfig.KEY_BRACELET_OF_CLAY) - 1, 0, MAX_BRACELET_OF_CLAY_CHARGES);
|
||||||
|
updateBraceletOfClayCharges(charges);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (message.equals(BRACELET_OF_CLAY_BREAK_TEXT))
|
||||||
|
{
|
||||||
|
if (config.braceletOfClayNotification())
|
||||||
|
{
|
||||||
|
notifier.notify("Your bracelet of clay has crumbled to dust");
|
||||||
|
}
|
||||||
|
updateBraceletOfClayCharges(MAX_BRACELET_OF_CLAY_CHARGES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,6 +602,12 @@ public class ItemChargePlugin extends Plugin
|
|||||||
updateInfoboxes();
|
updateInfoboxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateBraceletOfClayCharges(final int value)
|
||||||
|
{
|
||||||
|
setItemCharges(ItemChargeConfig.KEY_BRACELET_OF_CLAY, value);
|
||||||
|
updateInfoboxes();
|
||||||
|
}
|
||||||
|
|
||||||
private void checkDestroyWidget()
|
private void checkDestroyWidget()
|
||||||
{
|
{
|
||||||
final int currentTick = client.getTickCount();
|
final int currentTick = client.getTickCount();
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ enum ItemChargeType
|
|||||||
RING_OF_FORGING(ItemChargeConfig::showRingOfForgingCount),
|
RING_OF_FORGING(ItemChargeConfig::showRingOfForgingCount),
|
||||||
POTION(ItemChargeConfig::showPotionDoseCount),
|
POTION(ItemChargeConfig::showPotionDoseCount),
|
||||||
GUTHIX_REST(ItemChargeConfig::showGuthixRestDoses),
|
GUTHIX_REST(ItemChargeConfig::showGuthixRestDoses),
|
||||||
BLOOD_ESSENCE(ItemChargeConfig::showBloodEssenceCharges);
|
BLOOD_ESSENCE(ItemChargeConfig::showBloodEssenceCharges),
|
||||||
|
BRACELET_OF_CLAY(ItemChargeConfig::showBraceletOfClayCharges);
|
||||||
|
|
||||||
private final Predicate<ItemChargeConfig> enabled;
|
private final Predicate<ItemChargeConfig> enabled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ enum ItemWithConfig
|
|||||||
BRACELET_OF_SLAUGHTER(ItemID.BRACELET_OF_SLAUGHTER, ItemChargeConfig.KEY_BRACELET_OF_SLAUGHTER, ItemChargeType.BRACELET_OF_SLAUGHTER),
|
BRACELET_OF_SLAUGHTER(ItemID.BRACELET_OF_SLAUGHTER, ItemChargeConfig.KEY_BRACELET_OF_SLAUGHTER, ItemChargeType.BRACELET_OF_SLAUGHTER),
|
||||||
EXPEDITIOUS_BRACELET(ItemID.EXPEDITIOUS_BRACELET, ItemChargeConfig.KEY_EXPEDITIOUS_BRACELET, ItemChargeType.EXPEDITIOUS_BRACELET),
|
EXPEDITIOUS_BRACELET(ItemID.EXPEDITIOUS_BRACELET, ItemChargeConfig.KEY_EXPEDITIOUS_BRACELET, ItemChargeType.EXPEDITIOUS_BRACELET),
|
||||||
CHRONICLE(ItemID.CHRONICLE, ItemChargeConfig.KEY_CHRONICLE, ItemChargeType.TELEPORT),
|
CHRONICLE(ItemID.CHRONICLE, ItemChargeConfig.KEY_CHRONICLE, ItemChargeType.TELEPORT),
|
||||||
BLOOD_ESSENCE(ItemID.BLOOD_ESSENCE_ACTIVE, ItemChargeConfig.KEY_BLOOD_ESSENCE, ItemChargeType.BLOOD_ESSENCE);
|
BLOOD_ESSENCE(ItemID.BLOOD_ESSENCE_ACTIVE, ItemChargeConfig.KEY_BLOOD_ESSENCE, ItemChargeType.BLOOD_ESSENCE),
|
||||||
|
BRACELET_OF_CLAY(ItemID.BRACELET_OF_CLAY, ItemChargeConfig.KEY_BRACELET_OF_CLAY, ItemChargeType.BRACELET_OF_CLAY);
|
||||||
|
|
||||||
private final int itemId;
|
private final int itemId;
|
||||||
private final String configKey;
|
private final String configKey;
|
||||||
|
|||||||
@@ -128,4 +128,15 @@ public interface NpcAggroAreaConfig extends Config
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showOnSlayerTask",
|
||||||
|
name = "Show on slayer task",
|
||||||
|
description = "Enable for current slayer task NPCs",
|
||||||
|
position = 9
|
||||||
|
)
|
||||||
|
default boolean showOnSlayerTask()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ import net.runelite.client.config.ConfigManager;
|
|||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
|
import net.runelite.client.plugins.PluginDependency;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
|
import net.runelite.client.plugins.slayer.SlayerPlugin;
|
||||||
|
import net.runelite.client.plugins.slayer.SlayerPluginService;
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||||
import net.runelite.client.util.WildcardMatcher;
|
import net.runelite.client.util.WildcardMatcher;
|
||||||
@@ -68,6 +71,7 @@ import net.runelite.client.util.WildcardMatcher;
|
|||||||
tags = {"highlight", "lines", "unaggro", "aggro", "aggressive", "npcs", "area", "slayer"},
|
tags = {"highlight", "lines", "unaggro", "aggro", "aggressive", "npcs", "area", "slayer"},
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@PluginDependency(SlayerPlugin.class)
|
||||||
public class NpcAggroAreaPlugin extends Plugin
|
public class NpcAggroAreaPlugin extends Plugin
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -114,6 +118,9 @@ public class NpcAggroAreaPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private Notifier notifier;
|
private Notifier notifier;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private SlayerPluginService slayerPluginService;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final WorldPoint[] safeCenters = new WorldPoint[2];
|
private final WorldPoint[] safeCenters = new WorldPoint[2];
|
||||||
|
|
||||||
@@ -270,6 +277,15 @@ public class NpcAggroAreaPlugin extends Plugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.showOnSlayerTask())
|
||||||
|
{
|
||||||
|
List<NPC> targets = slayerPluginService.getTargets();
|
||||||
|
if (targets.contains(npc))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (String pattern : npcNamePatterns)
|
for (String pattern : npcNamePatterns)
|
||||||
{
|
{
|
||||||
if (WildcardMatcher.matches(pattern, npcName))
|
if (WildcardMatcher.matches(pattern, npcName))
|
||||||
@@ -381,6 +397,7 @@ public class NpcAggroAreaPlugin extends Plugin
|
|||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case "npcUnaggroAlwaysActive":
|
case "npcUnaggroAlwaysActive":
|
||||||
|
case "showOnSlayerTask":
|
||||||
recheckActive();
|
recheckActive();
|
||||||
break;
|
break;
|
||||||
case "npcUnaggroCollisionDetection":
|
case "npcUnaggroCollisionDetection":
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
package net.runelite.client.plugins.slayer;
|
package net.runelite.client.plugins.slayer;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import com.google.inject.Binder;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
@@ -222,6 +223,12 @@ public class SlayerPlugin extends Plugin
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(Binder binder)
|
||||||
|
{
|
||||||
|
binder.bind(SlayerPluginService.class).to(SlayerPluginServiceImpl.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022, Adam <Adam@sigterm.info>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.slayer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import net.runelite.api.NPC;
|
||||||
|
|
||||||
|
public interface SlayerPluginService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get targets for current slayer task
|
||||||
|
*
|
||||||
|
* @return pattern list of target npc
|
||||||
|
*/
|
||||||
|
List<NPC> getTargets();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
String getTask();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
String getTaskLocation();
|
||||||
|
|
||||||
|
int getInitialAmount();
|
||||||
|
|
||||||
|
int getRemainingAmount();
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022, Adam <Adam@sigterm.info>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.slayer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import net.runelite.api.NPC;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
class SlayerPluginServiceImpl implements SlayerPluginService
|
||||||
|
{
|
||||||
|
private final SlayerPlugin plugin;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private SlayerPluginServiceImpl(final SlayerPlugin plugin)
|
||||||
|
{
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<NPC> getTargets()
|
||||||
|
{
|
||||||
|
return plugin.getTargets();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTask()
|
||||||
|
{
|
||||||
|
return plugin.getTaskName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskLocation()
|
||||||
|
{
|
||||||
|
return plugin.getTaskLocation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getInitialAmount()
|
||||||
|
{
|
||||||
|
return plugin.getInitialAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRemainingAmount()
|
||||||
|
{
|
||||||
|
return plugin.getAmount();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,7 +29,6 @@ package net.runelite.client.plugins.timers;
|
|||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.temporal.ChronoUnit;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -146,8 +145,6 @@ public class TimersPlugin extends Plugin
|
|||||||
private int lastPoisonVarp;
|
private int lastPoisonVarp;
|
||||||
private int lastPvpVarb;
|
private int lastPvpVarb;
|
||||||
private int lastCorruptionVarb;
|
private int lastCorruptionVarb;
|
||||||
private int lastHomeTeleport;
|
|
||||||
private int lastMinigameTeleport;
|
|
||||||
private int lastStaminaEffect;
|
private int lastStaminaEffect;
|
||||||
private int lastImbuedHeartVarb;
|
private int lastImbuedHeartVarb;
|
||||||
private boolean imbuedHeartTimerActive;
|
private boolean imbuedHeartTimerActive;
|
||||||
@@ -202,8 +199,6 @@ public class TimersPlugin extends Plugin
|
|||||||
staminaTimer = null;
|
staminaTimer = null;
|
||||||
imbuedHeartTimerActive = false;
|
imbuedHeartTimerActive = false;
|
||||||
lastImbuedHeartVarb = 0;
|
lastImbuedHeartVarb = 0;
|
||||||
lastHomeTeleport = 0;
|
|
||||||
lastMinigameTeleport = 0;
|
|
||||||
lastStaminaEffect = 0;
|
lastStaminaEffect = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,8 +212,6 @@ public class TimersPlugin extends Plugin
|
|||||||
int pvpVarb = client.getVarbitValue(Varbits.PVP_SPEC_ORB);
|
int pvpVarb = client.getVarbitValue(Varbits.PVP_SPEC_ORB);
|
||||||
int corruptionCooldownVarb = client.getVarbitValue(Varbits.CORRUPTION_COOLDOWN);
|
int corruptionCooldownVarb = client.getVarbitValue(Varbits.CORRUPTION_COOLDOWN);
|
||||||
int imbuedHeartCooldownVarb = client.getVarbitValue(Varbits.IMBUED_HEART_COOLDOWN);
|
int imbuedHeartCooldownVarb = client.getVarbitValue(Varbits.IMBUED_HEART_COOLDOWN);
|
||||||
int homeTeleportVarp = client.getVar(VarPlayer.LAST_HOME_TELEPORT);
|
|
||||||
int minigameTeleportVarp = client.getVar(VarPlayer.LAST_MINIGAME_TELEPORT);
|
|
||||||
int staminaEffectActive = client.getVarbitValue(Varbits.RUN_SLOWED_DEPLETION_ACTIVE);
|
int staminaEffectActive = client.getVarbitValue(Varbits.RUN_SLOWED_DEPLETION_ACTIVE);
|
||||||
int staminaPotionEffectVarb = client.getVarbitValue(Varbits.STAMINA_EFFECT);
|
int staminaPotionEffectVarb = client.getVarbitValue(Varbits.STAMINA_EFFECT);
|
||||||
int enduranceRingEffectVarb = client.getVarbitValue(Varbits.RING_OF_ENDURANCE_EFFECT);
|
int enduranceRingEffectVarb = client.getVarbitValue(Varbits.RING_OF_ENDURANCE_EFFECT);
|
||||||
@@ -331,16 +324,14 @@ public class TimersPlugin extends Plugin
|
|||||||
lastImbuedHeartVarb = imbuedHeartCooldownVarb;
|
lastImbuedHeartVarb = imbuedHeartCooldownVarb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastHomeTeleport != homeTeleportVarp)
|
if (event.getIndex() == VarPlayer.LAST_HOME_TELEPORT.getId() && config.showHomeMinigameTeleports())
|
||||||
{
|
{
|
||||||
checkTeleport(VarPlayer.LAST_HOME_TELEPORT);
|
checkTeleport(VarPlayer.LAST_HOME_TELEPORT);
|
||||||
lastHomeTeleport = homeTeleportVarp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMinigameTeleport != minigameTeleportVarp)
|
if (event.getIndex() == VarPlayer.LAST_MINIGAME_TELEPORT.getId() && config.showHomeMinigameTeleports())
|
||||||
{
|
{
|
||||||
checkTeleport(VarPlayer.LAST_MINIGAME_TELEPORT);
|
checkTeleport(VarPlayer.LAST_MINIGAME_TELEPORT);
|
||||||
lastMinigameTeleport = minigameTeleportVarp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// staminaEffectActive is checked to match https://github.com/Joshua-F/cs2-scripts/blob/741271f0c3395048c1bad4af7881a13734516adf/scripts/%5Bproc%2Cbuff_bar_get_value%5D.cs2#L25
|
// staminaEffectActive is checked to match https://github.com/Joshua-F/cs2-scripts/blob/741271f0c3395048c1bad4af7881a13734516adf/scripts/%5Bproc%2Cbuff_bar_get_value%5D.cs2#L25
|
||||||
@@ -913,7 +904,7 @@ public class TimersPlugin extends Plugin
|
|||||||
|
|
||||||
int lastTeleport = client.getVar(varPlayer);
|
int lastTeleport = client.getVar(varPlayer);
|
||||||
long lastTeleportSeconds = (long) lastTeleport * 60;
|
long lastTeleportSeconds = (long) lastTeleport * 60;
|
||||||
Instant teleportExpireInstant = Instant.ofEpochSecond(lastTeleportSeconds).plus(teleport.getDuration().getSeconds(), ChronoUnit.SECONDS);
|
Instant teleportExpireInstant = Instant.ofEpochSecond(lastTeleportSeconds).plus(teleport.getDuration());
|
||||||
Duration remainingTime = Duration.between(Instant.now(), teleportExpireInstant);
|
Duration remainingTime = Duration.between(Instant.now(), teleportExpireInstant);
|
||||||
|
|
||||||
if (remainingTime.getSeconds() > 0)
|
if (remainingTime.getSeconds() > 0)
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ public class ItemChargePluginTest
|
|||||||
private static final String ACTIVATE_BLOOD_ESSENCE = "You activate the blood essence.";
|
private static final String ACTIVATE_BLOOD_ESSENCE = "You activate the blood essence.";
|
||||||
private static final String EXTRACT_BLOOD_ESSENCE = "You manage to extract power from the Blood Essence and craft 67 extra runes.";
|
private static final String EXTRACT_BLOOD_ESSENCE = "You manage to extract power from the Blood Essence and craft 67 extra runes.";
|
||||||
private static final String CHECK_BLOOD_ESSENCE = "Your blood essence has 56 charges remaining";
|
private static final String CHECK_BLOOD_ESSENCE = "Your blood essence has 56 charges remaining";
|
||||||
|
private static final String CHECK_BRACELET_OF_CLAY = "You can mine 13 more pieces of soft clay before your bracelet crumbles to dust.";
|
||||||
|
private static final String USED_BRACELET_OF_CLAY = "You manage to mine some clay.";
|
||||||
|
private static final String BREAK_BRACELET_OF_CLAY = "Your bracelet of clay crumbles to dust.";
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
@Bind
|
@Bind
|
||||||
@@ -450,4 +453,35 @@ public class ItemChargePluginTest
|
|||||||
itemChargePlugin.onChatMessage(chatMessage);
|
itemChargePlugin.onChatMessage(chatMessage);
|
||||||
verify(configManager).setRSProfileConfiguration(ItemChargeConfig.GROUP, ItemChargeConfig.KEY_BLOOD_ESSENCE, 56);
|
verify(configManager).setRSProfileConfiguration(ItemChargeConfig.GROUP, ItemChargeConfig.KEY_BLOOD_ESSENCE, 56);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBraceletOfClayCheck()
|
||||||
|
{
|
||||||
|
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", CHECK_BRACELET_OF_CLAY, "", 0);
|
||||||
|
itemChargePlugin.onChatMessage(chatMessage);
|
||||||
|
verify(configManager).setRSProfileConfiguration(ItemChargeConfig.GROUP, ItemChargeConfig.KEY_BRACELET_OF_CLAY, 13);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBraceletOfClayUsed()
|
||||||
|
{
|
||||||
|
when(configManager.getRSProfileConfiguration(ItemChargeConfig.GROUP, ItemChargeConfig.KEY_BRACELET_OF_CLAY, Integer.class)).thenReturn(25);
|
||||||
|
// Create equipment inventory with bracelet of clay
|
||||||
|
ItemContainer equipmentItemContainer = mock(ItemContainer.class);
|
||||||
|
when(client.getItemContainer(InventoryID.EQUIPMENT)).thenReturn(equipmentItemContainer);
|
||||||
|
when(equipmentItemContainer.contains(ItemID.BRACELET_OF_CLAY)).thenReturn(true);
|
||||||
|
when(equipmentItemContainer.getItems()).thenReturn(new Item[0]);
|
||||||
|
// Run message
|
||||||
|
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", USED_BRACELET_OF_CLAY, "", 0);
|
||||||
|
itemChargePlugin.onChatMessage(chatMessage);
|
||||||
|
verify(configManager).setRSProfileConfiguration(ItemChargeConfig.GROUP, ItemChargeConfig.KEY_BRACELET_OF_CLAY, 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBraceletOfClayBreak()
|
||||||
|
{
|
||||||
|
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BREAK_BRACELET_OF_CLAY, "", 0);
|
||||||
|
itemChargePlugin.onChatMessage(chatMessage);
|
||||||
|
verify(configManager).setRSProfileConfiguration(ItemChargeConfig.GROUP, ItemChargeConfig.KEY_BRACELET_OF_CLAY, 28);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user