@Override
 public String onFirstTalk(L2Npc npc, L2PcInstance player) {
   QuestState qs = getQuestState(player, true);
   String htmltext = getNoQuestMsg(player);
   if ((qs.getCond() >= 1) && (qs.getCond() < 8)) {
     htmltext = "32863-01.html";
   } else {
     htmltext = "32863-04.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;
    }

    switch (st.getState()) {
      case State.CREATED:
        htmltext = (player.getLevel() >= MIN_LEVEL) ? "30847-01.htm" : "30847-02.html";
        break;
      case State.STARTED:
        switch (st.getCond()) {
          case 1:
            htmltext = "30847-04.html";
            break;
          case 2:
            htmltext = "30847-05.html";
            break;
          case 3:
            htmltext =
                ((st.getQuestItemsCount(ARTISANS_FRAME) >= COUNT)
                        && (st.getQuestItemsCount(ORIHARUKON) >= COUNT))
                    ? "30847-07.html"
                    : "30847-08.html";
            break;
        }
        break;
      case State.COMPLETED:
        htmltext = getAlreadyCompletedMsg(player);
        break;
    }
    return htmltext;
  }
  @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 onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return htmltext;
    }

    final int cond = st.getCond();
    switch (event) {
      case "31517-02.htm":
        st.startQuest();
        st.giveItems(CRYSTAL_OF_SEAL, 5);
        break;
      case "31512-01.html":
      case "31513-01.html":
      case "31514-01.html":
      case "31515-01.html":
      case "31516-01.html":
        final int npcId = Integer.parseInt(event.replace("-01.html", ""));
        if ((cond == (npcId - 31511)) && st.hasQuestItems(CRYSTAL_OF_SEAL)) {
          st.takeItems(CRYSTAL_OF_SEAL, 1);
          st.setCond(cond + 1, true);
        }
        break;
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, true);
    if (st == null) {
      return getNoQuestMsg(player);
    }

    String htmltext = getNoQuestMsg(player);
    switch (st.getState()) {
      case State.CREATED:
        {
          if (player.getLevel() < MIN_LEVEL) {
            htmltext = "31540-02.html";
          } else if (!st.hasQuestItems(VACUALITE_FLOATING_STONE)) {
            htmltext = "31540-04.html";
          } else {
            htmltext = "31540-01.htm";
          }
          break;
        }
      case State.STARTED:
        {
          switch (st.getCond()) {
            case 1:
              {
                htmltext = "31540-08.html";
                break;
              }
            case 2:
              {
                st.giveItems(MEDAL_OF_GLORY, 30);
                st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
                st.exitQuest(QuestType.DAILY, true);
                htmltext = "31540-09.html";
                break;
              }
          }
          break;
        }
      case State.COMPLETED:
        {
          if (!st.isNowAvailable()) {
            htmltext = "31540-03.html";
          } else {
            st.setState(State.CREATED);
            if (player.getLevel() < MIN_LEVEL) {
              htmltext = "31540-02.html";
            } else if (!st.hasQuestItems(VACUALITE_FLOATING_STONE)) {
              htmltext = "31540-04.html";
            } else {
              htmltext = "31540-01.htm";
            }
          }
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance talker) {
    final QuestState qs =
        talker.getQuestState(Q00196_SevenSignsSealOfTheEmperor.class.getSimpleName());
    String htmltext = getNoQuestMsg(talker);
    if (qs == null) {
      return htmltext;
    }

    switch (npc.getId()) {
      case PROMISE_OF_MAMMON:
        {
          if (qs.isCond(3) || qs.isCond(4)) {
            enterInstance(talker, new DNPWorld(), "DisciplesNecropolisPast.xml", TEMPLATE_ID);
            return "";
          }
          break;
        }
      case LEON:
        {
          if (qs.getCond() >= 3) {
            takeItems(talker, SACRED_SWORD_OF_EINHASAD, -1);
            InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
            world.removeAllowed(talker.getObjectId());
            talker.teleToLocation(EXIT, 0);
            htmltext = "32587-01.html";
          }
          break;
        }
      case DISCIPLES_GATEKEEPER:
        {
          if (qs.getCond() >= 3) {
            InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
            if (tmpworld instanceof DNPWorld) {
              DNPWorld world = (DNPWorld) tmpworld;
              openDoor(DISCIPLES_NECROPOLIS_DOOR, world.getInstanceId());
              talker.showQuestMovie(12);
              startQuestTimer("FIGHT", 1000, null, talker);
            }
          }
          break;
        }
    }
    return htmltext;
  }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance talker) {
   final QuestState qs = getQuestState(talker, true);
   String htmltext = getNoQuestMsg(talker);
   switch (qs.getState()) {
     case State.CREATED:
       {
         if (npc.getId() == EYE_OF_ARGOS) {
           htmltext = ((talker.getLevel() < MIN_LVL) ? "31683-02.html" : "31683-01.htm");
         }
         break;
       }
     case State.STARTED:
       {
         if (npc.getId() == EYE_OF_ARGOS) {
           switch (qs.getCond()) {
             case 1:
             case 2:
             case 3:
             case 4:
             case 5:
               {
                 htmltext = "31683-04.html";
                 break;
               }
             case 6:
               {
                 htmltext = "31683-05.html";
                 break;
               }
             case 7:
               {
                 htmltext = "31683-07.html";
                 break;
               }
             case 8:
               {
                 htmltext = "31683-08.html";
                 break;
               }
           }
         } else if (qs.getInt("TABLET_" + npc.getId()) == 0) {
           htmltext = npc.getId() + "-01.html";
         } else {
           htmltext = npc.getId() + "-03.html";
         }
         break;
       }
     case State.COMPLETED:
       {
         htmltext = getAlreadyCompletedMsg(talker);
         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;
    }

    switch (st.getState()) {
      case State.CREATED:
        htmltext = (player.getLevel() >= MIN_LEVEL) ? "36479-03.html" : "36479-02.html";
        break;
      case State.STARTED:
        if (TerritoryWarManager.getInstance().isTWInProgress()) {
          return "36479-05.html";
        }
        switch (st.getCond()) {
          case 1:
            htmltext = "36479-06.html";
            break;
          case 2:
            st.setCond(3, true);
            htmltext = "36479-07.html";
            break;
          case 3:
            htmltext = "36479-08.html";
            break;
          case 4:
            st.setCond(5, true);
            htmltext = "36479-09.html";
            break;
          case 5:
            htmltext = "36479-10.html";
            break;
          case 6:
            st.setCond(7, true);
            htmltext = "36479-11.html";
            break;
          case 7:
            htmltext = "36479-12.html";
            break;
          case 8:
            st.giveItems(CLOAK, 1);
            st.exitQuest(false, true);
            htmltext = "36479-13.html";
            break;
        }
        break;
      case State.COMPLETED:
        htmltext = "36479-01.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;
    }

    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 = null;
   if (st != null) {
     switch (st.getState()) {
       case State.CREATED:
         {
           htmltext =
               (player.getRace() == Race.ORC)
                   ? (player.getLevel() >= MIN_LVL)
                       ? (hasAtLeastOneQuestItem(player, NECKLACE_OF_VALOR, NECKLACE_OF_COURAGE))
                           ? "30577-07.htm"
                           : "30577-03.htm"
                       : "30577-02.htm"
                   : "30577-01.htm";
           break;
         }
       case State.STARTED:
         {
           switch (st.getCond()) {
             case 1:
               {
                 htmltext = "30577-05.html";
                 break;
               }
             case 2:
               {
                 if (st.getQuestItemsCount(KASHA_WOLF_FANG) >= 50) {
                   if (getRandom(100) <= 13) {
                     st.rewardItems(NECKLACE_OF_VALOR, 1);
                     st.rewardItems(HEALING_POTION, 10);
                   } else {
                     st.rewardItems(NECKLACE_OF_COURAGE, 1);
                   }
                   st.takeItems(KASHA_WOLF_FANG, -1);
                   st.exitQuest(true, true);
                   htmltext = "30577-06.html";
                 }
                 break;
               }
           }
           break;
         }
     }
   }
   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);
   final QuestState st = getQuestState(player, true);
   if (st == null) {
     return htmltext;
   }
   switch (st.getState()) {
     case State.CREATED:
       htmltext = (player.getLevel() >= MIN_LEVEL_REQUIRED) ? "31517-01.htm" : "31517-00.htm";
       break;
     case State.STARTED:
       switch (st.getCond()) {
         case 1:
           htmltext = "31517-03.html";
           break;
         case 2:
           htmltext = "31517-04.html";
           break;
       }
       break;
   }
   return htmltext;
 }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState st = getQuestState(player, true);
   String htmltext = null;
   if (st != null) {
     switch (st.getState()) {
       case State.CREATED:
         {
           htmltext =
               (player.getRace() == Race.ORC)
                   ? (player.getLevel() >= MIN_LVL) ? "30572-03.htm" : "30572-02.htm"
                   : "30572-01.htm";
           break;
         }
       case State.STARTED:
         {
           switch (st.getCond()) {
             case 1:
               {
                 htmltext = "30572-05.html";
                 break;
               }
             case 2:
               {
                 st.giveAdena(1500, true);
                 st.exitQuest(true, true);
                 htmltext = "30572-06.html";
                 break;
               }
           }
           break;
         }
     }
   }
   return htmltext;
 }
