net.runelite.api.NpcID Java Examples

The following examples show how to use net.runelite.api.NpcID. 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: DriftNetPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Subscribe
public void onChatMessage(ChatMessage event)
{
	if (!inDriftNetArea)
	{
		return;
	}

	if (event.getType() == ChatMessageType.SPAM && event.getMessage().equals(CHAT_PRODDING_FISH))
	{
		Actor target = client.getLocalPlayer().getInteracting();

		if (target instanceof NPC && ((NPC) target).getId() == NpcID.FISH_SHOAL)
		{
			tagFish(target);
		}
		else
		{
			// If the fish is on an adjacent tile, the interaction change happens after
			// the chat message is sent, so we arm it
			armInteraction = true;
		}
	}
}
 
Example #2
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 #3
Source File: TimersPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Subscribe
private void onNpcDespawned(NpcDespawned npcDespawned)
{
	NPC npc = npcDespawned.getNpc();

	if (!npc.isDead())
	{
		return;
	}

	int npcId = npc.getId();

	if (npcId == NpcID.ZOMBIFIED_SPAWN || npcId == NpcID.ZOMBIFIED_SPAWN_8063)
	{
		removeGameTimer(ICEBARRAGE);
	}
}
 
Example #4
Source File: TimersPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Subscribe
public void onNpcDespawned(NpcDespawned npcDespawned)
{
	NPC npc = npcDespawned.getNpc();

	if (!npc.isDead())
	{
		return;
	}

	int npcId = npc.getId();

	if (npcId == NpcID.ZOMBIFIED_SPAWN || npcId == NpcID.ZOMBIFIED_SPAWN_8063)
	{
		removeGameTimer(ICEBARRAGE);
	}
}
 
Example #5
Source File: DriftNetPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Subscribe
public void onChatMessage(ChatMessage event)
{
	if (!inDriftNetArea)
	{
		return;
	}

	if (event.getType() == ChatMessageType.SPAM && event.getMessage().equals(CHAT_PRODDING_FISH))
	{
		Actor target = client.getLocalPlayer().getInteracting();

		if (target instanceof NPC && ((NPC) target).getId() == NpcID.FISH_SHOAL)
		{
			tagFish(target);
		}
		else
		{
			// If the fish is on an adjacent tile, the interaction change happens after
			// the chat message is sent, so we arm it
			armInteraction = true;
		}
	}
}
 
Example #6
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 #7
Source File: RandomEventPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private boolean shouldNotify(int id)
{
	if (config.notifyAllEvents())
	{
		return true;
	}

	switch (id)
	{
		case NpcID.SERGEANT_DAMIEN_6743:
			return config.notifyDemon();
		case NpcID.FREAKY_FORESTER_6748:
			return config.notifyForester();
		case NpcID.FROG_5429:
			return config.notifyFrog();
		case NpcID.GENIE:
		case NpcID.GENIE_327:
			return config.notifyGenie();
		case NpcID.EVIL_BOB:
		case NpcID.EVIL_BOB_6754:
			return config.notifyBob();
		case NpcID.LEO_6746:
			return config.notifyGravedigger();
		case NpcID.MYSTERIOUS_OLD_MAN_6750:
		case NpcID.MYSTERIOUS_OLD_MAN_6751:
		case NpcID.MYSTERIOUS_OLD_MAN_6752:
		case NpcID.MYSTERIOUS_OLD_MAN_6753:
			return config.notifyMoM();
		case NpcID.QUIZ_MASTER_6755:
			return config.notifyQuiz();
		case NpcID.DUNCE_6749:
			return config.notifyDunce();
		default:
			return false;
	}
}
 
Example #8
Source File: DriftNetPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
public void onInteractingChanged(InteractingChanged event)
{
	if (armInteraction
		&& event.getSource() == client.getLocalPlayer()
		&& event.getTarget() instanceof NPC
		&& ((NPC) event.getTarget()).getId() == NpcID.FISH_SHOAL)
	{
		tagFish(event.getTarget());
		armInteraction = false;
	}
}
 
Example #9
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 #10
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 #11
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 #12
Source File: DriftNetPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onInteractingChanged(InteractingChanged event)
{
	if (armInteraction
		&& event.getSource() == client.getLocalPlayer()
		&& event.getTarget() instanceof NPC
		&& ((NPC) event.getTarget()).getId() == NpcID.FISH_SHOAL)
	{
		tagFish(event.getTarget());
		armInteraction = false;
	}
}
 
