Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -53,6 +53,7 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import static net.runelite.api.ItemID.*;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.widgets.ItemQuantityMode;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.RuneLiteConfig;
|
||||
import net.runelite.client.util.AsyncBufferedImage;
|
||||
@@ -425,7 +426,7 @@ public class ItemManager
|
||||
return false;
|
||||
}
|
||||
SpritePixels sprite = client.createItemSprite(itemId, quantity, 1, SpritePixels.DEFAULT_SHADOW_COLOR,
|
||||
stackable ? 1 : 0, false, CLIENT_DEFAULT_ZOOM);
|
||||
stackable ? ItemQuantityMode.ALWAYS : ItemQuantityMode.NEVER, false, CLIENT_DEFAULT_ZOOM);
|
||||
if (sprite == null)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -210,7 +210,8 @@ public class DailyTasksPlugin extends Plugin
|
||||
|
||||
private void checkSand(boolean dailyReset)
|
||||
{
|
||||
if (client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE
|
||||
if (client.getAccountType() != AccountType.ULTIMATE_IRONMAN
|
||||
&& client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE
|
||||
&& (client.getVar(Varbits.DAILY_SAND_COLLECTED) == 0
|
||||
|| dailyReset))
|
||||
{
|
||||
|
||||
@@ -64,13 +64,15 @@ class Lootbeam
|
||||
|
||||
short hsl = JagexColor.rgbToHSL(l.color.getRGB(), 1.0d);
|
||||
int hue = JagexColor.unpackHue(hsl);
|
||||
int sat = Math.min(JagexColor.unpackSaturation(hsl) + 1, JagexColor.SATURATION_MAX);
|
||||
int sat = JagexColor.unpackSaturation(hsl);
|
||||
int lum = JagexColor.unpackLuminance(hsl);
|
||||
int satDelta = sat > 2 ? 1 : 0;
|
||||
|
||||
return md.cloneColors()
|
||||
.recolor((short) 26432, JagexColor.packHSL(hue, sat, Math.min(lum + 12, JagexColor.LUMINANCE_MAX)))
|
||||
.recolor((short) 26584, JagexColor.packHSL(hue, sat - 1, Math.max(lum - 12, 0)))
|
||||
.light(75, 1875, ModelData.DEFAULT_X, ModelData.DEFAULT_Y, ModelData.DEFAULT_Z);
|
||||
.recolor((short) 26432, JagexColor.packHSL(hue, sat - satDelta, lum))
|
||||
.recolor((short) 26584, JagexColor.packHSL(hue, sat, Math.min(lum + 24, JagexColor.LUMINANCE_MAX)))
|
||||
.light(75 + ModelData.DEFAULT_AMBIENT, 1875 + ModelData.DEFAULT_CONTRAST,
|
||||
ModelData.DEFAULT_X, ModelData.DEFAULT_Y, ModelData.DEFAULT_Z);
|
||||
}, anim(AnimationID.LOOTBEAM_ANIMATION)),
|
||||
;
|
||||
|
||||
|
||||
@@ -117,4 +117,15 @@ public interface NpcAggroAreaConfig extends Config
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "hideIfOutOfCombat",
|
||||
name = "Hide when out of combat",
|
||||
description = "Hides unaggressive area lines when out of combat.",
|
||||
position = 8
|
||||
)
|
||||
default boolean hideIfOutOfCombat()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import java.time.Instant;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
@@ -70,6 +71,12 @@ class NpcAggroAreaOverlay extends Overlay
|
||||
return null;
|
||||
}
|
||||
|
||||
final Player localPlayer = client.getLocalPlayer();
|
||||
if (localPlayer.getHealthScale() == -1 && config.hideIfOutOfCombat())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
GeneralPath lines = plugin.getLinesToDisplay()[client.getPlane()];
|
||||
if (lines == null)
|
||||
{
|
||||
|
||||
@@ -565,10 +565,10 @@ public class SlayerPlugin extends Plugin
|
||||
log.debug("Slayer xp change delta: {}, killed npcs: {}", delta, taggedNpcsDiedPrevTick);
|
||||
|
||||
final Task task = Task.getTask(taskName);
|
||||
if (task != null && task.getMinimumKillXp() > 0)
|
||||
if (task != null && task.getXpMatcher() != null)
|
||||
{
|
||||
// Only decrement a kill if the xp drop is above the minimum threshold. This is for Tzhaar and Sire tasks.
|
||||
if (delta >= task.getMinimumKillXp())
|
||||
// Only decrement a kill if the xp drop delta passes the matcher. This is for Tzhaar and Sire tasks.
|
||||
if (task.getXpMatcher().test(delta))
|
||||
{
|
||||
killed(max(taggedNpcsDiedPrevTick, 1));
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.IntPredicate;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ItemID;
|
||||
@@ -42,9 +43,10 @@ enum Task
|
||||
// Abyssal demon - 150 xp
|
||||
// Greater abyssal demon - 4200 xp
|
||||
// Abyssal sire - 450 xp
|
||||
// Use 51 for minimum xp to avoid a kill triggering from killing the sire vents
|
||||
ABYSSAL_DEMONS("Abyssal demons", ItemID.ABYSSAL_DEMON, 51),
|
||||
ABYSSAL_SIRE("Abyssal Sire", ItemID.ABYSSAL_ORPHAN, 51),
|
||||
// Reanimated abyssal - 31 xp
|
||||
// Ignore 50xp drops to avoid recording a kill from sire vents
|
||||
ABYSSAL_DEMONS("Abyssal demons", ItemID.ABYSSAL_DEMON, (xp) -> xp != 50),
|
||||
ABYSSAL_SIRE("Abyssal Sire", ItemID.ABYSSAL_ORPHAN, (xp) -> xp != 50),
|
||||
ADAMANT_DRAGONS("Adamant dragons", ItemID.ADAMANT_DRAGON_MASK),
|
||||
ALCHEMICAL_HYDRA("Alchemical Hydra", ItemID.IKKLE_HYDRA),
|
||||
ANKOU("Ankou", ItemID.ANKOU_MASK),
|
||||
@@ -114,7 +116,7 @@ enum Task
|
||||
ICE_WARRIORS("Ice warriors", ItemID.MITHRIL_FULL_HELM_T, "Icelord"),
|
||||
INFERNAL_MAGES("Infernal mages", ItemID.INFERNAL_MAGE, "Malevolent mage"),
|
||||
IRON_DRAGONS("Iron dragons", ItemID.IRON_DRAGON_MASK),
|
||||
JAD("TzTok-Jad", ItemID.TZREKJAD, 25250),
|
||||
JAD("TzTok-Jad", ItemID.TZREKJAD, (xp) -> xp == 25250),
|
||||
JELLIES("Jellies", ItemID.JELLY, "Jelly"),
|
||||
JUNGLE_HORROR("Jungle horrors", ItemID.ENSOULED_HORROR_HEAD),
|
||||
KALPHITE("Kalphite", ItemID.KALPHITE_SOLDIER),
|
||||
@@ -183,7 +185,7 @@ enum Task
|
||||
WYRMS("Wyrms", ItemID.WYRM),
|
||||
ZILYANA("Commander Zilyana", ItemID.PET_ZILYANA),
|
||||
ZOMBIES("Zombies", ItemID.ZOMBIE_HEAD, "Undead"),
|
||||
ZUK("TzKal-Zuk", ItemID.TZREKZUK, 101890),
|
||||
ZUK("TzKal-Zuk", ItemID.TZREKZUK, (xp) -> xp == 101890),
|
||||
ZULRAH("Zulrah", ItemID.PET_SNAKELING);
|
||||
//</editor-fold>
|
||||
|
||||
@@ -242,7 +244,8 @@ enum Task
|
||||
private final String[] targetNames;
|
||||
private final int weaknessThreshold;
|
||||
private final int weaknessItem;
|
||||
private final int minimumKillXp;
|
||||
@Nullable
|
||||
private final IntPredicate xpMatcher;
|
||||
|
||||
static
|
||||
{
|
||||
@@ -264,7 +267,7 @@ enum Task
|
||||
this.weaknessThreshold = -1;
|
||||
this.weaknessItem = -1;
|
||||
this.targetNames = targetNames;
|
||||
this.minimumKillXp = 0;
|
||||
this.xpMatcher = null;
|
||||
}
|
||||
|
||||
Task(String name, int itemSpriteId, int weaknessThreshold, int weaknessItem, String... targetNames)
|
||||
@@ -275,10 +278,10 @@ enum Task
|
||||
this.weaknessThreshold = weaknessThreshold;
|
||||
this.weaknessItem = weaknessItem;
|
||||
this.targetNames = targetNames;
|
||||
this.minimumKillXp = 0;
|
||||
this.xpMatcher = null;
|
||||
}
|
||||
|
||||
Task(String name, int itemSpriteId, int minimumKillXp)
|
||||
Task(String name, int itemSpriteId, IntPredicate xpMatcher)
|
||||
{
|
||||
Preconditions.checkArgument(itemSpriteId >= 0);
|
||||
this.name = name;
|
||||
@@ -286,7 +289,7 @@ enum Task
|
||||
this.weaknessThreshold = -1;
|
||||
this.weaknessItem = -1;
|
||||
this.targetNames = new String[0];
|
||||
this.minimumKillXp = minimumKillXp;
|
||||
this.xpMatcher = xpMatcher;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -41,7 +41,8 @@ enum TeleportWidget
|
||||
WidgetInfo.SPELL_EDGEVILLE_HOME_TELEPORT.getId(),
|
||||
WidgetInfo.SPELL_LUNAR_HOME_TELEPORT.getId(),
|
||||
WidgetInfo.SPELL_ARCEUUS_HOME_TELEPORT.getId(),
|
||||
WidgetInfo.SPELL_KOUREND_HOME_TELEPORT.getId()
|
||||
WidgetInfo.SPELL_KOUREND_HOME_TELEPORT.getId(),
|
||||
WidgetInfo.SPELL_CATHERBY_HOME_TELEPORT.getId()
|
||||
);
|
||||
private static final Collection MINIGAME_TELEPORT_IDS = ImmutableList.of(
|
||||
WidgetInfo.MINIGAME_TELEPORT_BUTTON.getId()
|
||||
|
||||
@@ -958,7 +958,8 @@ public class TimersPlugin extends Plugin
|
||||
&& client.getLocalPlayer().getAnimation() == AnimationID.IDLE
|
||||
&& (lastAnimation == AnimationID.BOOK_HOME_TELEPORT_5
|
||||
|| lastAnimation == AnimationID.COW_HOME_TELEPORT_6
|
||||
|| lastAnimation == AnimationID.LEAGUE_HOME_TELEPORT_6))
|
||||
|| lastAnimation == AnimationID.LEAGUE_HOME_TELEPORT_6
|
||||
|| lastAnimation == AnimationID.SHATTERED_LEAGUE_HOME_TELEPORT_6))
|
||||
{
|
||||
if (lastTeleportClicked == TeleportWidget.HOME_TELEPORT)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user