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

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 48) ? "30754-01.htm" : "30754-02.htm";
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case GILMORE:
            if (cond == 1)
              htmltext = (st.hasQuestItems(ARTICLE_DEAD_HERO)) ? "30754-05.htm" : "30754-09.htm";
            else if (cond == 2)
              htmltext = (st.get("success") != null) ? "30754-16.htm" : "30754-15.htm";
            break;

          default:
            if (cond == 2) {
              if (st.get("success") != null) htmltext = npc.getNpcId() + "-02.htm";
              else {
                rewards(st, npc.getNpcId());
                htmltext = npc.getNpcId() + "-01.htm";
              }
            }
            break;
        }
        break;
    }
    return htmltext;
  }
示例#2
0
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg();
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    switch (st.getState()) {
      case STATE_CREATED:
        if (player.getLevel() < 40) htmltext = npc.getNpcId() + "-lvl.htm";
        else htmltext = npc.getNpcId() + "-01.htm";
        break;

      case STATE_STARTED:
        // Check inventory for soul crystals.
        for (ItemInstance item : player.getInventory().getItems()) {
          // Crystal found, show "how to" html.
          if (SoulCrystalsTable.getSoulCrystalInfos().get(item.getItemId()) != null)
            return npc.getNpcId() + "-03.htm";
        }
        // No crystal found, offer a new crystal.
        htmltext = npc.getNpcId() + "-21.htm";
        break;
    }

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

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 75) ? "32113-01a.htm" : "32113-01.htm";
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case MARQUEZ:
            if (cond == 1) htmltext = "32113-03.htm";
            else if (cond > 1) htmltext = "32113-04a.htm";
            break;

          case MUSHIKA:
            if (cond == 2) htmltext = "32114-01.htm";
            else if (cond > 2) htmltext = "32114-03.htm";
            break;

          case ASAMAH:
            if (cond == 3) htmltext = "32115-01.htm";
            else if (cond == 6) {
              htmltext = "32115-05.htm";
              st.takeItems(8778, -1);
              st.rewardItems(57, 71318);
              st.playSound(QuestState.SOUND_FINISH);
              st.exitQuest(false);
            }
            break;

          case KARAKAWEI:
            if (cond == 4) {
              htmltext = "32117-01.htm";
              if (st.getInt("progress") == 1) htmltext = "32117-02.htm";
            } else if (cond > 4) htmltext = "32117-04.htm";
            break;

          case MANTARASA:
            if (cond == 5) htmltext = "32118-01.htm";
            else if (cond > 5) htmltext = "32118-03.htm";
            break;
        }
        break;

      case STATE_COMPLETED:
        if (npc.getNpcId() == ASAMAH) htmltext = "32115-06.htm";
        else htmltext = getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
示例#4
0
  @Override
  public String onAggro(L2Npc npc, L2PcInstance player, boolean isPet) {
    if (player == null) return null;

    // Instant use
    npc.setTarget(npc);
    npc.doCast((npc.getNpcId() == 18345) ? ANESTHESIA : POISON);

    // Launch a task every 15sec.
    if (getQuestTimer("skill", npc, null) == null) startQuestTimer("skill", 15000, npc, null, true);

    return super.onAggro(npc, player, isPet);
  }
示例#5
0
  @Override
  public String onSpawn(L2Npc npc) {
    for (L2PcInstance target : npc.getKnownList().getKnownType(L2PcInstance.class)) {
      if (!target.isDead()
          && GeoData.getInstance().canSeeTarget(npc, target)
          && Util.checkIfInRange(npc.getAggroRange(), npc, target, true)) {
        if (target.getActiveWeaponInstance() != null
            && !npc.isInCombat()
            && npc.getTarget() == null) {
          npc.setTarget(target);
          npc.broadcastNpcSay(
              ((target.getAppearance().getSex()) ? "Sister " : "Brother ")
                  + target.getName()
                  + ", move your weapon away!");

          switch (npc.getNpcId()) {
            case 22124:
            case 22126:
            case 22127:
              npc.doCast(SkillTable.getInstance().getInfo(4589, 8));
              break;

            default:
              attack(((L2Attackable) npc), target);
              break;
          }
        }
      }
    }
    return super.onSpawn(npc);
  }
示例#6
0
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(qn);
    String htmltext = getNoQuestMsg();
    if (st == null) return htmltext;

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 15) ? "30336-01.htm" : "30336-02.htm";
        break;

      case STATE_STARTED:
        switch (npc.getNpcId()) {
          case CURTIS:
            htmltext = (!st.hasQuestItems(ANATOMY_DIAGRAM)) ? "30336-04.htm" : "30336-05.htm";
            break;

          case SAMED:
            if (!st.hasQuestItems(ANATOMY_DIAGRAM)) htmltext = "30434-01.htm";
            else {
              if (getNumberOfPieces(st) == 0) htmltext = "30434-04.htm";
              else
                htmltext = (!st.hasQuestItems(COMPLETE_SKELETON)) ? "30434-05.htm" : "30434-08.htm";
            }
            break;

          case VARSAK:
            htmltext = "30342-01.htm";
            break;
        }
        break;
    }

    return htmltext;
  }
