Q10268_ToTheSeedOfInfinity.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.Q10268_ToTheSeedOfInfinity;
  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 Seed of Infinity (10268)<br>
  27. * Original Jython script by Kerberos.
  28. * @author nonom
  29. */
  30. public class Q10268_ToTheSeedOfInfinity extends Quest
  31. {
  32. // NPCs
  33. private static final int KEUCEREUS = 32548;
  34. private static final int TEPIOS = 32603;
  35. // Item
  36. private static final int INTRODUCTION = 13811;
  37. public Q10268_ToTheSeedOfInfinity()
  38. {
  39. super(10268, Q10268_ToTheSeedOfInfinity.class.getSimpleName(), "To the Seed of Infinity");
  40. addStartNpc(KEUCEREUS);
  41. addTalkId(KEUCEREUS, TEPIOS);
  42. registerQuestItems(INTRODUCTION);
  43. }
  44. @Override
  45. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  46. {
  47. final QuestState st = getQuestState(player, false);
  48. if (st == null)
  49. {
  50. return getNoQuestMsg(player);
  51. }
  52. if (event.equals("32548-05.html"))
  53. {
  54. st.startQuest();
  55. st.giveItems(INTRODUCTION, 1);
  56. }
  57. return event;
  58. }
  59. @Override
  60. public String onTalk(L2Npc npc, L2PcInstance player)
  61. {
  62. String htmltext = getNoQuestMsg(player);
  63. final QuestState st = getQuestState(player, true);
  64. if (st == null)
  65. {
  66. return htmltext;
  67. }
  68. switch (npc.getId())
  69. {
  70. case KEUCEREUS:
  71. switch (st.getState())
  72. {
  73. case State.CREATED:
  74. htmltext = (player.getLevel() < 75) ? "32548-00.html" : "32548-01.htm";
  75. break;
  76. case State.STARTED:
  77. htmltext = "32548-06.html";
  78. break;
  79. case State.COMPLETED:
  80. htmltext = "32548-0a.html";
  81. break;
  82. }
  83. break;
  84. case TEPIOS:
  85. switch (st.getState())
  86. {
  87. case State.STARTED:
  88. htmltext = "32530-01.html";
  89. st.giveAdena(16671, true);
  90. st.addExpAndSp(100640, 10098);
  91. st.exitQuest(false, true);
  92. break;
  93. case State.COMPLETED:
  94. htmltext = "32530-02.html";
  95. break;
  96. default:
  97. break;
  98. }
  99. break;
  100. }
  101. return htmltext;
  102. }
  103. }