public NpcInstance findTemplate(int npcId) { for (Spawner spawn : SpawnManager.getInstance().getSpawners(PeriodOfDay.NONE.name())) { if ((spawn != null) && (spawn.getCurrentNpcId() == npcId)) { return spawn.getLastSpawn(); } } return null; }
public static void reSpawn(SimulatorNPC npc) { if (simulator.get(npc.getPlayer().getEntityId()) == null) return; SimulatorNPC SP = simulator.remove(npc.getPlayer().getEntityId()); Spawner.despawnNPC(SP); spawner.add(SP); if (delay <= 0) delay = 25; }
private static void spawnSimulator(SimulatedPlayer SP, Location location, int id) { SimulatorNPC SPNPC = Spawner.spawnNPC(location, SP, id); simulator.put(SPNPC.getPlayer().getEntityId(), SPNPC); Messaging.log("spawning " + SPNPC.getName() + " in location " + location.toString()); }