示例#7
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) {
    // Retrieve individual mob informations.
    final LevelingInfo npcInfo = SoulCrystalsTable.getNpcInfos().get(npc.getNpcId());
    if (npcInfo == null) return null;

    // Handle npc leveling info type.
    switch (npcInfo.getAbsorbCrystalType()) {
      case FULL_PARTY:
        final L2Attackable mob = (L2Attackable) npc;
        final int chance = Rnd.get(100);

        for (L2PcInstance player : getPartyMembersState(killer, npc, Quest.STATE_STARTED))
          tryToStageCrystal(player, mob, npcInfo, chance);
        break;

      case PARTY_ONE_RANDOM:
        final L2PcInstance player = getRandomPartyMemberState(killer, npc, Quest.STATE_STARTED);
        if (player != null) tryToStageCrystal(player, (L2Attackable) npc, npcInfo, Rnd.get(100));
        break;

      case LAST_HIT:
        if (checkPlayerState(killer, npc, Quest.STATE_STARTED) != null)
          tryToStageCrystal(killer, (L2Attackable) npc, npcInfo, Rnd.get(100));
        break;
    }

    return null;
  }
示例#8
0
  @Override
  public String onSkillSee(
      L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) {
    // Caster is an allied.
    if (caster.isAlliedWithKetra()) {
      // Caster's skill is a positive effect ? Go further.
      switch (skill.getSkillType()) {
        case BUFF:
        case HEAL:
        case HEAL_PERCENT:
        case HEAL_STATIC:
        case BALANCE_LIFE:
        case HOT:
          for (L2Character target : (L2Character[]) targets) {
            // Character isn't existing, is dead or is current caster, we drop check.
            if (target == null || target.isDead() || target == caster) continue;

            // Target isn't a summon nor a player, we drop check.
            if (!(target instanceof L2Playable)) continue;

            // Retrieve the player behind that target.
            final L2PcInstance player = target.getActingPlayer();

            // If player is neutral or enemy, go further.
            if (!(player.isAlliedWithKetra())) {
              // If the NPC got that player registered in aggro list, go further.
              if (((L2Attackable) npc).containsTarget(player)) {
                // Save current target for future use.
                final L2Object oldTarget = npc.getTarget();

                // Curse the heretic or his pet.
                npc.setTarget((isPet && player.getPet() != null) ? caster.getPet() : caster);
                npc.doCast(FrequentSkill.VARKA_KETRA_PETRIFICATION.getSkill());

                // Revert to old target && drop the loop.
                npc.setTarget(oldTarget);
                break;
              }
            }
          }
          break;
      }
    }

    // Continue normal behavior.
    return super.onSkillSee(npc, caster, skill, targets, isPet);
  }
示例#9
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    L2PcInstance partyMember = getRandomPartyMemberState(player, npc, STATE_STARTED);
    if (partyMember == null) return null;

    partyMember.getQuestState(qn).dropItems(RED_GEM, 1, 0, CHANCES.get(npc.getNpcId()));
    return null;
  }
示例#10
0
  /**
   * This method displays SkillList to the player.
   *
   * @param player The player who requested the method.
   * @param npc The L2Npc linked to the request.
   * @param classId The classId asked. Used to sort available skill list.
   */
  public static void showSkillList(L2PcInstance player, L2Npc npc, ClassId classId) {
    if (((L2NpcInstance) npc).getClassesToTeach() == null) {
      NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
      final String sb =
          StringUtil.concat(
              "<html><body>I cannot teach you. My class list is empty.<br>Your admin needs to add me teachTo informations.<br>NpcId:",
              String.valueOf(npc.getTemplate().getNpcId()),
              ", your classId:",
              String.valueOf(player.getClassId().getId()),
              "</body></html>");
      html.setHtml(sb);
      player.sendPacket(html);
      return;
    }

    if (!npc.getTemplate().canTeach(classId)) {
      NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
      html.setFile("data/html/trainer/" + npc.getTemplate().getNpcId() + "-noskills.htm");
      player.sendPacket(html);
      return;
    }

    AcquireSkillList asl = new AcquireSkillList(AcquireSkillList.SkillType.Usual);
    boolean empty = true;

    for (L2SkillLearn sl : SkillTreeTable.getInstance().getAvailableSkills(player, classId)) {
      L2Skill sk = SkillTable.getInstance().getInfo(sl.getId(), sl.getLevel());
      if (sk == null) continue;

      asl.addSkill(sl.getId(), sl.getLevel(), sl.getLevel(), sl.getSpCost(), 0);
      empty = false;
    }

    if (empty) {
      int minlevel = SkillTreeTable.getInstance().getMinLevelForNewSkill(player, classId);

      if (minlevel > 0)
        player.sendPacket(
            SystemMessage.getSystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN_S1)
                .addNumber(minlevel));
      else player.sendPacket(SystemMessageId.NO_MORE_SKILLS_TO_LEARN);
    } else player.sendPacket(asl);

    player.sendPacket(ActionFailed.STATIC_PACKET);
  }
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    QuestState st = checkPlayerCondition(player, npc, "cond", "1");
    if (st == null) return null;

    st.dropItems(ARTICLE_DEAD_HERO, 1, 0, CHANCES.get(npc.getNpcId()));

    return null;
  }
