Q00014_WhereaboutsOfTheArchaeologist.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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.Q00014_WhereaboutsOfTheArchaeologist;
  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. * Whereabouts of the Archaeologist (14)<br>
  27. * Original Jython script by disKret.
  28. * @author nonom
  29. */
  30. public class Q00014_WhereaboutsOfTheArchaeologist extends Quest
  31. {
  32. // NPCs
  33. private static final int LIESEL = 31263;
  34. private static final int GHOST_OF_ADVENTURER = 31538;
  35. // Item
  36. private static final int LETTER = 7253;
  37. public Q00014_WhereaboutsOfTheArchaeologist()
  38. {
  39. super(14, Q00014_WhereaboutsOfTheArchaeologist.class.getSimpleName(), "Whereabouts of the Archaeologist");
  40. addStartNpc(LIESEL);
  41. addTalkId(LIESEL, GHOST_OF_ADVENTURER);
  42. registerQuestItems(LETTER);
  43. }
  44. @Override
  45. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  46. {
  47. String htmltext = event;
  48. final QuestState st = getQuestState(player, false);
  49. if (st == null)
  50. {
  51. return htmltext;
  52. }
  53. switch (event)
  54. {
  55. case "31263-02.html":
  56. st.startQuest();
  57. st.giveItems(LETTER, 1);
  58. break;
  59. case "31538-01.html":
  60. if (st.isCond(1) && st.hasQuestItems(LETTER))
  61. {
  62. st.giveAdena(136928, true);
  63. st.addExpAndSp(325881, 32524);
  64. st.exitQuest(false, true);
  65. }
  66. else
  67. {
  68. htmltext = "31538-02.html";
  69. }
  70. break;
  71. }
  72. return htmltext;
  73. }
  74. @Override
  75. public String onTalk(L2Npc npc, L2PcInstance player)
  76. {
  77. String htmltext = getNoQuestMsg(player);
  78. final QuestState st = getQuestState(player, true);
  79. if (st == null)
  80. {
  81. return htmltext;
  82. }
  83. final int npcId = npc.getId();
  84. switch (st.getState())
  85. {
  86. case State.COMPLETED:
  87. htmltext = getAlreadyCompletedMsg(player);
  88. break;
  89. case State.CREATED:
  90. if (npcId == LIESEL)
  91. {
  92. htmltext = (player.getLevel() < 74) ? "31263-01.html" : "31263-00.htm";
  93. }
  94. break;
  95. case State.STARTED:
  96. if (st.isCond(1))
  97. {
  98. switch (npcId)
  99. {
  100. case LIESEL:
  101. htmltext = "31263-02.html";
  102. break;
  103. case GHOST_OF_ADVENTURER:
  104. htmltext = "31538-00.html";
  105. break;
  106. }
  107. }
  108. break;
  109. }
  110. return htmltext;
  111. }
  112. }