NonTalkingNPCs.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 custom.NonTalkingNPCs;
  16. import com.l2jserver.gameserver.model.actor.L2Npc;
  17. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  18. import com.l2jserver.gameserver.model.quest.Quest;
  19. import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  20. public class NonTalkingNPCs extends Quest
  21. {
  22. private static final int[] NPC_IDS =
  23. {
  24. 18684, 18685, 18686, 18687, 18688, 18689, 18690, 19691, 18692, 31557, 31606,
  25. 31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621
  26. };
  27. public NonTalkingNPCs(int id, String name, String descr)
  28. {
  29. super(id, name, descr);
  30. for (int npcId : NPC_IDS)
  31. addFirstTalkId(npcId);
  32. }
  33. @Override
  34. public final String onFirstTalk(L2Npc npc, L2PcInstance player)
  35. {
  36. player.sendPacket(ActionFailed.STATIC_PACKET);
  37. return null;
  38. }
  39. public static void main(String[] args)
  40. {
  41. new NonTalkingNPCs(-1, NonTalkingNPCs.class.getSimpleName(), "custom");
  42. }
  43. }