@Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);

    if (st == null) {
      return getNoQuestMsg(player);
    }

    if (event.equalsIgnoreCase("32245-03.htm") && (player.getLevel() >= 76) && !st.isCompleted()) {
      if (st.getState() == State.CREATED) {
        st.setState(State.STARTED);
        st.set("cond", "1");
        st.set("rewarded_prince", "1");
        st.set("rewarded_ranku", "1");
        st.playSound("ItemSound.quest_accept");
      } else {
        htmltext = "32245-03a.htm";
      }
    } else if (event.equalsIgnoreCase("32245-07.htm")
        && (st.getInt("cond") == 3)
        && !st.isCompleted()) {
      st.giveAdena(65884, true);
      st.addExpAndSp(50541, 5094);
      st.giveItems(FIRE, 1);
      st.giveItems(WATER, 1);
      st.giveItems(EARTH, 1);
      st.giveItems(WIND, 1);
      st.giveItems(DARKNESS, 1);
      st.giveItems(DIVINITY, 1);
      st.playSound("ItemSound.quest_finish");
      st.exitQuest(false);
    }
    return htmltext;
  }
Ejemplo n.º 2
0
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = "";
    QuestState accessQuest = player.getQuestState("240_ImTheOnlyOneYouCanTrust");
    if ((accessQuest != null) && accessQuest.isCompleted()) htmltext = "32640.htm";
    else htmltext = "32640-no.htm";

    return htmltext;
  }
Ejemplo n.º 3
0
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    QuestState st = player.getQuestState(qn);
    QuestState prev = player.getQuestState("250_WatchWhatYouEat");

    if (st == null) return htmltext;

    switch (st.getState()) {
      case State.CREATED:
        if (player.getLevel() >= 82 && prev != null && prev.isCompleted())
          htmltext = "32742-01.htm";
        else htmltext = "32742-14.htm";
        break;
      case State.STARTED:
        if (st.getQuestItemsCount(VialOfTantaBlood) < 100) htmltext = "32742-04.html";
        else htmltext = "32742-05.html";
        break;
    }
    return htmltext;
  }
  @Override
  public final String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = Quest.getNoQuestMsg(player);
    QuestState st = player.getQuestState(qn);

    if (st == null) {
      return htmltext;
    }

    if (st.getState() == State.CREATED) {
      if (player.getLevel() >= 76) {
        htmltext = "32245-01.htm";
      } else {
        htmltext = "32245-02.htm";
      }
    } else if (st.isCompleted()) {
      htmltext = getAlreadyCompletedMsg(player);
    } else if (st.getState() == State.STARTED) {
      switch (st.getInt("cond")) {
        case 1:
        case 2:
          if (st.hasQuestItems(BLUEPRINT_RANKU) && st.hasQuestItems(BLUEPRINT_PRINCE)) {
            st.takeItems(BLUEPRINT_RANKU, -1);
            st.takeItems(BLUEPRINT_PRINCE, -1);
            st.set("cond", "3");
            st.playSound("ItemSound.quest_middle");
            htmltext = "32245-05.htm";
          } else {
            htmltext = "32245-04.htm";
          }

          break;
        case 3:
          htmltext = "32245-06.htm";
      }
    }
    return htmltext;
  }