public L2NpcTemplate getValidTemplate(int bossId) { L2NpcTemplate template = NpcTable.getInstance().getTemplate(bossId); if (template == null) return null; if (!template.isType("L2RaidBoss")) return null; return template; }
private static void spawnMercenary(int npcId, int x, int y, int z, int despawnDelay) { NpcTemplate template = NpcTable.getInstance().getTemplate(npcId); if (template != null) { final L2SiegeGuardInstance npc = new L2SiegeGuardInstance(IdFactory.getInstance().getNextId(), template); npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp()); npc.setDecayed(false); npc.spawnMe(x, y, (z + 20)); if (despawnDelay > 0) npc.scheduleDespawn(despawnDelay); } }