Ejemplo n.º 1
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 "30070-02.htm":
       st.startQuest();
       st.giveItems(TEMPLE_MANIFESTO, 1);
       break;
     case "30070-05.html":
       st.giveAdena(84593, true);
       if ((player.getLevel() < 42)) {
         st.addExpAndSp(187062, 11307);
       }
       st.exitQuest(false, true);
       break;
     case "30070-03.html":
       st.setCond(2, true);
       break;
     case "30118-06.html":
       st.setCond(3, true);
       break;
     case "30118-09.html":
       st.setCond(6, true);
       st.giveItems(PUPINAS_RECOMMENDATION, 1);
       break;
     case "30474-02.html":
       st.setCond(4, true);
       break;
     case "30666-02.html":
       if (st.hasQuestItems(PUPINAS_RECOMMENDATION)) {
         st.set("talk", "1");
         st.takeItems(PUPINAS_RECOMMENDATION, -1);
       }
       break;
     case "30666-03.html":
       if (st.hasQuestItems(TEMPLE_MANIFESTO)) {
         st.set("talk", "2");
         st.takeItems(TEMPLE_MANIFESTO, -1);
       }
       break;
     case "30666-08.html":
       st.setCond(7, true);
       st.unset("talk");
       break;
   }
   return event;
 }
Ejemplo n.º 2
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":
      case "31453-03.htm":
      case "31453-10.html":
        {
          htmltext = event;
          break;
        }
      case "31453-04.html":
        {
          st.startQuest();
          htmltext = event;
          break;
        }
      case "31453-11.html":
        {
          if (st.isCond(2)) {
            st.giveAdena(150292, true);
            st.addExpAndSp(902439, 90067);
            st.exitQuest(false, true);
            htmltext = event;
          }
          break;
        }
      case "brooch":
        {
          htmltext = (st.hasQuestItems(ANTIQUE_BROOCH)) ? "32009-02.html" : "32009-03.html";
          break;
        }
      case "32009-04.html":
        {
          if (st.isCond(1) && st.hasQuestItems(ANTIQUE_BROOCH)) {
            st.setCond(2, true);
            htmltext = event;
          }
          break;
        }
    }
    return htmltext;
  }
Ejemplo n.º 3
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 "31338-1.html":
        st.giveItems(ANCIENT_BOOK, 1);
        st.startQuest();
        break;
      case "32113-2.html":
      case "32113-2a.html":
        st.giveAdena(191678, true);
        st.addExpAndSp(251602, 25245);
        st.exitQuest(false, true);
        break;
    }
    return event;
  }
  @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 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 TOBIAS:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
              htmltext = "30297-01.html";
              break;
            case 2:
              htmltext = (st.isSet("talk")) ? "30297-04.html" : "30297-02.html";
              break;
            case 3:
            case 4:
              htmltext = "30297-06.html";
              break;
            case 5:
              st.giveAdena(89046, true);
              if (player.getLevel() <= MAX_REWARD_LEVEL) {
                st.addExpAndSp(223036, 13901);
              }
              st.exitQuest(false, true);
              htmltext = "30297-07.html";
              break;
          }
        }
        break;
      case CASIAN:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
            case 2:
              htmltext = "30612-01.html";
              break;
            case 3:
              htmltext = (st.isSet("talk")) ? "30612-04.html" : "30612-02.html";
              break;
            default:
              htmltext = "30612-10.html";
              break;
          }
        }
        break;
      case ROCK:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
            case 2:
            case 3:
              htmltext = "32368-01.html";
              break;
            case 4:
              htmltext = "32368-02.html";
              break;
            case 5:
              htmltext = "32368-05.html";
              break;
          }
        }
        break;
      case ANGEL:
        if (st.isStarted()) {
          switch (st.getCond()) {
            case 1:
            case 2:
            case 3:
              htmltext = "32369-01.html";
              break;
            case 4:
              if (st.getInt("talk") == 1) {
                htmltext = "32369-04.html";
              } else if (st.getInt("talk") == 2) {
                htmltext = "32369-07.html";
              } else {
                htmltext = "32369-02.html";
              }
              break;
          }
        }
        break;
    }
    return htmltext;
  }