Example #13
Source File: LootManager.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onNpcChanged(NpcChanged npcChanged)
{
	final NPC npc = npcChanged.getNpc();
	if (npc.getId() == NpcID.THE_NIGHTMARE_9433)
	{
		delayedLootNpc = npc;
		delayedLootTickLimit = 15;
	}
}
 
Example #14
Source File: LootManager.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onAnimationChanged(AnimationChanged e)
{
	if (!(e.getActor() instanceof NPC))
	{
		return;
	}

	final NPC npc = (NPC) e.getActor();
	int id = npc.getId();

	// We only care about certain NPCs
	final Integer deathAnim = NPC_DEATH_ANIMATIONS.get(id);

	// Current animation is death animation?
	if (deathAnim != null && deathAnim == npc.getAnimation())
	{
		if (id == NpcID.CAVE_KRAKEN)
		{
			// Big Kraken drops loot wherever player is standing when animation starts.
			krakenPlayerLocation = client.getLocalPlayer().getWorldLocation();
		}
		else
		{
			// These NPCs drop loot on death animation, which is right now.
			processNpcLoot(npc);
		}
	}
}
 
Example #15
Source File: BasicBossSwapper.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
public void onNpcDespawned(NpcDespawned event)
{
	final NPC npc = event.getNpc();

	if (npc.getId() == NpcID.NYLOCAS_VASILIAS)
	{
		nylo = null;
	}
}
 
Example #16
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 #17
Source File: MotherlodePlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
private void onOverheadTextChanged(OverheadTextChanged event)
{
	if (!config.payDirtMsg() || Strings.isNullOrEmpty(event.getOverheadText()) || !(event.getActor() instanceof NPC))
	{
		return;
	}

	switch (((NPC) event.getActor()).getId())
	{
		case NpcID.MINER_5606:
		case NpcID.MINER_5813:
		case NpcID.MINER_5814:
		case NpcID.MINER_6565:
		case NpcID.MINER_6567:
		case NpcID.MINER_6568:
		case NpcID.MINER_6569:
		case NpcID.MINER_6570:
		case NpcID.MINER_6571:
		case NpcID.MINER_6572:
		case NpcID.MINER_6645:
			break;
		default:
			return;
	}

	if ("pay-dirt!".equals(Text.standardize(event.getOverheadText())))
	{
		client.runScript(ScriptID.PUBLICMSG, "Pay-dirt!");
	}
}
 
Example #18
Source File: RandomEventPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
private boolean shouldNotify(int id)
{
	if (config.notifyAllEvents())
	{
		return true;
	}

	switch (id)
	{
		case NpcID.SERGEANT_DAMIEN_6743:
			return config.notifyDemon();
		case NpcID.FREAKY_FORESTER_6748:
			return config.notifyForester();
		case NpcID.FROG_5429:
			return config.notifyFrog();
		case NpcID.GENIE:
		case NpcID.GENIE_327:
			return config.notifyGenie();
		case NpcID.EVIL_BOB:
		case NpcID.EVIL_BOB_6754:
			return config.notifyBob();
		case NpcID.LEO_6746:
			return config.notifyGravedigger();
		case NpcID.MYSTERIOUS_OLD_MAN_6750:
		case NpcID.MYSTERIOUS_OLD_MAN_6751:
		case NpcID.MYSTERIOUS_OLD_MAN_6752:
		case NpcID.MYSTERIOUS_OLD_MAN_6753:
			return config.notifyMoM();
		case NpcID.QUIZ_MASTER_6755:
			return config.notifyQuiz();
		case NpcID.DUNCE_6749:
			return config.notifyDunce();
		case NpcID.DR_JEKYLL:
		case NpcID.DR_JEKYLL_314:
			return config.notifyDrJekyll();
		default:
			return false;
	}
}
 
Example #19
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 #20
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 #21
Source File: ZalcanoPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
private void onNpcDespawned(NpcDespawned npcDespawned)
{
	switch (npcDespawned.getNpc().getId())
	{
		case NpcID.ZALCANO:
			zalcano = null;
			break;
		case NpcID.GOLEM_9051:
			golem = null;
			break;
	}
}
 
