Buron.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright (C) 2004-2014 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 hellbound.Buron;
  20. import com.l2jserver.gameserver.instancemanager.HellboundManager;
  21. import com.l2jserver.gameserver.model.actor.L2Npc;
  22. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  23. import com.l2jserver.gameserver.model.quest.Quest;
  24. import com.l2jserver.gameserver.model.quest.QuestState;
  25. /**
  26. * @author DS
  27. */
  28. public class Buron extends Quest
  29. {
  30. private static final int BURON = 32345;
  31. private static final int HELMET = 9669;
  32. private static final int TUNIC = 9670;
  33. private static final int PANTS = 9671;
  34. private static final int DARION_BADGE = 9674;
  35. @Override
  36. public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  37. {
  38. String htmltext = event;
  39. if ("Rumor".equalsIgnoreCase(event))
  40. {
  41. htmltext = "32345-" + HellboundManager.getInstance().getLevel() + "r.htm";
  42. }
  43. else
  44. {
  45. if (HellboundManager.getInstance().getLevel() < 2)
  46. {
  47. htmltext = "32345-lowlvl.htm";
  48. }
  49. else
  50. {
  51. QuestState qs = player.getQuestState(getName());
  52. if (qs == null)
  53. {
  54. qs = newQuestState(player);
  55. }
  56. if (qs.getQuestItemsCount(DARION_BADGE) >= 10)
  57. {
  58. qs.takeItems(DARION_BADGE, 10);
  59. if (event.equalsIgnoreCase("Tunic"))
  60. {
  61. player.addItem("Quest", TUNIC, 1, npc, true);
  62. }
  63. else if (event.equalsIgnoreCase("Helmet"))
  64. {
  65. player.addItem("Quest", HELMET, 1, npc, true);
  66. }
  67. else if (event.equalsIgnoreCase("Pants"))
  68. {
  69. player.addItem("Quest", PANTS, 1, npc, true);
  70. }
  71. htmltext = null;
  72. }
  73. else
  74. {
  75. htmltext = "32345-noitems.htm";
  76. }
  77. }
  78. }
  79. return htmltext;
  80. }
  81. @Override
  82. public final String onFirstTalk(L2Npc npc, L2PcInstance player)
  83. {
  84. if (player.getQuestState(getName()) == null)
  85. {
  86. newQuestState(player);
  87. }
  88. switch (HellboundManager.getInstance().getLevel())
  89. {
  90. case 1:
  91. return "32345-01.htm";
  92. case 2:
  93. case 3:
  94. case 4:
  95. return "32345-02.htm";
  96. default:
  97. return "32345-01a.htm";
  98. }
  99. }
  100. public Buron(int questId, String name, String descr)
  101. {
  102. super(questId, name, descr);
  103. addFirstTalkId(BURON);
  104. addStartNpc(BURON);
  105. addTalkId(BURON);
  106. }
  107. public static void main(String[] args)
  108. {
  109. new Buron(-1, "Buron", "hellbound");
  110. }
  111. }