Q00110_ToThePrimevalIsle.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 quests.Q00110_ToThePrimevalIsle;
  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. import com.l2jserver.gameserver.model.quest.QuestState;
  24. import com.l2jserver.gameserver.model.quest.State;
  25. /**
  26. * To the Primeval Isle (110)
  27. * @author Adry_85
  28. */
  29. public class Q00110_ToThePrimevalIsle extends Quest
  30. {
  31. // NPCs
  32. private static final int ANTON = 31338;
  33. private static final int MARQUEZ = 32113;
  34. // Item
  35. private static final int ANCIENT_BOOK = 8777;
  36. public Q00110_ToThePrimevalIsle()
  37. {
  38. super(110, Q00110_ToThePrimevalIsle.class.getSimpleName(), "To the Primeval Isle");
  39. addStartNpc(ANTON);
  40. addTalkId(ANTON, MARQUEZ);
  41. registerQuestItems(ANCIENT_BOOK);
  42. }
  43. @Override
  44. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  45. {
  46. QuestState st = getQuestState(player, false);
  47. if (st == null)
  48. {
  49. return getNoQuestMsg(player);
  50. }
  51. switch (event)
  52. {
  53. case "31338-1.html":
  54. st.giveItems(ANCIENT_BOOK, 1);
  55. st.startQuest();
  56. break;
  57. case "32113-2.html":
  58. case "32113-2a.html":
  59. st.giveAdena(191678, true);
  60. st.addExpAndSp(251602, 25245);
  61. st.exitQuest(false, true);
  62. break;
  63. }
  64. return event;
  65. }
  66. @Override
  67. public String onTalk(L2Npc npc, L2PcInstance player)
  68. {
  69. String htmltext = getNoQuestMsg(player);
  70. final QuestState st = getQuestState(player, true);
  71. if (st == null)
  72. {
  73. return htmltext;
  74. }
  75. switch (npc.getId())
  76. {
  77. case ANTON:
  78. switch (st.getState())
  79. {
  80. case State.CREATED:
  81. htmltext = (player.getLevel() < 75) ? "31338-0a.htm" : "31338-0b.htm";
  82. break;
  83. case State.STARTED:
  84. htmltext = "31338-1a.html";
  85. break;
  86. case State.COMPLETED:
  87. htmltext = getAlreadyCompletedMsg(player);
  88. break;
  89. }
  90. break;
  91. case MARQUEZ:
  92. if (st.isCond(1))
  93. {
  94. htmltext = "32113-1.html";
  95. }
  96. break;
  97. }
  98. return htmltext;
  99. }
  100. }