예제 #1
0
 public String onEvent(String event, QuestState st) {
   String htmltext = event;
   if (event.equalsIgnoreCase("30141-03.htm")) {
     st.set("cond", "1");
     st.setState(State.STARTED);
     st.playSound("ItemSound.quest_accept");
   }
   return htmltext;
 }
예제 #2
0
  public String onKill(L2NpcInstance npc, L2PcInstance player, boolean isPet) {
    QuestState st = player.getQuestState(qn);
    if (st == null) return null;
    if (st.getState() != State.STARTED) return null;

    int npcId = npc.getNpcId();
    if (st.getInt("cond") == 1) {
      if (npcId == OMEN_BEAST && st.getQuestItemsCount(ONYX_BEAST_EYE) == 0) {
        st.giveItems(ONYX_BEAST_EYE, 1);
      } else if (contains(new int[] {TAINTED_ZOMBIE, STINK_ZOMBIE}, npcId)
          && st.getQuestItemsCount(TAINT_STONE) == 0) {
        st.giveItems(TAINT_STONE, 1);
      } else if (contains(
              new int[] {LESSER_SUCCUBUS, LESSER_SUCCUBUS_TUREN, LESSER_SUCCUBUS_TILFO}, npcId)
          && st.getQuestItemsCount(SUCCUBUS_BLOOD) == 0) {
        st.giveItems(SUCCUBUS_BLOOD, 1);
      }
      if (st.getQuestItemsCount(ONYX_BEAST_EYE) > 0
          && st.getQuestItemsCount(TAINT_STONE) > 0
          && st.getQuestItemsCount(SUCCUBUS_BLOOD) > 0) {
        st.set("cond", "2");
        st.playSound("ItemSound.quest_middle");
      } else st.playSound("ItemSound.quest_itemget");
    }
    return null;
  }
예제 #3
0
 public String onTalk(L2NpcInstance npc, L2PcInstance player) {
   String htmltext =
       "<html><body>Вы не взяли квест для этого NPC или просто не соответствуете его минимальным требованиям!</body></html>";
   QuestState st = player.getQuestState(qn);
   if (st == null) return htmltext;
   int id = st.getState();
   int cond = st.getInt("cond");
   if (id == State.COMPLETED) {
     return "<html><body>Данный квест уже выполнен.</body></html>";
   } else if (cond == 0) {
     if (player.getRace().ordinal() != 2) {
       htmltext = "30141-00.htm";
       st.exitQuest(true);
     } else if (player.getLevel() >= 16) {
       htmltext = "30141-02.htm";
     } else {
       htmltext = "30141-01.htm";
       st.exitQuest(true);
     }
   } else if (cond == 1) {
     htmltext = "30141-04.htm";
   } else if (cond == 2) {
     htmltext = "30141-06.htm";
     st.takeItems(ONYX_BEAST_EYE, -1);
     st.takeItems(TAINT_STONE, -1);
     st.takeItems(SUCCUBUS_BLOOD, -1);
     st.giveItems(956, 1);
     st.unset("cond");
     st.exitQuest(false);
     st.playSound("ItemSound.quest_finish");
   }
   return htmltext;
 }