@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 = 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;
  }
コード例 #3
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = getQuestState(player, false);
    if (st == null) {
      return getNoQuestMsg(player);
    }

    if (Util.isDigit(event)) {
      int i = Integer.valueOf(event);
      final ClassId cid = player.getClassId();
      if ((cid.getRace() == Race.DARK_ELF) && (cid.getId() == CLASSES[i][1])) {
        int suffix;
        final boolean item = st.hasQuestItems(CLASSES[i][6]);
        if (player.getLevel() < 20) {
          suffix = (!item) ? CLASSES[i][2] : CLASSES[i][3];
        } else {
          if (!item) {
            suffix = CLASSES[i][4];
          } else {
            suffix = CLASSES[i][5];
            st.giveItems(SHADOW_WEAPON_COUPON_DGRADE, 15);
            st.takeItems(CLASSES[i][6], -1);
            player.setClassId(CLASSES[i][0]);
            player.setBaseClass(CLASSES[i][0]);
            st.playSound(QuestSound.ITEMSOUND_QUEST_FANFARE_2);
            player.broadcastUserInfo();
            st.exitQuest(false);
          }
        }
        event = npc.getId() + "-" + suffix + ".html";
      }
    }
    return event;
  }
コード例 #4
0
  @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;
  }
コード例 #5
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState st = player.getQuestState(getName());
   String htmltext = getNoQuestMsg(player);
   if (st != null) {
     switch (st.getState()) {
       case State.CREATED:
         {
           htmltext =
               (player.getRace() == Race.DARK_ELF)
                   ? (player.getLevel() >= MIN_LVL) ? "30348-02.htm" : "30348-01.htm"
                   : "30348-00.htm";
           break;
         }
       case State.STARTED:
         {
           if (st.isCond(2) && (st.getQuestItemsCount(DARK_BEZOAR) >= REQUIRED_COUNT)) {
             st.giveItems(LESSER_HEALING_POTION, 5);
             st.addExpAndSp(1000, 0);
             st.exitQuest(false, true);
             htmltext = "30348-05.html";
           } else {
             htmltext = "30348-04.html";
           }
           break;
         }
       case State.COMPLETED:
         {
           htmltext = getAlreadyCompletedMsg(player);
           break;
         }
     }
   }
   return htmltext;
 }
コード例 #6
0
 @Override
 public String onTalk(L2Npc npc, L2PcInstance player) {
   final QuestState st = getQuestState(player, false);
   String htmltext = getNoQuestMsg(player);
   if (st != null) {
     switch (st.getState()) {
       case State.CREATED:
         {
           htmltext = player.getLevel() >= MIN_LVL ? "30078-01.html" : "30078-02.htm";
           break;
         }
       case State.STARTED:
         {
           if (st.isCond(2) && (st.getQuestItemsCount(BEAR_SKIN) >= REQUIRED_COUNT)) {
             st.giveAdena(ADENA_COUNT, true);
             st.exitQuest(true, true);
             htmltext = "30078-05.html";
           } else {
             htmltext = "30078-06.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() >= 79) ? "32711-01.htm" : "32711-02.htm";
          break;
        }
      case State.STARTED:
        {
          if ((hekaton != null) && !hekaton.isDead()) {
            htmltext = "32711-09.html";
          } else if (st.isCond(1)) {
            htmltext =
                (!hasQuestItems(player, CET_1_SHEET, CET_2_SHEET, CET_3_SHEET))
                    ? "32711-07.html"
                    : "32711-08.html";
          } else if (st.isCond(2)) {
            st.giveItems(SUPPORT_ITEMS, 1);
            st.exitQuest(true, true);
            htmltext = "32711-10.html";
          }
          break;
        }
    }
    return htmltext;
  }
コード例 #8
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    final QuestState st = player.getQuestState(qn);
    if (st == null) {
      return htmltext;
    }

    switch (event) {
      case "31570-03.htm":
        st.set("cond", "1");
        st.setState(State.STARTED);
        st.playSound("ItemSound.quest_accept");
        break;
      case "31570-05.htm":
        if ((st.getInt("cond") == 1) && (st.hasQuestItems(BLUE_TREASURE_BOX))) {
          htmltext = "31570-06.htm";
          st.set("cond", "2");
          st.giveItems(STRANGE_BLUESPRINT, 1);
          st.takeItems(BLUE_TREASURE_BOX, -1);
          st.playSound("ItemSound.quest_middle");
        }
        break;
      case "31434-02.htm":
        if ((st.getInt("cond") == 2) && (st.hasQuestItems(STRANGE_BLUESPRINT))) {
          htmltext = "31434-01.htm";
          st.giveItems(BLACK_PEARL_RING, 1);
          st.takeItems(STRANGE_BLUESPRINT, -1);
          st.playSound("ItemSound.quest_finish");
          st.exitQuest(false);
        }
        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 "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;
  }
  @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;
  }
コード例 #11
0
  @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;
  }
