Clan.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (C) 2004-2015 L2J DataPack
  3. *
  4. * This file is part of L2J DataPack.
  5. *
  6. * L2J DataPack is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J DataPack is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package village_master.Clan;
  20. import java.util.HashMap;
  21. import java.util.Map;
  22. import com.l2jserver.gameserver.model.actor.L2Npc;
  23. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  24. import com.l2jserver.gameserver.model.quest.Quest;
  25. /**
  26. * @author UnAfraid
  27. */
  28. public final class Clan extends Quest
  29. {
  30. // @formatter:off
  31. private static final int[] NPCS =
  32. {
  33. 30026,30031,30037,30066,30070,30109,30115,30120,30154,30174,
  34. 30175,30176,30187,30191,30195,30288,30289,30290,30297,30358,
  35. 30373,30462,30474,30498,30499,30500,30503,30504,30505,30508,
  36. 30511,30512,30513,30520,30525,30565,30594,30595,30676,30677,
  37. 30681,30685,30687,30689,30694,30699,30704,30845,30847,30849,
  38. 30854,30857,30862,30865,30894,30897,30900,30905,30910,30913,
  39. 31269,31272,31276,31279,31285,31288,31314,31317,31321,31324,
  40. 31326,31328,31331,31334,31336,31755,31958,31961,31965,31968,
  41. 31974,31977,31996,32092,32093,32094,32095,32096,32097,32098,
  42. 32145,32146,32147,32150,32153,32154,32157,32158,32160,32171,
  43. 32193,32196,32199,32202,32205,32206,32209,32210,32213,32214,
  44. 32217,32218,32221,32222,32225,32226,32229,32230,32233,32234
  45. };
  46. // @formatter:on
  47. private static final Map<String, String> LEADER_REQUIRED = new HashMap<>();
  48. static
  49. {
  50. LEADER_REQUIRED.put("9000-03.htm", "9000-03-no.htm");
  51. LEADER_REQUIRED.put("9000-04.htm", "9000-04-no.htm");
  52. LEADER_REQUIRED.put("9000-05.htm", "9000-05-no.htm");
  53. LEADER_REQUIRED.put("9000-07.htm", "9000-07-no.htm");
  54. LEADER_REQUIRED.put("9000-12a.htm", "9000-07-no.htm");
  55. LEADER_REQUIRED.put("9000-12b.htm", "9000-07-no.htm");
  56. LEADER_REQUIRED.put("9000-13a.htm", "9000-07-no.htm");
  57. LEADER_REQUIRED.put("9000-13b.htm", "9000-07-no.htm");
  58. LEADER_REQUIRED.put("9000-14a.htm", "9000-07-no.htm");
  59. LEADER_REQUIRED.put("9000-14b.htm", "9000-07-no.htm");
  60. LEADER_REQUIRED.put("9000-15.htm", "9000-07-no.htm");
  61. }
  62. private Clan()
  63. {
  64. super(-1, Clan.class.getSimpleName(), "village_master");
  65. addStartNpc(NPCS);
  66. addTalkId(NPCS);
  67. }
  68. @Override
  69. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  70. {
  71. if (LEADER_REQUIRED.containsKey(event))
  72. {
  73. if (!player.isClanLeader())
  74. {
  75. return LEADER_REQUIRED.get(event);
  76. }
  77. }
  78. return event;
  79. }
  80. @Override
  81. public String onTalk(L2Npc npc, L2PcInstance talker)
  82. {
  83. return "9000-01.htm";
  84. }
  85. public static void main(String[] args)
  86. {
  87. new Clan();
  88. }
  89. }