/** Pick enemy using generic filter. */ public static Npc pickEnemy() { return Npcs.getNearest( new Filter<Npc>() { public boolean accept(Npc npc) { if (npc.getHpPercent() == 0) return false; return !(npc.getInteracting() != null && !npc.getInteracting().equals(MyPlayer.get())) && !Util.arrayContains(GameConstants.NONARGRESSIVE_NPCS, npc.getId()); } }); }
/** * Pick enemy using ids. * * @param ids the valid ids */ public static Npc pickEnemy(final int... ids) { return Npcs.getNearest( new Filter<Npc>() { public boolean accept(Npc npc) { if (npc.getHpPercent() == 0) return false; return !(npc.getInteracting() != null && !npc.getInteracting().equals(MyPlayer.get())) && Util.arrayContains(ids, npc.getId()); } }); }
public static Npc getFalcon() { return Npcs.getNearest( new Filter<Npc>() { public boolean accept(Npc npc) { if (Utils.arrayContains(GameConstants.falconIDs, npc.getId())) { // Set<HintArrow> arrows = Game.getHintArrows(); // for (HintArrow a : arrows) { // if (a.getLocation().equals(npc.getLocation())) // return true; // } return true; } return false; } }); }