示例#12
0
 @Override
 public void onBypassFeedback(L2PcInstance player, String command) {
   if (command.startsWith("SkillList")) {
     player.setSkillLearningClassId(player.getClassId());
     showSkillList(player, this, player.getClassId());
   } else if (command.startsWith("EnchantSkillList"))
     showEnchantSkillList(player, this, player.getClassId());
   else if (command.startsWith("GiveBlessing")) giveBlessingSupport(player);
   else super.onBypassFeedback(player, command);
 }
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    L2PcInstance partyMember = getRandomPartyMemberState(player, npc, STATE_STARTED);
    if (partyMember == null) return null;

    partyMember
        .getQuestState(qn)
        .dropItems(DIMENSION_FRAGMENT, (int) (npc.getLevel() * 0.15 + 2.6), -1, 80000);

    return null;
  }
示例#14
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    if (!(npc instanceof L2Attackable)) return null;

    if (event.equalsIgnoreCase("skill")) {
      int playableCounter = 0;
      for (L2Playable playable :
          npc.getKnownList().getKnownTypeInRadius(L2Playable.class, npc.getAggroRange())) {
        if (!playable.isDead()) playableCounter++;
      }

      // If no one is inside aggro range, drop the task.
      if (playableCounter == 0) {
        cancelQuestTimer("skill", npc, null);
        return null;
      }

      npc.setTarget(npc);
      npc.doCast((npc.getNpcId() == 18345) ? ANESTHESIA : POISON);
    }
    return null;
  }
示例#15
0
  /**
   * This method selects a random player.<br>
   * Player can't be dead and isn't an hidden GM aswell.
   *
   * @param npc to check.
   * @return the random player.
   */
  public static L2PcInstance getRandomPlayer(L2Npc npc) {
    List<L2PcInstance> result = new ArrayList<>();

    for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class)) {
      if (player.isDead()) continue;

      if (player.isGM() && player.getAppearance().getInvisible()) continue;

      result.add(player);
    }

    return (result.isEmpty()) ? null : result.get(Rnd.get(result.size()));
  }
示例#16
0
  /**
   * This method displays EnchantSkillList to the player.
   *
   * @param player The player who requested the method.
   * @param npc The L2Npc linked to the request.
   * @param classId The classId asked. Used to sort available enchant skill list.
   */
  public static void showEnchantSkillList(L2PcInstance player, L2Npc npc, ClassId classId) {
    if (((L2NpcInstance) npc).getClassesToTeach() == null) {
      NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
      final String sb =
          StringUtil.concat(
              "<html><body>I cannot teach you. My class list is empty.<br>Your admin needs to add me teachTo informations.<br>NpcId:",
              String.valueOf(npc.getTemplate().getNpcId()),
              ", your classId:",
              String.valueOf(player.getClassId().getId()),
              "</body></html>");
      html.setHtml(sb);
      player.sendPacket(html);
      return;
    }

    if (!npc.getTemplate().canTeach(classId)) {
      NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
      html.setFile("data/html/trainer/" + npc.getTemplate().getNpcId() + "-noskills.htm");
      player.sendPacket(html);
      return;
    }

    if (player.getClassId().level() < 3) {
      NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
      html.setHtml("<html><body> You must have 3rd class change quest completed.</body></html>");
      player.sendPacket(html);
      return;
    }

    ExEnchantSkillList esl = new ExEnchantSkillList();
    boolean empty = true;

    List<L2EnchantSkillLearn> esll = SkillTreeTable.getInstance().getAvailableEnchantSkills(player);
    for (L2EnchantSkillLearn skill : esll) {
      L2Skill sk = SkillTable.getInstance().getInfo(skill.getId(), skill.getLevel());
      if (sk == null) continue;

      L2EnchantSkillData data =
          SkillTreeTable.getInstance().getEnchantSkillData(skill.getEnchant());
      if (data == null) continue;

      esl.addSkill(skill.getId(), skill.getLevel(), data.getCostSp(), data.getCostExp());
      empty = false;
    }

    if (empty) {
      player.sendPacket(SystemMessageId.THERE_IS_NO_SKILL_THAT_ENABLES_ENCHANT);

      if (player.getLevel() < 74)
        player.sendPacket(
            SystemMessage.getSystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN_S1)
                .addNumber(74));
      else player.sendPacket(SystemMessageId.NO_MORE_SKILLS_TO_LEARN);
    } else player.sendPacket(esl);

    player.sendPacket(ActionFailed.STATIC_PACKET);
  }
示例#17
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg();
    QuestState st = player.getQuestState(getName());
    if (st == null) return htmltext;

    if (Util.isDigit(event)) {
      final int eventId = Integer.parseInt(event);
      if (eventId >= 0 && eventId <= 7) {
        if (st.getQuestItemsCount(HORN) >= BUFF[eventId - 1][2]) {
          st.takeItems(HORN, BUFF[eventId - 1][2]);
          npc.setTarget(player);
          npc.doCast(SkillTable.getInstance().getInfo(BUFF[eventId - 1][0], BUFF[eventId - 1][1]));
          npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
          htmltext = "31372-4.htm";
        }
      }
    } else if (event.equals("Withdraw")) {
      if (player.getWarehouse().getSize() == 0) htmltext = "31374-0.htm";
      else {
        player.sendPacket(ActionFailed.STATIC_PACKET);
        player.setActiveWarehouse(player.getWarehouse());
        player.sendPacket(new WareHouseWithdrawalList(player, 1));
      }
    } else if (event.equals("Teleport")) {
      switch (player.getAllianceWithVarkaKetra()) {
        case 4:
          htmltext = "31376-4.htm";
          break;
        case 5:
          htmltext = "31376-5.htm";
          break;
      }
    }

    return htmltext;
  }