示例#14
0
 @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 "31521-03.htm":
       {
         if (qs.isCreated()) {
           qs.startQuest();
           giveItems(player, BOILED_EGG, 5);
           htmltext = event;
         }
         break;
       }
     case "31521-06.html":
       {
         if (qs.isCond(6)) {
           if (getQuestItemsCount(player, EGG_PRICE) >= 5) {
             qs.setCond(7, true);
             takeItems(player, EGG_PRICE, -1);
             htmltext = event;
           } else {
             htmltext = "31521-07.html";
           }
         }
         break;
       }
     case "31543-02.html":
       {
         if (qs.isCond(1)) {
           if (hasQuestItems(player, BOILED_EGG)) {
             qs.setCond(2, true);
             takeItems(player, BOILED_EGG, 1);
             giveItems(player, EGG_PRICE, 1);
             htmltext = event;
           } else {
             htmltext = "31543-03.html";
           }
         }
         break;
       }
     case "31544-02.html":
     case "31545-02.html":
     case "31546-02.html":
     case "31547-02.html":
       {
         if (TALKERS.contains(npc.getId()) && qs.isCond(TALKERS.indexOf(npc.getId()) + 2)) {
           if (hasQuestItems(player, BOILED_EGG)) {
             qs.setCond(qs.getCond() + 1, true);
             takeItems(player, BOILED_EGG, 1);
             giveItems(player, EGG_PRICE, 1);
             htmltext = event;
           } else {
             htmltext = npc.getId() + "-03.html";
           }
         }
         break;
       }
     case "31584-02.html":
       {
         if (qs.isCond(7)) {
           int rnd = getRandom(1000);
           if (rnd < 800) {
             rewardItems(player, QUICK_STEP_POTION, 1);
             giveAdena(player, 18800, true);
           } else if (rnd < 880) {
             rewardItems(player, SEALED_RING_OF_AURAKYRA, 1);
           } else if (rnd < 960) {
             rewardItems(player, SEALED_SANDDRAGONS_EARING, 1);
           } else if (rnd < 1000) {
             rewardItems(player, SEALED_DRAGON_NECKLACE, 1);
           }
           qs.exitQuest(true, true);
           htmltext = event;
         }
         break;
       }
   }
   return htmltext;
 }
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState st = player.getQuestState(getName());
   String htmltext = getNoQuestMsg(player);
   if (st != null) {
     switch (npc.getId()) {
       case JENNA:
         {
           switch (st.getState()) {
             case State.CREATED:
               {
                 htmltext =
                     (player.getRace() == Race.DARK_ELF)
                         ? (player.getLevel() >= MIN_LVL) ? "30349-02.htm" : "30349-01.htm"
                         : "30349-00.htm";
                 break;
               }
             case State.STARTED:
               {
                 switch (st.getCond()) {
                   case 1:
                     {
                       if (st.hasQuestItems(JENNAS_LETTER)) {
                         htmltext = "30349-04.html";
                       }
                       break;
                     }
                   case 2:
                     {
                       if (st.hasQuestItems(SENTRY_BLADE1, SENTRY_BLADE2, SENTRY_BLADE3)) {
                         st.takeItems(SENTRY_BLADE1, -1);
                         st.setCond(3, true);
                         htmltext = "30349-05.html";
                       }
                       break;
                     }
                   case 3:
                     {
                       if (hasAtLeastOneQuestItem(player, SENTRY_BLADE2, SENTRY_BLADE3)) {
                         htmltext = "30349-07.html";
                       }
                       break;
                     }
                   case 4:
                     {
                       if (st.getQuestItemsCount(OLD_BRONZE_SWORD) >= 2) {
                         st.giveAdena(820, true);
                         st.exitQuest(false, true);
                         htmltext = "30349-07.html";
                       }
                       break;
                     }
                 }
                 break;
               }
             case State.COMPLETED:
               {
                 htmltext = getAlreadyCompletedMsg(player);
                 break;
               }
           }
           break;
         }
       case HARANT:
         {
           if (st.isCond(1) && st.hasQuestItems(JENNAS_LETTER)) {
             st.takeItems(JENNAS_LETTER, -1);
             st.giveItems(SENTRY_BLADE1, 1);
             st.giveItems(SENTRY_BLADE2, 1);
             st.giveItems(SENTRY_BLADE3, 1);
             st.setCond(2, true);
             htmltext = "30360-01.html";
           } else if (st.isCond(2)) {
             htmltext = "30360-02.html";
           }
           break;
         }
       case ROSELYN:
       case KRISTIN:
         {
           if (st.isCond(3) && st.hasQuestItems(SENTRIES.get(npc.getId()))) {
             st.takeItems(SENTRIES.get(npc.getId()), -1);
             st.giveItems(OLD_BRONZE_SWORD, 1);
             if (st.getQuestItemsCount(OLD_BRONZE_SWORD) >= 2) {
               st.setCond(4, true);
             }
             htmltext = npc.getId() + "-01.html";
           } else if (!st.hasQuestItems(SENTRIES.get(npc.getId()))
               && st.hasQuestItems(OLD_BRONZE_SWORD)) {
             htmltext = npc.getId() + "-02.html";
           }
           break;
         }
     }
   }
   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;
   }
   switch (npc.getId()) {
     case ALEXIS:
       switch (st.getState()) {
         case State.CREATED:
           htmltext = (player.getLevel() >= MIN_LEVEL) ? "30842-01.htm" : "30842-02.html";
           break;
         case State.STARTED:
           if (st.isCond(1)) {
             htmltext = "30842-04.html";
           }
           break;
         case State.COMPLETED:
           htmltext = getAlreadyCompletedMsg(player);
           break;
       }
       break;
     case LEIKAR:
       if (st.isStarted()) {
         switch (st.getCond()) {
           case 1:
             htmltext = "31520-01.html";
             break;
           case 2:
             htmltext = "31520-03.html";
             break;
           case 5:
             htmltext = "31520-04.html";
             break;
           case 6:
             htmltext =
                 (st.hasQuestItems(SEWING_KIT, JEWEL_BOX, MYSTERIOUS_CLOTH))
                     ? "31520-06.html"
                     : "31520-07.html";
             break;
           case 7:
             htmltext = (st.hasQuestItems(DRESS_SHOES_BOX)) ? "31520-10.html" : "31520-11.html";
             break;
         }
       }
       break;
     case JEREMY:
       if (st.isStarted()) {
         switch (st.getCond()) {
           case 2:
             htmltext = "31521-01.html";
             break;
           case 3:
             htmltext = "31521-03.html";
             break;
           case 4:
             htmltext = "31521-04.html";
             break;
           case 5:
             htmltext = "31521-06.html";
             break;
         }
       }
       break;
     case MIST:
       if (st.isStarted()) {
         switch (st.getCond()) {
           case 3:
             htmltext = "31627-01.html";
             break;
           case 4:
             htmltext = "31627-03.html";
             break;
         }
       }
       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 (st.getState()) {
      case State.COMPLETED:
        {
          htmltext = getAlreadyCompletedMsg(player);
          break;
        }
      case State.CREATED:
        {
          if (npc.getId() == KANIS) {
            htmltext = (player.getLevel() >= MIN_LEVEL) ? "32264-01.htm" : "32264-02.html";
          }
          break;
        }
      case State.STARTED:
        {
          if (npc.getId() == KANIS) {
            switch (st.getCond()) {
              case 1:
                {
                  htmltext = "32264-05.html";
                  break;
                }
              case 2:
                {
                  htmltext = "32264-08.html";
                  break;
                }
              case 3:
                {
                  htmltext = "32264-13.html";
                  break;
                }
              case 4:
                {
                  htmltext = "32264-16.html";
                  break;
                }
              case 5:
                {
                  htmltext = "32264-18.html";
                  break;
                }
            }
          } else if (npc.getId() == PARME) {
            if (st.getCond() < 3) {
              htmltext = "32271-01.html";
            } else if (st.isCond(3)) {
              htmltext = "32271-02.html";
            }
          }
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState qs = getQuestState(player, false);
    if (qs == null) {
      return null;
    }

    String htmltext = null;
    switch (event) {
      case "32784-03.htm":
      case "32784-05.html":
      case "32861-13.html":
      case "32863-02.html":
      case "32863-03.html":
        {
          htmltext = event;
          break;
        }
      case "32784-04.html":
        {
          qs.startQuest();
          htmltext = event;
          break;
        }
      case "32784-07.html":
      case "32784-08.html":
        {
          if (qs.isCond(8)) {
            htmltext = event;
          }
          break;
        }
      case "REWARD":
        {
          if (player.isSubClassActive()) {
            htmltext = "32784-10.html";
          } else {
            addExpAndSp(player, 15000000, 1500000);
            qs.exitQuest(false, true);
            htmltext = "32784-09.html";
          }
          break;
        }
      case "32785-02.html":
        {
          if (qs.isCond(1)) {
            htmltext = event;
          }
          break;
        }
      case "32785-07.html":
        {
          if (qs.isCond(4)) {
            qs.setCond(5, true);
            htmltext = event;
          }
          break;
        }
      case "32596-03.html":
      case "32596-04.html":
        {
          if ((qs.getCond() >= 1) && (qs.getCond() < 8)) {
            htmltext = event;
          }
          break;
        }
      case "32861-02.html":
      case "32861-03.html":
        {
          if (qs.isCond(1)) {
            htmltext = event;
          }
          break;
        }
      case "32861-04.html":
        {
          if (qs.isCond(1)) {
            qs.setCond(2, true);
            htmltext = event;
          }
          break;
        }
      case "32861-07.html":
        {
          if (qs.isCond(3)) {
            htmltext = event;
          }
          break;
        }
      case "32861-08.html":
        {
          if (qs.isCond(3)) {
            qs.setCond(4, true);
            htmltext = event;
          }
          break;
        }
      case "32861-11.html":
        {
          if (qs.isCond(5)) {
            qs.setCond(6, true);
            htmltext = event;
          }
          break;
        }
      case "32809-02.html":
        {
          if (qs.isCond(6)) {
            qs.setCond(7, true);
            giveItems(player, SOLINAS_BIOGRAPHY, 1);
            htmltext = event;
          }
          break;
        }
      case "32810-02.html":
      case "32811-02.html":
      case "32812-02.html":
      case "32813-02.html":
        {
          if (qs.isCond(6)) {
            htmltext = event;
          }
          break;
        }
    }
    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;
 }
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(getName());
    String htmltext = getNoQuestMsg(player);
    if (st == null) {
      return htmltext;
    }

    switch (st.getState()) {
      case State.COMPLETED:
        {
          if (!st.isNowAvailable()) {
            htmltext = "31340-02.htm";
            break;
          }
          st.setState(State.CREATED);
        }
      case State.CREATED:
        {
          htmltext = (player.getLevel() >= MIN_LVL) ? "31340-01.htm" : "31340-03.htm";
          break;
        }
      case State.STARTED:
        {
          switch (st.getCond()) {
            case 1:
              {
                htmltext = "31340-09.html";
                break;
              }
            case 2:
              {
                htmltext = "31340-11.html";
                break;
              }
            case 3:
              {
                htmltext = "31340-12.html";
                break;
              }
            case 4:
              {
                htmltext = "31340-13.html";
                break;
              }
            case 5:
              {
                if (st.hasQuestItems(SHATTERED_BONES)) {
                  st.giveItems(PROOF_OF_CHALLENGE, 1);
                  st.giveAdena(134038, true);
                } else if (st.hasQuestItems(CANNIBALISTIC_STAKATO_LDR_CLAW)) {
                  st.giveItems(PROOF_OF_CHALLENGE, 3);
                  st.giveAdena(210119, true);
                } else if (st.hasQuestItems(ANAIS_SCROLL)) {
                  st.giveItems(PROOF_OF_CHALLENGE, 3);
                  st.giveAdena(348155, true);
                }
                st.exitQuest(QuestType.DAILY, true);
                htmltext = "31340-14.html";
                break;
              }
          }
          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;
 }
  @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 SHEGFIELD:
        switch (st.getState()) {
          case State.CREATED:
            htmltext = (player.getLevel() >= MIN_LEVEL) ? "30068-01.htm" : "30068-02.htm";
            break;
          case State.STARTED:
            switch (st.getCond()) {
              case 1: // 1
                st.setCond(2, true);
                htmltext = "30068-04.html";
                break;
              case 2: // 2, 3
              case 3: // 4
                htmltext = "30068-05.html";
                break;
              case 4: // 5
                htmltext = "30068-06.html";
                break;
              case 5:
                if (st.isSet("talk")) {
                  htmltext = "30068-08.html";
                } else if (st.hasQuestItems(
                    PANOS_CREDENTIALS, SONINS_CREDENTIALS, ALEXS_CREDENTIALS)) {
                  st.takeItems(SONINS_CREDENTIALS, -1);
                  st.takeItems(PANOS_CREDENTIALS, -1);
                  st.takeItems(ALEXS_CREDENTIALS, -1);
                  st.set("talk", "1");
                  htmltext = "30068-07.html";
                } else {
                  htmltext = "30068-06.html";
                }
                break;
            }
            break;
          case State.COMPLETED:
            htmltext = getAlreadyCompletedMsg(player);
            break;
        }
        break;
      case ALEX:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
              htmltext = "30291-01.html";
              break;
            case 2:
              if (st.isSet("talk")) {
                htmltext = "30291-03.html";
              } else {
                st.set("talk", "1");
                htmltext = "30291-02.html";
              }
              break;
            case 3:
              htmltext = "30291-08.html"; // 4
              break;
            case 4:
              if (st.hasQuestItems(PANOS_CREDENTIALS, SONINS_CREDENTIALS)) {
                if (st.getQuestItemsCount(OLD_TREASURE_MAP) < ITEM_COUNT) {
                  return htmltext;
                }
                st.setCond(5, true);
                st.takeItems(OLD_TREASURE_MAP, -1);
                st.giveItems(ALEXS_CREDENTIALS, 1);
                htmltext = "30291-10.html";
              } else {
                htmltext = "30291-09.html";
              }
              break;
            case 5:
              htmltext = "30291-11.html";
              break;
          }
        }
        break;
      case PANO:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
              htmltext = "30078-01.html";
              break;
            case 2:
              htmltext = "30078-02.html";
              break;
            case 3:
              htmltext = "30078-03.html";
              break;
            case 4:
              if (!st.isSet("Pano")) {
                if (st.getQuestItemsCount(HATE_CRYSTAL) < ITEM_COUNT) {
                  return htmltext;
                }
                st.takeItems(HATE_CRYSTAL, -1);
                st.giveItems(PANOS_CREDENTIALS, 1);
                st.set("Pano", "1");
                htmltext = "30078-04.html";
                break;
              }
            case 5:
              htmltext = "30078-05.html";
              break;
          }
        }
        break;
      case SONIN:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
              htmltext = "31773-01.html";
              break;
            case 2:
              htmltext = "31773-02.html";
              break;
            case 3:
              htmltext = "31773-03.html";
              break;
            case 4:
              if (!st.isSet("Sonin")) {
                if (st.getQuestItemsCount(STOLEN_CARGO) < ITEM_COUNT) {
                  return htmltext;
                }
                st.takeItems(STOLEN_CARGO, -1);
                st.giveItems(SONINS_CREDENTIALS, 1);
                st.set("Sonin", "1");
                htmltext = "31773-04.html";
                break;
              }
            case 5:
              htmltext = "31773-05.html";
              break;
          }
        }
        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 "31683-03.htm":
        {
          if (qs.isCreated()) {
            qs.set("tablet_" + TABLET_1, 0);
            qs.set("tablet_" + TABLET_2, 0);
            qs.set("tablet_" + TABLET_3, 0);
            qs.set("tablet_" + TABLET_4, 0);
            qs.set("tablet_" + TABLET_5, 0);
            qs.startQuest();
            htmltext = event;
          }
          break;
        }
      case "31548-02.html":
      case "31549-02.html":
      case "31550-02.html":
      case "31551-02.html":
      case "31552-02.html":
        {
          if (qs.getCond() < 6) {
            giveItems(player, BROKEN_CRYSTAL, 1);
            qs.set("TABLET_" + npc.getId(), 1);
            qs.setCond(qs.getCond() + 1, true);
            htmltext = event;
          }
          break;
        }
      case "31683-06.html":
        {
          if (qs.isCond(6) && (getQuestItemsCount(player, BROKEN_CRYSTAL) >= 5)) {
            takeItems(player, BROKEN_CRYSTAL, -1);
            qs.setCond(7, true);
            htmltext = event;
          }
          break;
        }
      case "31683-10.html":
        {
          if (qs.isCond(8)) {
            if (getQuestItemsCount(player, SPIRIT_OF_DARKNESS) >= 200) {
              takeItems(player, SPIRIT_OF_DARKNESS, -1);
              giveItems(player, UNFINISHED_CRYSTAL, 1);
              qs.exitQuest(true, true);
              htmltext = event;
            } else {
              htmltext = "31683-11.html";
            }
          }
          break;
        }
    }
    return htmltext;
  }
