SeeThroughSilentMove.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package ai.group_template;
  16. import com.l2jserver.gameserver.datatables.SpawnTable;
  17. import com.l2jserver.gameserver.model.L2Spawn;
  18. import com.l2jserver.gameserver.model.actor.L2Attackable;
  19. import com.l2jserver.gameserver.model.actor.L2Npc;
  20. import com.l2jserver.gameserver.util.Util;
  21. public class SeeThroughSilentMove extends L2AttackableAIScript
  22. {
  23. private static final int[] MOBIDS = {18001,18002,22199,22215,22216,22217,22327,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22756,22757,22758,22759,22760,22761,22762,22763,22764,22765,22794,22795,22796,22797,22798,22799,22800,29009,29010,29011,29012,29013};
  24. public SeeThroughSilentMove(int questId, String name, String descr)
  25. {
  26. super(questId, name, descr);
  27. for (L2Spawn npc : SpawnTable.getInstance().getSpawnTable())
  28. if (Util.contains(MOBIDS,npc.getNpcid()) && npc.getLastSpawn() != null && npc.getLastSpawn() instanceof L2Attackable)
  29. ((L2Attackable)npc.getLastSpawn()).setSeeThroughSilentMove(true);
  30. for (int npcId : MOBIDS)
  31. this.addSpawnId(npcId);
  32. }
  33. @Override
  34. public String onSpawn(L2Npc npc)
  35. {
  36. if (npc instanceof L2Attackable)
  37. ((L2Attackable)npc).setSeeThroughSilentMove(true);
  38. return super.onSpawn(npc);
  39. }
  40. public static void main(String[] args)
  41. {
  42. new SeeThroughSilentMove(-1, "SeeThroughSilentMove", "ai");
  43. }
  44. }