示例#18
0
  @Override
  public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet) {
    if (!npc.isInCombat()) {
      if (player.getActiveWeaponInstance() != null) {
        npc.setTarget(player);
        npc.broadcastNpcSay(
            ((player.getAppearance().getSex()) ? "Sister " : "Brother ")
                + player.getName()
                + ", move your weapon away!");

        switch (npc.getNpcId()) {
          case 22124:
          case 22126:
            npc.doCast(SkillTable.getInstance().getInfo(4589, 8));
            break;

          default:
            attack(((L2Attackable) npc), player);
            break;
        }
      } else if (((L2Attackable) npc).getMostHated() == null) return null;
    }
    return super.onAggroRangeEnter(npc, player, isPet);
  }
示例#19
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    QuestState st = checkPlayerState(player, npc, STATE_STARTED);
    if (st == null) return null;

    if (st.hasQuestItems(ANATOMY_DIAGRAM)) {
      final int chance = Rnd.get(100);
      for (IntIntHolder drop : DROPLIST.get(npc.getNpcId())) {
        if (chance < drop.getValue()) {
          st.dropItemsAlways(drop.getId(), 1, 0);
          break;
        }
      }
    }

    return null;
  }
示例#20
0
 @Override
 public String onSkillSee(
     L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) {
   if (skill.getSkillType() == L2SkillType.AGGDAMAGE && targets.length != 0) {
     for (L2Object obj : targets) {
       if (obj.equals(npc)) {
         npc.broadcastNpcSay(
             ((caster.getAppearance().getSex()) ? "Sister " : "Brother ")
                 + caster.getName()
                 + ", move your weapon away!");
         attack(((L2Attackable) npc), caster);
         break;
       }
     }
   }
   return super.onSkillSee(npc, caster, skill, targets, isPet);
 }
示例#21
0
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg();
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 15) ? "30050-01.htm" : "30050-02.htm";
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case ELIAS:
            if (cond == 1) htmltext = "30050-04.htm";
            else if (cond == 2) htmltext = "30050-05.htm";
            else if (cond == 3) {
              htmltext = "30050-06.htm";
              st.takeItems(FEVER_MEDICINE, 1);
              st.giveItems(102, 1);
              st.playSound(QuestState.SOUND_FINISH);
              st.exitQuest(false);
            }
            break;

          case YOHANES:
            if (cond == 2) {
              htmltext = "30032-01.htm";
              st.set("cond", "3");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(POISON_SAC, 1);
              st.giveItems(FEVER_MEDICINE, 1);
            } else if (cond == 3) htmltext = "30032-02.htm";
            break;
        }
        break;

      case STATE_COMPLETED:
        htmltext = getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    int npcId = npc.getNpcId();

    if (UNDEADS.containsKey(npcId)) {
      L2PcInstance partyMember = getRandomPartyMemberState(player, npc, STATE_STARTED);
      if (partyMember == null) return null;

      partyMember.getQuestState(qn).dropItems(ZOMBIE_LIVER, 1, 0, UNDEADS.get(npcId));
    } else if (MOBS.containsKey(npcId)) {
      L2PcInstance partyMember = getRandomPartyMember(player, npc, "1");
      if (partyMember == null) return null;

      QuestState st = partyMember.getQuestState(qn);

      if (st.dropItems(RIB_BONE, 1, 200, MOBS.get(npcId))) st.set("cond", "2");
    }

    return null;
  }