示例#24
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance talker) {
   final QuestState qs = getQuestState(talker, true);
   String htmltext = getNoQuestMsg(talker);
   switch (npc.getId()) {
     case JEREMY:
       {
         switch (qs.getState()) {
           case State.CREATED:
             {
               htmltext = (talker.getLevel() >= MIN_LVL) ? "31521-01.htm" : "31521-02.htm";
               break;
             }
           case State.STARTED:
             {
               switch (qs.getCond()) {
                 case 1:
                   {
                     htmltext = "31521-04.html";
                     break;
                   }
                 case 6:
                   {
                     if (hasQuestItems(talker, EGG_PRICE)) {
                       htmltext = "31521-05.html";
                     }
                     break;
                   }
                 case 7:
                   {
                     if (!hasQuestItems(talker, BOILED_EGG)) {
                       htmltext = "31521-08.html";
                     }
                     break;
                   }
               }
               break;
             }
           case State.COMPLETED:
             {
               htmltext = getAlreadyCompletedMsg(talker);
               break;
             }
         }
         break;
       }
     case PULIN:
       {
         if (qs.isStarted()) {
           switch (qs.getCond()) {
             case 1:
               {
                 if (getQuestItemsCount(talker, BOILED_EGG) >= 5) {
                   htmltext = "31543-01.html";
                 }
                 break;
               }
             case 2:
               {
                 htmltext = "31543-04.html";
                 break;
               }
           }
         }
         break;
       }
     case NAFF:
     case CROCUS:
     case KUBER:
     case BOELIN:
       {
         if (qs.isStarted()) {
           final int cond = TALKERS.indexOf(npc.getId()) + 2;
           if (qs.isCond(cond) && hasQuestItems(talker, EGG_PRICE)) // 2,3,4,5
           {
             htmltext = npc.getId() + "-01.html";
           } else if (qs.isCond(cond + 1)) // 3,4,5,6
           {
             htmltext = npc.getId() + "-04.html";
           }
         }
         break;
       }
     case VALENTINE:
       {
         if (qs.isStarted() && qs.isCond(7)) {
           htmltext = "31584-01.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;
    }

    switch (npc.getId()) {
      case NATOOLS:
        switch (st.getState()) {
          case State.STARTED:
            switch (st.getCond()) {
              case 1:
                htmltext = "30894-01.html";
                break;
              default:
                htmltext = "30894-04.html";
                break;
            }
            break;
          case State.COMPLETED:
            htmltext = getAlreadyCompletedMsg(player);
            break;
        }
        break;
      case RAYMOND:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
              htmltext = "30289-01.html";
              break;
            case 2:
              if (st.isSet("talk")) {
                htmltext = "30289-03.html";
              } else {
                st.takeItems(CRYPTOGRAM_OF_THE_ANGEL_SEARCH, -1);
                st.set("talk", "1");
                htmltext = "30289-02.html";
              }
              break;
            case 3:
            case 4:
            case 5:
              htmltext = "30289-06.html";
              break;
            case 6:
              st.giveAdena(92676, true);
              if (player.getLevel() <= MAX_REWARD_LEVEL) {
                st.addExpAndSp(223036, 13091);
              }
              st.exitQuest(false, true);
              htmltext = "30289-07.html";
              break;
          }
        }
        break;
      case CASIAN:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
            case 2:
              htmltext = "30612-01.html";
              break;
            case 3:
              if (st.getInt("talk") == 1) {
                htmltext = "30612-03.html";
              } else if (st.getInt("talk") == 2) {
                htmltext = "30612-06.html";
              } else {
                htmltext = "30612-02.html";
                st.set("talk", "1");
              }
              break;
            case 4:
            case 5:
            case 6:
              htmltext = "30612-09.html";
              break;
          }
        }
        break;
      case ROCK:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 5:
              htmltext = "32368-02.html";
              break;
            case 6:
              htmltext = "32368-05.html";
              break;
            default:
              htmltext = "32368-01.html";
              break;
          }
        }
        break;
    }
    return htmltext;
  }
示例#26
0
 @Override
 public boolean checkPartyMember(QuestState qs, L2Npc npc) {
   return (qs.getCond() < 3);
 }
 @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;
 }