Regactor hydra
This commit is contained in:
@@ -29,37 +29,49 @@ import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
|
||||
@ConfigGroup("hydra")
|
||||
public interface HydraConfig extends Config {
|
||||
public interface HydraConfig extends Config
|
||||
{
|
||||
@ConfigItem(
|
||||
position = 0,
|
||||
keyName = "hydraenable",
|
||||
name = "Enable Hydra (194 cb) Helper",
|
||||
description = "Configures whether or not to enable Hydra Helper. (For use on regular hydra's only, will not work with Alchemical Hydra)."
|
||||
)
|
||||
default boolean EnableHydra() { return true; }
|
||||
default boolean EnableHydra()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "textindicators",
|
||||
name = "Text Indicator",
|
||||
description = "Configures if text indicator is shown above hydra's or not."
|
||||
position = 1,
|
||||
keyName = "textindicators",
|
||||
name = "Text Indicator",
|
||||
description = "Configures if text indicator is shown above hydra's or not."
|
||||
)
|
||||
default boolean TextIndicator() { return true; }
|
||||
default boolean TextIndicator()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 2,
|
||||
keyName = "countersize",
|
||||
name = "Bold indicator",
|
||||
description = "Configures if text indicator is bold or not."
|
||||
position = 2,
|
||||
keyName = "countersize",
|
||||
name = "Bold indicator",
|
||||
description = "Configures if text indicator is bold or not."
|
||||
)
|
||||
default boolean BoldText() { return false; }
|
||||
default boolean BoldText()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 3,
|
||||
keyName = "prayerhelper",
|
||||
name = "Prayer Helper",
|
||||
description = "Configures if prayer helper is shown or not."
|
||||
position = 3,
|
||||
keyName = "prayerhelper",
|
||||
name = "Prayer Helper",
|
||||
description = "Configures if prayer helper is shown or not."
|
||||
)
|
||||
default boolean PrayerHelper() { return true; }
|
||||
|
||||
default boolean PrayerHelper()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,53 +24,53 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.hydra;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.ui.overlay.*;
|
||||
import net.runelite.client.ui.overlay.components.ComponentConstants;
|
||||
import net.runelite.client.ui.overlay.components.ImageComponent;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
public class HydraIndicatorOverlay extends Overlay
|
||||
{
|
||||
private final HydraConfig config;
|
||||
private final HydraPlugin plugin;
|
||||
|
||||
public class HydraIndicatorOverlay extends Overlay {
|
||||
private final HydraConfig config;
|
||||
private final HydraPlugin plugin;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
@Inject
|
||||
private HydraIndicatorOverlay(HydraConfig config, HydraPlugin plugin)
|
||||
{
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||
setPriority(OverlayPriority.MED);
|
||||
panelComponent.setPreferredSize(new Dimension(14, 0));
|
||||
}
|
||||
|
||||
@Inject
|
||||
private HydraIndicatorOverlay(HydraConfig config, HydraPlugin plugin) {
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||
setPriority(OverlayPriority.MED);
|
||||
panelComponent.setPreferredSize(new Dimension(14, 0));
|
||||
}
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.PrayerHelper())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics) {
|
||||
if (!config.PrayerHelper()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (plugin.Hydra != null) {
|
||||
if (plugin.hydras.containsKey(plugin.Hydra.getIndex())) {
|
||||
int val = plugin.hydras.get(plugin.Hydra.getIndex());
|
||||
if (val != 0) {
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.getChildren().add(LineComponent.builder().right(Integer.toString(val)).build());
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (plugin.Hydra != null)
|
||||
{
|
||||
if (plugin.hydras.containsKey(plugin.Hydra.getIndex()))
|
||||
{
|
||||
int val = plugin.hydras.get(plugin.Hydra.getIndex());
|
||||
if (val != 0)
|
||||
{
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.getChildren().add(LineComponent.builder().right(Integer.toString(val)).build());
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,16 +24,23 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.hydra;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.overlay.*;
|
||||
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;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
public class HydraOverlay extends Overlay {
|
||||
public class HydraOverlay extends Overlay
|
||||
{
|
||||
private final HydraConfig config;
|
||||
private final HydraPlugin plugin;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
@@ -43,7 +50,8 @@ public class HydraOverlay extends Overlay {
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private HydraOverlay(HydraConfig config, HydraPlugin plugin) {
|
||||
private HydraOverlay(HydraConfig config, HydraPlugin plugin)
|
||||
{
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||
@@ -53,41 +61,60 @@ public class HydraOverlay extends Overlay {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics) {
|
||||
if (!config.TextIndicator()) {
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.TextIndicator())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (NPC hydra : client.getNpcs()) {
|
||||
if (hydra == null || hydra.getName() == null) {
|
||||
for (NPC hydra : client.getNpcs())
|
||||
{
|
||||
if (hydra == null || hydra.getName() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra")) {
|
||||
if (plugin.hydras.containsKey(hydra.getIndex())) {
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra"))
|
||||
{
|
||||
if (plugin.hydras.containsKey(hydra.getIndex()))
|
||||
{
|
||||
int val = plugin.hydras.get(hydra.getIndex());
|
||||
if (val != 0) {
|
||||
if (config.BoldText()) {
|
||||
if (val != 0)
|
||||
{
|
||||
if (config.BoldText())
|
||||
{
|
||||
graphics.setFont(FontManager.getRunescapeBoldFont());
|
||||
}
|
||||
if (plugin.hydraattacks.containsKey(hydra.getIndex())) {
|
||||
if (plugin.hydraattacks.containsKey(hydra.getIndex()))
|
||||
{
|
||||
int attack = plugin.hydraattacks.get(hydra.getIndex());
|
||||
if (attack == 8261) {
|
||||
if (val == 3) {
|
||||
if (attack == 8261)
|
||||
{
|
||||
if (val == 3)
|
||||
{
|
||||
OverlayUtil.renderTextLocation(graphics, hydra.getCanvasTextLocation(graphics, "MAGE", hydra.getLogicalHeight() + 100), "MAGE", Color.BLUE);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
OverlayUtil.renderTextLocation(graphics, hydra.getCanvasTextLocation(graphics, "RANGE", hydra.getLogicalHeight() + 100), "RANGE", Color.GREEN);
|
||||
}
|
||||
} else if (attack == 8262) {
|
||||
if (val == 3) {
|
||||
}
|
||||
else if (attack == 8262)
|
||||
{
|
||||
if (val == 3)
|
||||
{
|
||||
OverlayUtil.renderTextLocation(graphics, hydra.getCanvasTextLocation(graphics, "RANGE", hydra.getLogicalHeight() + 100), "RANGE", Color.GREEN);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
OverlayUtil.renderTextLocation(graphics, hydra.getCanvasTextLocation(graphics, "MAGE", hydra.getLogicalHeight() + 100), "MAGE", Color.BLUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
Point runelitepleaseexplainwhyineedtocheckthisfornullinsteadoftheentirehydravariablethisshitcostmelikeanhourofmylifeandiblameyouadam = hydra.getCanvasTextLocation(graphics, Integer.toString(val), hydra.getLogicalHeight() + 40);
|
||||
if (runelitepleaseexplainwhyineedtocheckthisfornullinsteadoftheentirehydravariablethisshitcostmelikeanhourofmylifeandiblameyouadam != null) {
|
||||
OverlayUtil.renderTextLocation(graphics, runelitepleaseexplainwhyineedtocheckthisfornullinsteadoftheentirehydravariablethisshitcostmelikeanhourofmylifeandiblameyouadam, Integer.toString(val), Color.WHITE);
|
||||
Point hydraPoint = hydra.getCanvasTextLocation(graphics, Integer.toString(val), hydra.getLogicalHeight() + 40);
|
||||
if (hydraPoint != null)
|
||||
{
|
||||
OverlayUtil.renderTextLocation(graphics, hydraPoint, Integer.toString(val), Color.WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,21 +24,24 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.hydra;
|
||||
|
||||
import net.runelite.api.events.*;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Hydra Helper",
|
||||
description = "Hydra Helper",
|
||||
@@ -65,11 +68,9 @@ public class HydraPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private SpriteManager spriteManager;
|
||||
|
||||
@Provides
|
||||
HydraConfig provideConfig(ConfigManager configManager) {
|
||||
HydraConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(HydraConfig.class);
|
||||
}
|
||||
|
||||
@@ -78,14 +79,16 @@ public class HydraPlugin extends Plugin
|
||||
NPC Hydra;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception {
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(HydraOverlay);
|
||||
overlayManager.add(HydraPrayOverlay);
|
||||
overlayManager.add(HydraIndicatorOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception {
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(HydraOverlay);
|
||||
overlayManager.remove(HydraPrayOverlay);
|
||||
overlayManager.remove(HydraIndicatorOverlay);
|
||||
@@ -94,14 +97,19 @@ public class HydraPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event) {
|
||||
if (!config.EnableHydra()) {
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
if (!config.EnableHydra())
|
||||
{
|
||||
return;
|
||||
}
|
||||
NPC hydra = event.getNpc();
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null) {
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra")) {
|
||||
if (!hydras.containsKey(hydra.getIndex())) {
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null)
|
||||
{
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra"))
|
||||
{
|
||||
if (!hydras.containsKey(hydra.getIndex()))
|
||||
{
|
||||
hydras.put(hydra.getIndex(), 3);
|
||||
}
|
||||
}
|
||||
@@ -109,56 +117,75 @@ public class HydraPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event) {
|
||||
if (!config.EnableHydra()) {
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (!config.EnableHydra())
|
||||
{
|
||||
return;
|
||||
}
|
||||
NPC hydra = event.getNpc();
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null) {
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra")) {
|
||||
if (hydras.containsKey(hydra.getIndex())) {
|
||||
hydras.remove(hydra.getIndex());
|
||||
}
|
||||
if (hydraattacks.containsKey(hydra.getIndex())) {
|
||||
hydraattacks.remove(hydra.getIndex());
|
||||
}
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null)
|
||||
{
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra"))
|
||||
{
|
||||
hydras.remove(hydra.getIndex());
|
||||
hydraattacks.remove(hydra.getIndex());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event) {
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
Actor monster = event.getActor();
|
||||
Actor local = client.getLocalPlayer();
|
||||
if (monster instanceof NPC) {
|
||||
if (monster instanceof NPC)
|
||||
{
|
||||
NPC hydra = (NPC) monster;
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null) {
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra")) {
|
||||
if (hydras.containsKey(hydra.getIndex())) {
|
||||
if (hydra.getAnimation() == 8261 || hydra.getAnimation() == 8262) {
|
||||
if (hydra.getInteracting().equals(local)) {
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null)
|
||||
{
|
||||
if (hydra.getName().equalsIgnoreCase("Hydra"))
|
||||
{
|
||||
if (hydras.containsKey(hydra.getIndex()))
|
||||
{
|
||||
if (hydra.getAnimation() == 8261 || hydra.getAnimation() == 8262)
|
||||
{
|
||||
if (hydra.getInteracting().equals(local))
|
||||
{
|
||||
Hydra = hydra;
|
||||
}
|
||||
if (hydraattacks.containsKey(hydra.getIndex())) {
|
||||
if (hydraattacks.containsKey(hydra.getIndex()))
|
||||
{
|
||||
int lastattack = hydraattacks.get(hydra.getIndex());
|
||||
hydraattacks.replace(hydra.getIndex(), hydra.getAnimation());
|
||||
|
||||
if (lastattack != hydra.getAnimation()) {
|
||||
if (lastattack != hydra.getAnimation())
|
||||
{
|
||||
hydras.replace(hydra.getIndex(), 2);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
int currval = hydras.get(hydra.getIndex());
|
||||
if (currval == 1) {
|
||||
if (currval == 1)
|
||||
{
|
||||
hydras.replace(hydra.getIndex(), 3);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
hydras.replace(hydra.getIndex(), currval - 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
hydraattacks.put(hydra.getIndex(), hydra.getAnimation());
|
||||
int currval = hydras.get(hydra.getIndex());
|
||||
if (currval == 1) {
|
||||
if (currval == 1)
|
||||
{
|
||||
hydras.replace(hydra.getIndex(), 3);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
hydras.replace(hydra.getIndex(), currval - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,101 +24,122 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.hydra;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.ui.overlay.*;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.ComponentConstants;
|
||||
import net.runelite.client.ui.overlay.components.ImageComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
public class HydraPrayOverlay extends Overlay {
|
||||
private final HydraConfig config;
|
||||
private final HydraPlugin plugin;
|
||||
public class HydraPrayOverlay extends Overlay
|
||||
{
|
||||
private final HydraConfig config;
|
||||
private final HydraPlugin plugin;
|
||||
|
||||
private static final Color NOT_ACTIVATED_BACKGROUND_COLOR = new Color(150, 0, 0, 150);
|
||||
private static final Color NOT_ACTIVATED_BACKGROUND_COLOR = new Color(150, 0, 0, 150);
|
||||
|
||||
private final SpriteManager spriteManager;
|
||||
private final PanelComponent imagePanelComponent = new PanelComponent();
|
||||
private final SpriteManager spriteManager;
|
||||
private final PanelComponent imagePanelComponent = new PanelComponent();
|
||||
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private HydraPrayOverlay(HydraConfig config, HydraPlugin plugin, SpriteManager spriteManager) {
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||
setPriority(OverlayPriority.HIGH);
|
||||
this.spriteManager = spriteManager;
|
||||
}
|
||||
@Inject
|
||||
private HydraPrayOverlay(HydraConfig config, HydraPlugin plugin, SpriteManager spriteManager)
|
||||
{
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||
setPriority(OverlayPriority.HIGH);
|
||||
this.spriteManager = spriteManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics) {
|
||||
if (!config.PrayerHelper()) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.PrayerHelper())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (plugin.Hydra != null) {
|
||||
if (plugin.hydras.containsKey(plugin.Hydra.getIndex())) {
|
||||
int val = plugin.hydras.get(plugin.Hydra.getIndex());
|
||||
if (val != 0) {
|
||||
if (plugin.hydraattacks.containsKey(plugin.Hydra.getIndex())) {
|
||||
int attack = plugin.hydraattacks.get(plugin.Hydra.getIndex());
|
||||
if (attack == 8261) {
|
||||
if (val == 3) {
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
|
||||
if (plugin.Hydra != null)
|
||||
{
|
||||
if (plugin.hydras.containsKey(plugin.Hydra.getIndex()))
|
||||
{
|
||||
int val = plugin.hydras.get(plugin.Hydra.getIndex());
|
||||
if (val != 0)
|
||||
{
|
||||
if (plugin.hydraattacks.containsKey(plugin.Hydra.getIndex()))
|
||||
{
|
||||
int attack = plugin.hydraattacks.get(plugin.Hydra.getIndex());
|
||||
if (attack == 8261)
|
||||
{
|
||||
if (val == 3)
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
|
||||
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
|
||||
return imagePanelComponent.render(graphics);
|
||||
} else {
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
else
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
|
||||
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
} else if (attack == 8262) {
|
||||
if (val == 3) {
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
else if (attack == 8262)
|
||||
{
|
||||
if (val == 3)
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
|
||||
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
|
||||
return imagePanelComponent.render(graphics);
|
||||
} else {
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
else
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
|
||||
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user