Example #22
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 #23
Source File: ZalcanoUtil.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
void manuallyFindZalcano()
{
	for (NPC npc : client.getNpcs())
	{
		if (npc != null)
		{
			if (npc.getId() == NpcID.ZALCANO)
			{
				plugin.setZalcano(npc);
			}
		}
	}
}
 
Example #24
Source File: DriftNetPlugin.java    From plugins with GNU General Public License v3.0 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 #25
Source File: LootManager.java    From runelite with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Subscribe
public void onNpcDespawned(NpcDespawned npcDespawned)
{
	final NPC npc = npcDespawned.getNpc();

	if (npc == delayedLootNpc)
	{
		delayedLootNpc = null;
		delayedLootTickLimit = 0;
	}

	if (!npc.isDead())
	{
		int id = npc.getId();
		switch (id)
		{
			case NpcID.GARGOYLE:
			case NpcID.GARGOYLE_413:
			case NpcID.GARGOYLE_1543:
			case NpcID.MARBLE_GARGOYLE:
			case NpcID.MARBLE_GARGOYLE_7408:
			case NpcID.DUSK_7888:
			case NpcID.DUSK_7889:

			case NpcID.ROCKSLUG:
			case NpcID.ROCKSLUG_422:
			case NpcID.GIANT_ROCKSLUG:

			case NpcID.SMALL_LIZARD:
			case NpcID.SMALL_LIZARD_463:
			case NpcID.DESERT_LIZARD:
			case NpcID.DESERT_LIZARD_460:
			case NpcID.DESERT_LIZARD_461:
			case NpcID.LIZARD:

			case NpcID.ZYGOMITE:
			case NpcID.ZYGOMITE_1024:
			case NpcID.ANCIENT_ZYGOMITE:

				// these monsters die with >0 hp, so we just look for coincident
				// item spawn with despawn
				break;
			default:
				return;
		}
	}

	processNpcLoot(npc);
}
 
Example #26
Source File: LootManager.java    From runelite with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private WorldPoint getDropLocation(NPC npc, WorldPoint worldLocation)
{
	switch (npc.getId())
	{
		case NpcID.KRAKEN:
		case NpcID.KRAKEN_6640:
		case NpcID.KRAKEN_6656:
			worldLocation = playerLocationLastTick;
			break;
		case NpcID.CAVE_KRAKEN:
			worldLocation = krakenPlayerLocation;
			break;
		case NpcID.ZULRAH:      // Green
		case NpcID.ZULRAH_2043: // Red
		case NpcID.ZULRAH_2044: // Blue
			for (Map.Entry<Integer, ItemStack> entry : itemSpawns.entries())
			{
				if (entry.getValue().getId() == ItemID.ZULRAHS_SCALES)
				{
					int packed = entry.getKey();
					int unpackedX = packed >> 8;
					int unpackedY = packed & 0xFF;
					worldLocation = WorldPoint.fromScene(client, unpackedX, unpackedY, worldLocation.getPlane());
					break;
				}
			}
			break;
		case NpcID.VORKATH:
		case NpcID.VORKATH_8058:
		case NpcID.VORKATH_8059:
		case NpcID.VORKATH_8060:
		case NpcID.VORKATH_8061:
			int x = worldLocation.getX() + 3;
			int y = worldLocation.getY() + 3;
			if (playerLocationLastTick.getX() < x)
			{
				x -= 4;
			}
			else if (playerLocationLastTick.getX() > x)
			{
				x += 4;
			}
			if (playerLocationLastTick.getY() < y)
			{
				y -= 4;
			}
			else if (playerLocationLastTick.getY() > y)
			{
				y += 4;
			}
			worldLocation = new WorldPoint(x, y, worldLocation.getPlane());
			break;
	}

	return worldLocation;
}
 
Example #27
Source File: KourendLibraryPlugin.java    From runelite with BSD 2-Clause "Simplified" License 4 votes vote down vote up
static boolean isLibraryCustomer(int npcId)
{
	return npcId == NpcID.VILLIA || npcId == NpcID.PROFESSOR_GRACKLEBONE || npcId == NpcID.SAM_7049;
}
 
