@Override
  public String onTalk(final L2Npc npc, final L2PcInstance player) {
    final QuestState st = player.getQuestState(qn);
    String htmltext = getNoQuestMsg();
    if (st == null) return htmltext;

    switch (st.getState()) {
      case QuestState.CREATED:
        if (player.getRace().ordinal() == 1) {
          if (player.getLevel() >= 12 && player.getLevel() <= 18) htmltext = "30154-03.htm";
          else {
            htmltext = "30154-02.htm";
            st.exitQuest(true);
          }
        } else {
          htmltext = "30154-00.htm";
          st.exitQuest(true);
        }
        break;

      case QuestState.STARTED:
        final int cond = st.getInt("cond");
        if (cond == 1) htmltext = "30154-05.htm";
        else if (cond == 2) {
          st.set("cond", "3");
          htmltext = "30154-06.htm";
          st.takeItems(PLAGUE_DUST, -1);
          st.takeItems(HYACINTH_CHARM1, -1);
          st.giveItems(HYACINTH_CHARM2, 1);
          st.playSound(QuestState.SOUND_MIDDLE);
        } else if (cond == 3) htmltext = "30154-07.htm";
        else if (cond == 4) {
          htmltext = "30154-08.htm";
          st.takeItems(PLAGUE_DUST, -1);
          st.takeItems(HYACINTH_CHARM2, -1);
          st.rewardItems(ADENA, 18250);
          st.playSound(QuestState.SOUND_FINISH);
          st.exitQuest(false);
        }
        break;

      case QuestState.COMPLETED:
        htmltext = Quest.getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
Пример #2
0
  @Override
  public String onTalk(final L2Npc npc, final L2PcInstance player) {
    String htmltext = getNoQuestMsg();
    final QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    switch (st.getState()) {
      case QuestState.CREATED:
        htmltext =
            player.getLevel() >= 3 && player.getLevel() <= 10 && player.getRace().ordinal() == 4
                ? "30533-01.htm"
                : "30533-01a.htm";
        break;

      case QuestState.STARTED:
        final int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case Balanki:
            if (cond >= 1 && cond <= 3) htmltext = "30533-03.htm";
            else if (cond == 4) htmltext = "30533-04.htm";
            break;

          case Reed:
            if (cond == 1) htmltext = "30520-01.htm";
            else if (cond == 2) htmltext = "30520-02a.htm";
            else if (cond == 3) htmltext = "30520-03.htm";
            else if (cond == 4) htmltext = "30520-04a.htm";
            break;

          case Gerald:
            if (cond == 2) htmltext = "30650-01.htm";
            else if (cond >= 3) htmltext = "30650-04.htm";
            break;
        }
        break;

      case QuestState.COMPLETED:
        htmltext = Quest.getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
  @Override
  public String onTalk(final L2Npc npc, final L2PcInstance player) {
    final QuestState st = player.getQuestState(qn);
    String htmltext = getNoQuestMsg();
    if (st == null) return htmltext;

    switch (st.getState()) {
      case QuestState.CREATED:
        if (player.getRace().ordinal() == 2) {
          htmltext = "30147-00.htm";
          st.exitQuest(true);
        } else if (player.getLevel() >= 12 && player.getLevel() <= 21) htmltext = "30147-02.htm";
        else {
          htmltext = "30147-01.htm";
          st.exitQuest(true);
        }
        break;

      case QuestState.STARTED:
        final int cond = st.getInt("cond");
        if (cond == 1) htmltext = "30147-05.htm";
        else if (cond == 2
            && st.getQuestItemsCount(ELF_SKULL) >= 3
            && st.getQuestItemsCount(BONE_FRAGMENT) >= 10) {
          htmltext = "30147-06.htm";
          st.takeItems(ELF_SKULL, -1);
          st.takeItems(BONE_FRAGMENT, -1);
          st.rewardItems(ADENA, 24000);
          st.giveItems(BONE_SHIELD, 1);
          st.exitQuest(false);
          st.playSound(QuestState.SOUND_FINISH);
        }
        break;

      case QuestState.COMPLETED:
        htmltext = Quest.getAlreadyCompletedMsg();
        break;
    }
    return htmltext;
  }
Пример #4
0
  @Override
  public String onTalk(final L2Npc npc, final L2PcInstance player) {
    String htmltext = Quest.getNoQuestMsg();
    final QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    switch (st.getState()) {
      case QuestState.CREATED:
        if (player.getLevel() >= 62) htmltext = "31517-0.htm";
        else {
          htmltext = "31517-0a.htm";
          st.exitQuest(true);
        }
        break;

      case QuestState.STARTED:
        final int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case HIERARCH:
            if (cond >= 1 && cond <= 5) {
              if (st.getQuestItemsCount(CRYSTAL_OF_SEAL) == 0) {
                htmltext = "31517-3a.htm";
                st.exitQuest(true);
              } else htmltext = "31517-3.htm";
            } else if (cond == 6) {
              htmltext = "31517-4.htm";
              st.addExpAndSp(221958, 0);
              st.exitQuest(false);
              st.playSound(QuestState.SOUND_FINISH);
            }
            break;

          case EVIL_ALTAR_1:
            if (cond == 1) {
              htmltext =
                  st.getQuestItemsCount(CRYSTAL_OF_SEAL) > 0
                      ? "31512-0.htm"
                      : "altar_nocrystal.htm";
            } else if (cond > 1) htmltext = "31512-2.htm";
            break;

          case EVIL_ALTAR_2:
            if (cond == 2) {
              htmltext =
                  st.getQuestItemsCount(CRYSTAL_OF_SEAL) > 0
                      ? "31513-0.htm"
                      : "altar_nocrystal.htm";
            } else if (cond > 2) htmltext = "31513-2.htm";
            break;

          case EVIL_ALTAR_3:
            if (cond == 3) {
              htmltext =
                  st.getQuestItemsCount(CRYSTAL_OF_SEAL) > 0
                      ? "31514-0.htm"
                      : "altar_nocrystal.htm";
            } else if (cond > 3) htmltext = "31514-2.htm";
            break;

          case EVIL_ALTAR_4:
            if (cond == 4) {
              htmltext =
                  st.getQuestItemsCount(CRYSTAL_OF_SEAL) > 0
                      ? "31515-0.htm"
                      : "altar_nocrystal.htm";
            } else if (cond > 4) htmltext = "31515-2.htm";
            break;

          case EVIL_ALTAR_5:
            if (cond == 5) {
              htmltext =
                  st.getQuestItemsCount(CRYSTAL_OF_SEAL) > 0
                      ? "31516-0.htm"
                      : "altar_nocrystal.htm";
            } else if (cond > 5) htmltext = "31516-2.htm";
            break;
        }
        break;

      case QuestState.COMPLETED:
        htmltext = Quest.getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
  @Override
  public String onTalk(final L2Npc npc, final L2PcInstance player) {
    final QuestState st = player.getQuestState(qn);
    String htmltext = getNoQuestMsg();
    if (st == null) return htmltext;

    switch (st.getState()) {
      case QuestState.CREATED:
        if (player.getLevel() >= 39) htmltext = "32053-01.htm";
        else {
          htmltext = "32053-00.htm";
          st.exitQuest(true);
        }
        break;

      case QuestState.STARTED:
        final int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case GHOST:
            if (cond == 1) htmltext = "32055-01.htm";
            else if (cond >= 2 && cond <= 8) htmltext = "32055-02.htm";
            else if (cond == 9 && st.getQuestItemsCount(ENGRAVED_HAMMER) == 1)
              htmltext = "32055-03.htm";
            else if (cond >= 10) htmltext = "32055-05.htm";
            break;

          case OBI:
            if (cond == 2) htmltext = "32052-01.htm";
            else if (cond >= 2 && cond <= 5) htmltext = "32052-02.htm";
            else if (cond == 6 && st.getQuestItemsCount(ENGRAVED_HAMMER) == 1)
              htmltext = "32052-03.htm";
            else if (cond == 7 && st.getQuestItemsCount(ENGRAVED_HAMMER) == 1)
              htmltext = "32052-04.htm";
            else if (cond == 8 && st.getQuestItemsCount(GREY_STAR) == 1) htmltext = "32052-05.htm";
            else if (cond >= 9) htmltext = "32052-06.htm";
            break;

          case ABEY:
            if (cond == 1 || cond == 2) htmltext = "32053-02.htm";
            else if (cond == 3) htmltext = "32053-03.htm";
            else if (cond == 4) htmltext = "32053-04.htm";
            else if (cond == 5 && st.getQuestItemsCount(ENGRAVED_HAMMER) == 1)
              htmltext = "32053-05.htm";
            else if (cond >= 6 && st.getQuestItemsCount(ENGRAVED_HAMMER) == 1)
              htmltext = "32053-06.htm";
            break;

          case BOX:
            if (cond == 4) htmltext = "32076-01.htm";
            else if (cond >= 5) htmltext = "32076-03.htm";
            break;

          case GHOST_F:
            if (cond == 10) htmltext = "32054-01.htm";
            break;
        }
        break;

      case QuestState.COMPLETED:
        htmltext = Quest.getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }