Jude.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 hellbound.Jude;
  16. import com.l2jserver.gameserver.instancemanager.HellboundManager;
  17. import com.l2jserver.gameserver.model.actor.L2Npc;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. import com.l2jserver.gameserver.model.quest.Quest;
  20. import com.l2jserver.gameserver.model.quest.QuestState;
  21. /**
  22. * @author DS
  23. */
  24. public class Jude extends Quest
  25. {
  26. private static final int JUDE = 32356;
  27. private static final int NativeTreasure = 9684;
  28. private static final int RingOfWindMastery = 9677;
  29. @Override
  30. public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  31. {
  32. QuestState qs = player.getQuestState(getName());
  33. if (qs == null)
  34. {
  35. qs = newQuestState(player);
  36. }
  37. if ("TreasureSacks".equalsIgnoreCase(event))
  38. {
  39. if (HellboundManager.getInstance().getLevel() == 3)
  40. {
  41. if (qs.getQuestItemsCount(NativeTreasure) >= 40)
  42. {
  43. qs.takeItems(NativeTreasure, 40);
  44. qs.giveItems(RingOfWindMastery, 1);
  45. return "32356-02.htm";
  46. }
  47. }
  48. return "32356-02a.htm";
  49. }
  50. return event;
  51. }
  52. @Override
  53. public final String onFirstTalk(L2Npc npc, L2PcInstance player)
  54. {
  55. if (player.getQuestState(getName()) == null)
  56. {
  57. newQuestState(player);
  58. }
  59. switch (HellboundManager.getInstance().getLevel())
  60. {
  61. case 0:
  62. case 1:
  63. case 2:
  64. return "32356-01.htm";
  65. case 3:
  66. case 4:
  67. return "32356-01c.htm";
  68. case 5:
  69. return "32356-01a.htm";
  70. default:
  71. return "32356-01b.htm";
  72. }
  73. }
  74. public Jude(int questId, String name, String descr)
  75. {
  76. super(questId, name, descr);
  77. addFirstTalkId(JUDE);
  78. addStartNpc(JUDE);
  79. addTalkId(JUDE);
  80. }
  81. public static void main(String[] args)
  82. {
  83. new Jude(-1, "Jude", "hellbound");
  84. }
  85. }