Kief.java 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package hellbound.Kief;
  16. import com.l2jserver.gameserver.instancemanager.HellboundManager;
  17. import com.l2jserver.gameserver.model.actor.L2Npc;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. import com.l2jserver.gameserver.model.quest.Quest;
  20. import com.l2jserver.gameserver.model.quest.QuestState;
  21. /**
  22. * @author DS
  23. */
  24. public class Kief extends Quest
  25. {
  26. private static final int KIEF = 32354;
  27. private static final int BOTTLE = 9672;
  28. private static final int DARION_BADGE = 9674;
  29. private static final int DIM_LIFE_FORCE = 9680;
  30. private static final int LIFE_FORCE = 9681;
  31. private static final int CONTAINED_LIFE_FORCE = 9682;
  32. private static final int STINGER = 10012;
  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 ("Badges".equalsIgnoreCase(event))
  42. {
  43. switch (HellboundManager.getInstance().getLevel())
  44. {
  45. case 2:
  46. case 3:
  47. if (qs.hasQuestItems(DARION_BADGE))
  48. {
  49. HellboundManager.getInstance().updateTrust((int) qs.getQuestItemsCount(DARION_BADGE) * 10, true);
  50. qs.takeItems(DARION_BADGE, -1);
  51. return "32354-10.htm";
  52. }
  53. }
  54. return "32354-10a.htm";
  55. }
  56. else if ("Bottle".equalsIgnoreCase(event))
  57. {
  58. if (HellboundManager.getInstance().getLevel() >= 7)
  59. {
  60. if (qs.getQuestItemsCount(STINGER) >= 20)
  61. {
  62. qs.takeItems(STINGER, 20);
  63. qs.giveItems(BOTTLE, 1);
  64. return "32354-11h.htm";
  65. }
  66. return "32354-11i.htm";
  67. }
  68. }
  69. else if ("dlf".equalsIgnoreCase(event))
  70. {
  71. if (HellboundManager.getInstance().getLevel() == 7)
  72. {
  73. if (qs.hasQuestItems(DIM_LIFE_FORCE))
  74. {
  75. HellboundManager.getInstance().updateTrust((int) qs.getQuestItemsCount(DIM_LIFE_FORCE) * 20, true);
  76. qs.takeItems(DIM_LIFE_FORCE, -1);
  77. return "32354-11a.htm";
  78. }
  79. return "32354-11b.htm";
  80. }
  81. }
  82. else if ("lf".equalsIgnoreCase(event))
  83. {
  84. if (HellboundManager.getInstance().getLevel() == 7)
  85. {
  86. if (qs.hasQuestItems(LIFE_FORCE))
  87. {
  88. HellboundManager.getInstance().updateTrust((int) qs.getQuestItemsCount(LIFE_FORCE) * 80, true);
  89. qs.takeItems(LIFE_FORCE, -1);
  90. return "32354-11c.htm";
  91. }
  92. return "32354-11d.htm";
  93. }
  94. }
  95. else if ("clf".equalsIgnoreCase(event))
  96. {
  97. if (HellboundManager.getInstance().getLevel() == 7)
  98. {
  99. if (qs.hasQuestItems(CONTAINED_LIFE_FORCE))
  100. {
  101. HellboundManager.getInstance().updateTrust((int) qs.getQuestItemsCount(CONTAINED_LIFE_FORCE) * 200, true);
  102. qs.takeItems(CONTAINED_LIFE_FORCE, -1);
  103. return "32354-11e.htm";
  104. }
  105. return "32354-11f.htm";
  106. }
  107. }
  108. return event;
  109. }
  110. @Override
  111. public final String onFirstTalk(L2Npc npc, L2PcInstance player)
  112. {
  113. if (player.getQuestState(getName()) == null)
  114. {
  115. newQuestState(player);
  116. }
  117. switch (HellboundManager.getInstance().getLevel())
  118. {
  119. case 1:
  120. return "32354-01.htm";
  121. case 2:
  122. case 3:
  123. return "32354-01a.htm";
  124. case 4:
  125. return "32354-01e.htm";
  126. case 5:
  127. return "32354-01d.htm";
  128. case 6:
  129. return "32354-01b.htm";
  130. case 7:
  131. return "32354-01c.htm";
  132. default:
  133. return "32354-01f.htm";
  134. }
  135. }
  136. public Kief(int questId, String name, String descr)
  137. {
  138. super(questId, name, descr);
  139. addFirstTalkId(KIEF);
  140. addStartNpc(KIEF);
  141. addTalkId(KIEF);
  142. }
  143. public static void main(String[] args)
  144. {
  145. new Kief(-1, "Kief", "hellbound");
  146. }
  147. }