コード例 #12
0
  @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;
  }
コード例 #13
0
  @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 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;
  }
コード例 #15
0
  @Override
  public final String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(qn);
    if (st == null) {
      return "<html><body>目前沒有執行任務,或條件不符。</body></html>";
    }

    final byte id = st.getState();
    if (id == State.CREATED) {
      if (player.getLevel() > 72) {
        if (st.hasQuestItems(FADED_MARK)) {
          return "32010-02.htm";
        }
        if (st.hasQuestItems(VISITOR_MARK)) {
          st.exitQuest(true);
          return "32010-01a.htm";
        }
        if (st.hasQuestItems(MARK)) {
          st.exitQuest(true);
          return "32010-0.htm";
        }
      }
      st.exitQuest(true);
      return "32010-01.htm";
    } else if (id == State.STARTED) {
      if ((st.getInt("cond") == 2) && (st.getQuestItemsCount(NECRO_HEART) == 10)) {
        st.takeItems(NECRO_HEART, 10);
        st.takeItems(FADED_MARK, 1);
        st.giveItems(MARK, 1);
        st.giveItems(8273, 10);
        st.playSound("ItemSound.quest_finish");
        st.exitQuest(true);
        return "32010-05.htm";
      }
      return "32010-04.htm";
    }
    return "<html><body>目前沒有執行任務,或條件不符。</body></html>";
  }
  @Override
  public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(qn);

    if (st == null) return "<html><body>目前沒有執行任務,或條件不符。</body></html>";

    final int cond = st.getInt("cond");
    if (event.equalsIgnoreCase("31001-05.htm")) {
      if (cond == 0) {
        st.set("cond", "1");
        st.setState(State.STARTED);
        st.playSound("ItemSound.quest_accept");
      }
    } else if (event.equalsIgnoreCase("32576-02.htm")) {
      if (cond == 1) {
        st.giveItems(IDENTITY_CARD, 1);
        st.set("cond", "2");
        st.playSound("ItemSound.quest_middle");
      }
    } else if (event.equalsIgnoreCase("30289-04.htm")) {
      if (cond == 2) {
        st.set("cond", "3");
        player.stopAllEffects();
        SkillTable.getInstance().getInfo(GUARD_DAWN, 1).getEffects(player, player);
      }
    } else if (event.equalsIgnoreCase("30289-07.htm")) {
      if (cond == 3) {
        SkillTable.getInstance().getInfo(GUARD_DAWN, 1).getEffects(player, player);
      }
    } else if (event.equalsIgnoreCase("30289-08.htm")) {
      if (cond == 3) {
        player.stopAllEffects();
      }
    } else if (event.equalsIgnoreCase("30289-11.htm")) {
      if (cond == 3) {
        st.set("cond", "4");
        st.playSound("ItemSound.quest_middle");
        player.stopAllEffects();
      }
    } else if (event.equalsIgnoreCase("30969-03.htm")) {
      if (cond == 4) {
        st.addExpAndSp(52518015, 5817677);
        // st.addExpAndSp(25000000, 2500000); // High Five
        st.unset("cond");
        st.exitQuest(false);
        st.playSound("ItemSound.quest_finish");
      }
    }
    return event;
  }
