@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 onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    String htmltext = null;
    if (st == null) {
      return htmltext;
    }

    switch (event) {
      case "30346-04.htm":
        {
          st.startQuest();
          htmltext = event;
          break;
        }
      case "30346-07.html":
        {
          st.exitQuest(true, true);
          htmltext = event;
          break;
        }
      case "30346-08.html":
        {
          htmltext = event;
          break;
        }
    }
    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;
    }

    switch (event) {
      case "31296-03.html":
        st.startQuest();
        break;
      case "31256-02.html":
        if (st.isCond(1)) {
          st.setCond(2, true);
          st.giveItems(BOX, 1);
        }
        break;
      case "31371-02.html":
        if (st.isCond(2) && st.hasQuestItems(BOX)) {
          st.addExpAndSp(233125, 18142);
          st.exitQuest(false, true);
        } else {
          htmltext = "31371-03.html";
        }
        break;
    }
    return htmltext;
  }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = player.getQuestState(getName());
   if (st == null) {
     return null;
   }
   String htmltext = event;
   switch (event) {
     case "31517-05.html":
       break;
     case "31517-02.htm":
       st.startQuest();
       break;
     case "Exp":
       if (st.getQuestItemsCount(BLOOD_OF_SAINT) < ITEMS_COUNT_REQUIRED) {
         return "31517-06.html";
       }
       st.addExpAndSp(XP_COUNT, SP_COUNT);
       st.exitQuest(true, true);
       htmltext = "31517-07.html";
       break;
     case "Adena":
       if (st.getQuestItemsCount(BLOOD_OF_SAINT) < ITEMS_COUNT_REQUIRED) {
         return "31517-06.html";
       }
       st.giveAdena(ADENA_COUNT, true);
       st.exitQuest(true, true);
       htmltext = "31517-07.html";
       break;
     default:
       htmltext = null;
       break;
   }
   return htmltext;
 }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return null;
    }

    String htmltext = null;
    if ((player.getLevel() >= MIN_LEVEL) && st.hasQuestItems(VACUALITE_FLOATING_STONE)) {
      switch (event) {
        case "31540-05.htm":
        case "31540-06.htm":
          {
            htmltext = event;
            break;
          }
        case "31540-07.html":
          {
            st.startQuest();
            htmltext = event;
            break;
          }
      }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return null;
    }

    String htmltext = null;
    switch (event) {
      case "30926-02.htm":
        {
          st.startQuest();
          htmltext = event;
          break;
        }
      case "30926-05.html":
        {
          st.exitQuest(true, true);
          htmltext = event;
          break;
        }
      case "30926-06.html":
        {
          htmltext = event;
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return null;
    }

    String htmltext = null;
    switch (event) {
      case "31453-02.htm":
        {
          st.startQuest();
          st.setMemoState(1);
          htmltext = event;
          break;
        }
      case "31453-03.html":
        {
          if (st.isMemoState(1)) {
            st.setMemoState(2);
            st.setCond(2, true);
            htmltext = event;
          }
        }
      case "31453-07.html":
        {
          if (st.isMemoState(2) && st.hasQuestItems(ANTELOPE_SKIN)) {
            giveItems(player, FRINTEZZAS_SCROLL, 1);
            st.exitQuest(true, true);
            htmltext = event;
          }
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return null;
    }

    String htmltext = event;
    switch (event) {
      case "32740.html":
      case "32740-01.html":
      case "32744-02.html":
      case "32744-03.htm":
        break;
      case "32744-04.htm":
        st.startQuest();
        break;
      case "32744-quit.html":
        st.exitQuest(true);
        break;
      default:
        htmltext = null;
        break;
    }
    return htmltext;
  }
Esempio n. 9
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 "30307-04.htm":
       {
         htmltext = event;
         break;
       }
     case "30307-05.htm":
       {
         if (qs.isCreated()) {
           qs.startQuest();
           giveItems(player, KAROYDS_LETTER, 1);
           htmltext = event;
         }
         break;
       }
   }
   return htmltext;
 }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    String htmltext = null;
    if (st == null) {
      return htmltext;
    }

    switch (event) {
      case "31340-04.htm":
        {
          if (st.isCreated()) {
            htmltext = event;
          }
          break;
        }
      case "31340-05.html":
        {
          if (st.isCreated()) {
            st.startQuest();
            htmltext = event;
          }
          break;
        }
      case "31340-06.html":
        {
          if (st.isCond(1)) {
            st.setCond(2, true);
            htmltext = event;
          }
          break;
        }
      case "31340-07.html":
        {
          if (st.isCond(1)) {
            st.setCond(3, true);
            htmltext = event;
          }
          break;
        }
      case "31340-08.html":
        {
          if (st.isCond(1)) {
            st.setCond(4, true);
            htmltext = event;
          }
          break;
        }
      case "31340-10.html":
        {
          if (st.isCond(1)) {
            htmltext = event;
          }
          break;
        }
    }
    return htmltext;
  }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = player.getQuestState(getName());
   if ((st != null) && event.equalsIgnoreCase("36479-04.html")) {
     st.startQuest();
     return event;
   }
   return null;
 }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = getQuestState(player, false);
   if ((st != null) && event.equalsIgnoreCase("30572-04.htm")) {
     st.startQuest();
     return event;
   }
   return null;
 }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = player.getQuestState(getName());
   if ((st != null) && event.equals("30349-03.htm")) {
     st.startQuest();
     st.giveItems(JENNAS_LETTER, 1);
     return event;
   }
   return null;
 }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return null;
    }

    String htmltext = event;
    switch (event) {
      case "32711-04.html":
        if (player.getLevel() >= 79) {
          st.startQuest();
          htmltext =
              (st.hasQuestItems(CET_1_SHEET, CET_2_SHEET, CET_3_SHEET))
                  ? "32711-04a.html"
                  : "32711-04.html";
        }
        break;
      case "32711-05a.html":
        player.sendPacket(new RadarControl(0, 2, 186214, 61591, -4152));
        break;
      case "32711-05b.html":
        player.sendPacket(new RadarControl(0, 2, 187554, 60800, -4984));
        break;
      case "32711-05c.html":
        player.sendPacket(new RadarControl(0, 2, 193432, 53922, -4368));
        break;
      case "spawn":
        if (!hasQuestItems(player, CET_1_SHEET, CET_2_SHEET, CET_3_SHEET)) {
          return getNoQuestMsg(player);
        } else if ((hekaton != null) && !hekaton.isDead()) {
          return "32711-09.html";
        }
        String respawn = loadGlobalQuestVar("Respawn");
        long remain =
            (!respawn.isEmpty()) ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
        if (remain > 0) {
          return "32711-09a.html";
        }
        st.takeItems(CET_1_SHEET, 1);
        st.takeItems(CET_2_SHEET, 1);
        st.takeItems(CET_3_SHEET, 1);
        hekaton = addSpawn(HEKATON_PRIME, 191777, 56197, -7624, 0, false, 0);
        htmltext = "32711-09.html";
        break;
      case "32711-03.htm":
      case "32711-05.html":
      case "32711-06.html":
        break;
      default:
        htmltext = null;
        break;
    }
    return htmltext;
  }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = getQuestState(player, false);
   if ((st != null) && event.equalsIgnoreCase("30577-04.htm")) {
     st.startQuest();
     return hasAtLeastOneQuestItem(player, NECKLACE_OF_VALOR, NECKLACE_OF_COURAGE)
         ? "30577-08.html"
         : event;
   }
   return null;
 }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return null;
    }

    String htmltext = event;
    switch (event) {
      case "30894-02.html":
      case "30289-03.html":
      case "30289-04.html":
      case "30612-03.html":
      case "30612-04.html":
      case "30612-06.html":
      case "30612-07.html":
        break;
      case "30894-01.html":
        st.startQuest();
        break;
      case "30894-03.html":
        st.giveItems(CRYPTOGRAM_OF_THE_ANGEL_SEARCH, 1);
        st.setCond(2, true);
        break;
      case "30289-05.html":
        st.unset("talk");
        st.setCond(3, true);
        break;
      case "30612-05.html":
        st.set("talk", "2");
        break;
      case "30612-08.html":
        st.unset("talk");
        st.setCond(4, true);
        break;
      case "32368-04.html":
        if (isAngelSpawned) {
          return "32368-03.html";
        }
        addSpawn(FALLEN_ANGEL, npc.getX() + 100, npc.getY() + 100, npc.getZ(), 0, false, 120000);
        isAngelSpawned = true;
        startQuestTimer("despawn", 120000, null, player);
        break;
      case "despawn":
        if (isAngelSpawned) {
          isAngelSpawned = false;
        }
      default:
        htmltext = null;
        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 "31388-03.htm":
        {
          if (qs.isCreated()) {
            qs.startQuest();
            htmltext = event;
          }
          break;
        }
      case "31388-04.html":
      case "31388-05.html":
      case "31388-06.html":
        {
          if (qs.isStarted()) {
            htmltext = event;
          }
          break;
        }
      case "31388-07.html":
        {
          if (qs.isCond(2)) {
            if (getQuestItemsCount(player, RIB_BONE_OF_A_BLACK_MAGUS) >= RIB_BONE_REQUIRED_COUNT) {
              giveAdena(player, 25000, true);
              addExpAndSp(player, 305235, 0);
              takeItems(player, RIB_BONE_OF_A_BLACK_MAGUS, -1);
              qs.setCond(1, true);
              htmltext = event;
            } else {
              htmltext = "31388-08.html";
            }
          }
          break;
        }
      case "31388-09.html":
        {
          if (qs.isStarted()) {
            qs.exitQuest(true, true);
            htmltext = event;
          }
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return getNoQuestMsg(player);
    }

    if (event.equals("32557-03.html")) {
      st.startQuest();
      st.giveItems(SCROLL, 8);
    }
    return event;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState qs = getQuestState(player, false);
    String html = null;

    if (qs == null) {
      return html;
    }

    switch (event) {
      case "quest_accept":
        {
          if (qs.isCreated()
              && (player.getLevel() >= MIN_LEVEL)
              && player.isInCategory(CategoryType.KNIGHT_GROUP)) {
            qs.startQuest();
            qs.setMemoState(1);
            qs.set("flag", 0);

            if (rewardDimensionalDiamonds(player)) {
              html = "30109-04a.htm";
            } else {
              html = "30109-04.htm";
            }
          }
          break;
        }
      case "30116-02.html":
      case "30116-03.html":
      case "30116-04.html":
        {
          if (qs.isMemoState(10) && hasQuestItems(player, TEAR_OF_LOYALTY)) {
            html = event;
          }
          break;
        }
      case "30116-05.html":
        {
          if (qs.isMemoState(10) && hasQuestItems(player, TEAR_OF_LOYALTY)) {
            html = event;
            takeItems(player, TEAR_OF_LOYALTY, -1);
            qs.setMemoState(11);
            qs.setCond(14, true);
          }
          break;
        }
    }
    return html;
  }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = player.getQuestState(getName());
   if (st == null) {
     return null;
   }
   String htmltext = null;
   switch (event) {
     case "30621-02.html":
     case "30512-02.html":
       {
         htmltext = event;
         break;
       }
     case "30673-03.htm":
       {
         if (st.isCreated()) {
           st.startQuest();
           st.takeItems(LORAINES_CERTIFICATE, -1);
           st.giveItems(METALLOGRAPH, 1);
           htmltext = event;
         }
         break;
       }
     case "30621-03.html":
       {
         if (st.isCond(1)) {
           st.setCond(2, true);
           htmltext = event;
         }
         break;
       }
     case "30512-03.html":
       {
         if (st.isCond(2)) {
           st.giveAdena(93383, true);
           if (player.getLevel() < MIN_LEVEL_FOR_EXP_SP) {
             st.addExpAndSp(285935, 18711);
           }
           st.exitQuest(false, true);
           htmltext = event;
         }
         break;
       }
   }
   return htmltext;
 }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = getQuestState(player, false);
    if (st == null) {
      return getNoQuestMsg(player);
    }

    switch (event) {
      case "31331-3.html":
        st.startQuest();
        break;
      case "31331-6.html":
        st.exitQuest(true, true);
        break;
    }
    return event;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    if (st == null) {
      return getNoQuestMsg(player);
    }

    switch (event) {
      case "31340-03.htm":
        st.startQuest();
        break;
      case "31335-03.htm":
        st.giveAdena(360000, true);
        st.exitQuest(false, true);
        break;
    }
    return event;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return htmltext;
    }

    if (npc.getId() == MOUEN) {
      if (event.equalsIgnoreCase("30196-03.htm")) {
        st.startQuest();
      }
    } else if ((npc.getId() == JOHNNY) && event.equalsIgnoreCase("32744-03.htm")) {
      st.giveAdena(83056, true);
      st.addExpAndSp(477496, 58743);
      st.exitQuest(false, true);
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = getQuestState(player, false);
    String htmltext = null;
    if (st == null) {
      return htmltext;
    }

    switch (event) {
      case "32133-03.htm":
        {
          st.startQuest();
          htmltext = event;
          break;
        }
      case "32133-06.html":
        {
          htmltext = event;
          break;
        }
      case "32133-08.html":
        {
          if (st.hasQuestItems(CRIMSON_SPIDER_CLAW)) {
            final long claws = st.getQuestItemsCount(CRIMSON_SPIDER_CLAW);
            st.giveAdena((claws * CLAW_PRICE) + ((claws >= 10) ? BONUS : 0), true);
            st.takeItems(CRIMSON_SPIDER_CLAW, -1);
            Q00261_CollectorsDream.giveNewbieReward(player);
            htmltext = event;
          } else {
            htmltext = "32133-07.html";
          }
          break;
        }
      case "32133-09.html":
        {
          st.exitQuest(true, true);
          htmltext = event;
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return null;
    }

    String htmltext = event;
    switch (event) {
      case "30291-02a.html":
      case "30291-04.html":
      case "30291-05.html":
      case "30291-06.html":
      case "30068-08.html":
      case "30068-09.html":
      case "30068-10.html":
        break;
      case "30068-03.htm":
        st.startQuest();
        break;
      case "30068-04.html":
        st.setCond(2, true);
        break;
      case "30291-07.html":
        st.unset("talk");
        st.setCond(3, true);
        break;
      case "30068-11.html":
        st.giveItems(BADGE_TEMPLE_EXECUTOR, 1);
        st.giveAdena(16924, true);
        if (player.getLevel() < MAX_REWARD_LEVEL) {
          st.addExpAndSp(30000, 2000);
        }
        st.exitQuest(false, true);
        break;
      default:
        htmltext = null;
        break;
    }
    return htmltext;
  }
 @Override
 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
   final QuestState st = getQuestState(player, false);
   String htmltext = null;
   if (st != null) {
     switch (event) {
       case "30078-03.htm":
         {
           htmltext = event;
           break;
         }
       case "30078-04.htm":
         {
           st.startQuest();
           htmltext = event;
           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 "32974-03.htm":
        {
          qs.startQuest();
          htmltext = event;
          break;
        }
      case "32974-02.htm":
        {
          htmltext = event;
          break;
        }
      case "32980-02.html":
        {
          player.sendPacket(
              new TutorialShowHtml(
                  npc.getObjectId(),
                  "..\\L2Text\\QT_004_skill_01.htm",
                  TutorialShowHtml.LARGE_WINDOW));
          giveAdena(player, 110, true);
          addExpAndSp(player, 3100, 5);
          qs.exitQuest(false, true);
          htmltext = event;
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    String htmltext = null;
    if (st == null) {
      return htmltext;
    }

    switch (event) {
      case "32054-03.htm":
        {
          if (st.isCreated()) {
            st.startQuest();
            htmltext = event;
          }
          break;
        }
      case "32054-07.html":
      case "32054-08.html":
        {
          if (st.isStarted()) {
            htmltext = event;
          }
          break;
        }
      case "32054-09.html":
        {
          if (st.isStarted()) {
            st.exitQuest(true, true);
            htmltext = event;
          }
          break;
        }
    }
    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(getName());
    if (st == null) {
      return null;
    }

    String htmltext = event;
    switch (event) {
      case "30847-03.htm":
        st.startQuest();
        break;
      case "30847-06.html":
        if (st.getQuestItemsCount(ENCHANTED_IRON) < IRON_COUNT) {
          return getNoQuestMsg(player);
        }
        st.takeItems(ENCHANTED_IRON, -1);
        st.setCond(3, true);
        break;
      case "30847-09.html":
        if ((st.getQuestItemsCount(ARTISANS_FRAME) >= COUNT)
            && (st.getQuestItemsCount(ORIHARUKON) >= COUNT)) {
          st.takeItems(ARTISANS_FRAME, 10);
          st.takeItems(ORIHARUKON, 10);
          st.giveItems(SEWING_KIT, 1);
          st.exitQuest(false, true);
        } else {
          htmltext = "30847-10.html";
        }
        break;
      default:
        htmltext = null;
        break;
    }
    return htmltext;
  }
Esempio n. 30
0
  @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 "30565-02.htm":
        {
          qs.startQuest();
          htmltext = event;
          break;
        }
      case "30565-03.html":
        {
          htmltext = event;
          break;
        }
      case "30332-02.html":
        {
          htmltext = event;
          break;
        }
      case "30332-03.html":
        {
          giveAdena(player, ADENA_REWARD, true);
          addExpAndSp(player, EXP_REWARD, SP_REWARD);
          qs.exitQuest(false, true);
          htmltext = event;
          break;
        }
    }
    return htmltext;
  }