Plugin additions (#19)

* Added getProjectile tranform & zeruths player transform

cleaned up a bit of the imports / code

* fixed equipment inspector & added more features to tob
This commit is contained in:
lordzuku
2019-04-20 15:44:19 -04:00
committed by Tyler Bochard
parent ab7ca3ebed
commit 7efc3c1dcd
11 changed files with 1554 additions and 1067 deletions

View File

@@ -32,8 +32,7 @@ import lombok.Getter;
*/ */
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum Varbits public enum Varbits {
{
/* /*
* If chatbox is transparent or not * If chatbox is transparent or not
*/ */
@@ -227,7 +226,7 @@ public enum Varbits
/** /**
* Blast Furnace Bar Dispenser * Blast Furnace Bar Dispenser
* * <p>
* These are the expected values: * These are the expected values:
* 0 = No bars being processed * 0 = No bars being processed
* 1 = Ores are being processed on the conveyor belt, bar dispenser cannot be checked * 1 = Ores are being processed on the conveyor belt, bar dispenser cannot be checked
@@ -244,7 +243,7 @@ public enum Varbits
/** /**
* Experience tracker * Experience tracker
* * <p>
* EXPERIENCE_TRACKER_POSITION expected values: * EXPERIENCE_TRACKER_POSITION expected values:
* 0 = Right * 0 = Right
* 1 = Middle * 1 = Middle
@@ -493,8 +492,8 @@ public enum Varbits
TREK_POINTS(1955), TREK_POINTS(1955),
TREK_STARTED(1956), TREK_STARTED(1956),
TREK_EVENT(1958), TREK_EVENT(1958),
TREK_STATUS(6719); TREK_STATUS(6719),
BLOAT_ENTERED_ROOM(6447);
/** /**
* The raw varbit ID. * The raw varbit ID.

View File

@@ -44,7 +44,6 @@ public class EquipmentInspectorPanel extends PluginPanel
c.weightx = 1; c.weightx = 1;
c.gridx = 0; c.gridx = 0;
c.gridy = 0; c.gridy = 0;
header = new JPanel(); header = new JPanel();
header.setLayout(new BorderLayout()); header.setLayout(new BorderLayout());
header.setBorder(new CompoundBorder( header.setBorder(new CompoundBorder(
@@ -53,9 +52,7 @@ public class EquipmentInspectorPanel extends PluginPanel
nameLabel = new JLabel(NO_PLAYER_SELECTED); nameLabel = new JLabel(NO_PLAYER_SELECTED);
nameLabel.setForeground(Color.WHITE); nameLabel.setForeground(Color.WHITE);
header.add(nameLabel, BorderLayout.CENTER); header.add(nameLabel, BorderLayout.CENTER);
layout.setHorizontalGroup(layout.createParallelGroup() layout.setHorizontalGroup(layout.createParallelGroup()
.addComponent(equipmentPanels) .addComponent(equipmentPanels)
.addComponent(header) .addComponent(header)
@@ -65,7 +62,6 @@ public class EquipmentInspectorPanel extends PluginPanel
.addGap(10) .addGap(10)
.addComponent(equipmentPanels) .addComponent(equipmentPanels)
); );
update(new HashMap<>(), ""); update(new HashMap<>(), "");
} }
@@ -79,7 +75,6 @@ public class EquipmentInspectorPanel extends PluginPanel
{ {
nameLabel.setText("Player: " + playerName); nameLabel.setText("Player: " + playerName);
} }
SwingUtilities.invokeLater(() -> SwingUtilities.invokeLater(() ->
{ {
equipmentPanels.removeAll(); equipmentPanels.removeAll();

View File

@@ -3,7 +3,10 @@ package net.runelite.client.plugins.equipmentinspector;
import com.google.inject.Provides; import com.google.inject.Provides;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.runelite.api.*; import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.ItemComposition;
import net.runelite.api.Player;
import net.runelite.api.events.PlayerMenuOptionClicked; import net.runelite.api.events.PlayerMenuOptionClicked;
import net.runelite.api.kit.KitType; import net.runelite.api.kit.KitType;
import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatColorType;
@@ -18,11 +21,10 @@ import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.ClientToolbar; import net.runelite.client.ui.ClientToolbar;
import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.NavigationButton;
import net.runelite.client.util.ImageUtil;
import net.runelite.client.util.Text; import net.runelite.client.util.Text;
import net.runelite.http.api.item.ItemPrice;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.imageio.ImageIO;
import javax.inject.Inject; import javax.inject.Inject;
import javax.swing.*; import javax.swing.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -33,7 +35,6 @@ import java.util.concurrent.ScheduledExecutorService;
@PluginDescriptor( @PluginDescriptor(
name = "Equipment Inspector", name = "Equipment Inspector",
description = "Inspects enemy equipment",
enabledByDefault = false, enabledByDefault = false,
type = "utility" type = "utility"
) )
@@ -65,13 +66,6 @@ public class EquipmentInspectorPlugin extends Plugin {
@Inject @Inject
private ClientToolbar pluginToolbar; private ClientToolbar pluginToolbar;
@Provides
EquipmentInspectorConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(EquipmentInspectorConfig.class);
}
private NavigationButton navButton; private NavigationButton navButton;
private EquipmentInspectorPanel equipmentInspectorPanel; private EquipmentInspectorPanel equipmentInspectorPanel;
private int TotalPrice = 0; private int TotalPrice = 0;
@@ -80,21 +74,23 @@ public class EquipmentInspectorPlugin extends Plugin {
private int Prot3 = 0; private int Prot3 = 0;
private int Prot4 = 0; private int Prot4 = 0;
@Provides
EquipmentInspectorConfig provideConfig(ConfigManager configManager) {
return configManager.getConfig(EquipmentInspectorConfig.class);
}
@Override @Override
protected void startUp() throws Exception protected void startUp() throws Exception {
{
equipmentInspectorPanel = injector.getInstance(EquipmentInspectorPanel.class); equipmentInspectorPanel = injector.getInstance(EquipmentInspectorPanel.class);
if (client != null) { if (client != null) {
menuManager.addPlayerMenuItem(INSPECT_EQUIPMENT); menuManager.addPlayerMenuItem(INSPECT_EQUIPMENT);
} }
BufferedImage icon; //synchronized (ImageIO.class)
synchronized (ImageIO.class) //{
{ final BufferedImage icon = ImageUtil.getResourceStreamFromClass(this.getClass(), "normal.png");
icon = ImageIO.read(getClass().getResourceAsStream("normal.png")); //}
}
navButton = NavigationButton.builder() navButton = NavigationButton.builder()
.tooltip("Equipment Inspector") .tooltip("Equipment Inspector")
@@ -109,33 +105,26 @@ public class EquipmentInspectorPlugin extends Plugin {
} }
@Override @Override
protected void shutDown() throws Exception protected void shutDown() throws Exception {
{
menuManager.removePlayerMenuItem(INSPECT_EQUIPMENT); menuManager.removePlayerMenuItem(INSPECT_EQUIPMENT);
} }
@Subscribe @Subscribe
public void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event) public void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event) {
{ if (event.getMenuOption().equals(INSPECT_EQUIPMENT)) {
if (event.getMenuOption().equals(INSPECT_EQUIPMENT))
{
executor.execute(() -> executor.execute(() ->
{ {
try try {
{
SwingUtilities.invokeAndWait(() -> SwingUtilities.invokeAndWait(() ->
{ {
if (!navButton.isSelected()) if (!navButton.isSelected()) {
{
navButton.getOnSelect().run(); navButton.getOnSelect().run();
} }
}); });
} } catch (InterruptedException | InvocationTargetException e) {
catch (InterruptedException | InvocationTargetException e)
{
throw new RuntimeException(e); throw new RuntimeException(e);
@@ -150,8 +139,7 @@ public class EquipmentInspectorPlugin extends Plugin {
.filter(Objects::nonNull) .filter(Objects::nonNull)
.filter(p -> p.getName().equals(finalPlayerName)).findFirst(); .filter(p -> p.getName().equals(finalPlayerName)).findFirst();
if (targetPlayer.isPresent()) if (targetPlayer.isPresent()) {
{
TotalPrice = 0; TotalPrice = 0;
Prot1 = 0; Prot1 = 0;
Prot2 = 0; Prot2 = 0;
@@ -160,11 +148,9 @@ public class EquipmentInspectorPlugin extends Plugin {
Player p = targetPlayer.get(); Player p = targetPlayer.get();
Map<KitType, ItemComposition> playerEquipment = new HashMap<>(); Map<KitType, ItemComposition> playerEquipment = new HashMap<>();
for (KitType kitType : KitType.values()) for (KitType kitType : KitType.values()) {
{
int itemId = p.getPlayerComposition().getEquipmentId(kitType); int itemId = p.getPlayerComposition().getEquipmentId(kitType);
if (itemId != -1) if (itemId != -1) {
{
ItemComposition itemComposition = client.getItemDefinition(itemId); ItemComposition itemComposition = client.getItemDefinition(itemId);
playerEquipment.put(kitType, itemComposition); playerEquipment.put(kitType, itemComposition);
int ItemPrice = itemManager.getItemPrice(itemId); int ItemPrice = itemManager.getItemPrice(itemId);

View File

@@ -15,6 +15,7 @@ class ItemPanel extends JPanel
ItemPanel(ItemComposition item, KitType kitType, AsyncBufferedImage icon) ItemPanel(ItemComposition item, KitType kitType, AsyncBufferedImage icon)
{ {
setBorder(new EmptyBorder(3, 3, 3, 3)); setBorder(new EmptyBorder(3, 3, 3, 3));
setBackground(ColorScheme.DARK_GRAY_COLOR); setBackground(ColorScheme.DARK_GRAY_COLOR);

View File

@@ -0,0 +1,83 @@
package net.runelite.client.plugins.ztob;
import net.runelite.api.Client;
import net.runelite.api.Perspective;
import net.runelite.api.Point;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import net.runelite.client.ui.overlay.*;
import javax.inject.Inject;
import java.awt.*;
public class BloatTimerOverlay extends Overlay {
private final Client client;
private final TheatrePlugin plugin;
private final TheatreConfig config;
@Inject
private BloatTimerOverlay(Client client, TheatrePlugin plugin, TheatreConfig config) {
this.client = client;
this.plugin = plugin;
this.config = config;
setPosition(OverlayPosition.DYNAMIC);
setPriority(OverlayPriority.HIGH);
setLayer(OverlayLayer.ABOVE_SCENE);
}
public Dimension render(Graphics2D graphics) {
if (config.bloatTimer()) {
final String tickCounter = String.valueOf(plugin.bloatTimer);
int secondConversion = (int) (plugin.bloatTimer * .6);
if (plugin.getBloat_NPC() != null) {
Point canvasPoint = plugin.getBloat_NPC().getCanvasTextLocation(graphics, tickCounter, 60);
if (plugin.bloatTimer <= 37) {
renderTextLocation(graphics, tickCounter + "( " + secondConversion + " )", 15, Font.BOLD, Color.WHITE, canvasPoint);
} else {
renderTextLocation(graphics, tickCounter + "( " + secondConversion + " )", 15, Font.BOLD, Color.RED, canvasPoint);
}
}
}
return null;
}
private void drawTile(Graphics2D graphics, WorldPoint point, Color color, int strokeWidth, int outlineAlpha, int fillAlpha) {
WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation();
if (point.distanceTo(playerLocation) >= 32) {
return;
}
LocalPoint lp = LocalPoint.fromWorld(client, point);
if (lp == null) {
return;
}
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
if (poly == null) {
return;
}
//OverlayUtil.renderPolygon(graphics, poly, color);
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha));
graphics.setStroke(new BasicStroke(strokeWidth));
graphics.draw(poly);
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha));
graphics.fill(poly);
}
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, net.runelite.api.Point canvasPoint) {
graphics.setFont(new Font("Arial", fontStyle, fontSize));
if (canvasPoint != null) {
final net.runelite.api.Point canvasCenterPoint = new net.runelite.api.Point(
canvasPoint.getX(),
canvasPoint.getY());
final net.runelite.api.Point canvasCenterPoint_shadow = new Point(
canvasPoint.getX() + 1,
canvasPoint.getY() + 1);
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
}
}
}

View File

@@ -14,15 +14,16 @@ import net.runelite.client.config.ConfigItem;
@ConfigGroup("Theatre") @ConfigGroup("Theatre")
public interface TheatreConfig extends Config public interface TheatreConfig extends Config {
{
@ConfigItem( @ConfigItem(
position = 0, position = 0,
keyName = "MaidenBlood", keyName = "MaidenBlood",
name = "Maiden blood attack", name = "Maiden blood attack",
description = "" description = ""
) )
default boolean MaidenBlood(){ return false; } default boolean MaidenBlood() {
return true;
}
@ConfigItem( @ConfigItem(
position = 1, position = 1,
@@ -30,109 +31,181 @@ public interface TheatreConfig extends Config
name = "Maiden blood spawns", name = "Maiden blood spawns",
description = "" description = ""
) )
default boolean MaidenSpawns(){ return false; } default boolean MaidenSpawns() {
return true;
}
@ConfigItem( @ConfigItem(
position = 2, position = 2,
keyName = "BloatIndicator", keyName = "BloatIndicator",
name = "Bloat indicator", name = "Bloat Indicator",
description = "" description = ""
) )
default boolean BloatIndicator(){ return false; } default boolean BloatIndicator() {
return true;
}
@ConfigItem( @ConfigItem(
position = 3, position = 3,
keyName = "BloatHands", keyName = "bloat Timer",
name = "Bloat Falling Hands", name = "Bloat Timer",
description = "" description = ""
) )
default boolean BloatHands(){ return false; } default boolean bloatTimer() {
return true;
}
@ConfigItem( @ConfigItem(
position = 4, position = 4,
keyName = "bloatFeet",
name = "Bloat Feet",
description = ""
)
default boolean bloatFeetIndicator() {
return true;
}
@ConfigItem(
position = 5,
keyName = "NyloPillars", keyName = "NyloPillars",
name = "Nylocas pillar health", name = "Nylocas pillar health",
description = "" description = ""
) )
default boolean NyloPillars(){ return false; } default boolean NyloPillars() {
return true;
}
@ConfigItem( @ConfigItem(
position = 5, position = 6,
keyName = "NyloBlasts", keyName = "NyloBlasts",
name = "Nylocas explosions", name = "Nylocas explosions",
description = "" description = ""
) )
default boolean NyloBlasts(){ return false; } default boolean NyloBlasts() {
return true;
}
@ConfigItem( @ConfigItem(
position = 6, position = 7,
keyName = "NyloMenu",
name = "Hide Attack options for Nylocas",
description = ""
)
default boolean NyloMenu() {
return true;
}
@ConfigItem(
position = 8,
keyName = "SotetsegMaze1", keyName = "SotetsegMaze1",
name = "Sotetseg maze", name = "Sotetseg maze",
description = "" description = ""
) )
default boolean SotetsegMaze1(){ return false; } default boolean SotetsegMaze1() {
return true;
}
@ConfigItem( @ConfigItem(
position = 7, position = 9,
keyName = "SotetsegMaze2", keyName = "SotetsegMaze2",
name = "Sotetseg maze (solo mode)", name = "Sotetseg maze (solo mode)",
description = "" description = ""
) )
default boolean SotetsegMaze2(){ return false; } default boolean SotetsegMaze2() {
return true;
@ConfigItem( }
position = 8,
keyName = "SotetsegTick",
name = "Sotetseg tick eat",
description = ""
)
default boolean SotetsegTick(){ return false; }
@ConfigItem(
position = 9,
keyName = "XarpusExhumed",
name = "Xarpus exhumed",
description = ""
)
default boolean XarpusExhumed(){ return false; }
@ConfigItem( @ConfigItem(
position = 10, position = 10,
keyName = "XarpusTick", keyName = "XarpusExhumed",
name = "Xarpus tick", name = "Xarpus Exhumed",
description = "" description = ""
) )
default boolean XarpusTick(){ return false; } default boolean XarpusExhumed() {
return true;
}
@ConfigItem( @ConfigItem(
position = 11, position = 11,
keyName = "VerzikCupcakes", keyName = "XarpusTick",
name = "Verzik cupcakes", name = "Xarpus Tick",
description = "" description = ""
) )
default boolean VerzikCupcakes(){ return false; } default boolean XarpusTick() {
return false;
}
@ConfigItem( @ConfigItem(
position = 12, position = 12,
keyName = "VerzikTick", keyName = "xarpusExhumes",
name = "Verzik p3 tick", name = "Xarpus Exhume Counter",
description = "" description = ""
) )
default boolean VerzikTick(){ return false; } default boolean XarpusExhumeOverlay() {
return false;
}
@ConfigItem( @ConfigItem(
position = 13, position = 13,
keyName = "VerzikMelee", keyName = "VerzikCupcakes",
name = "Verzik p3 melee range", name = "Verzik Projectile Markers",
description = "" description = ""
) )
default boolean VerzikMelee(){ return false; } default boolean VerzikCupcakes() {
return false;
}
@ConfigItem( @ConfigItem(
position = 14, position = 14,
keyName = "VerzikYellow", keyName = "VerzikTick",
name = "Verzik yellow timing", name = "Verzik P3 Tick",
description = "" description = ""
) )
default boolean VerzikYellow(){ return false; } default boolean VerzikTick() {
return false;
}
@ConfigItem(
position = 15,
keyName = "VerzikMelee",
name = "Verzik P3 Melee Range",
description = ""
)
default boolean VerzikMelee() {
return false;
}
@ConfigItem(
position = 16,
keyName = "VerzikYellow",
name = "Verzik Yellow Timing",
description = ""
)
default boolean VerzikYellow() {
return false;
}
@ConfigItem(
position = 17,
keyName = "Verzik Nylo",
name = "Verzik Nylo Overlay",
description = ""
)
default boolean NyloTargetOverlay() {
return false;
}
@ConfigItem(
position = 18,
keyName = "VerzikTankTile",
name = "Verzik P3 Tile Overlay",
description = ""
)
default boolean verzikTankTile() {
return true;
}
} }

View File

@@ -8,27 +8,21 @@
package net.runelite.client.plugins.ztob; package net.runelite.client.plugins.ztob;
import net.runelite.api.Point;
import net.runelite.api.*;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldArea;
import net.runelite.api.coords.WorldPoint;
import net.runelite.client.ui.overlay.*;
import javax.inject.Inject;
import java.awt.*; import java.awt.*;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.inject.Inject;
import net.runelite.api.*;
import net.runelite.api.Point;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldArea;
import net.runelite.api.coords.WorldPoint;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.OverlayUtil;
public class TheatreOverlay extends Overlay { public class TheatreOverlay extends Overlay {
private final Client client; private final Client client;
private final TheatrePlugin plugin; private final TheatrePlugin plugin;
private final TheatreConfig config; private final TheatreConfig config;
@@ -43,42 +37,47 @@ public class TheatreOverlay extends Overlay {
} }
@Override @Override
public Dimension render(Graphics2D graphics) public Dimension render(Graphics2D graphics) {
{ if (plugin.isRunMaiden()) {
if (plugin.isRunMaiden()) if (config.MaidenBlood()) {
{ for (WorldPoint point : plugin.getMaiden_BloodSpatters()) {
if (config.MaidenBlood()) drawTile(graphics, point, new Color(36, 248, 229), 2, 150, 10);
{
for (WorldPoint point : plugin.getMaiden_BloodSpatters())
{
drawTile(graphics, point, new Color(0,150,200), 2, 150, 10);
} }
} }
if (config.MaidenSpawns()) if (config.MaidenSpawns()) {
{ for (WorldPoint point : plugin.getMaiden_SpawnLocations()) {
for (WorldPoint point : plugin.getMaiden_SpawnLocations()) drawTile(graphics, point, new Color(36, 248, 229), 2, 180, 20);
{
drawTile(graphics, point, new Color(0,150,200), 2, 180, 20);
} }
for (WorldPoint point : plugin.getMaiden_SpawnLocations2()) for (WorldPoint point : plugin.getMaiden_SpawnLocations2()) {
{ drawTile(graphics, point, new Color(36, 248, 229), 1, 120, 10);
drawTile(graphics, point, new Color(0,150,200), 1,120, 10);
} }
} }
} }
if (plugin.isRunBloat()) if (plugin.isRunBloat() && config.BloatIndicator()) {
{ if (config.bloatFeetIndicator()) {
if (plugin.getTemp().size() > 0) {
if (plugin.isTempFlag()) {
for (WorldPoint point : plugin.getTemp()) {
drawTile(graphics, point, Color.black, 4, 255, 0);
}
}
} else if (plugin.getTemp2().size() > 0) {
if (plugin.isTemp2Flag()) {
for (WorldPoint point : plugin.getTemp2()) {
drawTile(graphics, point, Color.black, 4, 255, 0);
}
if (config.BloatHands())
{
for (WorldPoint p : plugin.getBloat_Hands())
{
drawTile(graphics, p, Color.BLACK,3,255,0);
} }
} }
if(config.BloatIndicator()) { }
NPC bloat = plugin.getBloat_NPC(); NPC bloat = plugin.getBloat_NPC();
int state = plugin.getBloat_State(); int state = plugin.getBloat_State();
if (bloat == null) { if (bloat == null) {
@@ -96,16 +95,13 @@ public class TheatreOverlay extends Overlay {
break; break;
} }
} }
}
if (plugin.isRunNylocas()) if (plugin.isRunNylocas()) {
{ if (config.NyloPillars()) {
if (config.NyloPillars())
{
Map<NPC, Integer> pillars = plugin.getNylocas_Pillars(); Map<NPC, Integer> pillars = plugin.getNylocas_Pillars();
for (NPC npc : pillars.keySet()) { for (NPC npc : pillars.keySet()) {
final int health = pillars.get(npc); final int health = pillars.get(npc);
final String healthStr = String.valueOf(health) + "%"; final String healthStr = health + "%";
WorldPoint p = npc.getWorldLocation(); WorldPoint p = npc.getWorldLocation();
LocalPoint lp = LocalPoint.fromWorld(client, p.getX() + 1, p.getY() + 1); LocalPoint lp = LocalPoint.fromWorld(client, p.getX() + 1, p.getY() + 1);
final double rMod = 130.0 * health / 100.0; final double rMod = 130.0 * health / 100.0;
@@ -118,41 +114,34 @@ public class TheatreOverlay extends Overlay {
} }
} }
if (config.NyloBlasts()) if (config.NyloBlasts()) {
{
final Map<NPC, Integer> npcMap = plugin.getNylocas_Map(); final Map<NPC, Integer> npcMap = plugin.getNylocas_Map();
for (NPC npc : npcMap.keySet()) for (NPC npc : npcMap.keySet()) {
{
int ticksLeft = npcMap.get(npc); int ticksLeft = npcMap.get(npc);
if (ticksLeft > -1) { if (ticksLeft > -1) {
if (ticksLeft <= 6) { if (ticksLeft <= 6) {
Color color = new Color(255, 255, 0, 180); Color color = new Color(255, 255, 0, 180);
int outlineWidth = 2; int outlineWidth = 2;
int outlineAlpha = 150; int outlineAlpha = 150;
renderNpcOverlay(graphics, npc, color, outlineWidth, outlineAlpha, 0); renderNpcOverlay(graphics, npc, color, outlineWidth, outlineAlpha, 15);
} }
} }
} }
} }
} }
if (plugin.isRunSotetseg()) if (plugin.isRunSotetseg()) {
{ if (config.SotetsegMaze1()) {
if (config.SotetsegMaze1())
{
int i = 1; int i = 1;
for (GroundObject z : plugin.getRedTiles().keySet()) for (GroundObject o : plugin.getRedTiles().keySet()) {
{ Polygon poly = o.getCanvasTilePoly();
Polygon poly = z.getCanvasTilePoly(); if (poly != null) {
if (poly != null)
{
graphics.setColor(Color.WHITE); graphics.setColor(Color.WHITE);
graphics.setStroke(new BasicStroke(2)); graphics.setStroke(new BasicStroke(2));
graphics.draw(poly); graphics.draw(poly);
} }
Point textLocation = z.getCanvasTextLocation(graphics, String.valueOf(i), 0); Point textLocation = o.getCanvasTextLocation(graphics, String.valueOf(i), 0);
if (textLocation != null) if (textLocation != null) {
{
OverlayUtil.renderTextLocation(graphics, textLocation, String.valueOf(i), Color.WHITE); OverlayUtil.renderTextLocation(graphics, textLocation, String.valueOf(i), Color.WHITE);
} }
@@ -160,111 +149,111 @@ public class TheatreOverlay extends Overlay {
} }
} }
if (config.SotetsegMaze2()) if (config.SotetsegMaze2()) {
{ for (WorldPoint p : plugin.getRedTilesOverworld()) {
for (WorldPoint p : plugin.getRedTilesOverworld())
{
drawTile(graphics, p, Color.WHITE, 2, 255, 10); drawTile(graphics, p, Color.WHITE, 2, 255, 10);
} }
} }
if (config.SotetsegTick()) {
NPC boss = plugin.getSotetseg_NPC();
int eattick = plugin.getTickTillEat();
if (eattick > -1)
{
final String eatTicksStr = String.valueOf(eattick);
Point canvasPoint = boss.getCanvasTextLocation(graphics, eatTicksStr, 130);
renderTextLocation(graphics, eatTicksStr, 12, Font.BOLD, Color.WHITE, canvasPoint);
}
}
} }
if (plugin.isRunXarpus()) {
if (plugin.isRunXarpus())
{
NPC boss = plugin.getXarpus_NPC(); NPC boss = plugin.getXarpus_NPC();
if (boss.getId() == NpcID.XARPUS_8340 && !plugin.isXarpus_Stare() && config.XarpusTick()) if (boss.getId() == NpcID.XARPUS_8340 && !plugin.isXarpus_Stare() && config.XarpusTick()) {
{
int tick = plugin.getXarpus_TicksUntilShoot(); int tick = plugin.getXarpus_TicksUntilShoot();
if (tick < 1) if (tick < 1) {
{
tick = tick % 4 + 4; tick = tick % 4 + 4;
} }
final String ticksLeftStr = String.valueOf(tick); final String ticksLeftStr = String.valueOf(tick);
Point canvasPoint = boss.getCanvasTextLocation(graphics, ticksLeftStr, 130); Point canvasPoint = boss.getCanvasTextLocation(graphics, ticksLeftStr, 130);
renderTextLocation(graphics, ticksLeftStr, 12, Font.BOLD, Color.WHITE, canvasPoint); renderTextLocation(graphics, ticksLeftStr, 12, Font.BOLD, Color.WHITE, canvasPoint);
} }
if (boss.getId() == NpcID.XARPUS_8339 && config.XarpusExhumed()) if (boss.getId() == NpcID.XARPUS_8339 && config.XarpusExhumed()) {
{ for (GroundObject o : plugin.getXarpus_Exhumeds().keySet()) {
for (GroundObject o : plugin.getXarpus_Exhumeds().keySet())
{
Polygon poly = o.getCanvasTilePoly(); Polygon poly = o.getCanvasTilePoly();
if (poly != null) if (poly != null) {
{
graphics.setColor(new Color(0, 255, 0, 130)); graphics.setColor(new Color(0, 255, 0, 130));
graphics.setStroke(new BasicStroke(1)); graphics.setStroke(new BasicStroke(1));
graphics.draw(poly); graphics.draw(poly);
} }
} }
} for (Map.Entry<GroundObject, Integer> exhumes : plugin.getXarpusExhumedsTimer().entrySet()) {
final String ticksremaining = String.valueOf(exhumes.getValue());
if (Integer.valueOf(ticksremaining) > 0) {
GroundObject ex = exhumes.getKey();
Point point = ex.getCanvasTextLocation(graphics, ticksremaining, 0);
renderTextLocation(graphics, ticksremaining, 12, Font.BOLD, Color.white, point);
} }
if (plugin.isRunVerzik()) }
{
if (config.VerzikCupcakes())
{ }
for (WorldPoint p : plugin.getVerzik_RangeProjectiles().values())
{ }
if (plugin.isRunVerzik()) {
if (config.VerzikCupcakes()) {
for (WorldPoint p : plugin.getVerzik_RangeProjectiles().values()) {
drawTile(graphics, p, Color.RED, 2, 180, 50); drawTile(graphics, p, Color.RED, 2, 180, 50);
} }
} }
if (config.VerzikYellow()) if (config.VerzikYellow()) {
{ for (WorldPoint p : plugin.getVerzik_YellowTiles()) {
for (WorldPoint p : plugin.getVerzik_YellowTiles())
{
drawTile(graphics, p, Color.YELLOW, 3, 255, 0); drawTile(graphics, p, Color.YELLOW, 3, 255, 0);
Projectile yellowBall = plugin.getVerzik_YellowBall(); Projectile yellowBall = plugin.getVerzik_YellowBall();
if (yellowBall != null) if (yellowBall != null) {
{
final int ticksToImpact = yellowBall.getRemainingCycles() / 30; final int ticksToImpact = yellowBall.getRemainingCycles() / 30;
final String countdownStr = String.valueOf(ticksToImpact); final String countdownStr = String.valueOf(ticksToImpact);
Point canvasPoint = Perspective.getCanvasTextLocation(client, graphics, LocalPoint.fromWorld(client, p), countdownStr, 0); Point canvasPoint = Perspective.getCanvasTextLocation(client, graphics, LocalPoint.fromWorld(client, p), countdownStr, 0);
renderTextLocation(graphics, countdownStr, 12, Font.BOLD, Color.WHITE, canvasPoint); renderTextLocation(graphics, countdownStr, 12, Font.BOLD, Color.WHITE, canvasPoint);
} }
} }
} }
if (plugin.getVerzik_NPC_P3() != null) {
final NPC boss = plugin.getVerzik_NPC_P3(); final NPC boss = plugin.getVerzik_NPC();
if (boss.getId() == NpcID.VERZIK_VITUR_8374) if (boss.getId() == NpcID.VERZIK_VITUR_8374) {
{ if (config.verzikTankTile()) {
if (config.VerzikTick()) renderNpcOverlay(graphics, boss, new Color(75, 0, 130), 1, 255, 0);
{ }
if (config.VerzikTick()) {
final int ticksLeft = plugin.getP3_TicksUntilAttack(); final int ticksLeft = plugin.getP3_TicksUntilAttack();
if (ticksLeft > 0 && ticksLeft < 8) if (ticksLeft > 0 && ticksLeft < 8) {
{
final String ticksLeftStr = String.valueOf(ticksLeft); final String ticksLeftStr = String.valueOf(ticksLeft);
Point canvasPoint = boss.getCanvasTextLocation(graphics, ticksLeftStr, 60); Point canvasPoint = boss.getCanvasTextLocation(graphics, ticksLeftStr, 60);
renderTextLocation(graphics, ticksLeftStr, 15, Font.BOLD, Color.WHITE, canvasPoint); renderTextLocation(graphics, ticksLeftStr, 15, Font.BOLD, Color.WHITE, canvasPoint);
} }
} }
if (config.VerzikMelee() && boss.getAnimation() != 8127) if (config.VerzikMelee()) {
{
List<WorldPoint> meleeRange = getHitSquares(boss.getWorldLocation(), 7, 1, false); List<WorldPoint> meleeRange = getHitSquares(boss.getWorldLocation(), 7, 1, false);
for (WorldPoint p : meleeRange) for (WorldPoint p : meleeRange) {
{
drawTile(graphics, p, Color.WHITE, 1, 155, 10); drawTile(graphics, p, Color.WHITE, 1, 155, 10);
} }
} }
} }
if (boss.getAnimation() == 8117) {
final int ticksLeft = plugin.getRedCrabsTimer();
if (ticksLeft > 0) {
final String ticksLeftStr = String.valueOf(ticksLeft);
Point canvasPoint = boss.getCanvasTextLocation(graphics, ticksLeftStr, 60);
renderTextLocation(graphics, ticksLeftStr, 15, Font.BOLD, Color.WHITE, canvasPoint);
} }
} }
}
return null; return null;
} }
@@ -290,19 +279,16 @@ public class TheatreOverlay extends Overlay {
graphics.fill(poly); graphics.fill(poly);
} }
private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color, int outlineWidth, int outlineAlpha, int fillAlpha) private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color, int outlineWidth, int outlineAlpha, int fillAlpha) {
{
int size = 1; int size = 1;
NPCComposition composition = actor.getTransformedComposition(); NPCComposition composition = actor.getTransformedComposition();
if (composition != null) if (composition != null) {
{
size = composition.getSize(); size = composition.getSize();
} }
LocalPoint lp = actor.getLocalLocation(); LocalPoint lp = actor.getLocalLocation();
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size); Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
if (tilePoly != null) if (tilePoly != null) {
{
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha)); graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha));
graphics.setStroke(new BasicStroke(outlineWidth)); graphics.setStroke(new BasicStroke(outlineWidth));
graphics.draw(tilePoly); graphics.draw(tilePoly);
@@ -311,11 +297,9 @@ public class TheatreOverlay extends Overlay {
} }
} }
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint) private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint) {
{
graphics.setFont(new Font("Arial", fontStyle, fontSize)); graphics.setFont(new Font("Arial", fontStyle, fontSize));
if (canvasPoint != null) if (canvasPoint != null) {
{
final Point canvasCenterPoint = new Point( final Point canvasCenterPoint = new Point(
canvasPoint.getX(), canvasPoint.getX(),
canvasPoint.getY()); canvasPoint.getY());
@@ -327,17 +311,13 @@ public class TheatreOverlay extends Overlay {
} }
} }
private List<WorldPoint> getHitSquares(WorldPoint npcLoc, int npcSize, int thickness, boolean includeUnder) private List<WorldPoint> getHitSquares(WorldPoint npcLoc, int npcSize, int thickness, boolean includeUnder) {
{
List<WorldPoint> little = new WorldArea(npcLoc, npcSize, npcSize).toWorldPointList(); List<WorldPoint> little = new WorldArea(npcLoc, npcSize, npcSize).toWorldPointList();
List<WorldPoint> big = new WorldArea(npcLoc.getX() - thickness, npcLoc.getY() - thickness, npcSize + (thickness * 2), npcSize + (thickness * 2), npcLoc.getPlane()).toWorldPointList(); List<WorldPoint> big = new WorldArea(npcLoc.getX() - thickness, npcLoc.getY() - thickness, npcSize + (thickness * 2), npcSize + (thickness * 2), npcLoc.getPlane()).toWorldPointList();
if (!includeUnder) if (!includeUnder) {
{ for (Iterator<WorldPoint> it = big.iterator(); it.hasNext(); ) {
for (Iterator<WorldPoint> it = big.iterator(); it.hasNext();)
{
WorldPoint p = it.next(); WorldPoint p = it.next();
if (little.contains(p)) if (little.contains(p)) {
{
it.remove(); it.remove();
} }
} }

View File

@@ -0,0 +1,68 @@
package net.runelite.client.plugins.ztob;
import com.google.inject.Inject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
import java.awt.*;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
public class TheatreXarpusOverlay extends Overlay {
private final TheatrePlugin plugin;
private final TheatreConfig config;
PanelComponent panelComponent = new PanelComponent();
@Inject
private TheatreXarpusOverlay(TheatrePlugin plugin, TheatreConfig config) {
super(plugin);
setPosition(OverlayPosition.ABOVE_CHATBOX_RIGHT);
setPosition(OverlayPosition.DYNAMIC);
setPosition(OverlayPosition.DETACHED);
this.plugin = plugin;
this.config = config;
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Theatre xarpus overlay"));
}
@Override
public Dimension render(Graphics2D graphics) {
if (plugin.isRunXarpus()) {
if (config.XarpusExhumeOverlay()) {
if (plugin.getXarpus_NPC().getId() == 8339) {
panelComponent.getChildren().clear();
String overlayTitle = "Exhume Counter";
// Build overlay title
panelComponent.getChildren().add(TitleComponent.builder()
.text(overlayTitle)
.color(Color.GREEN)
.build());
//Set the size of overlay
panelComponent.setPreferredSize(new Dimension(
graphics.getFontMetrics().stringWidth(overlayTitle) + 30, 0
));
panelComponent.getChildren().add(LineComponent.builder()
.left("Exhumes: ")
.right(String.valueOf(plugin.getExhumecount()))
.build());
}
}
return panelComponent.render(graphics);
}
return null;
}
}

View File

@@ -0,0 +1,81 @@
package net.runelite.client.plugins.ztob;
import net.runelite.api.Client;
import net.runelite.api.NPC;
import net.runelite.api.Point;
import net.runelite.client.ui.overlay.*;
import javax.inject.Inject;
import java.awt.*;
public class VerzikNyloOverlay extends Overlay {
private final Client client;
private final TheatrePlugin plugin;
private final TheatreConfig config;
@Inject
private VerzikNyloOverlay(Client client, TheatrePlugin plugin, TheatreConfig config) {
this.client = client;
this.plugin = plugin;
this.config = config;
setPosition(OverlayPosition.DYNAMIC);
setPriority(OverlayPriority.HIGH);
setLayer(OverlayLayer.ABOVE_SCENE);
}
public Dimension render(Graphics2D graphics) {
if (plugin.isRunVerzik()) {
if (config.NyloTargetOverlay()) {
if (plugin.getCrabList().size() > 0) {
for (NPC npc : plugin.getCrabList()) {
if (npc.isDead()) {
continue;
}
String renderText = "";
if (npc.getInteracting() != null) {
renderText = npc.getInteracting().getName();
Point point = npc.getCanvasTextLocation(graphics, npc.getInteracting().getName(), 0);
if (npc.getInteracting().getName().toLowerCase().equals(client.getLocalPlayer().getName().toLowerCase())) {
point = npc.getCanvasTextLocation(graphics, client.getLocalPlayer().getName(), 0);
renderText = "YOU NIGGA RUN!";
} else if (npc.getInteracting().getName().toLowerCase().equals("afyy")) {
point = npc.getCanvasTextLocation(graphics, "Ricecup", 0);
renderText = "Ricecup";
}
if (renderText.equals("YOU NIGGA RUN!")) {
renderTextLocation(graphics, renderText, 12, Font.BOLD, Color.RED, point);
} else {
renderTextLocation(graphics, renderText, 12, Font.BOLD, Color.GREEN, point);
}
}
}
}
}
}
return null;
}
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint) {
graphics.setFont(new Font("Arial", fontStyle, fontSize));
if (canvasPoint != null) {
final Point canvasCenterPoint = new Point(
canvasPoint.getX(),
canvasPoint.getY());
final Point canvasCenterPoint_shadow = new Point(
canvasPoint.getX() + 1,
canvasPoint.getY() + 1);
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B