ShadowWeapons.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 custom.ShadowWeapons;
  20. import com.l2jserver.gameserver.model.actor.L2Npc;
  21. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  22. import com.l2jserver.gameserver.model.quest.Quest;
  23. /**
  24. * Shadow Weapons AI.<br>
  25. * Original Jython script by DrLecter.
  26. * @author Nyaran, jurchiks
  27. */
  28. public final class ShadowWeapons extends Quest
  29. {
  30. // @formatter:off
  31. private static final int[] NPCS =
  32. {
  33. 30037, 30066, 30070, 30109, 30115, 30120, 30174, 30175, 30176, 30187,
  34. 30191, 30195, 30288, 30289, 30290, 30297, 30373, 30462, 30474, 30498,
  35. 30499, 30500, 30503, 30504, 30505, 30511, 30512, 30513, 30595, 30676,
  36. 30677, 30681, 30685, 30687, 30689, 30694, 30699, 30704, 30845, 30847,
  37. 30849, 30854, 30857, 30862, 30865, 30894, 30897, 30900, 30905, 30910,
  38. 30913, 31269, 31272, 31276, 31285, 31288, 31314, 31317, 31321, 31324,
  39. 31326, 31328, 31331, 31334, 31336, 31958, 31961, 31965, 31968, 31974,
  40. 31977, 31996, 32092, 32093, 32094, 32095, 32096, 32097, 32098, 32193,
  41. 32196, 32199, 32202, 32205, 32206, 32213, 32214, 32221, 32222, 32229,
  42. 32230, 32233, 32234
  43. };
  44. // @formatter:on
  45. private ShadowWeapons()
  46. {
  47. super(-1, ShadowWeapons.class.getSimpleName(), "custom");
  48. addStartNpc(NPCS);
  49. addTalkId(NPCS);
  50. }
  51. @Override
  52. public String onTalk(L2Npc npc, L2PcInstance player)
  53. {
  54. String htmltext;
  55. boolean has_d = hasQuestItems(player, 8869); // Shadow Item Exchange Coupon (D-Grade)
  56. boolean has_c = hasQuestItems(player, 8870); // Shadow Item Exchange Coupon (C-Grade)
  57. if (has_d || has_c)
  58. {
  59. if (!has_d)
  60. {
  61. htmltext = "exchange_c.html";
  62. }
  63. else if (!has_c)
  64. {
  65. htmltext = "exchange_d.html";
  66. }
  67. else
  68. {
  69. htmltext = "exchange_both.html";
  70. }
  71. }
  72. else
  73. {
  74. htmltext = "exchange_no.html";
  75. }
  76. return htmltext;
  77. }
  78. public static void main(String args[])
  79. {
  80. new ShadowWeapons();
  81. }
  82. }