corp plugin: add dark core attack deprioritization
This commit is contained in:
@@ -33,6 +33,17 @@ public interface CorpConfig extends Config
|
|||||||
{
|
{
|
||||||
String GROUP = "corp";
|
String GROUP = "corp";
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "leftClickCore",
|
||||||
|
name = "Left click walk on core",
|
||||||
|
description = "Prioritizes Walk here over Attack on the Dark energy core",
|
||||||
|
position = 1
|
||||||
|
)
|
||||||
|
default boolean leftClickCore()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showDamage",
|
keyName = "showDamage",
|
||||||
name = "Show damage overlay",
|
name = "Show damage overlay",
|
||||||
|
|||||||
@@ -37,12 +37,15 @@ import net.runelite.api.Actor;
|
|||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
|
import net.runelite.api.MenuAction;
|
||||||
|
import net.runelite.api.MenuEntry;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.NpcID;
|
import net.runelite.api.NpcID;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.HitsplatApplied;
|
import net.runelite.api.events.HitsplatApplied;
|
||||||
import net.runelite.api.events.InteractingChanged;
|
import net.runelite.api.events.InteractingChanged;
|
||||||
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
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.VarbitChanged;
|
import net.runelite.api.events.VarbitChanged;
|
||||||
@@ -66,6 +69,9 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class CorpPlugin extends Plugin
|
public class CorpPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
private static final String ATTACK = "Attack";
|
||||||
|
private static final String DARK_ENERGY_CORE = "Dark energy core";
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private NPC corp;
|
private NPC corp;
|
||||||
|
|
||||||
@@ -243,4 +249,24 @@ public class CorpPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
||||||
|
{
|
||||||
|
final MenuEntry menuEntry = menuEntryAdded.getMenuEntry();
|
||||||
|
final NPC npc = menuEntry.getNpc();
|
||||||
|
if (npc == null || !DARK_ENERGY_CORE.equals(npc.getName()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menuEntry.getType() != MenuAction.NPC_SECOND_OPTION
|
||||||
|
|| !menuEntry.getOption().equals(ATTACK)
|
||||||
|
|| !config.leftClickCore())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
menuEntry.setDeprioritized(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user