Java Code Examples for net.runelite.api.events.NpcSpawned#getNpc()

The following examples show how to use net.runelite.api.events.NpcSpawned#getNpc() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CorpPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();

	switch (npc.getId())
	{
		case NpcID.CORPOREAL_BEAST:
			log.debug("Corporeal beast spawn: {}", npc);
			corp = npc;
			yourDamage = 0;
			totalDamage = 0;
			players.clear();
			break;
		case NpcID.DARK_ENERGY_CORE:
			core = npc;
			break;
	}
}
 
Example 2
Source File: ImplingsPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();
	Impling impling = Impling.findImpling(npc.getId());

	if (impling != null)
	{
		if (showImplingType(impling.getImplingType()) == ImplingsConfig.ImplingMode.NOTIFY)
		{
			notifier.notify(impling.getImplingType().getName() + " impling is in the area");
		}

		implings.add(npc);
	}
}
 
Example 3
Source File: NpcStatusPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned npcSpawned)
{
	final NPC npc = npcSpawned.getNpc();
	final String npcName = npc.getName();

	if (npcName == null || !Arrays.asList(npc.getDefinition().getActions()).contains("Attack"))
	{
		return;
	}
	int AttackSpeed = npcManager.getAttackSpeed(npc.getId());
	if (AttackSpeed == 0)
	{
		AttackSpeed = 4;
	}
	memorizedNPCs.add(new MemorizedNPC(npc, AttackSpeed, npc.getWorldArea()));
}
 
Example 4
Source File: CorpPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();

	switch (npc.getId())
	{
		case NpcID.CORPOREAL_BEAST:
			log.debug("Corporeal beast spawn: {}", npc);
			corp = npc;
			yourDamage = 0;
			totalDamage = 0;
			players.clear();
			break;
		case NpcID.DARK_ENERGY_CORE:
			core = npc;
			break;
	}
}
 
Example 5
Source File: ImplingsPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();
	Impling impling = Impling.findImpling(npc.getId());

	if (impling != null)
	{
		if (showImplingType(impling.getImplingType()) == ImplingsConfig.ImplingMode.NOTIFY)
		{
			notifier.notify(impling.getImplingType().getName() + " impling is in the area");
		}

		implings.add(npc);
	}
}
 
Example 6
Source File: RunecraftPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned event)
{
	final NPC npc = event.getNpc();

	if (npc.getId() == NpcID.DARK_MAGE)
	{
		darkMage = npc;
	}
}
 
Example 7
Source File: PestControlPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned event)
{
	final NPC npc = event.getNpc();
	if (SPINNER_IDS.contains(npc.getId()))
	{
		spinners.add(npc);
	}
}
 
Example 8
Source File: SlayerPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();
	if (isTarget(npc))
	{
		highlightedTargets.add(npc);
	}
}
 
Example 9
Source File: DriftNetPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned event)
{
	final NPC npc = event.getNpc();
	if (npc.getId() == NpcID.FISH_SHOAL)
	{
		fish.add(npc);
	}
}
 
Example 10
Source File: BasicBossSwapper.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned event)
{
	final NPC npc = event.getNpc();

	switch (npc.getId())
	{
		case NpcID.NYLOCAS_VASILIAS:
		case NpcID.NYLOCAS_VASILIAS_8355:
		case NpcID.NYLOCAS_VASILIAS_8356:
		case NpcID.NYLOCAS_VASILIAS_8357:
			nylo = npc;
			break;
	}
}
 
Example 11
Source File: AgilityPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();

	if (SEPULCHRE_NPCS.contains(npc.getId()))
	{
		npcs.add(npc);
	}
}
 
Example 12
Source File: AgilityPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();

	if (SEPULCHRE_NPCS.contains(npc.getId()))
	{
		npcs.add(npc);
	}
}
 
Example 13
Source File: TelekineticRoom.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned event)
{
	NPC npc = event.getNpc();

	if (npc.getId() == NpcID.MAZE_GUARDIAN)
	{
		guardian = npc;
	}
}
 
Example 14
Source File: TelekineticRoom.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
private void onNpcSpawned(NpcSpawned event)
{
	NPC npc = event.getNpc();

	if (npc.getId() == NpcID.MAZE_GUARDIAN)
	{
		guardian = npc;
	}
}
 
Example 15
Source File: SpawnTimerPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned n)
{
	if (n.getNpc() != null)
	{
		final NPC npc = n.getNpc();
		highlightedNpcs.add(npc);
		thing temp = new thing();
		temp.setNpc(npc);
		temp.setTick(currentTick);
		ticks.add(temp);
	}
}
 
Example 16
Source File: ZalcanoPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned npcSpawned)
{
	switch (npcSpawned.getNpc().getId())
	{
		case NpcID.ZALCANO:
			log.debug("zalcano spawned");
			zalcano = npcSpawned.getNpc();
			break;
		case NpcID.GOLEM_9051:
			log.debug("golem spawned");
			golem = npcSpawned.getNpc();
			break;
	}
}
 
Example 17
Source File: RunecraftPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned event)
{
	final NPC npc = event.getNpc();
	if (npc.getId() == NpcID.DARK_MAGE)
	{
		darkMage = npc;
	}
}
 
Example 18
Source File: SlayerPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
private void onNpcSpawned(NpcSpawned npcSpawned)
{
	NPC npc = npcSpawned.getNpc();
	if (isTarget(npc, targetNames))
	{
		highlightedTargets.add(npc);
	}
}
 
Example 19
Source File: FishingPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcSpawned(NpcSpawned event)
{
	final NPC npc = event.getNpc();

	if (FishingSpot.findSpot(npc.getId()) == null)
	{
		return;
	}

	fishingSpots.add(npc);
	inverseSortSpotDistanceFromPlayer();
}
 
Example 20
Source File: ClueScrollPlugin.java    From plugins with GNU General Public License v3.0 4 votes vote down vote up
@Subscribe
public void onNpcSpawned(final NpcSpawned event)
{
	final NPC npc = event.getNpc();
	checkClueNPCs(clue, npc);
}