Esempio n. 1
0
  @Override
  public String onKill(final L2Npc npc, final L2PcInstance player, final boolean isPet) {
    final QuestState st = player.getQuestState(qn);
    if (st == null) return null;

    if (st.isStarted() && Rnd.get(10) > 4) {
      st.giveItems(npc.getNpcId() == 20385 ? ORC_AMULET : ORC_NECKLACE, 1);
      st.playSound(QuestState.SOUND_ITEMGET);
    }

    return null;
  }
  @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() >= 34 && player.getLevel() <= 40) htmltext = "30620-0.htm";
        else {
          htmltext = "30620-0a.htm";
          st.exitQuest(true);
        }
        break;

      case QuestState.STARTED:
        final int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case EMILY:
            if (cond == 1) htmltext = "30620-1a.htm";
            else if (cond == 2) {
              if (st.getQuestItemsCount(HONEY_POUCH) >= 100) htmltext = "30620-2.htm";
              else {
                htmltext = "30620-2a.htm";
                st.exitQuest(true);
              }
            } else if (cond == 3) htmltext = "30620-3a.htm";
            else if (cond == 4) {
              if (st.getQuestItemsCount(AVELLAN_SPICE) >= 1) htmltext = "30620-4.htm";
              else {
                htmltext = "30620-4a.htm";
                st.exitQuest(true);
              }
            } else if (cond == 5) htmltext = "30620-5a.htm";
            else if (cond == 6) htmltext = "30620-6.htm";
            break;

          case LARA:
            if (cond == 3) htmltext = "30063-0.htm";
            else if (cond >= 4) htmltext = "30063-1a.htm";
            break;

          case BRIGHT:
            if (cond == 5) htmltext = "30466-0.htm";
            else if (cond >= 6) htmltext = "30466-1a.htm";
            break;
        }
        break;
    }

    return htmltext;
  }
Esempio n. 3
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 onKill(final L2Npc npc, final L2PcInstance player, final boolean isPet) {
    final QuestState st = player.getQuestState(qn);
    if (st == null) return null;

    if (st.getInt("cond") == 1 && Rnd.get(4) == 1) {
      switch (npc.getNpcId()) {
        case Dungeon_Skeleton:
        case Dungeon_Skeleton_Archer:
        case Dread_Soldier:
          if (st.getQuestItemsCount(BONE_FRAGMENT) < 10) {
            st.giveItems(BONE_FRAGMENT, 1);

            if (st.getQuestItemsCount(BONE_FRAGMENT) >= 10
                && st.getQuestItemsCount(ELF_SKULL) >= 3) {
              st.playSound(QuestState.SOUND_MIDDLE);
              st.set("cond", "2");
            } else st.playSound(QuestState.SOUND_ITEMGET);
          }
          break;

        case Shade_Horror:
        case Dark_Terror:
        case Mist_Terror:
          if (st.getQuestItemsCount(ELF_SKULL) < 3) {
            st.giveItems(ELF_SKULL, 1);

            if (st.getQuestItemsCount(BONE_FRAGMENT) >= 10
                && st.getQuestItemsCount(ELF_SKULL) >= 3) {
              st.playSound(QuestState.SOUND_MIDDLE);
              st.set("cond", "2");
            } else st.playSound(QuestState.SOUND_ITEMGET);
          }
          break;
      }
    }
    return null;
  }
  @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;
  }