Search in sources :

Example 11 with NPC

use of net.runelite.api.NPC in project runelite by runelite.

the class NpcClickboxOverlay method render.

@Override
public Dimension render(Graphics2D graphics) {
    Map<NPC, String> npcMap = plugin.getHighlightedNpcs();
    for (NPC npc : npcMap.keySet()) {
        renderNpcOverlay(graphics, npc, npcMap.get(npc), config.getNpcColor());
    }
    for (NPC npc : plugin.getTaggedNpcs()) {
        NPCComposition composition = plugin.getComposition(npc);
        if (composition == null || composition.getName() == null)
            continue;
        String name = composition.getName().replace('\u00A0', ' ');
        renderNpcOverlay(graphics, npc, name, config.getTagColor());
    }
    return null;
}
Also used : NPC(net.runelite.api.NPC) NPCComposition(net.runelite.api.NPCComposition)

Example 12 with NPC

use of net.runelite.api.NPC in project runelite by runelite.

the class CrypticClue method makeWorldOverlayHint.

@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin) {
    // Mark dig location
    if (getLocation() != null && getNpc() == null && objectId == -1) {
        LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
        if (localLocation != null) {
            OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localLocation, SPADE_IMAGE, Color.ORANGE);
        }
    }
    // Mark NPC
    if (plugin.getNpcsToMark() != null) {
        for (NPC npc : plugin.getNpcsToMark()) {
            OverlayUtil.renderActorOverlayImage(graphics, npc, CLUE_SCROLL_IMAGE, Color.ORANGE, IMAGE_Z_OFFSET);
        }
    }
    // Mark game object
    if (objectId != -1) {
        net.runelite.api.Point mousePosition = plugin.getClient().getMouseCanvasPosition();
        if (plugin.getObjectsToMark() != null) {
            for (GameObject gameObject : plugin.getObjectsToMark()) {
                OverlayUtil.renderHoverableArea(graphics, gameObject.getClickbox(), mousePosition, CLICKBOX_FILL_COLOR, CLICKBOX_BORDER_COLOR, CLICKBOX_HOVER_BORDER_COLOR);
                OverlayUtil.renderImageLocation(plugin.getClient(), graphics, gameObject.getLocalLocation(), CLUE_SCROLL_IMAGE, IMAGE_Z_OFFSET);
            }
        }
    }
}
Also used : NPC(net.runelite.api.NPC) LocalPoint(net.runelite.api.coords.LocalPoint) GameObject(net.runelite.api.GameObject)

Example 13 with NPC

use of net.runelite.api.NPC in project runelite by runelite.

the class DevToolsOverlay method renderNpcs.

private void renderNpcs(Graphics2D graphics) {
    List<NPC> npcs = client.getNpcs();
    for (NPC npc : npcs) {
        NPCComposition composition = npc.getComposition();
        if (composition.getConfigs() != null) {
            composition = composition.transform();
        }
        String text = composition.getName() + " (ID: " + composition.getId() + ") (A: " + npc.getAnimation() + ") (G: " + npc.getGraphic() + ")";
        if (npc.getCombatLevel() > 1) {
            OverlayUtil.renderActorOverlay(graphics, npc, text, YELLOW);
        } else {
            OverlayUtil.renderActorOverlay(graphics, npc, text, ORANGE);
        }
    }
}
Also used : NPC(net.runelite.api.NPC) NPCComposition(net.runelite.api.NPCComposition)

Example 14 with NPC

use of net.runelite.api.NPC in project runelite by runelite.

the class FishingSpotMinimapOverlay method render.

@Override
public Dimension render(Graphics2D graphics) {
    NPC[] fishingSpots = plugin.getFishingSpots();
    if (fishingSpots == null) {
        return null;
    }
    for (NPC npc : fishingSpots) {
        FishingSpot spot = FishingSpot.getSpot(npc.getId());
        if (spot == null) {
            continue;
        }
        Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
        net.runelite.api.Point minimapLocation = npc.getMinimapLocation();
        if (minimapLocation != null) {
            OverlayUtil.renderMinimapLocation(graphics, minimapLocation, color.darker());
        }
    }
    return null;
}
Also used : NPC(net.runelite.api.NPC) Color(java.awt.Color)

Example 15 with NPC

use of net.runelite.api.NPC in project runelite by runelite.

the class FightCavePlugin method findJad.

private NPC findJad() {
    Query query = new NPCQuery().nameContains("TzTok-Jad");
    NPC[] result = queryRunner.runQuery(query);
    return result.length >= 1 ? result[0] : null;
}
Also used : NPC(net.runelite.api.NPC) Query(net.runelite.api.Query) NPCQuery(net.runelite.api.queries.NPCQuery) NPCQuery(net.runelite.api.queries.NPCQuery)

Aggregations

NPC (net.runelite.api.NPC)16 NPCComposition (net.runelite.api.NPCComposition)6 LocalPoint (net.runelite.api.coords.LocalPoint)3 Color (java.awt.Color)2 Client (net.runelite.api.Client)2 Player (net.runelite.api.Player)2 Point (net.runelite.api.Point)2 Query (net.runelite.api.Query)2 Inject (net.runelite.api.mixins.Inject)2 NPCQuery (net.runelite.api.queries.NPCQuery)2 Subscribe (com.google.common.eventbus.Subscribe)1 Dimension (java.awt.Dimension)1 FontMetrics (java.awt.FontMetrics)1 Point (java.awt.Point)1 Rectangle (java.awt.Rectangle)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Actor (net.runelite.api.Actor)1 GameObject (net.runelite.api.GameObject)1