Jude.java 2.5 KB

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