Q00249_PoisonedPlainsOfTheLizardmen.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.Q00249_PoisonedPlainsOfTheLizardmen;
  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. * Poisoned Plains of the Lizardmen (249)
  27. * @author Gnacik
  28. * @version 2010-08-04 Based on Freya PTS
  29. */
  30. public class Q00249_PoisonedPlainsOfTheLizardmen extends Quest
  31. {
  32. // NPCs
  33. private static final int MOUEN = 30196;
  34. private static final int JOHNNY = 32744;
  35. public Q00249_PoisonedPlainsOfTheLizardmen()
  36. {
  37. super(249, Q00249_PoisonedPlainsOfTheLizardmen.class.getSimpleName(), "Poisoned Plains of the Lizardmen");
  38. addStartNpc(MOUEN);
  39. addTalkId(MOUEN, JOHNNY);
  40. }
  41. @Override
  42. public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  43. {
  44. String htmltext = event;
  45. final QuestState st = getQuestState(player, false);
  46. if (st == null)
  47. {
  48. return htmltext;
  49. }
  50. if (npc.getId() == MOUEN)
  51. {
  52. if (event.equalsIgnoreCase("30196-03.htm"))
  53. {
  54. st.startQuest();
  55. }
  56. }
  57. else if ((npc.getId() == JOHNNY) && event.equalsIgnoreCase("32744-03.htm"))
  58. {
  59. st.giveAdena(83056, true);
  60. st.addExpAndSp(477496, 58743);
  61. st.exitQuest(false, true);
  62. }
  63. return htmltext;
  64. }
  65. @Override
  66. public String onTalk(L2Npc npc, L2PcInstance player)
  67. {
  68. String htmltext = getNoQuestMsg(player);
  69. final QuestState st = getQuestState(player, true);
  70. if (st == null)
  71. {
  72. return htmltext;
  73. }
  74. if (npc.getId() == MOUEN)
  75. {
  76. switch (st.getState())
  77. {
  78. case State.CREATED:
  79. htmltext = (player.getLevel() >= 82) ? "30196-01.htm" : "30196-00.htm";
  80. break;
  81. case State.STARTED:
  82. if (st.isCond(1))
  83. {
  84. htmltext = "30196-04.htm";
  85. }
  86. break;
  87. case State.COMPLETED:
  88. htmltext = "30196-05.htm";
  89. break;
  90. }
  91. }
  92. else if (npc.getId() == JOHNNY)
  93. {
  94. if (st.isCond(1))
  95. {
  96. htmltext = "32744-01.htm";
  97. }
  98. else if (st.isCompleted())
  99. {
  100. htmltext = "32744-04.htm";
  101. }
  102. }
  103. return htmltext;
  104. }
  105. }