protected boolean checkQuests(L2PcInstance player) {
    // Noble players can add subbclasses without quests
    if (player.isNoble()) return true;

    QuestState qs = player.getQuestState("234_FatesWhisper");
    if (qs == null || !qs.isCompleted()) return false;

    qs = player.getQuestState("235_MimirsElixir");
    if (qs == null || !qs.isCompleted()) return false;

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

    if (qs.isCreated()) {
      final QuestState q10288 = player.getQuestState(Q10288_SecretMission.class.getSimpleName());
      if ((player.getLevel() < 82) || (q10288 == null) || !q10288.isCompleted()) {
        htmltext = "32757-00.htm";
      } else {
        htmltext = "32757-01.htm";
      }
    } else if (qs.isStarted()) {
      switch (qs.getCond()) {
        case 1:
          htmltext = "32757-04.html";
          break;
        case 2:
        case 3:
          htmltext = "32757-05.html";
          break;
      }
    } else {
      htmltext = "32757-10.html";
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    String htmltext = getNoQuestMsg(player);
    if (st == null) {
      return htmltext;
    }

    switch (st.getState()) {
      case State.CREATED:
        {
          if (player.getLevel() < MIN_LVL) {
            htmltext = "32054-02.htm";
          } else {
            final QuestState q117 = player.getQuestState("117_OceanOfDistantStar"); // TODO: Update.
            htmltext = (q117 != null) && q117.isCompleted() ? "32054-01.htm" : "32054-04.htm";
          }
          break;
        }
      case State.STARTED:
        {
          htmltext =
              st.hasQuestItems(REMNANTS_OF_OLD_DWARVES_DREAMS) ? "32054-05.html" : "32054-06.html";
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return htmltext;
    }

    if (npc.getId() == MOUEN) {
      switch (st.getState()) {
        case State.CREATED:
          htmltext = (player.getLevel() >= 82) ? "30196-01.htm" : "30196-00.htm";
          break;
        case State.STARTED:
          if (st.isCond(1)) {
            htmltext = "30196-04.htm";
          }
          break;
        case State.COMPLETED:
          htmltext = "30196-05.htm";
          break;
      }
    } else if (npc.getId() == JOHNNY) {
      if (st.isCond(1)) {
        htmltext = "32744-01.htm";
      } else if (st.isCompleted()) {
        htmltext = "32744-04.htm";
      }
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return htmltext;
    }

    switch (npc.getId()) {
      case RESEARCHER_LORAIN:
        {
          switch (st.getState()) {
            case State.CREATED:
              {
                final QuestState qs = player.getQuestState("185_Nikolas_Cooperation_Consideration");
                if ((qs != null) && qs.isCompleted() && st.hasQuestItems(LORAINES_CERTIFICATE)) {
                  htmltext = player.getLevel() < MIN_LEVEL ? "30673-02.htm" : "30673-01.htm";
                }
                break;
              }
            case State.STARTED:
              {
                if (st.getCond() >= 1) {
                  htmltext = "30673-04.html";
                }
                break;
              }
            case State.COMPLETED:
              {
                htmltext = getAlreadyCompletedMsg(player);
                break;
              }
          }
          break;
        }
      case MAESTRO_NIKOLA:
        {
          if (st.isStarted()) {
            htmltext = st.isCond(1) ? "30621-01.html" : "30621-04.html";
          }
          break;
        }
      case HEAD_BLACKSMITH_KUSTO:
        {
          if (st.isCond(2) && st.hasQuestItems(METALLOGRAPH)) {
            htmltext = "30512-01.html";
          }
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, true);
    String htmltext = getNoQuestMsg(player);
    if (st == null) {
      return htmltext;
    }

    switch (npc.getId()) {
      case JOHNNY:
        switch (st.getState()) {
          case State.CREATED:
            final QuestState _prev =
                player.getQuestState(Q00249_PoisonedPlainsOfTheLizardmen.class.getSimpleName());
            if ((_prev != null) && _prev.isCompleted() && (player.getLevel() >= MIN_LEVEL)) {
              htmltext = (st.hasQuestItems(SEER_UGOROS_PASS)) ? "32744-07.htm" : "32744-01.htm";
            } else {
              htmltext = "32744-00.htm";
            }
            break;
          case State.STARTED:
            if (st.isCond(1)) {
              htmltext = "32744-05.html";
            } else if (st.isCond(2)) {
              htmltext = "32744-06.html";
            }
            break;
        }
        break;
      case BATRACOS:
        switch (st.getState()) {
          case State.CREATED:
            htmltext = (st.hasQuestItems(SEER_UGOROS_PASS)) ? "32740-05.html" : "32740-00.html";
            break;
          case State.STARTED:
            if (st.isCond(1)) {
              htmltext = "32740-02.html";
            } else if (st.isCond(2)) {
              st.giveItems(SEER_UGOROS_PASS, 1);
              st.exitQuest(true, true);
              htmltext = "32740-04.html";
            }
            break;
        }
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    final QuestState st = player.getQuestState(qn);
    if (st == null) {
      return htmltext;
    }

    final int npcId = npc.getNpcId();
    switch (st.getState()) {
      case State.COMPLETED:
        htmltext = getAlreadyCompletedMsg(player);
        break;
      case State.CREATED:
        final QuestState qs = player.getQuestState("50_LanoscosSpecialBait");
        if (npcId == LANOSCO) {
          htmltext = "31570-02.htm";
          if (qs != null) {
            htmltext = ((player.getLevel() >= 27) && qs.isCompleted()) ? "31570-01.htm" : htmltext;
          }
        }
        break;
      case State.STARTED:
        final int cond = st.getInt("cond");
        switch (npcId) {
          case LANOSCO:
            if (cond == 1) {
              if (st.hasQuestItems(BLUE_TREASURE_BOX)) {
                htmltext = "31570-04.htm";
              } else {
                htmltext = "31570-05.htm";
              }
            } else {
              htmltext = "31570-07.htm";
            }
            break;
          case SHALING:
            if (cond == 2) {
              htmltext = "31434-00.htm";
            }
            break;
        }
    }
    return htmltext;
  }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   QuestState st = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if (st.isCreated()) {
     st = player.getQuestState(Q00119_LastImperialPrince.class.getSimpleName());
     htmltext =
         ((player.getLevel() >= MIN_LEVEL) && (st != null) && (st.isCompleted()))
             ? "31453-01.htm"
             : "31453-04.htm";
   } else if (st.isStarted()) {
     if (st.isMemoState(1)) {
       st.setMemoState(2);
       st.setCond(2, true);
       htmltext = "31453-03.html";
     } else if (st.isMemoState(2)) {
       htmltext = (hasQuestItems(player, ANTELOPE_SKIN) ? "31453-06.html" : "31453-05.html");
     }
   }
   return htmltext;
 }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    final QuestState st = getQuestState(player, true);
    if (st == null) {
      return htmltext;
    }

    final QuestState st2 = player.getQuestState(Q00017_LightAndDarkness.class.getSimpleName());
    if ((st2 != null) && !st2.isCompleted()) {
      return "31517-04.html";
    }

    switch (st.getState()) {
      case State.COMPLETED:
        htmltext = getAlreadyCompletedMsg(player);
        break;
      case State.CREATED:
        htmltext = (player.getLevel() >= 62) ? "31517-00.htm" : "31517-05.html";
        break;
      case State.STARTED:
        final int npcId = npc.getId();
        if (npcId == HIERARCH) {
          if (st.isCond(6)) {
            st.addExpAndSp(865187, 69172);
            st.exitQuest(false, true);
            htmltext = "31517-03.html";
          } else {
            htmltext = "31517-02a.html";
          }
        } else if ((npcId - 31511) == st.getCond()) {
          htmltext = npcId + "-00.html";
        } else {
          htmltext = npcId + "-01.html";
        }
        break;
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    QuestState st = getQuestState(player, true);
    if (st == null) {
      return htmltext;
    }

    switch (st.getState()) {
      case State.COMPLETED:
        htmltext = "32557-0a.html";
        break;
      case State.CREATED:
        st = player.getQuestState(Q10273_GoodDayToFly.class.getSimpleName());
        if (st == null) {
          htmltext = "32557-00.html";
        } else {
          htmltext =
              ((player.getLevel() >= 75) && st.isCompleted()) ? "32557-01.htm" : "32557-00.html";
        }
        break;
      case State.STARTED:
        if ((st.getQuestItemsCount(RED)
                + st.getQuestItemsCount(BLUE)
                + st.getQuestItemsCount(GREEN))
            >= 8) {
          htmltext = "32557-05.html";
          st.giveItems(13728, 1);
          st.addExpAndSp(25160, 2525);
          st.exitQuest(false, true);
        } else {
          htmltext = "32557-04.html";
        }
        break;
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState qs = getQuestState(player, true);
    final int memoState = qs.getMemoState();
    String htmltext = getNoQuestMsg(player);
    if (qs.isCreated()) {
      if (npc.getId() == HERMIT_SANTIAGO) {
        if (!player.isInCategory(CategoryType.HEAL_GROUP)) {
          htmltext = "30648-02.html";
        } else if (player.getLevel() < MIN_LVL) {
          htmltext = "30648-01.html";
        } else {
          htmltext = "30648-03.htm";
        }
      }
    } else if (qs.isStarted()) {
      switch (npc.getId()) {
        case HERMIT_SANTIAGO:
          {
            if (memoState >= 1) {
              if (!hasQuestItems(player, BOOK_OF_SAGE)) {
                htmltext = "30648-09.html";
              } else {
                giveAdena(player, 229298, true);
                giveItems(player, MARK_OF_PILGRIM, 1);
                addExpAndSp(player, 1258250, 81606);
                qs.exitQuest(false, true);
                player.sendPacket(new SocialAction(player.getObjectId(), 3));
                htmltext = "30648-10.html";
              }
            }
            break;
          }
        case PRIEST_PETRON:
          {
            if (memoState == 9) {
              giveItems(player, PICTURE_OF_NAHIR, 1);
              qs.setMemoState(10);
              qs.setCond(10, true);
              htmltext = "30036-01.html";
            } else if (memoState == 10) {
              htmltext = "30036-02.html";
            } else if (memoState == 11) {
              takeItems(player, PICTURE_OF_NAHIR, 1);
              takeItems(player, HAIR_OF_NAHIR, 1);
              giveItems(player, STATUE_OF_EINHASAD, 1);
              qs.setMemoState(12);
              qs.setCond(12, true);
              htmltext = "30036-03.html";
            } else if (memoState == 12) {
              if (hasQuestItems(player, STATUE_OF_EINHASAD)) {
                htmltext = "30036-04.html";
              }
            }
            break;
          }
        case PRIEST_PRIMOS:
          {
            if (memoState == 8) {
              qs.setMemoState(9);
              qs.setCond(9, true);
              htmltext = "30117-01.html";
            } else if (memoState == 9) {
              qs.setMemoState(9);
              qs.setCond(9, true);
              htmltext = "30117-02.html";
            }
            break;
          }
        case ANDELLIA:
          {
            if (memoState == 12) {
              if (player.getLevel() >= 0) {
                qs.setMemoState(13);
                qs.setCond(13, true);
                htmltext = "30362-01.html";
              } else {
                htmltext = "30362-01a.html";
              }
            } else if (memoState == 13) {
              htmltext = "30362-02.html";
            } else if (memoState == 14) {
              htmltext = "30362-02a.html";
            } else if (memoState == 15) {
              if (hasQuestItems(player, BOOK_OF_DARKNESS)) {
                htmltext = "30362-03.html";
              } else {
                htmltext = "30362-07.html";
              }
            } else if (memoState == 16) {
              htmltext = "30362-06.html";
            }
            break;
          }
        case GAURI_TWINKLEROCK:
          {
            if (memoState == 5) {
              if (hasQuestItems(player, SPIRIT_OF_FLAME)) {
                takeItems(player, SPIRIT_OF_FLAME, 1);
                giveItems(player, TAG_OF_RUMOR, 1);
                qs.setMemoState(6);
                qs.setCond(7, true);
                htmltext = "30550-01.html";
              }
            } else if (memoState == 6) {
              htmltext = "30550-02.html";
            }
            break;
          }
        case SEER_TANAPI:
          {
            if (memoState == 1) {
              if (hasQuestItems(player, VOUCHER_OF_TRIAL)) {
                takeItems(player, VOUCHER_OF_TRIAL, 1);
                qs.setMemoState(2);
                qs.setCond(2, true);
                htmltext = "30571-01.html";
              }
            } else if (memoState == 2) {
              htmltext = "30571-02.html";
            } else if (memoState == 5) {
              if (hasQuestItems(player, SPIRIT_OF_FLAME)) {
                qs.setCond(6, true);
                htmltext = "30571-03.html";
              }
            }
            break;
          }
        case ELDER_CASIAN:
          {
            if (memoState == 16) {
              qs.setMemoState(17);
              if (!hasQuestItems(player, BOOK_OF_SAGE)) {
                giveItems(player, BOOK_OF_SAGE, 1);
              }
              takeItems(player, GREY_BADGE, 1);
              takeItems(player, SPIRIT_OF_FLAME, 1);
              takeItems(player, STATUE_OF_EINHASAD, 1);
              if (hasQuestItems(player, BOOK_OF_DARKNESS)) {
                addExpAndSp(player, 5000, 500);
                takeItems(player, BOOK_OF_DARKNESS, 1);
              }
              htmltext = "30612-01.html";

            } else if (memoState == 17) {
              qs.setCond(17, true);
              htmltext = "30612-02.html";
            }
            break;
          }
        case ANCESTOR_MARTANKUS:
          {
            if (memoState == 2) {
              qs.setMemoState(3);
              qs.setCond(3, true);
              htmltext = "30649-01.html";
            } else if (memoState == 3) {
              htmltext = "30649-02.html";
            } else if (memoState == 4) {
              if (hasQuestItems(player, ESSENSE_OF_FLAME)) {
                htmltext = "30649-03.html";
              }
            }
            break;
          }
        case PRIEST_OF_THE_EARTH_GERALD:
          {
            if (memoState == 6) {
              if (hasQuestItems(player, TAG_OF_RUMOR)) {
                htmltext = "30650-01.html";
              }
            } else if (hasQuestItems(player, GREY_BADGE, BOOK_OF_GERALD)) {
              giveAdena(player, 100000, true);
              takeItems(player, BOOK_OF_GERALD, 1);
              htmltext = "30650-04.html";
            }
            break;
          }
        case WANDERER_DORF:
          {
            if (memoState == 6) {
              if (hasQuestItems(player, TAG_OF_RUMOR)) {
                giveItems(player, GREY_BADGE, 1);
                takeItems(player, TAG_OF_RUMOR, 1);
                qs.setMemoState(8);
                htmltext = "30651-01.html";
              }
            } else if (memoState == 7) {
              if (hasQuestItems(player, TAG_OF_RUMOR)) {
                giveItems(player, GREY_BADGE, 1);
                takeItems(player, TAG_OF_RUMOR, 1);
                qs.setMemoState(8);
                htmltext = "30651-02.html";
              }
            } else if (memoState == 8) {
              qs.setCond(8, true);
              htmltext = "30651-03.html";
            }
            break;
          }
        case URUHA:
          {
            if (memoState == 14) {
              if (hasQuestItems(player, DEBRIS_OF_WILLOW)) {
                htmltext = "30652-01.html";
              }
            } else if (memoState == 15) {
              if (hasQuestItems(player, BOOK_OF_DARKNESS)) {
                htmltext = "30652-03.html";
              }
            }
            break;
          }
      }
    } else if (qs.isCompleted()) {
      if (npc.getId() == HERMIT_SANTIAGO) {
        htmltext = getAlreadyCompletedMsg(player);
      }
    }
    return htmltext;
  }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, true);
   final int memoState = qs.getMemoState();
   String htmltext = getNoQuestMsg(player);
   if (qs.isCreated()) {
     if (npc.getId() == IRON_GATES_LOCKIRIN) {
       if (player.getClassId() == ClassId.artisan) {
         if (player.getLevel() >= MIN_LEVEL) {
           htmltext = "30531-03.htm";
         } else {
           htmltext = "30531-01.html";
         }
       } else {
         htmltext = "30531-02.html";
       }
     }
   } else if (qs.isStarted()) {
     switch (npc.getId()) {
       case IRON_GATES_LOCKIRIN:
         {
           if ((memoState >= 1)
               && !hasQuestItems(
                   player,
                   RECOMMENDATION_OF_BALANKI,
                   RECOMMENDATION_OF_FILAUR,
                   RECOMMENDATION_OF_ARIN)) {
             htmltext = "30531-05.html";
           } else if (hasQuestItems(
               player,
               RECOMMENDATION_OF_BALANKI,
               RECOMMENDATION_OF_FILAUR,
               RECOMMENDATION_OF_ARIN)) {
             giveAdena(player, 372154, true);
             giveItems(player, MARK_OF_MAESTRO, 1);
             addExpAndSp(player, 2085244, 141240);
             qs.exitQuest(false, true);
             player.sendPacket(new SocialAction(player.getObjectId(), 3));
             htmltext = "30531-06.html";
           }
           break;
         }
       case GOLDEN_WHEELS_SPIRON:
         {
           htmltext = "30532-01.html";
           break;
         }
       case SILVER_SCALES_BALANKI:
         {
           if ((memoState == 1) && !hasQuestItems(player, RECOMMENDATION_OF_BALANKI)) {
             htmltext = "30533-01.html";
           } else if (memoState == 2) {
             if (!hasQuestItems(player, LETTER_OF_SOLDER_DERACHMENT)) {
               htmltext = "30533-03.html";
             } else {
               giveItems(player, RECOMMENDATION_OF_BALANKI, 1);
               takeItems(player, LETTER_OF_SOLDER_DERACHMENT, 1);
               qs.setMemoState(1);
               if (hasQuestItems(player, RECOMMENDATION_OF_ARIN, RECOMMENDATION_OF_FILAUR)) {
                 qs.setCond(2, true);
               }
               htmltext = "30533-04.html";
             }
           } else if (hasQuestItems(player, RECOMMENDATION_OF_BALANKI)) {
             htmltext = "30533-05.html";
           }
           break;
         }
       case BRONZE_KEYS_KEEF:
         {
           htmltext = "30534-01.html";
           break;
         }
       case GRAY_PILLAR_MEMBER_FILAUR:
         {
           if ((memoState == 1) && !hasQuestItems(player, RECOMMENDATION_OF_FILAUR)) {
             giveItems(player, ARCHITECTURE_OF_CRUMA, 1);
             qs.setMemoState(4);
             htmltext = "30535-01.html";
           } else if (memoState == 4) {
             if (hasQuestItems(player, ARCHITECTURE_OF_CRUMA)
                 && !hasQuestItems(player, REPORT_OF_CRUMA)) {
               htmltext = "30535-02.html";
             } else if (hasQuestItems(player, REPORT_OF_CRUMA)
                 && !hasQuestItems(player, ARCHITECTURE_OF_CRUMA)) {
               giveItems(player, RECOMMENDATION_OF_FILAUR, 1);
               takeItems(player, REPORT_OF_CRUMA, 1);
               qs.setMemoState(1);
               if (hasQuestItems(player, RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_ARIN)) {
                 qs.setCond(2, true);
               }
               htmltext = "30535-03.html";
             }
           } else if (hasQuestItems(player, RECOMMENDATION_OF_FILAUR)) {
             htmltext = "30535-04.html";
           }
           break;
         }
       case BLACK_ANVILS_ARIN:
         {
           if ((memoState == 1) && !hasQuestItems(player, RECOMMENDATION_OF_ARIN)) {
             giveItems(player, PAINT_OF_TELEPORT_DEVICE, 1);
             qs.setMemoState(3);
             htmltext = "30536-01.html";
           } else if (memoState == 3) {
             if (hasQuestItems(player, PAINT_OF_TELEPORT_DEVICE)
                 && !hasQuestItems(player, TELEPORT_DEVICE)) {
               htmltext = "30536-02.html";
             } else if (getQuestItemsCount(player, TELEPORT_DEVICE) >= 5) {
               giveItems(player, RECOMMENDATION_OF_ARIN, 1);
               takeItems(player, TELEPORT_DEVICE, -1);
               qs.setMemoState(1);
               if (hasQuestItems(player, RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_FILAUR)) {
                 qs.setCond(2, true);
               }
               htmltext = "30536-03.html";
             }
           } else if (hasQuestItems(player, RECOMMENDATION_OF_ARIN)) {
             htmltext = "30536-04.html";
           }
           break;
         }
       case MASTER_TOMA:
         {
           if (memoState == 3) {
             if (hasQuestItems(player, PAINT_OF_TELEPORT_DEVICE)) {
               htmltext = "30556-01.html";
             } else if (hasQuestItems(player, BROKEN_TELEPORT_DEVICE)) {
               giveItems(player, TELEPORT_DEVICE, 5);
               takeItems(player, BROKEN_TELEPORT_DEVICE, 1);
               htmltext = "30556-06.html";
             } else if (getQuestItemsCount(player, TELEPORT_DEVICE) == 5) {
               htmltext = "30556-07.html";
             }
           }
           break;
         }
       case CHIEF_CROTO:
         {
           if ((memoState == 2)
               && !hasAtLeastOneQuestItem(
                   player, PAINT_OF_KAMURU, NECKLACE_OF_KAMUTU, LETTER_OF_SOLDER_DERACHMENT)) {
             htmltext = "30671-01.html";
           } else if (hasQuestItems(player, PAINT_OF_KAMURU)
               && !hasQuestItems(player, NECKLACE_OF_KAMUTU)) {
             htmltext = "30671-03.html";
           } else if (hasQuestItems(player, NECKLACE_OF_KAMUTU)) {
             giveItems(player, LETTER_OF_SOLDER_DERACHMENT, 1);
             takeItems(player, NECKLACE_OF_KAMUTU, 1);
             takeItems(player, PAINT_OF_KAMURU, 1);
             htmltext = "30671-04.html";
           } else if (hasQuestItems(player, LETTER_OF_SOLDER_DERACHMENT)) {
             htmltext = "30671-05.html";
           }
           break;
         }
       case JAILER_DUBABAH:
         {
           if (hasQuestItems(player, PAINT_OF_KAMURU)) {
             htmltext = "30672-01.html";
           }
           break;
         }
       case RESEARCHER_LORAIN:
         {
           if (memoState == 4) {
             if (hasQuestItems(player, ARCHITECTURE_OF_CRUMA)
                 && !hasAtLeastOneQuestItem(player, INGREDIENTS_OF_ANTIDOTE, REPORT_OF_CRUMA)) {
               giveItems(player, INGREDIENTS_OF_ANTIDOTE, 1);
               takeItems(player, ARCHITECTURE_OF_CRUMA, 1);
               htmltext = "30673-01.html";
             } else if (hasQuestItems(player, INGREDIENTS_OF_ANTIDOTE)
                 && !hasQuestItems(player, REPORT_OF_CRUMA)) {
               if ((getQuestItemsCount(player, STINGER_WASP_NEEDLE) >= 10)
                   && (getQuestItemsCount(player, MARSH_SPIDERS_WEB) >= 10)
                   && (getQuestItemsCount(player, BLOOD_OF_LEECH) >= 10)) {
                 htmltext = "30673-03.html";
               } else {
                 htmltext = "30673-02.html";
               }
             } else if (hasQuestItems(player, REPORT_OF_CRUMA)) {
               htmltext = "30673-05.html";
             }
           }
           break;
         }
     }
   } else if (qs.isCompleted()) {
     if (npc.getId() == IRON_GATES_LOCKIRIN) {
       htmltext = getAlreadyCompletedMsg(player);
     }
   }
   return htmltext;
 }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if (qs.isCreated() || qs.isCompleted()) {
     if (npc.getId() == MASTER_VIRGIL) {
       htmltext = "30329-01.htm";
     }
   } else if (qs.isStarted()) {
     switch (npc.getId()) {
       case MASTER_VIRGIL:
         {
           if (hasQuestItems(player, PALLUS_TALISMAN)) {
             if (!hasQuestItems(player, LYCANTHROPE_SKULL)) {
               htmltext = "30329-07.html";
             } else if (hasQuestItems(player, LYCANTHROPE_SKULL)
                 && (getQuestItemsCount(player, LYCANTHROPE_SKULL) < 13)) {
               htmltext = "30329-08.html";
             } else {
               htmltext = "30329-09.html";
             }
           } else if (hasQuestItems(player, COFFIN_OF_ETERNAL_REST)) {
             giveAdena(player, 163800, true);
             giveItems(player, GAZE_OF_ABYSS, 1);
             final int level = player.getLevel();
             if (level >= 20) {
               addExpAndSp(player, 320534, 26212);
             } else if (level == 19) {
               addExpAndSp(player, 456128, 32910);
             } else {
               addExpAndSp(player, 591724, 39608);
             }
             qs.exitQuest(false, true);
             player.sendPacket(new SocialAction(player.getObjectId(), 3));
             qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
             htmltext = "30329-11.html";
           } else if (hasAtLeastOneQuestItem(player, VIRGILS_LETTER, MORTE_TALISMAN)) {
             htmltext = "30329-12.html";
           }
           break;
         }
       case KALINTA:
         {
           if (hasQuestItems(player, VIRGILS_LETTER)) {
             htmltext = "30422-01.html";
           } else if (hasQuestItems(player, MORTE_TALISMAN)) {
             if (!hasQuestItems(player, ARACHNID_TRACKER_SILK, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-03.html";
             } else if (!hasQuestItems(player, ARACHNID_TRACKER_SILK)
                 && hasQuestItems(player, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-04.html";
             } else if ((getQuestItemsCount(player, ARACHNID_TRACKER_SILK) >= 5)
                 && hasQuestItems(player, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-05.html";
             } else if (hasQuestItems(player, ARACHNID_TRACKER_SILK, VENOMOUS_SPIDERS_CARAPACE)) {
               htmltext = "30422-04.html";
             }
           } else if (hasQuestItems(player, COFFIN_OF_ETERNAL_REST)) {
             htmltext = "30422-06.html";
           }
           break;
         }
     }
   }
   return htmltext;
 }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance talker) {
   final QuestState qs = getQuestState(talker, true);
   String htmltext = getNoQuestMsg(talker);
   switch (npc.getId()) {
     case TIFAREN:
       {
         switch (qs.getCond()) {
           case 0:
             {
               if (qs.isCreated()) {
                 htmltext = "31334-01.htm";
               } else if (qs.isCompleted()) {
                 htmltext = getAlreadyCompletedMsg(talker);
               }
               break;
             }
           case 1:
           case 3:
             {
               htmltext = "31334-05.html";
               break;
             }
           case 4:
           case 5:
             {
               if (hasQuestItems(talker, CROSS_OF_EINHASAD)) {
                 if (!hasQuestItems(talker, LOST_SKULL_OF_ELF)) {
                   htmltext = "31334-09.html";
                 } else if (_tifarenOwner == 0) {
                   htmltext = "31334-10.html";
                 } else {
                   htmltext = "31334-11.html";
                 }
               }
               break;
             }
           case 6:
           case 7:
             {
               if (hasQuestItems(talker, CROSS_OF_EINHASAD)) {
                 if (_tifarenOwner == 0) {
                   htmltext = "31334-17.html";
                 } else if (_tifarenOwner == talker.getObjectId()) {
                   htmltext = "31334-15.html";
                 } else {
                   htmltext = "31334-16.html";
                   qs.setCond(6, true);
                 }
               }
               break;
             }
           case 8:
             {
               if (hasQuestItems(talker, CROSS_OF_EINHASAD)) {
                 htmltext = "31334-18.html";
               }
               break;
             }
         }
         break;
       }
     case GHOST_OF_PRIEST:
       {
         playSound(talker, QuestSound.AMBSOUND_HORROR_15);
         if (npc.getScriptValue() == talker.getObjectId()) {
           htmltext = "31528-01.html";
         } else {
           htmltext = "31528-03.html";
         }
         break;
       }
     case INNOCENTIN:
       {
         switch (qs.getCond()) {
           case 2:
             {
               if (!hasQuestItems(talker, CROSS_OF_EINHASAD)) {
                 giveItems(talker, CROSS_OF_EINHASAD, 1);
                 qs.setCond(3, true);
                 htmltext = "31328-01.html";
               }
               break;
             }
           case 3:
             {
               if (hasQuestItems(talker, CROSS_OF_EINHASAD)) {
                 htmltext = "31328-01b.html";
               }
               break;
             }
           case 8:
             {
               if (hasQuestItems(talker, CROSS_OF_EINHASAD)) {
                 htmltext = "31328-02.html";
               } else {
                 htmltext = "31328-04.html";
               }
               break;
             }
           case 9:
             {
               htmltext = "31328-09a.html";
               break;
             }
           case 14:
             {
               if (hasQuestItems(talker, REPORT_BOX)) {
                 htmltext = "31328-10.html";
               }
               break;
             }
           case 15:
             {
               htmltext = "31328-12.html";
               break;
             }
           case 16:
             {
               addExpAndSp(talker, 345966, 31578);
               qs.exitQuest(false, true);
               if (talker.getLevel() >= MIN_LVL) {
                 htmltext = "31328-20.html";
               } else {
                 htmltext = "31328-21.html";
               }
               break;
             }
         }
         break;
       }
     case WELL:
       {
         switch (qs.getCond()) {
           case 10:
             {
               if (hasQuestItems(talker, JEWEL_OF_ADVENTURER_1)) {
                 htmltext = "31527-01.html";
                 playSound(talker, QuestSound.AMBSOUND_HORROR_01);
               }
               break;
             }
           case 12:
             {
               if (hasQuestItems(talker, JEWEL_OF_ADVENTURER_2)
                   && !hasQuestItems(talker, SEALED_REPORT_BOX)) {
                 giveItems(talker, SEALED_REPORT_BOX, 1);
                 qs.setCond(13, true);
                 htmltext = "31527-04.html";
               }
               break;
             }
           case 13:
           case 14:
           case 15:
           case 16:
             {
               htmltext = "31527-05.html";
               break;
             }
         }
         break;
       }
     case GHOST_OF_ADVENTURER:
       {
         switch (qs.getCond()) {
           case 9:
             {
               if (hasQuestItems(talker, LETTER_OF_INNOCENTIN)) {
                 switch (qs.getMemoState()) {
                   case 0:
                     {
                       htmltext = "31529-01.html";
                       break;
                     }
                   case 8:
                     {
                       htmltext = "31529-03a.html";
                       break;
                     }
                   case 9:
                     {
                       htmltext = "31529-10.html";
                       break;
                     }
                   default:
                     break;
                 }
               }
               break;
             }
           case 10:
             {
               if (hasQuestItems(talker, JEWEL_OF_ADVENTURER_1)) {
                 final int id = qs.getMemoState();
                 if (id == 10) {
                   htmltext = "31529-12.html";
                 } else if (id == 11) {
                   htmltext = "31529-14.html";
                 }
               }
               break;
             }
           case 11:
             {
               if (hasQuestItems(talker, JEWEL_OF_ADVENTURER_2)
                   && !hasQuestItems(talker, SEALED_REPORT_BOX)) {
                 htmltext = "31529-15.html";
                 qs.setCond(12, true);
               }
               break;
             }
           case 13:
             {
               if (hasQuestItems(talker, JEWEL_OF_ADVENTURER_2)
                   && hasQuestItems(talker, SEALED_REPORT_BOX)) {
                 giveItems(talker, REPORT_BOX, 1);
                 takeItems(talker, SEALED_REPORT_BOX, -1);
                 takeItems(talker, JEWEL_OF_ADVENTURER_2, -1);
                 qs.setCond(14, true);
                 htmltext = "31529-16.html";
               }
               break;
             }
           case 14:
             {
               if (hasQuestItems(talker, REPORT_BOX)) {
                 htmltext = "31529-17.html";
               }
               break;
             }
         }
         break;
       }
   }
   return htmltext;
 }
Example #15
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance talker) {
   final QuestState qs = getQuestState(talker, true);
   String htmltext = getNoQuestMsg(talker);
   switch (npc.getId()) {
     case BLACKSMITH_KAROYD:
       {
         if (qs.isCreated()) {
           if (talker.getRace() != Race.DARK_ELF) {
             htmltext = "30307-01.htm";
           } else if (talker.getLevel() < MIN_LVL) {
             htmltext = "30307-02.htm";
           } else {
             htmltext = "30307-03.htm";
           }
         } else if (qs.isStarted()) {
           if (hasAtLeastOneQuestItem(
               talker, KAROYDS_LETTER, CECKTINONS_VOUCHER1, CECKTINONS_VOUCHER2)) {
             htmltext = "30307-06.html";
           } else if (hasQuestItems(talker, STEELBENDERS_HEAD)) {
             // Q00281_HeadForTheHills.giveNewbieReward(talker);
             addExpAndSp(talker, 46663, 3999);
             giveAdena(talker, 19799, true);
             for (ItemHolder reward : REWARDS) {
               rewardItems(talker, reward);
             }
             rewardItems(talker, BLOODSABER, 1);
             qs.exitQuest(false, true);
             talker.sendPacket(new SocialAction(talker.getObjectId(), 3));
             htmltext = "30307-07.html";
           }
         } else if (qs.isCompleted()) {
           htmltext = getAlreadyCompletedMsg(talker);
           break;
         }
       }
     case CECON:
       {
         if (qs.isStarted()) {
           if (hasQuestItems(talker, KAROYDS_LETTER)) {
             qs.setCond(2, true);
             takeItems(talker, KAROYDS_LETTER, 1);
             giveItems(talker, CECKTINONS_VOUCHER1, 1);
             htmltext = "30132-01.html";
           } else if (hasAtLeastOneQuestItem(talker, CECKTINONS_VOUCHER1, CECKTINONS_VOUCHER2)) {
             htmltext = "30132-02.html";
           } else if (hasQuestItems(talker, SOUL_CATCHER)) {
             qs.setCond(6, true);
             takeItems(talker, SOUL_CATCHER, 1);
             giveItems(talker, PRESERVE_OIL, 1);
             htmltext = "30132-03.html";
           } else if (hasQuestItems(talker, PRESERVE_OIL)
               && !hasQuestItems(talker, ZOMBIE_HEAD, STEELBENDERS_HEAD)) {
             htmltext = "30132-04.html";
           } else if (hasQuestItems(talker, ZOMBIE_HEAD)) {
             qs.setCond(8, true);
             takeItems(talker, ZOMBIE_HEAD, 1);
             giveItems(talker, STEELBENDERS_HEAD, 1);
             htmltext = "30132-05.html";
           } else if (hasQuestItems(talker, STEELBENDERS_HEAD)) {
             htmltext = "30132-06.html";
           }
         }
         break;
       }
     case HARNE:
       {
         if (qs.isStarted()) {
           if (hasQuestItems(talker, CECKTINONS_VOUCHER1)) {
             qs.setCond(3, true);
             takeItems(talker, CECKTINONS_VOUCHER1, 1);
             giveItems(talker, CECKTINONS_VOUCHER2, 1);
             htmltext = "30144-01.html";
           } else if (hasQuestItems(talker, CECKTINONS_VOUCHER2)) {
             if (getQuestItemsCount(talker, BONE_FRAGMENT) >= 10) {
               qs.setCond(5, true);
               takeItems(talker, CECKTINONS_VOUCHER2, 1);
               takeItems(talker, BONE_FRAGMENT, 10);
               giveItems(talker, SOUL_CATCHER, 1);
               htmltext = "30144-03.html";
             } else {
               htmltext = "30144-02.html";
             }
           } else if (hasQuestItems(talker, SOUL_CATCHER)) {
             htmltext = "30144-04.html";
           }
         }
         break;
       }
   }
   return htmltext;
 }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, false);
   String htmltext = null;
   if (qs == null) {
     return htmltext;
   }
   switch (event) {
     case "31529-02.html":
     case "31529-04.html":
     case "31529-05.html":
     case "31529-06.html":
     case "31529-07.html":
     case "31529-09.html":
     case "31529-13.html":
     case "31529-13a.html":
     case "31528-02.html":
     case "31528-05.html":
     case "31528-06.html":
     case "31528-07.html":
     case "31328-13.html":
     case "31328-06.html":
     case "31328-05.html":
     case "31328-02.html":
     case "31328-07.html":
     case "31328-08.html":
     case "31328-14.html":
     case "31328-15.html":
     case "31328-16.html":
     case "31328-17.html":
     case "31328-18.html":
     case "31334-12.html":
       {
         htmltext = event;
         break;
       }
     case "31334-02.htm":
       {
         if (qs.isCreated()) {
           final QuestState q21 = player.getQuestState(Q00021_HiddenTruth.class.getSimpleName());
           if ((player.getLevel() >= MIN_LVL) && (q21 != null) && q21.isCompleted()) {
             htmltext = event;
           } else {
             htmltext = "31334-03.html";
           }
         }
         break;
       }
     case "31334-04.html":
       {
         if (qs.isCreated()) {
           qs.startQuest();
           htmltext = event;
         }
         break;
       }
     case "31334-06.html":
       {
         if (qs.isCond(3) && hasQuestItems(player, CROSS_OF_EINHASAD)) {
           htmltext = event;
         } else {
           qs.setCond(2, true);
           htmltext = "31334-07.html";
         }
         break;
       }
     case "31334-08.html":
       {
         if (qs.isCond(3)) {
           qs.setCond(4, true);
           htmltext = event;
         }
         break;
       }
     case "31334-13.html":
       {
         final int cond = qs.getCond();
         if (((5 <= cond) && (cond <= 7)) && hasQuestItems(player, CROSS_OF_EINHASAD)) {
           if (_tifarenOwner == 0) {
             _tifarenOwner = player.getObjectId();
             final L2Npc ghost2 = addSpawn(GHOST_OF_PRIEST, PRIEST_LOC, true, 0);
             ghost2.setScriptValue(player.getObjectId());
             qs.startQuestTimer("DESPAWN_GHOST2", 1000 * 120, ghost2);
             ghost2.broadcastPacket(
                 new NpcSay(
                         ghost2.getObjectId(),
                         Say2.NPC_ALL,
                         ghost2.getId(),
                         NpcStringId.DID_YOU_CALL_ME_S1)
                     .addStringParameter(player.getName()));
             if (((cond == 5) || (cond == 6)) && hasQuestItems(player, LOST_SKULL_OF_ELF)) {
               takeItems(player, LOST_SKULL_OF_ELF, -1);
               qs.setCond(7, true);
             }
             htmltext = event;
           } else {
             qs.setCond(6, true);
             htmltext = "31334-14.html";
           }
         }
         break;
       }
     case "31528-04.html":
       {
         if (npc.getScriptValue() == player.getObjectId()) {
           playSound(player, QuestSound.AMBSOUND_HORROR_03);
           htmltext = event;
         }
         break;
       }
     case "31528-08.html":
       {
         QuestTimer qt = getQuestTimer("DESPAWN_GHOST2", npc, player);
         if ((qt != null) && (npc.getScriptValue() == player.getObjectId())) {
           qt.cancelAndRemove();
           npc.setScriptValue(0);
           qs.startQuestTimer("DESPAWN_GHOST2", 1000 * 3, npc);
           qs.setCond(8);
           htmltext = event;
         }
         break;
       }
     case "DESPAWN_GHOST2":
       {
         _tifarenOwner = 0;
         if (npc.getScriptValue() != 0) {
           npc.broadcastPacket(
               new NpcSay(
                   npc.getObjectId(),
                   Say2.NPC_ALL,
                   npc.getId(),
                   NpcStringId.IM_CONFUSED_MAYBE_ITS_TIME_TO_GO_BACK));
         }
         npc.deleteMe();
         break;
       }
     case "31328-03.html":
       {
         if (qs.isCond(8)) {
           takeItems(player, CROSS_OF_EINHASAD, -1);
           htmltext = event;
         }
         break;
       }
     case "31328-09.html":
       {
         if (qs.isCond(8)) {
           giveItems(player, LETTER_OF_INNOCENTIN, 1);
           qs.setCond(9, true);
           htmltext = event;
         }
         break;
       }
     case "31328-11.html":
       {
         if (qs.isCond(14) && hasQuestItems(player, REPORT_BOX)) {
           takeItems(player, REPORT_BOX, -1);
           qs.setCond(15, true);
           htmltext = event;
         }
         break;
       }
     case "31328-19.html":
       {
         if (qs.isCond(15)) {
           qs.setCond(16, true);
           htmltext = event;
         }
         break;
       }
     case "31527-02.html":
       {
         if (qs.isCond(10) && (_soulWellNpc == null)) {
           _soulWellNpc = addSpawn(SOUL_OF_WELL, SOUL_WELL_LOC, true, 0);
           qs.startQuestTimer("activateSoulOfWell", 90000, _soulWellNpc);
           qs.startQuestTimer("despawnSoulOfWell", 120000, _soulWellNpc);
           _soulWellNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
           playSound(player, QuestSound.SKILLSOUND_ANTARAS_FEAR);
           htmltext = event;
         } else {
           htmltext = "31527-03.html";
         }
         break;
       }
     case "activateSoulOfWell":
       {
         // this enables onAttack ELSE IF block which allows the player to proceed the quest
         npc.setScriptValue(1);
         break;
       }
     case "despawnSoulOfWell":
       {
         // if the player fails to proceed the quest in 2 minutes, the soul is unspawned
         if (!npc.isDead()) {
           _soulWellNpc = null;
         }
         npc.deleteMe();
         break;
       }
     case "31529-03.html":
       {
         if (qs.isCond(9) && hasQuestItems(player, LETTER_OF_INNOCENTIN)) {
           qs.setMemoState(8);
           htmltext = event;
         }
         break;
       }
     case "31529-08.html":
       {
         if (qs.isMemoState(8)) {
           qs.setMemoState(9);
           htmltext = event;
         }
         break;
       }
     case "31529-11.html":
       {
         if (qs.isMemoState(9)) {
           giveItems(player, JEWEL_OF_ADVENTURER_1, 1);
           qs.setCond(10, true);
           qs.setMemoState(10);
           htmltext = event;
         }
         break;
       }
   }
   return htmltext;
 }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if (qs.isCreated() || qs.isCompleted()) {
     if (npc.getId() == PRIEST_MANUEL) {
       if (!hasQuestItems(player, LEAF_OF_ORACLE)) {
         htmltext = "30293-01.htm";
       } else {
         htmltext = "30293-04.htm";
       }
     }
   } else if (qs.isStarted()) {
     switch (npc.getId()) {
       case PRIEST_MANUEL:
         {
           if (hasQuestItems(player, CRYSTAL_MEDALLION)) {
             if (!hasAtLeastOneQuestItem(
                 player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
               if (qs.isMemoState(2)) {
                 qs.setMemoState(1);
                 qs.setCond(8);
                 htmltext = "30293-09.html";
               } else {
                 qs.setMemoState(1);
                 htmltext = "30293-06.html";
               }
             } else if (hasQuestItems(
                 player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, LIZARD_CAPTAIN_ORDER)) {
               if (!hasQuestItems(player, HALF_OF_DAIRY)) {
                 giveAdena(player, 163800, true);
                 giveItems(player, LEAF_OF_ORACLE, 1);
                 final int level = player.getLevel();
                 if (level >= 20) {
                   addExpAndSp(player, 320534, 20392);
                 } else if (level == 19) {
                   addExpAndSp(player, 456128, 27090);
                 } else {
                   addExpAndSp(player, 591724, 33788);
                 }
                 qs.exitQuest(false, true);
                 player.sendPacket(new SocialAction(player.getObjectId(), 3));
                 qs.saveGlobalQuestVar("1ClassQuestFinished", "1");
                 htmltext = "30293-08.html";
               }
             } else {
               htmltext = "30293-07.html";
             }
           }
           break;
         }
       case ALLANA:
         {
           if (hasQuestItems(player, CRYSTAL_MEDALLION)) {
             if (!hasAtLeastOneQuestItem(
                 player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
               if (qs.isMemoState(2)) {
                 htmltext = "30424-05.html";
               } else if (qs.isMemoState(1)) {
                 qs.setCond(2, true);
                 htmltext = "30424-01.html";
               }
             } else if (!hasAtLeastOneQuestItem(
                     player, SWINDLERS_MONEY, ALLANA_OF_DAIRY, HALF_OF_DAIRY)
                 && hasQuestItems(player, LIZARD_CAPTAIN_ORDER)) {
               qs.setMemoState(2);
               giveItems(player, HALF_OF_DAIRY, 1);
               qs.setCond(4, true);
               htmltext = "30424-02.html";
             } else if (!hasAtLeastOneQuestItem(player, SWINDLERS_MONEY, ALLANA_OF_DAIRY)
                 && hasQuestItems(player, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
               if ((qs.isMemoState(3)) && !hasQuestItems(player, TAMIL_NECKLACE)) {
                 qs.setMemoState(2);
                 qs.setCond(4, true);
                 htmltext = "30424-06.html";
               } else {
                 htmltext = "30424-03.html";
               }
             } else if (hasQuestItems(player, SWINDLERS_MONEY, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)
                 && !hasQuestItems(player, ALLANA_OF_DAIRY)) {
               giveItems(player, ALLANA_OF_DAIRY, 1);
               takeItems(player, HALF_OF_DAIRY, 1);
               qs.setCond(9, true);
               htmltext = "30424-04.html";
             } else if (hasQuestItems(
                 player, SWINDLERS_MONEY, LIZARD_CAPTAIN_ORDER, ALLANA_OF_DAIRY)) {
               qs.setCond(7, true);
               htmltext = "30424-05.html";
             }
           }
           break;
         }
       case PERRIN:
         {
           if (hasQuestItems(player, CRYSTAL_MEDALLION, LIZARD_CAPTAIN_ORDER, HALF_OF_DAIRY)) {
             if (hasQuestItems(player, TAMIL_NECKLACE)) {
               giveItems(player, SWINDLERS_MONEY, 1);
               takeItems(player, TAMIL_NECKLACE, 1);
               qs.setCond(6, true);
               htmltext = "30428-04.html";
             } else if (hasQuestItems(player, SWINDLERS_MONEY)) {
               htmltext = "30428-05.html";
             } else if (qs.isMemoState(3)) {
               htmltext = "30428-06.html";
             } else {
               htmltext = "30428-01.html";
             }
           }
           break;
         }
     }
   }
   return htmltext;
 }
Example #18
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if (qs.isCreated()) {
     if (npc.getId() == MAGISTER_MIRIEN) {
       if ((player.getClassId() == ClassId.WIZARD)
           || (player.getClassId() == ClassId.ELVEN_WIZARD)
           || ((player.getClassId() == ClassId.DARK_WIZARD))) {
         if (player.getLevel() < MIN_LVL) {
           htmltext = "30461-02.html";
         } else {
           htmltext = "30461-03.htm";
         }
       } else {
         htmltext = "30461-01.html";
       }
     }
   } else if (qs.isStarted()) {
     switch (npc.getId()) {
       case MAGISTER_MIRIEN:
         {
           if (hasQuestItems(player, MIRIENS_1ST_SIGIL)) {
             if (!hasQuestItems(player, SYMBOL_OF_SYLVAIN)) {
               htmltext = "30461-05.html";
             } else {
               takeItems(player, MIRIENS_1ST_SIGIL, 1);
               giveItems(player, MIRIENS_2ND_SIGIL, 1);
               takeItems(player, SYMBOL_OF_SYLVAIN, 1);
               qs.setCond(15, true);
               htmltext = "30461-06.html";
             }
           } else if (hasQuestItems(player, MIRIENS_2ND_SIGIL)) {
             if (!hasQuestItems(player, SYMBOL_OF_JUREK)) {
               htmltext = "30461-07.html";
             } else {
               htmltext = "30461-08.html";
             }
           } else if (hasQuestItems(player, MIRIENS_INSTRUCTION)) {
             if (player.getLevel() < LEVEL) {
               htmltext = "30461-11.html";
             } else {
               takeItems(player, MIRIENS_INSTRUCTION, 1);
               giveItems(player, MIRIENS_3RD_SIGIL, 1);
               qs.setCond(19, true);
               htmltext = "30461-12.html";
             }
           } else if (hasQuestItems(player, MIRIENS_3RD_SIGIL)) {
             if (!hasQuestItems(player, SYMBOL_OF_CRONOS)) {
               htmltext = "30461-13.html";
             } else {
               giveAdena(player, 319628, true);
               giveItems(player, MARK_OF_SCHOLAR, 1);
               addExpAndSp(player, 1753926, 113754);
               qs.exitQuest(false, true);
               player.sendPacket(new SocialAction(player.getObjectId(), 3));
               htmltext = "30461-14.html";
             }
           }
           break;
         }
       case HIGH_PRIEST_SYLVAIN:
         {
           if (hasQuestItems(player, MIRIENS_1ST_SIGIL)
               && !hasAtLeastOneQuestItem(player, HIGH_PRIESTS_SIGIL, SYMBOL_OF_SYLVAIN)) {
             htmltext = "30070-01.html";
           } else if (!hasQuestItems(player, CRYSTAL_OF_PURITY1)
               && hasQuestItems(player, HIGH_PRIESTS_SIGIL, MIRIENS_1ST_SIGIL)) {
             htmltext = "30070-03.html";
           } else if (hasQuestItems(
               player, HIGH_PRIESTS_SIGIL, MIRIENS_1ST_SIGIL, CRYSTAL_OF_PURITY1)) {
             takeItems(player, CRYSTAL_OF_PURITY1, 1);
             takeItems(player, HIGH_PRIESTS_SIGIL, 1);
             giveItems(player, SYMBOL_OF_SYLVAIN, 1);
             qs.setCond(14, true);
             htmltext = "30070-04.html";
           } else if (hasQuestItems(player, MIRIENS_1ST_SIGIL, SYMBOL_OF_SYLVAIN)
               && !hasQuestItems(player, HIGH_PRIESTS_SIGIL)) {
             htmltext = "30070-05.html";
           } else if (hasAtLeastOneQuestItem(player, MIRIENS_2ND_SIGIL, MIRIENS_3RD_SIGIL)) {
             htmltext = "30070-06.html";
           }
           break;
         }
       case CAPTAIN_LUCAS:
         {
           if (hasQuestItems(player, MIRIENS_1ST_SIGIL, HIGH_PRIESTS_SIGIL)) {
             if (hasQuestItems(player, MARIAS_1ST_LETTER)) {
               takeItems(player, MARIAS_1ST_LETTER, 1);
               giveItems(player, LUCASS_LETTER, 1);
               qs.setCond(4, true);
               htmltext = "30071-01.html";
             } else if (hasAtLeastOneQuestItem(
                 player,
                 MARIAS_2ND_LETTER,
                 CRETAS_1ST_LETTER,
                 LUCILLAS_HANDBAG,
                 CRERAS_PAINTING1,
                 LUCASS_LETTER)) {
               htmltext = "30071-02.html";
             } else if (hasQuestItems(player, CRERAS_PAINTING2)) {
               htmltext = "30071-03.html";
             } else if (hasQuestItems(player, CRERAS_PAINTING3)) {
               if (getQuestItemsCount(player, BROWN_SCROLL_SCRAP) < 5) {
                 htmltext = "30071-05.html";
               } else {
                 htmltext = "30071-06.html";
               }
             }
           } else if (hasAtLeastOneQuestItem(
               player,
               SYMBOL_OF_SYLVAIN,
               MIRIENS_2ND_SIGIL,
               MIRIENS_3RD_SIGIL,
               CRYSTAL_OF_PURITY1)) {
             htmltext = "30071-07.html";
           }
           break;
         }
       case WAREHOUSE_KEEPER_VALKON:
         {
           if (hasQuestItems(player, TRIFFS_RING)) {
             if (!hasAtLeastOneQuestItem(
                 player, VALKONS_REQUEST, CRYSTAL_OF_PURITY2, SCRIPTURE_CHAPTER_2)) {
               htmltext = "30103-01.html";
             } else if (hasQuestItems(player, VALKONS_REQUEST)
                 && !hasAtLeastOneQuestItem(player, CRYSTAL_OF_PURITY2, SCRIPTURE_CHAPTER_2)) {
               htmltext = "30103-05.html";
             } else if (hasQuestItems(player, CRYSTAL_OF_PURITY2)
                 && !hasAtLeastOneQuestItem(player, VALKONS_REQUEST, SCRIPTURE_CHAPTER_2)) {
               giveItems(player, SCRIPTURE_CHAPTER_2, 1);
               takeItems(player, CRYSTAL_OF_PURITY2, 1);
               htmltext = "30103-06.html";
             } else if (hasQuestItems(player, SCRIPTURE_CHAPTER_2)
                 && !hasAtLeastOneQuestItem(player, VALKONS_REQUEST, CRYSTAL_OF_PURITY2)) {
               htmltext = "30103-07.html";
             }
           }
           break;
         }
       case MAGISTER_DIETER:
         {
           if (hasQuestItems(player, MIRIENS_3RD_SIGIL, CRONOS_SIGIL)) {
             if (hasQuestItems(player, CRONOS_LETTER)) {
               htmltext = "30111-01.html";
             } else if (hasQuestItems(player, DIETERS_KEY)) {
               htmltext = "30111-06.html";
             } else if (hasQuestItems(player, CRETAS_2ND_LETTER)) {
               htmltext = "30111-07.html";
             } else if (hasQuestItems(player, DIETERS_DIARY, DIETERS_LETTER)) {
               htmltext = "30111-10.html";
             } else if (hasQuestItems(player, DIETERS_DIARY, RAUTS_LETTER_ENVELOPE)) {
               htmltext = "30111-11.html";
             } else if (hasQuestItems(player, DIETERS_DIARY)
                 && !hasAtLeastOneQuestItem(player, DIETERS_LETTER, RAUTS_LETTER_ENVELOPE)) {
               if (hasQuestItems(
                   player,
                   SCRIPTURE_CHAPTER_1,
                   SCRIPTURE_CHAPTER_2,
                   SCRIPTURE_CHAPTER_3,
                   SCRIPTURE_CHAPTER_4)) {
                 htmltext = "30111-13.html";
               } else {
                 htmltext = "30111-12.html";
               }
             }
           } else if (hasQuestItems(player, SYMBOL_OF_CRONOS)) {
             htmltext = "30111-15.html";
           }
           break;
         }
       case GRAND_MAGISTER_JUREK:
         {
           if (hasQuestItems(player, MIRIENS_2ND_SIGIL)) {
             if (!hasAtLeastOneQuestItem(player, GRAND_MAGISTER_SIGIL, SYMBOL_OF_JUREK)) {
               htmltext = "30115-01.html";
             } else if (hasQuestItems(player, JUREKS_LIST)) {
               if ((getQuestItemsCount(player, MONSTER_EYE_DESTROYER_SKIN)
                       + getQuestItemsCount(player, SHAMANS_NECKLACE)
                       + getQuestItemsCount(player, SHACKLES_SCALP))
                   < 12) {
                 htmltext = "30115-04.html";
               } else {
                 takeItems(player, GRAND_MAGISTER_SIGIL, 1);
                 takeItems(player, JUREKS_LIST, 1);
                 takeItems(player, MONSTER_EYE_DESTROYER_SKIN, -1);
                 takeItems(player, SHAMANS_NECKLACE, -1);
                 takeItems(player, SHACKLES_SCALP, -1);
                 giveItems(player, SYMBOL_OF_JUREK, 1);
                 qs.setCond(18, true);
                 htmltext = "30115-05.html";
               }
             } else if (hasQuestItems(player, SYMBOL_OF_JUREK)
                 && !hasQuestItems(player, GRAND_MAGISTER_SIGIL)) {
               htmltext = "30115-06.html";
             }
           } else if (hasAtLeastOneQuestItem(player, MIRIENS_1ST_SIGIL, MIRIENS_3RD_SIGIL)) {
             htmltext = "30115-07.html";
           }
           break;
         }
       case TRADER_EDROC:
         {
           if (hasQuestItems(player, DIETERS_DIARY)) {
             if (hasQuestItems(player, DIETERS_LETTER)) {
               htmltext = "30230-01.html";
             } else if (hasQuestItems(player, RAUTS_LETTER_ENVELOPE)) {
               htmltext = "30230-03.html";
             } else if (hasAtLeastOneQuestItem(player, STRONG_LIGUOR, TRIFFS_RING)) {
               htmltext = "30230-04.html";
             }
           }
           break;
         }
       case WAREHOUSE_KEEPER_RAUT:
         {
           if (hasQuestItems(player, DIETERS_DIARY)) {
             if (hasQuestItems(player, RAUTS_LETTER_ENVELOPE)) {
               htmltext = "30316-01.html";
             } else if (hasQuestItems(player, SCRIPTURE_CHAPTER_1, STRONG_LIGUOR)) {
               htmltext = "30316-04.html";
             } else if (hasQuestItems(player, SCRIPTURE_CHAPTER_1, TRIFFS_RING)) {
               htmltext = "30316-05.html";
             }
           }
           break;
         }
       case BLACKSMITH_POITAN:
         {
           if (hasQuestItems(player, TRIFFS_RING)) {
             if (!hasAtLeastOneQuestItem(
                 player, POITANS_NOTES, CASIANS_LIST, SCRIPTURE_CHAPTER_4)) {
               giveItems(player, POITANS_NOTES, 1);
               htmltext = "30458-01.html";
             } else if (hasQuestItems(player, POITANS_NOTES)
                 && !hasAtLeastOneQuestItem(player, CASIANS_LIST, SCRIPTURE_CHAPTER_4)) {
               htmltext = "30458-02.html";
             } else if (hasQuestItems(player, POITANS_NOTES, CASIANS_LIST)
                 && !hasQuestItems(player, SCRIPTURE_CHAPTER_4)) {
               htmltext = "30458-03.html";
             } else if (hasQuestItems(player, SCRIPTURE_CHAPTER_4)
                 && !hasAtLeastOneQuestItem(player, POITANS_NOTES, CASIANS_LIST)) {
               htmltext = "30458-04.html";
             }
           }
           break;
         }
       case MARIA:
         {
           if (hasQuestItems(player, MIRIENS_1ST_SIGIL, HIGH_PRIESTS_SIGIL)) {
             if (hasQuestItems(player, SYLVAINS_LETTER)) {
               htmltext = "30608-01.html";
             } else if (hasQuestItems(player, MARIAS_1ST_LETTER)) {
               htmltext = "30608-03.html";
             } else if (hasQuestItems(player, LUCASS_LETTER)) {
               giveItems(player, MARIAS_2ND_LETTER, 1);
               takeItems(player, LUCASS_LETTER, 1);
               qs.setCond(5, true);
               htmltext = "30608-04.html";
             } else if (hasQuestItems(player, MARIAS_2ND_LETTER)) {
               htmltext = "30608-05.html";
             } else if (hasQuestItems(player, CRETAS_1ST_LETTER)) {
               htmltext = "30608-06.html";
             } else if (hasQuestItems(player, LUCILLAS_HANDBAG)) {
               htmltext = "30608-09.html";
             } else if (hasQuestItems(player, CRERAS_PAINTING1)) {
               takeItems(player, CRERAS_PAINTING1, 1);
               giveItems(player, CRERAS_PAINTING2, 1);
               qs.setCond(9, true);
               htmltext = "30608-10.html";
             } else if (hasQuestItems(player, CRERAS_PAINTING2)) {
               htmltext = "30608-11.html";
             } else if (hasQuestItems(player, CRERAS_PAINTING3)) {
               if (getQuestItemsCount(player, BROWN_SCROLL_SCRAP) < 5) {
                 qs.setCond(11, true);
                 htmltext = "30608-12.html";
               } else {
                 htmltext = "30608-13.html";
               }
             } else if (hasQuestItems(player, CRYSTAL_OF_PURITY1)) {
               htmltext = "30608-15.html";
             }
           } else if (hasAtLeastOneQuestItem(player, SYMBOL_OF_SYLVAIN, MIRIENS_2ND_SIGIL)) {
             htmltext = "30608-16.html";
           } else if (hasQuestItems(player, MIRIENS_3RD_SIGIL)) {
             if (!hasQuestItems(player, VALKONS_REQUEST)) {
               htmltext = "30608-17.html";
             } else {
               takeItems(player, VALKONS_REQUEST, 1);
               giveItems(player, CRYSTAL_OF_PURITY2, 1);
               htmltext = "30608-18.html";
             }
           }
           break;
         }
       case ASTROLOGER_CRETA:
         {
           if (hasQuestItems(player, MIRIENS_1ST_SIGIL, HIGH_PRIESTS_SIGIL)) {
             if (hasQuestItems(player, MARIAS_2ND_LETTER)) {
               htmltext = "30609-01.html";
             } else if (hasQuestItems(player, CRETAS_1ST_LETTER)) {
               htmltext = "30609-06.html";
             } else if (hasQuestItems(player, LUCILLAS_HANDBAG)) {
               htmltext = "30609-07.html";
             } else if (hasAtLeastOneQuestItem(
                 player, CRERAS_PAINTING1, CRERAS_PAINTING2, CRERAS_PAINTING3)) {
               htmltext = "30609-10.html";
             }
           } else if (hasAtLeastOneQuestItem(
               player, CRYSTAL_OF_PURITY1, SYMBOL_OF_SYLVAIN, MIRIENS_2ND_SIGIL)) {
             htmltext = "30609-11.html";
           } else if (hasQuestItems(player, MIRIENS_3RD_SIGIL)) {
             if (hasQuestItems(player, DIETERS_KEY)) {
               htmltext = "30609-12.html";
             } else {
               htmltext = "30609-15.html";
             }
           }
           break;
         }
       case ELDER_CRONOS:
         {
           if (hasQuestItems(player, MIRIENS_3RD_SIGIL)) {
             if (!hasAtLeastOneQuestItem(player, CRONOS_SIGIL, SYMBOL_OF_CRONOS)) {
               htmltext = "30610-01.html";
             } else if (hasQuestItems(player, CRONOS_SIGIL)) {
               if (hasQuestItems(
                   player,
                   SCRIPTURE_CHAPTER_1,
                   SCRIPTURE_CHAPTER_2,
                   SCRIPTURE_CHAPTER_3,
                   SCRIPTURE_CHAPTER_4)) {
                 htmltext = "30610-12.html";
               } else {
                 htmltext = "30610-11.html";
               }
             } else if (hasQuestItems(player, SYMBOL_OF_CRONOS)
                 && !hasQuestItems(player, CRONOS_SIGIL)) {
               htmltext = "30610-15.html";
             }
           }
           break;
         }
       case DRUNKARD_TRIFF:
         {
           if (hasQuestItems(player, DIETERS_DIARY, SCRIPTURE_CHAPTER_1, STRONG_LIGUOR)) {
             htmltext = "30611-01.html";
           } else if (hasAtLeastOneQuestItem(player, TRIFFS_RING, SYMBOL_OF_CRONOS)) {
             htmltext = "30611-05.html";
           }
           break;
         }
       case ELDER_CASIAN:
         {
           if (hasQuestItems(player, TRIFFS_RING, POITANS_NOTES)) {
             if (!hasQuestItems(player, CASIANS_LIST)) {
               if (hasQuestItems(
                   player, SCRIPTURE_CHAPTER_1, SCRIPTURE_CHAPTER_2, SCRIPTURE_CHAPTER_3)) {
                 htmltext = "30612-02.html";
               } else {
                 htmltext = "30612-01.html";
               }
             } else {
               if ((getQuestItemsCount(player, GHOULS_SKIN)
                       + getQuestItemsCount(player, MEDUSAS_BLOOD)
                       + getQuestItemsCount(player, FETTERED_SOULS_ICHOR)
                       + getQuestItemsCount(player, ENCHANTED_GARGOYLES_NAIL))
                   < 32) {
                 htmltext = "30612-05.html";
               } else {
                 htmltext = "30612-06.html";
               }
             }
           } else if (hasQuestItems(
                   player,
                   TRIFFS_RING,
                   SCRIPTURE_CHAPTER_1,
                   SCRIPTURE_CHAPTER_2,
                   SCRIPTURE_CHAPTER_3,
                   SCRIPTURE_CHAPTER_4)
               && !hasAtLeastOneQuestItem(player, POITANS_NOTES, CASIANS_LIST)) {
             htmltext = "30612-08.html";
           }
           break;
         }
     }
   } else if (qs.isCompleted()) {
     if (npc.getId() == MAGISTER_MIRIEN) {
       htmltext = getAlreadyCompletedMsg(player);
     }
   }
   return htmltext;
 }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   switch (npc.getId()) {
     case ELCADIA:
       {
         if (qs.isCompleted()) {
           htmltext = "32784-02.html";
         } else if (qs.isCreated()) {
           qs = player.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName());
           htmltext =
               ((player.getLevel() >= MIN_LEVEL) && (qs != null) && (qs.isCompleted()))
                   ? "32784-01.htm"
                   : "32784-11.htm";
         } else if (qs.isStarted()) {
           if (qs.isCond(1)) {
             htmltext = "32784-06.html";
           } else if (qs.isCond(8)) {
             htmltext = "32784-07.html";
           }
         }
         break;
       }
     case ELCADIA_INSTANCE:
       {
         switch (qs.getCond()) {
           case 1:
             {
               htmltext = "32785-01.html";
               break;
             }
           case 2:
             {
               htmltext = "32785-04.html";
               qs.setCond(3, true);
               break;
             }
           case 3:
             {
               htmltext = "32785-05.html";
               break;
             }
           case 4:
             {
               htmltext = "32785-06.html";
               break;
             }
           case 5:
             {
               htmltext = "32785-08.html";
               break;
             }
           case 6:
             {
               htmltext = "32785-09.html";
               break;
             }
           case 7:
             {
               qs.setCond(8, true);
               htmltext = "32785-11.html";
               break;
             }
           case 8:
             {
               htmltext = "32785-12.html";
               break;
             }
         }
         break;
       }
     case SOPHIA1:
       {
         if (qs.isStarted()) {
           if ((qs.getCond() >= 1) && (qs.getCond() < 8)) {
             htmltext = "32596-01.html";
           } else {
             htmltext = "32596-05.html";
           }
         }
         break;
       }
     case SOPHIA2:
       {
         switch (qs.getCond()) {
           case 1:
             {
               htmltext = "32861-01.html";
               break;
             }
           case 2:
             {
               htmltext = "32861-05.html";
               break;
             }
           case 3:
             {
               htmltext = "32861-06.html";
               break;
             }
           case 4:
             {
               htmltext = "32861-09.html";
               break;
             }
           case 5:
             {
               htmltext = "32861-10.html";
               break;
             }
           case 6:
           case 7:
             {
               htmltext = "32861-12.html";
               break;
             }
           case 8:
             {
               htmltext = "32861-14.html";
               break;
             }
         }
         break;
       }
     case PILE_OF_BOOKS1:
       {
         if (qs.isCond(6)) {
           htmltext = "32809-01.html";
         }
         break;
       }
     case PILE_OF_BOOKS2:
       {
         if (qs.isCond(6)) {
           htmltext = "32810-01.html";
         }
         break;
       }
     case PILE_OF_BOOKS3:
       {
         if (qs.isCond(6)) {
           htmltext = "32811-01.html";
         }
         break;
       }
     case PILE_OF_BOOKS4:
       {
         if (qs.isCond(6)) {
           htmltext = "32812-01.html";
         }
         break;
       }
     case PILE_OF_BOOKS5:
       {
         if (qs.isCond(6)) {
           htmltext = "32813-01.html";
         }
         break;
       }
   }
   return htmltext;
 }