コード例 #17
0
 @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) {
    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;
  }
コード例 #19
0
 @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;
 }
コード例 #20
0
  @Override
  public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(qn);
    if (st == null) {
      return null;
    }

    if ("32010-03.htm".equalsIgnoreCase(event)) {
      st.set("cond", "1");
      st.setState(State.STARTED);
      st.playSound("ItemSound.quest_accept");
    } else if ("32010-10.htm".equalsIgnoreCase(event)) {
      st.exitQuest(true);
    }

    return event;
  }
コード例 #21
0
  @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 final String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState st = player.getQuestState(qn);
    final QuestState contractOfMammon = player.getQuestState("194_SevenSignContractOfMammon");

    if (st == null) return "<html><body>目前沒有執行任務,或條件不符。</body></html>";

    final int cond = st.getInt("cond");
    switch (npc.getNpcId()) {
      case CLAUDIA:
        switch (st.getState()) {
          case State.CREATED:
            if (cond == 0
                && player.getLevel() >= 79
                && contractOfMammon.getState() == State.COMPLETED) return "31001-01.htm";
            else st.exitQuest(true);
            return "31001-00.htm";
          case State.STARTED:
            if (cond == 1) return "31001-06.htm";
          case State.COMPLETED:
            return "<html><body>這是已經完成的任務。</body></html>";
        }
      case JOHN:
        switch (st.getInt("cond")) {
          case 1:
            return "32576-01.htm";
          case 2:
            return "32576-03.htm";
        }
      case RAYMOND:
        switch (st.getInt("cond")) {
          case 1:
          case 2:
            return "30289-01.htm";
          case 3:
            if (st.getQuestItemsCount(SHUNAIMAN_CONTRACT) == 1) return "30289-09.htm";
            else return "30289-06.htm";
          case 4:
            return "30289-12.htm";
        }
      case IASON_HEINE:
        if (cond == 4) return "30969-01.htm";
    }
    return "<html><body>目前沒有執行任務,或條件不符。</body></html>";
  }
コード例 #23
0
  @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;
  }
コード例 #24
0
  @Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg(player);
    final QuestState st = getQuestState(player, true);
    if (st == null) {
      return htmltext;
    }

    L2Clan clan = player.getClan();
    switch (st.getState()) {
      case State.CREATED:
        htmltext =
            ((clan == null) || !player.isClanLeader() || (clan.getLevel() < 5))
                ? "31331-0.htm"
                : "31331-1.htm";
        break;
      case State.STARTED:
        if ((clan == null) || !player.isClanLeader()) {
          st.exitQuest(true);
          return "31331-8.html";
        }

        if (!st.hasQuestItems(TYRANNOSAURUS_CLAW)) {
          htmltext = "31331-4.html";
        } else {
          int count = (int) st.getQuestItemsCount(TYRANNOSAURUS_CLAW);
          int reward = (count < 10) ? (30 * count) : (59 + (30 * count));
          st.playSound(QuestSound.ITEMSOUND_QUEST_FANFARE_1);
          st.takeItems(TYRANNOSAURUS_CLAW, -1);
          clan.addReputationScore(reward, true);
          player.sendPacket(
              SystemMessage.getSystemMessage(
                      SystemMessageId
                          .YOU_HAVE_SUCCESSFULLY_COMPLETED_A_CLAN_QUEST_S1_POINT_S_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION)
                  .addInt(reward));
          clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
          htmltext = "31331-7.html";
        }
        break;
      default:
        break;
    }
    return htmltext;
  }
  @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;
  }
コード例 #26
0
  @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;
  }
コード例 #27
0
  @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;
  }
コード例 #28
0
  @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;
  }
コード例 #29
0
  @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 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;
  }