Maiden Handler now utilizes npc definition changed for nylos.
This commit is contained in:
@@ -23,6 +23,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GroundObjectSpawned;
|
||||
import net.runelite.api.events.NpcDefinitionChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
@@ -154,6 +155,15 @@ public class TheatrePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDefinitionChanged(NpcDefinitionChanged event)
|
||||
{
|
||||
if (maidenHandler != null)
|
||||
{
|
||||
maidenHandler.onNpcDefinitionChanged(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.runelite.api.GraphicsObject;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.NpcDefinitionChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
@@ -59,7 +60,7 @@ public class MaidenHandler extends RoomHandler
|
||||
private List<WorldPoint> bloodSpawnLocation = new ArrayList<>();
|
||||
private List<WorldPoint> bloodSpawnTarget = new ArrayList<>();
|
||||
private NPC maiden;
|
||||
private String nyloCall = "n1";
|
||||
private String nyloCall;
|
||||
private Set<Nylos> nylos = new HashSet<>();
|
||||
private List<NPC> healers = new ArrayList<>();
|
||||
private int healerCount = 0;
|
||||
@@ -101,6 +102,7 @@ public class MaidenHandler extends RoomHandler
|
||||
this.bloodSpawnLocation.clear();
|
||||
this.bloodSpawnTarget.clear();
|
||||
this.healers.clear();
|
||||
this.nylos.clear();
|
||||
this.healerCount = 0;
|
||||
this.startTime = -1;
|
||||
this.wave = 1;
|
||||
@@ -117,6 +119,11 @@ public class MaidenHandler extends RoomHandler
|
||||
|
||||
final String location = nylo.getSpawnLocation().getName();
|
||||
|
||||
if (nyloCall == null || nyloCall.equals(""))
|
||||
{
|
||||
nyloCall = "n1";
|
||||
}
|
||||
|
||||
if (location.equals(nyloCall))
|
||||
{
|
||||
Color color = Color.WHITE;
|
||||
@@ -233,6 +240,19 @@ public class MaidenHandler extends RoomHandler
|
||||
}
|
||||
}
|
||||
|
||||
public void onNpcDefinitionChanged(NpcDefinitionChanged event)
|
||||
{
|
||||
NPC npc = event.getNpc();
|
||||
|
||||
if (npc.getName() != null && npc.getName().equals("Nylocas Matomenos"))
|
||||
{
|
||||
if (npc.getId() == -1)
|
||||
{
|
||||
nylos.removeIf(c -> c.getNpc() == npc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getSender() != null && !event.getSender().equals(client.getLocalPlayer().getName()))
|
||||
@@ -249,6 +269,7 @@ public class MaidenHandler extends RoomHandler
|
||||
case "s1":
|
||||
case "s2":
|
||||
nyloCall = msg;
|
||||
log.debug("Nylo Call Assigned: " + msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -280,14 +301,6 @@ public class MaidenHandler extends RoomHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nylos.isEmpty())
|
||||
{
|
||||
for (Nylos nylo : nylos)
|
||||
{
|
||||
nylos.removeIf(c -> c.getNpc().getId() == -1);
|
||||
}
|
||||
}
|
||||
|
||||
bloodThrows.clear();
|
||||
|
||||
for (GraphicsObject o : client.getGraphicsObjects())
|
||||
|
||||
Reference in New Issue
Block a user