示例#23
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    // Drop tooth or light to anyone.
    L2PcInstance partyMember = getRandomPartyMemberState(player, npc, STATE_STARTED);
    if (partyMember == null) return null;

    QuestState st = partyMember.getQuestState(qn);

    st.dropItems(
        (npc.getNpcId() == CAVE_BEAST) ? CAVE_BEAST_TOOTH : DEATH_WAVE_LIGHT, 1, 65, 500000);

    // Drop sealed mysterious stone to party member who still need it.
    partyMember = getRandomPartyMember(player, npc, "condStone", "1");
    if (partyMember == null) return null;

    st = partyMember.getQuestState(qn);

    if (st.dropItems(SEALED_MYSTERIOUS_STONE, 1, 1, 1000)) st.unset("condStone");

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

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 25) ? "30828-00a.htm" : "30828-00.htm";
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case WATERS:
            if (cond == 1)
              htmltext = (!st.hasQuestItems(TRIDENT)) ? "30828-01a.htm" : "30828-02.htm";
            else if (cond == 2) htmltext = "30828-03a.htm";
            else if (cond == 3) htmltext = "30828-04.htm";
            else if (cond == 4) htmltext = "30828-05a.htm";
            else if (cond == 5) htmltext = "30828-06.htm";
            break;

          case SOPHYA:
            if (cond == 4) htmltext = "30735-05.htm";
            else if (cond == 5) htmltext = "30735-06a.htm";
            break;
        }
        break;

      case STATE_COMPLETED:
        htmltext = getAlreadyCompletedMsg();
        break;
    }

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

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 56) ? "30515-01.htm" : "30515-02.htm";
        break;

      case STATE_STARTED:
        final int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case MANAKIA:
            if (!(st.hasQuestItems(SEALED_MYSTERIOUS_STONE))) {
              if (st.getQuestItemsCount(CAVE_BEAST_TOOTH) >= 65
                  && st.getQuestItemsCount(DEATH_WAVE_LIGHT) >= 65) htmltext = "30515-05.htm";
              else htmltext = "30515-04.htm";
            } else {
              if (cond == 1) {
                htmltext = "30515-09.htm";
                st.set("cond", "2");
                st.playSound(QuestState.SOUND_MIDDLE);
              } else htmltext = "30515-10.htm";
            }
            break;

          case TORAI:
            if (cond == 2 && st.hasQuestItems(SEALED_MYSTERIOUS_STONE)) htmltext = "30557-01.htm";
            break;
        }
        break;
    }

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

    switch (st.getState()) {
      case STATE_CREATED:
        htmltext = (player.getLevel() < 66) ? "31314-02.htm" : "31314-01.htm";
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case DONAL:
            htmltext = "31314-04.htm";
            break;

          case DAISY:
            if (cond == 1) htmltext = "31315-01.htm";
            else if (cond == 2) htmltext = "31315-03.htm";
            break;

          case ABERCROMBIE:
            if (cond == 2) htmltext = "31555-01.htm";
            break;
        }
        break;

      case STATE_COMPLETED:
        htmltext = getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