Example #28
Source File: TimersPlugin.java    From runelite with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Subscribe
public void onAnimationChanged(AnimationChanged event)
{
	Actor actor = event.getActor();

	if (config.showAbyssalSireStun()
		&& actor instanceof NPC)
	{
		int npcId = ((NPC)actor).getId();

		switch (npcId)
		{
			// Show the countdown when the Sire enters the stunned state.
			case NpcID.ABYSSAL_SIRE_5887:
				createGameTimer(ABYSSAL_SIRE_STUN);
				break;

			// Hide the countdown if the Sire isn't in the stunned state.
			// This is necessary because the Sire leaves the stunned
			// state early once all all four respiratory systems are killed.
			case NpcID.ABYSSAL_SIRE:
			case NpcID.ABYSSAL_SIRE_5888:
			case NpcID.ABYSSAL_SIRE_5889:
			case NpcID.ABYSSAL_SIRE_5890:
			case NpcID.ABYSSAL_SIRE_5891:
			case NpcID.ABYSSAL_SIRE_5908:
				removeGameTimer(ABYSSAL_SIRE_STUN);
				break;
		}
	}

	if (actor != client.getLocalPlayer())
	{
		return;
	}

	if (config.showHomeMinigameTeleports()
		&& client.getLocalPlayer().getAnimation() == AnimationID.IDLE
		&& (lastAnimation == AnimationID.BOOK_HOME_TELEPORT_5
		|| lastAnimation == AnimationID.COW_HOME_TELEPORT_6))
	{
		if (lastTeleportClicked == TeleportWidget.HOME_TELEPORT)
		{
			createGameTimer(HOME_TELEPORT);
		}
		else if (lastTeleportClicked == TeleportWidget.MINIGAME_TELEPORT)
		{
			createGameTimer(MINIGAME_TELEPORT);
		}
	}

	if (config.showDFSSpecial() && lastAnimation == AnimationID.DRAGONFIRE_SHIELD_SPECIAL)
	{
		createGameTimer(DRAGON_FIRE_SHIELD);
	}

	lastAnimation = client.getLocalPlayer().getAnimation();
}
 
Example #29
Source File: TimersPlugin.java    From plugins with GNU General Public License v3.0 4 votes vote down vote up
@Subscribe
private void onAnimationChanged(AnimationChanged event)
{
	Actor actor = event.getActor();

	if (config.showAbyssalSireStun()
		&& actor instanceof NPC)
	{
		int npcId = ((NPC) actor).getId();

		switch (npcId)
		{
			// Show the countdown when the Sire enters the stunned state.
			case NpcID.ABYSSAL_SIRE_5887:
				createGameTimer(ABYSSAL_SIRE_STUN);
				break;

			// Hide the countdown if the Sire isn't in the stunned state.
			// This is necessary because the Sire leaves the stunned
			// state early once all all four respiratory systems are killed.
			case NpcID.ABYSSAL_SIRE:
			case NpcID.ABYSSAL_SIRE_5888:
			case NpcID.ABYSSAL_SIRE_5889:
			case NpcID.ABYSSAL_SIRE_5890:
			case NpcID.ABYSSAL_SIRE_5891:
			case NpcID.ABYSSAL_SIRE_5908:
				removeGameTimer(ABYSSAL_SIRE_STUN);
				break;
		}
	}

	Player player = client.getLocalPlayer();

	if (player == null || actor != player)
	{
		return;
	}

	if (config.showHomeMinigameTeleports()
		&& player.getAnimation() == AnimationID.IDLE
		&& (lastAnimation == AnimationID.BOOK_HOME_TELEPORT_5
		|| lastAnimation == AnimationID.COW_HOME_TELEPORT_6))
	{
		if (lastTeleportClicked == TeleportWidget.HOME_TELEPORT)
		{
			createGameTimer(HOME_TELEPORT);
		}
		else if (lastTeleportClicked == TeleportWidget.MINIGAME_TELEPORT)
		{
			createGameTimer(MINIGAME_TELEPORT);
		}
	}

	if (config.showDFSSpecial() && lastAnimation == AnimationID.DRAGONFIRE_SHIELD_SPECIAL)
	{
		createGameTimer(DRAGON_FIRE_SHIELD);
	}

	lastAnimation = player.getAnimation();
}
 
Example #30
Source File: KourendLibraryPlugin.java    From plugins with GNU General Public License v3.0 4 votes vote down vote up
static boolean isLibraryCustomer(int npcId)
{
	return npcId == NpcID.VILLIA || npcId == NpcID.PROFESSOR_GRACKLEBONE || npcId == NpcID.SAM_7049;
}