Fix-up Vanguards in Cox Helper

This commit is contained in:
Ganom
2019-06-21 17:54:35 -04:00
parent 311f924dd2
commit 619d4907e6
2 changed files with 24 additions and 17 deletions

View File

@@ -103,7 +103,7 @@ public class CoxInfoBox extends Overlay
plugin.setPrayAgainstOlm(null); plugin.setPrayAgainstOlm(null);
} }
if (config.vangHealth() && plugin.isRunVanguard()) if (config.vangHealth() && plugin.getVanguards() > 0)
{ {
panelComponent.getChildren().add(TitleComponent.builder() panelComponent.getChildren().add(TitleComponent.builder()
.text("Vanguards") .text("Vanguards")

View File

@@ -108,7 +108,7 @@ public class CoxPlugin extends Plugin
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private boolean runOlm; private boolean runOlm;
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private boolean runVanguard; private int vanguards;
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private boolean tektonActive; private boolean tektonActive;
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
@@ -165,13 +165,6 @@ public class CoxPlugin extends Plugin
{ {
overlayManager.add(coxOverlay); overlayManager.add(coxOverlay);
overlayManager.add(coxInfoBox); overlayManager.add(coxInfoBox);
}
@Override
protected void shutDown()
{
overlayManager.remove(coxOverlay);
overlayManager.remove(coxInfoBox);
HandCripple = false; HandCripple = false;
hand = null; hand = null;
acidTarget = null; acidTarget = null;
@@ -183,6 +176,14 @@ public class CoxPlugin extends Plugin
burnTicks = 40; burnTicks = 40;
acidTicks = 25; acidTicks = 25;
teleportTicks = 10; teleportTicks = 10;
vanguards = 0;
}
@Override
protected void shutDown()
{
overlayManager.remove(coxOverlay);
overlayManager.remove(coxInfoBox);
} }
@Subscribe @Subscribe
@@ -316,7 +317,7 @@ public class CoxPlugin extends Plugin
case NpcID.VANGUARD_7527: case NpcID.VANGUARD_7527:
case NpcID.VANGUARD_7528: case NpcID.VANGUARD_7528:
case NpcID.VANGUARD_7529: case NpcID.VANGUARD_7529:
runVanguard = true; vanguards++;
npcContainer.put(npc, new NPCContainer(npc)); npcContainer.put(npc, new NPCContainer(npc));
break; break;
case NpcID.GREAT_OLM_LEFT_CLAW: case NpcID.GREAT_OLM_LEFT_CLAW:
@@ -362,7 +363,7 @@ public class CoxPlugin extends Plugin
{ {
npcContainer.remove(event.getNpc()); npcContainer.remove(event.getNpc());
} }
runVanguard = false; vanguards--;
break; break;
case NpcID.GREAT_OLM_RIGHT_CLAW_7553: case NpcID.GREAT_OLM_RIGHT_CLAW_7553:
case NpcID.GREAT_OLM_RIGHT_CLAW: case NpcID.GREAT_OLM_RIGHT_CLAW:
@@ -513,16 +514,22 @@ public class CoxPlugin extends Plugin
} }
break; break;
case NpcID.VANGUARD_7529: case NpcID.VANGUARD_7529:
npcs.setAttackStyle(NPCContainer.Attackstyle.MAGE); if (npcs.getAttackStyle() == NPCContainer.Attackstyle.UNKNOWN)
{
npcs.setAttackStyle(NPCContainer.Attackstyle.MAGE);
}
break; break;
case NpcID.VANGUARD_7528: case NpcID.VANGUARD_7528:
npcs.setAttackStyle(NPCContainer.Attackstyle.RANGE); if (npcs.getAttackStyle() == NPCContainer.Attackstyle.UNKNOWN)
{
npcs.setAttackStyle(NPCContainer.Attackstyle.RANGE);
}
break; break;
case NpcID.VANGUARD_7527: case NpcID.VANGUARD_7527:
npcs.setAttackStyle(NPCContainer.Attackstyle.MELEE); if (npcs.getAttackStyle() == NPCContainer.Attackstyle.UNKNOWN)
break; {
case NpcID.VANGUARD_7526: npcs.setAttackStyle(NPCContainer.Attackstyle.MELEE);
npcs.setAttackStyle(NPCContainer.Attackstyle.UNKNOWN); }
break; break;
} }
} }