示例#27
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    QuestState st = checkPlayerState(player, npc, STATE_STARTED);
    if (st == null) return null;

    switch (npc.getNpcId()) {
      case LETO_LIZARDMAN_WARRIOR:
        if (st.getInt("cond") == 11 && st.dropItems(BROWN_SCROLL_SCRAP, 1, 5, 500000))
          st.set("cond", "12");
        break;

      case SHACKLE_1:
      case SHACKLE_2:
        if (st.getInt("cond") == 16 && st.dropItems(SHACKLE_SCALP, 1, 2, 500000))
          if (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5
              && st.getQuestItemsCount(SHAMAN_NECKLACE) == 5) st.set("cond", "17");
        break;

      case MONSTER_EYE_DESTROYER:
        if (st.getInt("cond") == 16 && st.dropItems(MONSTER_EYE_DESTROYER_SKIN, 1, 5, 500000))
          if (st.getQuestItemsCount(SHACKLE_SCALP) == 2
              && st.getQuestItemsCount(SHAMAN_NECKLACE) == 5) st.set("cond", "17");
        break;

      case BREKA_ORC_SHAMAN:
        if (st.getInt("cond") == 16 && st.dropItems(SHAMAN_NECKLACE, 1, 5, 500000))
          if (st.getQuestItemsCount(SHACKLE_SCALP) == 2
              && st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5) st.set("cond", "17");
        break;

      case GRANDIS:
        if (st.hasQuestItems(TRIFF_RING)) st.dropItems(SCRIPTURE_CHAPTER_3, 1, 1, 300000);
        break;

      case MEDUSA:
        if (st.getInt("cond") == 28 && st.dropItemsAlways(MEDUSA_BLOOD, 1, 12))
          if (st.getQuestItemsCount(GHOUL_SKIN) == 10
              && st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5
              && st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5) st.set("cond", "29");
        break;

      case GHOUL:
        if (st.getInt("cond") == 28 && st.dropItemsAlways(GHOUL_SKIN, 1, 10))
          if (st.getQuestItemsCount(MEDUSA_BLOOD) == 12
              && st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5
              && st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5) st.set("cond", "29");
        break;

      case FETTERED_SOUL:
        if (st.getInt("cond") == 28 && st.dropItemsAlways(FETTERED_SOUL_ICHOR, 1, 5))
          if (st.getQuestItemsCount(MEDUSA_BLOOD) == 12
              && st.getQuestItemsCount(GHOUL_SKIN) == 10
              && st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5) st.set("cond", "29");
        break;

      case ENCHANTED_GARGOYLE:
        if (st.getInt("cond") == 28 && st.dropItemsAlways(ENCHANTED_GARGOYLE_NAIL, 1, 5))
          if (st.getQuestItemsCount(MEDUSA_BLOOD) == 12
              && st.getQuestItemsCount(GHOUL_SKIN) == 10
              && st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) st.set("cond", "29");
        break;
    }

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

    switch (st.getState()) {
      case STATE_CREATED:
        if (player.getClassId() != ClassId.wizard
            && player.getClassId() != ClassId.elvenWizard
            && player.getClassId() != ClassId.darkWizard) htmltext = "30461-01.htm";
        else if (player.getLevel() < 35) htmltext = "30461-02.htm";
        else htmltext = "30461-03.htm";
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case MIRIEN:
            if (cond < 14) htmltext = "30461-05.htm";
            else if (cond == 14) {
              htmltext = "30461-06.htm";
              st.set("cond", "15");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(MIRIEN_SIGIL_1, 1);
              st.takeItems(SYMBOL_OF_SYLVAIN, 1);
              st.giveItems(MIRIEN_SIGIL_2, 1);
            } else if (cond > 14 && cond < 18) htmltext = "30461-07.htm";
            else if (cond == 18) {
              if (!st.hasQuestItems(MIRIEN_INSTRUCTION)) htmltext = "30461-08.htm";
              else {
                if (player.getLevel() < 36) htmltext = "30461-11.htm";
                else {
                  htmltext = "30461-12.htm";
                  st.set("cond", "19");
                  st.playSound(QuestState.SOUND_MIDDLE);
                  st.takeItems(MIRIEN_INSTRUCTION, 1);
                  st.takeItems(MIRIEN_SIGIL_2, 1);
                  st.takeItems(SYMBOL_OF_JUREK, 1);
                  st.giveItems(MIRIEN_SIGIL_3, 1);
                }
              }
            } else if (cond > 18 && cond < 31) htmltext = "30461-13.htm";
            else if (cond == 31) {
              htmltext = "30461-14.htm";
              st.takeItems(MIRIEN_SIGIL_3, 1);
              st.takeItems(SYMBOL_OF_CRONOS, 1);
              st.giveItems(MARK_OF_SCHOLAR, 1);
              st.rewardExpAndSp(80265, 30000);
              player.broadcastPacket(new SocialAction(player, 3));
              st.playSound(QuestState.SOUND_FINISH);
              st.exitQuest(false);
            }
            break;

          case SYLVAIN:
            if (cond == 1) htmltext = "30070-01.htm";
            else if (cond < 13) htmltext = "30070-03.htm";
            else if (cond == 13) {
              htmltext = "30070-04.htm";
              st.set("cond", "14");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(CRYSTAL_OF_PURITY_1, 1);
              st.takeItems(HIGH_PRIEST_SIGIL, 1);
              st.giveItems(SYMBOL_OF_SYLVAIN, 1);
            } else if (cond == 14) htmltext = "30070-05.htm";
            else if (cond > 14) htmltext = "30070-06.htm";
            break;

          case MARIA:
            if (cond == 2) htmltext = "30608-01.htm";
            else if (cond == 3) htmltext = "30608-03.htm";
            else if (cond == 4) {
              htmltext = "30608-04.htm";
              st.set("cond", "5");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(LUCAS_LETTER, 1);
              st.giveItems(MARIA_LETTER_2, 1);
            } else if (cond == 5) htmltext = "30608-05.htm";
            else if (cond == 6) htmltext = "30608-06.htm";
            else if (cond == 7) htmltext = "30608-09.htm";
            else if (cond == 8) {
              htmltext = "30608-10.htm";
              st.set("cond", "9");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(CRETA_PAINTING_1, 1);
              st.giveItems(CRETA_PAINTING_2, 1);
            } else if (cond == 9) htmltext = "30608-11.htm";
            else if (cond == 10) {
              htmltext = "30608-12.htm";
              st.set("cond", "11");
              st.playSound(QuestState.SOUND_MIDDLE);
            } else if (cond == 11) htmltext = "30608-12.htm";
            else if (cond == 12) htmltext = "30608-13.htm";
            else if (cond == 13) htmltext = "30608-15.htm";
            else if (st.hasAtLeastOneQuestItem(SYMBOL_OF_SYLVAIN, MIRIEN_SIGIL_2))
              htmltext = "30608-16.htm";
            else if (cond > 18) {
              if (!st.hasQuestItems(VALKON_REQUEST)) htmltext = "30608-17.htm";
              else {
                htmltext = "30608-18.htm";
                st.takeItems(VALKON_REQUEST, 1);
                st.giveItems(CRYSTAL_OF_PURITY_2, 1);
              }
            }
            break;

          case JUREK:
            if (cond == 15) htmltext = "30115-01.htm";
            else if (cond == 16) htmltext = "30115-04.htm";
            else if (cond == 17) {
              htmltext = "30115-05.htm";
              st.set("cond", "18");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(GRAND_MAGISTER_SIGIL, 1);
              st.takeItems(JUREK_LIST, 1);
              st.takeItems(MONSTER_EYE_DESTROYER_SKIN, -1);
              st.takeItems(SHACKLE_SCALP, -1);
              st.takeItems(SHAMAN_NECKLACE, -1);
              st.giveItems(SYMBOL_OF_JUREK, 1);
            } else if (cond == 18) htmltext = "30115-06.htm";
            else if (cond > 18) htmltext = "30115-07.htm";
            break;

          case LUCAS:
            if (cond == 3) {
              htmltext = "30071-01.htm";
              st.set("cond", "4");
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(MARIA_LETTER_1, 1);
              st.giveItems(LUCAS_LETTER, 1);
            } else if (cond > 3 && cond < 9) htmltext = "30071-02.htm";
            else if (cond == 9) htmltext = "30071-03.htm";
            else if (cond == 10 || cond == 11) htmltext = "30071-05.htm";
            else if (cond == 12) htmltext = "30071-06.htm";
            else if (cond > 12) htmltext = "30071-07.htm";
            break;

          case CRETA:
            if (cond == 5) htmltext = "30609-01.htm";
            else if (cond == 6) htmltext = "30609-06.htm";
            else if (cond == 7) htmltext = "30609-07.htm";
            else if (cond > 7 && cond < 13) htmltext = "30609-10.htm";
            else if (cond >= 13 && cond < 19) htmltext = "30609-11.htm";
            else if (cond == 21) htmltext = "30609-12.htm";
            else if (cond > 21) htmltext = "30609-15.htm";
            break;

          case CRONOS:
            if (cond == 19) htmltext = "30610-01.htm";
            else if (cond > 19 && cond < 30) htmltext = "30610-11.htm";
            else if (cond == 30) htmltext = "30610-12.htm";
            else if (cond == 31) htmltext = "30610-15.htm";
            break;

          case DIETER:
            if (cond == 20) htmltext = "30111-01.htm";
            else if (cond == 21) htmltext = "30111-06.htm";
            else if (cond == 22) htmltext = "30111-07.htm";
            else if (cond == 23) htmltext = "30111-10.htm";
            else if (cond == 24) htmltext = "30111-11.htm";
            else if (cond > 24 && cond < 31)
              htmltext =
                  (!st.hasQuestItems(
                          SCRIPTURE_CHAPTER_1,
                          SCRIPTURE_CHAPTER_2,
                          SCRIPTURE_CHAPTER_3,
                          SCRIPTURE_CHAPTER_4))
                      ? "30111-12.htm"
                      : "30111-13.htm";
            else if (cond == 31) htmltext = "30111-15.htm";
            break;

          case EDROC:
            if (cond == 23) htmltext = "30230-01.htm";
            else if (cond == 24) htmltext = "30230-03.htm";
            else if (cond > 24) htmltext = "30230-04.htm";
            break;

          case RAUT:
            if (cond == 24) htmltext = "30316-01.htm";
            else if (cond == 25) htmltext = "30316-04.htm";
            else if (cond > 25) htmltext = "30316-05.htm";
            break;

          case TRIFF:
            if (cond == 25) htmltext = "30611-01.htm";
            else if (cond > 25) htmltext = "30611-05.htm";
            break;

          case VALKON:
            if (st.hasQuestItems(TRIFF_RING)) {
              if (!st.hasQuestItems(SCRIPTURE_CHAPTER_2)) {
                if (!st.hasQuestItems(VALKON_REQUEST)) {
                  if (!st.hasQuestItems(CRYSTAL_OF_PURITY_2)) htmltext = "30103-01.htm";
                  else {
                    htmltext = "30103-06.htm";
                    st.takeItems(CRYSTAL_OF_PURITY_2, 1);
                    st.giveItems(SCRIPTURE_CHAPTER_2, 1);
                  }
                } else htmltext = "30103-05.htm";
              } else htmltext = "30103-07.htm";
            }
            break;

          case POITAN:
            if (cond == 26 || cond == 27) {
              if (!st.hasQuestItems(POITAN_NOTES)) {
                htmltext = "30458-01.htm";
                st.giveItems(POITAN_NOTES, 1);
              } else htmltext = "30458-02.htm";
            } else if (cond == 28 || cond == 29) htmltext = "30458-03.htm";
            else if (cond == 30) htmltext = "30458-04.htm";
            break;

          case CASIAN:
            if ((cond == 26 || cond == 27) && st.hasQuestItems(POITAN_NOTES)) {
              if (st.hasQuestItems(SCRIPTURE_CHAPTER_1, SCRIPTURE_CHAPTER_2, SCRIPTURE_CHAPTER_3))
                htmltext = "30612-02.htm";
              else {
                htmltext = "30612-01.htm";
                if (cond == 26) {
                  st.set("cond", "27");
                  st.playSound(QuestState.SOUND_MIDDLE);
                }
              }
            } else if (cond == 28) htmltext = "30612-05.htm";
            else if (cond == 29) htmltext = "30612-06.htm";
            else if (cond == 30) htmltext = "30612-08.htm";
            break;
        }
        break;

      case STATE_COMPLETED:
        htmltext = getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }
