cox: Use projectile spawned instead of moved, and various other fixes.
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
package net.runelite.client.plugins.coxhelper;
|
package net.runelite.client.plugins.coxhelper;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import java.awt.BasicStroke;
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@@ -32,6 +33,7 @@ import java.awt.Font;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
@@ -53,6 +55,9 @@ import net.runelite.client.ui.overlay.OverlayUtil;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class CoxOverlay extends Overlay
|
public class CoxOverlay extends Overlay
|
||||||
{
|
{
|
||||||
|
private static final Set<Integer> GAP = ImmutableSet.of(
|
||||||
|
34, 33, 26, 25, 18, 17, 10, 9, 2, 1
|
||||||
|
);
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final CoxPlugin plugin;
|
private final CoxPlugin plugin;
|
||||||
|
|
||||||
@@ -105,7 +110,6 @@ public class CoxOverlay extends Overlay
|
|||||||
if (plugin.isTektonTickCounter())
|
if (plugin.isTektonTickCounter())
|
||||||
{
|
{
|
||||||
ticksLeft = npcs.getTicksUntilAttack();
|
ticksLeft = npcs.getTicksUntilAttack();
|
||||||
int attackTicksleft = plugin.getTektonAttackTicks();
|
|
||||||
if (ticksLeft > 0)
|
if (ticksLeft > 0)
|
||||||
{
|
{
|
||||||
if (ticksLeft == 1)
|
if (ticksLeft == 1)
|
||||||
@@ -214,67 +218,67 @@ public class CoxOverlay extends Overlay
|
|||||||
|
|
||||||
if (plugin.isTimers())
|
if (plugin.isTimers())
|
||||||
{
|
{
|
||||||
if (plugin.getBurnTarget().size() > 0)
|
if (plugin.getVictims().size() > 0)
|
||||||
{
|
{
|
||||||
for (Actor actor : plugin.getBurnTarget())
|
plugin.getVictims().forEach(victim ->
|
||||||
{
|
{
|
||||||
final int ticksLeft = plugin.getBurnTicks();
|
final int ticksLeft = victim.getTicks();
|
||||||
String ticksLeftStr = String.valueOf(ticksLeft);
|
String ticksLeftStr = String.valueOf(ticksLeft);
|
||||||
Color tickcolor;
|
Color tickcolor;
|
||||||
if (ticksLeft >= 0)
|
switch (victim.getType())
|
||||||
{
|
{
|
||||||
if (ticksLeft == 34 ||
|
case ACID:
|
||||||
ticksLeft == 33 ||
|
if (ticksLeft > 0)
|
||||||
ticksLeft == 26 ||
|
{
|
||||||
ticksLeft == 25 ||
|
if (ticksLeft > 1)
|
||||||
ticksLeft == 18 ||
|
{
|
||||||
ticksLeft == 17 ||
|
tickcolor = new Color(69, 241, 44, 255);
|
||||||
ticksLeft == 10 ||
|
}
|
||||||
ticksLeft == 9 ||
|
else
|
||||||
ticksLeft == 2 ||
|
{
|
||||||
ticksLeft == 1)
|
tickcolor = new Color(255, 255, 255, 255);
|
||||||
{
|
}
|
||||||
tickcolor = new Color(255, 0, 0, 255);
|
Point canvasPoint = victim.getPlayer().getCanvasTextLocation(graphics, ticksLeftStr, 0);
|
||||||
ticksLeftStr = "GAP";
|
renderTextLocation(graphics, ticksLeftStr, plugin.getTextSize(), plugin.getFontStyle().getFont(), tickcolor, canvasPoint);
|
||||||
}
|
}
|
||||||
else
|
break;
|
||||||
{
|
case BURN:
|
||||||
tickcolor = new Color(255, 255, 255, 255);
|
if (ticksLeft > 0)
|
||||||
}
|
{
|
||||||
Point canvasPoint = actor.getCanvasTextLocation(graphics, ticksLeftStr, 0);
|
if (GAP.contains(ticksLeft))
|
||||||
renderTextLocation(graphics, ticksLeftStr, plugin.getTextSize(), plugin.getFontStyle().getFont(), tickcolor, canvasPoint);
|
{
|
||||||
|
tickcolor = new Color(255, 0, 0, 255);
|
||||||
|
ticksLeftStr = "GAP";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tickcolor = new Color(255, 255, 255, 255);
|
||||||
|
}
|
||||||
|
Point canvasPoint = victim.getPlayer().getCanvasTextLocation(graphics, ticksLeftStr, 0);
|
||||||
|
renderTextLocation(graphics, ticksLeftStr, plugin.getTextSize(), plugin.getFontStyle().getFont(), tickcolor, canvasPoint);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TELEPORT:
|
||||||
|
if (plugin.isTpOverlay())
|
||||||
|
{
|
||||||
|
if (ticksLeft > 0)
|
||||||
|
{
|
||||||
|
if (ticksLeft > 1)
|
||||||
|
{
|
||||||
|
tickcolor = new Color(193, 255, 245, 255);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tickcolor = new Color(255, 255, 255, 255);
|
||||||
|
}
|
||||||
|
Point canvasPoint = victim.getPlayer().getCanvasTextLocation(graphics, ticksLeftStr, 0);
|
||||||
|
renderTextLocation(graphics, ticksLeftStr, plugin.getTextSize(), plugin.getFontStyle().getFont(), tickcolor, canvasPoint);
|
||||||
|
}
|
||||||
|
renderActorOverlay(graphics, victim.getPlayer(), new Color(193, 255, 245, 255), 2, 100, 10);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (plugin.getAcidTarget() != null)
|
|
||||||
{
|
|
||||||
Actor actor = plugin.getAcidTarget();
|
|
||||||
renderActorOverlay(graphics, actor, plugin.getAcidColor(), 2, 100, 10);
|
|
||||||
final int ticksLeft = plugin.getAcidTicks();
|
|
||||||
Color tickcolor;
|
|
||||||
if (ticksLeft > 0)
|
|
||||||
{
|
|
||||||
if (ticksLeft > 1)
|
|
||||||
{
|
|
||||||
tickcolor = new Color(69, 241, 44, 255);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tickcolor = new Color(255, 255, 255, 255);
|
|
||||||
}
|
|
||||||
final String ticksLeftStr = String.valueOf(ticksLeft);
|
|
||||||
Point canvasPoint = actor.getCanvasTextLocation(graphics, ticksLeftStr, 0);
|
|
||||||
renderTextLocation(graphics, ticksLeftStr, plugin.getTextSize(), plugin.getFontStyle().getFont(), tickcolor, canvasPoint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plugin.isTpOverlay())
|
|
||||||
{
|
|
||||||
if (plugin.getTeleportTarget() != null)
|
|
||||||
{
|
|
||||||
renderActorOverlay(graphics, plugin.getTeleportTarget(), new Color(193, 255, 245, 255), 2, 100, 10);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,10 @@ import com.google.inject.Provides;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
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;
|
||||||
@@ -59,7 +61,7 @@ import net.runelite.api.events.ConfigChanged;
|
|||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.NpcSpawned;
|
import net.runelite.api.events.NpcSpawned;
|
||||||
import net.runelite.api.events.ProjectileMoved;
|
import net.runelite.api.events.ProjectileSpawned;
|
||||||
import net.runelite.api.events.SpotAnimationChanged;
|
import net.runelite.api.events.SpotAnimationChanged;
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -80,123 +82,77 @@ import net.runelite.client.util.Text;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
public class CoxPlugin extends Plugin
|
public class CoxPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final int ANIMATION_ID_G1 = 430;
|
private static final int ANIMATION_ID_G1 = 430;
|
||||||
private static final String OLM_HAND_CRIPPLE = "The Great Olm\'s left claw clenches to protect itself temporarily.";
|
private static final String OLM_HAND_CRIPPLE = "The Great Olm\'s left claw clenches to protect itself temporarily.";
|
||||||
private static final Pattern TP_REGEX = Pattern.compile("You have been paired with <col=ff0000>(.*)</col>! The magical power will enact soon...");
|
private static final Pattern TP_REGEX = Pattern.compile("You have been paired with <col=ff0000>(.*)</col>! The magical power will enact soon...");
|
||||||
@Setter
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
protected PrayAgainst prayAgainstOlm;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
protected long lastPrayTime;
|
|
||||||
private int sleepcount = 0;
|
|
||||||
private boolean needOlm = false;
|
|
||||||
private GraphicsObject teleportObject;
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private Client client;
|
private Client client;
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private ChatMessageManager chatMessageManager;
|
private ChatMessageManager chatMessageManager;
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private CoxOverlay coxOverlay;
|
private CoxOverlay coxOverlay;
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private CoxInfoBox coxInfoBox;
|
private CoxInfoBox coxInfoBox;
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private CoxConfig config;
|
private CoxConfig config;
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private OverlayManager overlayManager;
|
private OverlayManager overlayManager;
|
||||||
@Inject
|
@Inject
|
||||||
|
@Getter(AccessLevel.NONE)
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
private boolean handCripple;
|
||||||
private boolean HandCripple;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean runOlm;
|
private boolean runOlm;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int vanguards;
|
private int vanguards;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean tektonActive;
|
private boolean tektonActive;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private NPC hand;
|
private NPC hand;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private NPC Olm_NPC;
|
private NPC Olm_NPC;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private NPC OlmMelee_NPC;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private List<WorldPoint> Olm_Crystals = new ArrayList<>();
|
private List<WorldPoint> Olm_Crystals = new ArrayList<>();
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private List<WorldPoint> Olm_Heal = new ArrayList<>();
|
private List<WorldPoint> Olm_Heal = new ArrayList<>();
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private List<WorldPoint> Olm_TP = new ArrayList<>();
|
private List<WorldPoint> Olm_TP = new ArrayList<>();
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private List<WorldPoint> Olm_PSN = new ArrayList<>();
|
private List<WorldPoint> Olm_PSN = new ArrayList<>();
|
||||||
@Getter(AccessLevel.PACKAGE)
|
private Set<Victim> victims = new HashSet<>();
|
||||||
private List<Actor> burnTarget = new ArrayList<>();
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Actor teleportTarget;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Actor acidTarget;
|
private Actor acidTarget;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int crippleTimer = 45;
|
private int crippleTimer = 45;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int burnTicks = 41;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int acidTicks = 25;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int teleportTicks = 10;
|
private int teleportTicks = 10;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int tektonAttackTicks;
|
private int tektonAttackTicks;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int OlmPhase = 0;
|
private int OlmPhase = 0;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int Olm_TicksUntilAction = -1;
|
private int Olm_TicksUntilAction = -1;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int Olm_ActionCycle = -1; //4:0 = auto 3:0 = null 2:0 = auto 1:0 = spec + actioncycle =4
|
private int Olm_ActionCycle = -1; //4:0 = auto 3:0 = null 2:0 = auto 1:0 = spec + actioncycle =4
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int Olm_NextSpec = -1; // 1= crystals 2=lightnig 3=portals 4= heal hand if p4
|
private int Olm_NextSpec = -1; // 1= crystals 2=lightnig 3=portals 4= heal hand if p4
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private float percent;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Map<NPC, NPCContainer> npcContainer = new HashMap<>();
|
private Map<NPC, NPCContainer> npcContainer = new HashMap<>();
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
@Getter(AccessLevel.PACKAGE)
|
private PrayAgainst prayAgainstOlm;
|
||||||
|
private long lastPrayTime;
|
||||||
|
private int sleepcount = 0;
|
||||||
|
private boolean needOlm = false;
|
||||||
private boolean muttadile;
|
private boolean muttadile;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean tekton;
|
private boolean tekton;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean tektonTickCounter;
|
private boolean tektonTickCounter;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean guardians;
|
private boolean guardians;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean guardinTickCounter;
|
private boolean guardinTickCounter;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean vangHighlight;
|
private boolean vangHighlight;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean vangHealth;
|
private boolean vangHealth;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean configPrayAgainstOlm;
|
private boolean configPrayAgainstOlm;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean timers;
|
private boolean timers;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean tpOverlay;
|
private boolean tpOverlay;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean olmTick;
|
private boolean olmTick;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Color muttaColor;
|
private Color muttaColor;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Color guardColor;
|
private Color guardColor;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Color tektonColor;
|
private Color tektonColor;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Color burnColor;
|
private Color burnColor;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Color acidColor;
|
private Color acidColor;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private Color tpColor;
|
private Color tpColor;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private CoxConfig.FontStyle fontStyle;
|
private CoxConfig.FontStyle fontStyle;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int textSize;
|
private int textSize;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean shadows;
|
private boolean shadows;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -213,16 +169,12 @@ public class CoxPlugin extends Plugin
|
|||||||
|
|
||||||
overlayManager.add(coxOverlay);
|
overlayManager.add(coxOverlay);
|
||||||
overlayManager.add(coxInfoBox);
|
overlayManager.add(coxInfoBox);
|
||||||
HandCripple = false;
|
handCripple = false;
|
||||||
hand = null;
|
hand = null;
|
||||||
acidTarget = null;
|
|
||||||
teleportTarget = null;
|
|
||||||
Olm_TP.clear();
|
Olm_TP.clear();
|
||||||
prayAgainstOlm = null;
|
prayAgainstOlm = null;
|
||||||
burnTarget.clear();
|
victims.clear();
|
||||||
crippleTimer = 45;
|
crippleTimer = 45;
|
||||||
burnTicks = 40;
|
|
||||||
acidTicks = 25;
|
|
||||||
teleportTicks = 10;
|
teleportTicks = 10;
|
||||||
vanguards = 0;
|
vanguards = 0;
|
||||||
}
|
}
|
||||||
@@ -231,7 +183,6 @@ public class CoxPlugin extends Plugin
|
|||||||
protected void shutDown()
|
protected void shutDown()
|
||||||
{
|
{
|
||||||
eventBus.unregister(this);
|
eventBus.unregister(this);
|
||||||
|
|
||||||
overlayManager.remove(coxOverlay);
|
overlayManager.remove(coxOverlay);
|
||||||
overlayManager.remove(coxInfoBox);
|
overlayManager.remove(coxInfoBox);
|
||||||
}
|
}
|
||||||
@@ -240,203 +191,231 @@ public class CoxPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||||
eventBus.subscribe(ProjectileMoved.class, this, this::onProjectileMoved);
|
eventBus.subscribe(ProjectileSpawned.class, this, this::onProjectileSpawned);
|
||||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onChatMessage(ChatMessage chatMessage)
|
private void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
if (inRaid())
|
if (event.getGroup().equals("Cox"))
|
||||||
{
|
{
|
||||||
if (chatMessage.getType() == ChatMessageType.GAMEMESSAGE)
|
updateConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onChatMessage(ChatMessage event)
|
||||||
|
{
|
||||||
|
if (!inRaid())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getType() == ChatMessageType.GAMEMESSAGE)
|
||||||
|
{
|
||||||
|
final Matcher tpMatcher = TP_REGEX.matcher(event.getMessage());
|
||||||
|
|
||||||
|
if (tpMatcher.matches())
|
||||||
{
|
{
|
||||||
Matcher tpMatcher = TP_REGEX.matcher(chatMessage.getMessage());
|
for (Player player : client.getPlayers())
|
||||||
if (tpMatcher.matches())
|
|
||||||
{
|
{
|
||||||
log.info("TP Matcher has found a match");
|
if (player.getName().equals(tpMatcher.group(1)))
|
||||||
for (Actor actor : client.getPlayers())
|
|
||||||
{
|
{
|
||||||
if (actor.getName().equals(tpMatcher.group(1)))
|
victims.add(new Victim(player, Victim.Type.TELEPORT));
|
||||||
{
|
|
||||||
log.info("Teleport Target Assigned");
|
|
||||||
teleportTarget = actor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (Text.standardize(chatMessage.getMessageNode().getValue()))
|
}
|
||||||
{
|
|
||||||
case "the great olm rises with the power of acid.":
|
switch (Text.standardize(event.getMessageNode().getValue()))
|
||||||
case "the great olm rises with the power of crystal.":
|
{
|
||||||
case "the great olm rises with the power of flame.":
|
case "the great olm rises with the power of acid.":
|
||||||
case "the great olm is giving its all. this is its final stand.":
|
case "the great olm rises with the power of crystal.":
|
||||||
if (!runOlm)
|
case "the great olm rises with the power of flame.":
|
||||||
{
|
case "the great olm is giving its all. this is its final stand.":
|
||||||
Olm_ActionCycle = -1;
|
if (!runOlm)
|
||||||
Olm_TicksUntilAction = 4;
|
{
|
||||||
}
|
Olm_ActionCycle = -1;
|
||||||
else
|
Olm_TicksUntilAction = 4;
|
||||||
{
|
}
|
||||||
Olm_ActionCycle = -1;
|
else
|
||||||
Olm_TicksUntilAction = 3;
|
{
|
||||||
}
|
Olm_ActionCycle = -1;
|
||||||
OlmPhase = 0;
|
Olm_TicksUntilAction = 3;
|
||||||
runOlm = true;
|
}
|
||||||
needOlm = true;
|
OlmPhase = 0;
|
||||||
crippleTimer = 45;
|
runOlm = true;
|
||||||
Olm_NextSpec = -1;
|
needOlm = true;
|
||||||
break;
|
crippleTimer = 45;
|
||||||
case "the great olm fires a sphere of aggression your way. your prayers have been sapped.":
|
Olm_NextSpec = -1;
|
||||||
prayAgainstOlm = PrayAgainst.MELEE;
|
break;
|
||||||
lastPrayTime = System.currentTimeMillis();
|
case "the great olm fires a sphere of aggression your way. your prayers have been sapped.":
|
||||||
break;
|
case "the great olm fires a sphere of aggression your way.":
|
||||||
case "the great olm fires a sphere of aggression your way.":
|
prayAgainstOlm = PrayAgainst.MELEE;
|
||||||
prayAgainstOlm = PrayAgainst.MELEE;
|
lastPrayTime = System.currentTimeMillis();
|
||||||
lastPrayTime = System.currentTimeMillis();
|
break;
|
||||||
break;
|
case "the great olm fires a sphere of magical power your way. your prayers have been sapped.":
|
||||||
case "the great olm fires a sphere of magical power your way. your prayers have been sapped.":
|
case "the great olm fires a sphere of magical power your way.":
|
||||||
prayAgainstOlm = PrayAgainst.MAGIC;
|
prayAgainstOlm = PrayAgainst.MAGIC;
|
||||||
lastPrayTime = System.currentTimeMillis();
|
lastPrayTime = System.currentTimeMillis();
|
||||||
break;
|
break;
|
||||||
case "the great olm fires a sphere of magical power your way.":
|
case "the great olm fires a sphere of accuracy and dexterity your way. your prayers have been sapped.":
|
||||||
prayAgainstOlm = PrayAgainst.MAGIC;
|
case "the great olm fires a sphere of accuracy and dexterity your way.":
|
||||||
lastPrayTime = System.currentTimeMillis();
|
prayAgainstOlm = PrayAgainst.RANGED;
|
||||||
break;
|
lastPrayTime = System.currentTimeMillis();
|
||||||
case "the great olm fires a sphere of accuracy and dexterity your way. your prayers have been sapped.":
|
break;
|
||||||
prayAgainstOlm = PrayAgainst.RANGED;
|
case "the great olm's left claw clenches to protect itself temporarily.":
|
||||||
lastPrayTime = System.currentTimeMillis();
|
handCripple = true;
|
||||||
break;
|
|
||||||
case "the great olm fires a sphere of accuracy and dexterity your way.":
|
|
||||||
prayAgainstOlm = PrayAgainst.RANGED;
|
|
||||||
lastPrayTime = System.currentTimeMillis();
|
|
||||||
break;
|
|
||||||
case "the great olm's left claw clenches to protect itself temporarily.":
|
|
||||||
HandCripple = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onProjectileMoved(ProjectileMoved event)
|
private void onProjectileSpawned(ProjectileSpawned event)
|
||||||
{
|
{
|
||||||
if (inRaid())
|
if (!inRaid())
|
||||||
{
|
{
|
||||||
Projectile projectile = event.getProjectile();
|
return;
|
||||||
if (projectile.getId() == ProjectileID.OLM_MAGE_ATTACK)
|
}
|
||||||
{
|
|
||||||
|
final Projectile projectile = event.getProjectile();
|
||||||
|
|
||||||
|
switch (projectile.getId())
|
||||||
|
{
|
||||||
|
case ProjectileID.OLM_MAGE_ATTACK:
|
||||||
prayAgainstOlm = PrayAgainst.MAGIC;
|
prayAgainstOlm = PrayAgainst.MAGIC;
|
||||||
lastPrayTime = System.currentTimeMillis();
|
lastPrayTime = System.currentTimeMillis();
|
||||||
}
|
break;
|
||||||
if (projectile.getId() == ProjectileID.OLM_RANGE_ATTACK)
|
case ProjectileID.OLM_RANGE_ATTACK:
|
||||||
{
|
|
||||||
prayAgainstOlm = PrayAgainst.RANGED;
|
prayAgainstOlm = PrayAgainst.RANGED;
|
||||||
lastPrayTime = System.currentTimeMillis();
|
lastPrayTime = System.currentTimeMillis();
|
||||||
}
|
break;
|
||||||
if (projectile.getId() == ProjectileID.OLM_ACID_TRAIL)
|
case ProjectileID.OLM_ACID_TRAIL:
|
||||||
{
|
|
||||||
acidTarget = projectile.getInteracting();
|
acidTarget = projectile.getInteracting();
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
private void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||||
{
|
{
|
||||||
if (inRaid())
|
if (!inRaid())
|
||||||
{
|
{
|
||||||
Actor actor = graphicChanged.getActor();
|
return;
|
||||||
if (actor.getSpotAnimation() == GraphicID.OLM_BURN)
|
}
|
||||||
|
|
||||||
|
if (!(event.getActor() instanceof Player))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Player player = (Player) event.getActor();
|
||||||
|
|
||||||
|
if (player.getSpotAnimation() == GraphicID.OLM_BURN)
|
||||||
|
{
|
||||||
|
int add = 0;
|
||||||
|
|
||||||
|
for (Victim victim : victims)
|
||||||
{
|
{
|
||||||
if (!burnTarget.contains(actor))
|
if (victim.getPlayer().getName().equals(player.getName()))
|
||||||
{
|
{
|
||||||
burnTarget.add(actor);
|
add++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (add == 0)
|
||||||
|
{
|
||||||
|
victims.add(new Victim(player, Victim.Type.BURN));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onNpcSpawned(NpcSpawned npcSpawned)
|
private void onNpcSpawned(NpcSpawned event)
|
||||||
{
|
{
|
||||||
if (inRaid())
|
if (inRaid())
|
||||||
{
|
{
|
||||||
NPC npc = npcSpawned.getNpc();
|
return;
|
||||||
switch (npc.getId())
|
}
|
||||||
{
|
|
||||||
case NpcID.TEKTON:
|
final NPC npc = event.getNpc();
|
||||||
case NpcID.TEKTON_7541:
|
|
||||||
case NpcID.TEKTON_7542:
|
switch (npc.getId())
|
||||||
case NpcID.TEKTON_7545:
|
{
|
||||||
case NpcID.TEKTON_ENRAGED:
|
case NpcID.TEKTON:
|
||||||
case NpcID.TEKTON_ENRAGED_7544:
|
case NpcID.TEKTON_7541:
|
||||||
npcContainer.put(npc, new NPCContainer(npc));
|
case NpcID.TEKTON_7542:
|
||||||
tektonAttackTicks = 27;
|
case NpcID.TEKTON_7545:
|
||||||
break;
|
case NpcID.TEKTON_ENRAGED:
|
||||||
case NpcID.MUTTADILE:
|
case NpcID.TEKTON_ENRAGED_7544:
|
||||||
case NpcID.MUTTADILE_7562:
|
npcContainer.put(npc, new NPCContainer(npc));
|
||||||
case NpcID.MUTTADILE_7563:
|
tektonAttackTicks = 27;
|
||||||
case NpcID.GUARDIAN:
|
break;
|
||||||
case NpcID.GUARDIAN_7570:
|
case NpcID.MUTTADILE:
|
||||||
npcContainer.put(npc, new NPCContainer(npc));
|
case NpcID.MUTTADILE_7562:
|
||||||
break;
|
case NpcID.MUTTADILE_7563:
|
||||||
case NpcID.VANGUARD:
|
case NpcID.GUARDIAN:
|
||||||
case NpcID.VANGUARD_7526:
|
case NpcID.GUARDIAN_7570:
|
||||||
case NpcID.VANGUARD_7527:
|
npcContainer.put(npc, new NPCContainer(npc));
|
||||||
case NpcID.VANGUARD_7528:
|
break;
|
||||||
case NpcID.VANGUARD_7529:
|
case NpcID.VANGUARD:
|
||||||
vanguards++;
|
case NpcID.VANGUARD_7526:
|
||||||
npcContainer.put(npc, new NPCContainer(npc));
|
case NpcID.VANGUARD_7527:
|
||||||
break;
|
case NpcID.VANGUARD_7528:
|
||||||
case NpcID.GREAT_OLM_LEFT_CLAW:
|
case NpcID.VANGUARD_7529:
|
||||||
case NpcID.GREAT_OLM_LEFT_CLAW_7555:
|
vanguards++;
|
||||||
hand = npc;
|
npcContainer.put(npc, new NPCContainer(npc));
|
||||||
break;
|
break;
|
||||||
}
|
case NpcID.GREAT_OLM_LEFT_CLAW:
|
||||||
|
case NpcID.GREAT_OLM_LEFT_CLAW_7555:
|
||||||
|
hand = npc;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onNpcDespawned(NpcDespawned event)
|
private void onNpcDespawned(NpcDespawned event)
|
||||||
{
|
{
|
||||||
if (inRaid())
|
if (!inRaid())
|
||||||
{
|
{
|
||||||
NPC npc = event.getNpc();
|
return;
|
||||||
switch (npc.getId())
|
}
|
||||||
{
|
|
||||||
case NpcID.TEKTON:
|
final NPC npc = event.getNpc();
|
||||||
case NpcID.TEKTON_7541:
|
|
||||||
case NpcID.TEKTON_7542:
|
switch (npc.getId())
|
||||||
case NpcID.TEKTON_7545:
|
{
|
||||||
case NpcID.TEKTON_ENRAGED:
|
case NpcID.TEKTON:
|
||||||
case NpcID.TEKTON_ENRAGED_7544:
|
case NpcID.TEKTON_7541:
|
||||||
case NpcID.MUTTADILE:
|
case NpcID.TEKTON_7542:
|
||||||
case NpcID.MUTTADILE_7562:
|
case NpcID.TEKTON_7545:
|
||||||
case NpcID.MUTTADILE_7563:
|
case NpcID.TEKTON_ENRAGED:
|
||||||
case NpcID.GUARDIAN:
|
case NpcID.TEKTON_ENRAGED_7544:
|
||||||
case NpcID.GUARDIAN_7570:
|
case NpcID.MUTTADILE:
|
||||||
case NpcID.GUARDIAN_7571:
|
case NpcID.MUTTADILE_7562:
|
||||||
case NpcID.GUARDIAN_7572:
|
case NpcID.MUTTADILE_7563:
|
||||||
if (npcContainer.remove(event.getNpc()) != null && !npcContainer.isEmpty())
|
case NpcID.GUARDIAN:
|
||||||
{
|
case NpcID.GUARDIAN_7570:
|
||||||
npcContainer.remove(event.getNpc());
|
case NpcID.GUARDIAN_7571:
|
||||||
}
|
case NpcID.GUARDIAN_7572:
|
||||||
break;
|
if (npcContainer.remove(event.getNpc()) != null && !npcContainer.isEmpty())
|
||||||
case NpcID.VANGUARD:
|
{
|
||||||
case NpcID.VANGUARD_7526:
|
npcContainer.remove(event.getNpc());
|
||||||
case NpcID.VANGUARD_7527:
|
}
|
||||||
case NpcID.VANGUARD_7528:
|
break;
|
||||||
case NpcID.VANGUARD_7529:
|
case NpcID.VANGUARD:
|
||||||
if (npcContainer.remove(event.getNpc()) != null && !npcContainer.isEmpty())
|
case NpcID.VANGUARD_7526:
|
||||||
{
|
case NpcID.VANGUARD_7527:
|
||||||
npcContainer.remove(event.getNpc());
|
case NpcID.VANGUARD_7528:
|
||||||
}
|
case NpcID.VANGUARD_7529:
|
||||||
vanguards--;
|
if (npcContainer.remove(event.getNpc()) != null && !npcContainer.isEmpty())
|
||||||
break;
|
{
|
||||||
case NpcID.GREAT_OLM_RIGHT_CLAW_7553:
|
npcContainer.remove(event.getNpc());
|
||||||
case NpcID.GREAT_OLM_RIGHT_CLAW:
|
}
|
||||||
HandCripple = false;
|
vanguards--;
|
||||||
break;
|
break;
|
||||||
}
|
case NpcID.GREAT_OLM_RIGHT_CLAW_7553:
|
||||||
|
case NpcID.GREAT_OLM_RIGHT_CLAW:
|
||||||
|
handCripple = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,7 +428,7 @@ public class CoxPlugin extends Plugin
|
|||||||
sleepcount = 0;
|
sleepcount = 0;
|
||||||
Olm_Heal.clear();
|
Olm_Heal.clear();
|
||||||
npcContainer.clear();
|
npcContainer.clear();
|
||||||
burnTarget.clear();
|
victims.clear();
|
||||||
Olm_NPC = null;
|
Olm_NPC = null;
|
||||||
hand = null;
|
hand = null;
|
||||||
prayAgainstOlm = null;
|
prayAgainstOlm = null;
|
||||||
@@ -457,7 +436,8 @@ public class CoxPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
npcHandler();
|
handleNpcs();
|
||||||
|
handleVictims();
|
||||||
|
|
||||||
if (needOlm = true)
|
if (needOlm = true)
|
||||||
{
|
{
|
||||||
@@ -472,57 +452,32 @@ public class CoxPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (teleportTarget != null)
|
if (handCripple)
|
||||||
{
|
|
||||||
log.info(teleportTarget.getName());
|
|
||||||
Player target = (Player) teleportTarget;
|
|
||||||
client.setHintArrow(target);
|
|
||||||
teleportTicks--;
|
|
||||||
if (teleportTicks <= 0)
|
|
||||||
{
|
|
||||||
client.clearHintArrow();
|
|
||||||
teleportTarget = null;
|
|
||||||
teleportTicks = 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (acidTarget != null)
|
|
||||||
{
|
|
||||||
acidTicks--;
|
|
||||||
if (acidTicks <= 0)
|
|
||||||
{
|
|
||||||
acidTarget = null;
|
|
||||||
acidTicks = 25;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (burnTarget.size() > 0)
|
|
||||||
{
|
|
||||||
burnTicks--;
|
|
||||||
if (burnTicks <= 0)
|
|
||||||
{
|
|
||||||
burnTarget.clear();
|
|
||||||
burnTicks = 41;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HandCripple)
|
|
||||||
{
|
{
|
||||||
crippleTimer--;
|
crippleTimer--;
|
||||||
if (crippleTimer <= 0)
|
if (crippleTimer <= 0)
|
||||||
{
|
{
|
||||||
HandCripple = false;
|
handCripple = false;
|
||||||
crippleTimer = 45;
|
crippleTimer = 45;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runOlm)
|
if (runOlm)
|
||||||
{
|
{
|
||||||
olmHandler();
|
handleOlm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void npcHandler()
|
private void handleVictims()
|
||||||
|
{
|
||||||
|
if (victims.size() > 0)
|
||||||
|
{
|
||||||
|
victims.forEach(Victim::updateTicks);
|
||||||
|
victims.removeIf(victim -> victim.getTicks() <= 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleNpcs()
|
||||||
{
|
{
|
||||||
for (NPCContainer npcs : getNpcContainer().values())
|
for (NPCContainer npcs : getNpcContainer().values())
|
||||||
{
|
{
|
||||||
@@ -605,7 +560,7 @@ public class CoxPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void olmHandler()
|
private void handleOlm()
|
||||||
{
|
{
|
||||||
Olm_Crystals.clear();
|
Olm_Crystals.clear();
|
||||||
Olm_Heal.clear();
|
Olm_Heal.clear();
|
||||||
@@ -706,14 +661,6 @@ public class CoxPlugin extends Plugin
|
|||||||
return client.getVar(Varbits.IN_RAID) == 1;
|
return client.getVar(Varbits.IN_RAID) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onConfigChanged(ConfigChanged configChanged)
|
|
||||||
{
|
|
||||||
if (configChanged.getGroup().equals("Cox"))
|
|
||||||
{
|
|
||||||
updateConfig();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateConfig()
|
private void updateConfig()
|
||||||
{
|
{
|
||||||
this.muttadile = config.muttadile();
|
this.muttadile = config.muttadile();
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package net.runelite.client.plugins.coxhelper;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import net.runelite.api.Player;
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
class Victim
|
||||||
|
{
|
||||||
|
private Player player;
|
||||||
|
private Type type;
|
||||||
|
private int ticks;
|
||||||
|
|
||||||
|
Victim(Player player, Type type)
|
||||||
|
{
|
||||||
|
this.player = player;
|
||||||
|
this.type = type;
|
||||||
|
this.ticks = type.getTicks();
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateTicks()
|
||||||
|
{
|
||||||
|
if (ticks > 0)
|
||||||
|
{
|
||||||
|
ticks--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
BURN(41),
|
||||||
|
ACID(23),
|
||||||
|
TELEPORT(10);
|
||||||
|
|
||||||
|
private int ticks;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user