示例#29
0
  @Override
  public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) {
    QuestState st = checkPlayerState(player, npc, STATE_STARTED);
    if (st == null) return null;

    if (st.getInt("cond") == 2) {
      switch (npc.getNpcId()) {
        case PUNCHER:
          if (st.dropItemsAlways(PUNCHER_SHARD, 1, 10))
            if (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case NOBLE_ANT_LEADER:
          if (st.dropItemsAlways(NOBLE_ANT_FEELER, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case MARSH_STAKATO_DRONE:
          if (st.dropItemsAlways(DRONE_CHITIN, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case DEAD_SEEKER:
          if (st.dropItemsAlways(DEAD_SEEKER_FANG, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case BREKA_ORC_OVERLORD:
          if (st.dropItemsAlways(OVERLORD_NECKLACE, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case FETTERED_SOUL:
          if (st.dropItemsAlways(FETTERED_SOUL_CHAIN, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case LETO_LIZARDMAN_OVERLORD:
          if (st.dropItemsAlways(CHIEF_AMULET, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case ENCHANTED_MONSTEREYE:
          if (st.dropItemsAlways(ENCHANTED_EYE_MEAT, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case TAMLIN_ORC:
          if (st.dropItemsAlways(TAMRIN_ORC_RING, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10) st.set("cond", "3");
          break;

        case TAMLIN_ORC_ARCHER:
          if (st.dropItemsAlways(TAMRIN_ORC_ARROW, 1, 10))
            if (st.getQuestItemsCount(PUNCHER_SHARD) >= 10
                && st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10
                && st.getQuestItemsCount(DRONE_CHITIN) >= 10
                && st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10
                && st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10
                && st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10
                && st.getQuestItemsCount(CHIEF_AMULET) >= 10
                && st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10
                && st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) st.set("cond", "3");
          break;
      }
    } else if (st.getInt("cond") == 4) {
      switch (npc.getNpcId()) {
        case EXCURO:
          if (st.dropItemsAlways(EXCURO_SKIN, 1, 3))
            if (st.getQuestItemsCount(KRATOR_SHARD) >= 3
                && st.getQuestItemsCount(LAKIN_MACE) >= 3
                && st.getQuestItemsCount(GRANDIS_SKIN) >= 3
                && st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3) st.set("cond", "5");
          break;

        case KRATOR:
          if (st.dropItemsAlways(KRATOR_SHARD, 1, 3))
            if (st.getQuestItemsCount(EXCURO_SKIN) >= 3
                && st.getQuestItemsCount(LAKIN_MACE) >= 3
                && st.getQuestItemsCount(GRANDIS_SKIN) >= 3
                && st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3) st.set("cond", "5");
          break;

        case LAKIN:
          if (st.dropItemsAlways(LAKIN_MACE, 1, 3))
            if (st.getQuestItemsCount(EXCURO_SKIN) >= 3
                && st.getQuestItemsCount(KRATOR_SHARD) >= 3
                && st.getQuestItemsCount(GRANDIS_SKIN) >= 3
                && st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3) st.set("cond", "5");
          break;

        case GRANDIS:
          if (st.dropItemsAlways(GRANDIS_SKIN, 1, 3))
            if (st.getQuestItemsCount(EXCURO_SKIN) >= 3
                && st.getQuestItemsCount(KRATOR_SHARD) >= 3
                && st.getQuestItemsCount(LAKIN_MACE) >= 3
                && st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3) st.set("cond", "5");
          break;

        case TIMAK_ORC_OVERLORD:
          if (st.dropItemsAlways(TIMAK_ORC_BELT, 1, 3))
            if (st.getQuestItemsCount(EXCURO_SKIN) >= 3
                && st.getQuestItemsCount(KRATOR_SHARD) >= 3
                && st.getQuestItemsCount(LAKIN_MACE) >= 3
                && st.getQuestItemsCount(GRANDIS_SKIN) >= 3) st.set("cond", "5");
          break;
      }
    }

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

    switch (st.getState()) {
      case STATE_CREATED:
        if (player.getRace() == Race.Elf) {
          if (player.getLevel() >= 3) htmltext = "30370-03.htm";
          else {
            htmltext = "30370-02.htm";
            st.exitQuest(true);
          }
        } else {
          htmltext = "30370-00.htm";
          st.exitQuest(true);
        }
        break;

      case STATE_STARTED:
        int cond = st.getInt("cond");
        switch (npc.getNpcId()) {
          case NERUPA:
            if (cond >= 1 && cond <= 3) htmltext = "30370-05.htm";
            else if (cond == 4) {
              if (st.getQuestItemsCount(NIGHTSHADE_LEAF) == 1) {
                htmltext = "30370-06.htm";
                st.playSound(QuestState.SOUND_FINISH);
                st.takeItems(NIGHTSHADE_LEAF, 1);
                st.rewardItems(LESSER_HEALING_POTION, 5);
                st.rewardExpAndSp(1000, 0);
                st.exitQuest(false);
              }
            }
            break;

          case UNOREN:
            if (cond == 1) {
              st.set("cond", "2");
              htmltext = "30147-01.htm";
              st.playSound(QuestState.SOUND_MIDDLE);
              st.takeItems(SILVERY_SPIDERSILK, 1);
              st.giveItems(UNOS_RECEIPT, 1);
            } else if (cond == 2) htmltext = "30147-02.htm";
            else if (cond == 4) htmltext = "30147-03.htm";
            break;

          case CREAMEES:
            if (cond == 2) {
              st.set("cond", "3");
              htmltext = "30149-01.htm";
              st.takeItems(UNOS_RECEIPT, 1);
              st.giveItems(CELS_TICKET, 1);
              st.playSound(QuestState.SOUND_MIDDLE);
            } else if (cond == 3) htmltext = "30149-02.htm";
            else if (cond == 4) htmltext = "30149-03.htm";
            break;

          case JULIA:
            if (cond == 3) {
              st.set("cond", "4");
              htmltext = "30152-01.htm";
              st.takeItems(CELS_TICKET, -1);
              st.giveItems(NIGHTSHADE_LEAF, 1);
              st.playSound(QuestState.SOUND_MIDDLE);
            } else if (cond == 4) htmltext = "30152-02.htm";
            break;
        }
        break;

      case STATE_COMPLETED:
        htmltext = getAlreadyCompletedMsg();
        break;
    }

    return htmltext;
  }