@Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("30686-2.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (event.equalsIgnoreCase("30686-7.htm")) {
      final int count = st.getQuestItemsCount(JADE_CRYSTAL);
      if (count == 0) htmltext = "30686-4.htm";
      else {
        int reward = (count * 425) + 3500;
        if (count >= 100) reward += 7400;

        st.takeItems(JADE_CRYSTAL, -1);
        st.rewardItems(57, reward);
      }
    } else if (event.equalsIgnoreCase("30686-8.htm")) {
      st.playSound(QuestState.SOUND_FINISH);
      st.exitQuest(true);
    }

    return htmltext;
  }
Exemplo n.º 2
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    // Start the quest.
    if (event.endsWith("-04.htm")) {
      st.setState(Quest.STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    }
    // Give Red Soul Crystal.
    else if (event.endsWith("-09.htm")) {
      st.playSound(QuestState.SOUND_MIDDLE);
      st.giveItems(4629, 1);
    }
    // Give Green Soul Crystal.
    else if (event.endsWith("-10.htm")) {
      st.playSound(QuestState.SOUND_MIDDLE);
      st.giveItems(4640, 1);
    }
    // Give Blue Soul Crystal.
    else if (event.endsWith("-11.htm")) {
      st.playSound(QuestState.SOUND_MIDDLE);
      st.giveItems(4651, 1);
    }
    // Terminate the quest.
    else if (event.endsWith("-exit.htm")) st.exitQuest(true);

    return htmltext;
  }
Exemplo n.º 3
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("30828-01.htm")) {
      st.set("cond", "1");
      st.setState(STATE_STARTED);
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (event.equalsIgnoreCase("30828-03.htm") && st.hasQuestItems(TRIDENT)) {
      st.set("cond", "2");
      st.takeItems(TRIDENT, 1);
      st.playSound(QuestState.SOUND_MIDDLE);
    } else if (event.equalsIgnoreCase("30828-05.htm")) {
      st.takeItems(MAP_PIECE, 30);
      st.giveItems(MAP, 1);
      st.set("cond", "4");
      st.playSound(QuestState.SOUND_MIDDLE);
    } else if (event.equalsIgnoreCase("30735-06.htm")) {
      st.takeItems(MAP, 1);
      st.set("cond", "5");
      st.playSound(QuestState.SOUND_MIDDLE);
    } else if (event.equalsIgnoreCase("30828-07.htm")) {
      st.giveItems(PET_TICKET, 1);
      st.playSound(QuestState.SOUND_FINISH);
      st.exitQuest(false);
    }

    return htmltext;
  }
Exemplo n.º 4
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("30050-03.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    }

    return htmltext;
  }
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("30754-04.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (event.equalsIgnoreCase("30754-07.htm")) {
      if (st.get("success") != null) {
        st.set("cond", "1");
        st.unset("success");
        st.playSound(QuestState.SOUND_MIDDLE);
      }
    } else if (event.equalsIgnoreCase("30754-08.htm")) {
      st.playSound(QuestState.SOUND_FINISH);
      st.exitQuest(true);
    } else if (event.equalsIgnoreCase("30754-06.htm")) {
      if (!st.hasQuestItems(ARTICLE_DEAD_HERO)) htmltext = "30754-06a.htm";
      else {
        final int amount = st.getQuestItemsCount(ARTICLE_DEAD_HERO);

        st.takeItems(ARTICLE_DEAD_HERO, -1);
        st.giveItems(57, amount * 60);

        // Special item, % based on actual number of qItems.
        if (Rnd.get(1000) < Math.min(10, Math.max(1, amount / 10))) htmltext = "30754-10.htm";
      }
    } else if (event.equalsIgnoreCase("30754-11.htm")) {
      final int random = Rnd.get(4);
      if (random < 1) {
        htmltext = "30754-12.htm";
        st.giveItems(OLD_KEY, 1);
      } else if (random < 2) {
        htmltext = "30754-13.htm";
        st.giveItems(OLD_HILT, 1);
      } else if (random < 3) {
        htmltext = "30754-14.htm";
        st.giveItems(OLD_TOTEM, 1);
      } else st.giveItems(CRUCIFIX, 1);

      st.set("cond", "2");
      st.playSound(QuestState.SOUND_MIDDLE);
    }

    return htmltext;
  }
Exemplo n.º 6
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("30623-04.htm")) {
      if (player.getRace() == Race.Orc) htmltext = "30623-05.htm";
    } else if (event.equalsIgnoreCase("30623-07.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.set("cond", "2");
      st.playSound(QuestState.SOUND_ACCEPT);
      st.giveItems(ORDER_GLUDIO, 1);
      st.giveItems(ORDER_DION, 1);
      st.giveItems(ORDER_GIRAN, 1);
      st.giveItems(ORDER_OREN, 1);
      st.giveItems(ORDER_ADEN, 1);
      st.giveItems(DIMENSIONAL_DIAMOND, 72);
    } else if (event.equalsIgnoreCase("30623-16.htm")) {
      if (st.getInt("cond") == 3) {
        st.set("cond", "4");
        st.playSound(QuestState.SOUND_MIDDLE);

        st.takeItems(ORDER_GLUDIO, 1);
        st.takeItems(ORDER_DION, 1);
        st.takeItems(ORDER_GIRAN, 1);
        st.takeItems(ORDER_OREN, 1);
        st.takeItems(ORDER_ADEN, 1);

        st.takeItems(PUNCHER_SHARD, -1);
        st.takeItems(NOBLE_ANT_FEELER, -1);
        st.takeItems(DRONE_CHITIN, -1);
        st.takeItems(DEAD_SEEKER_FANG, -1);
        st.takeItems(OVERLORD_NECKLACE, -1);
        st.takeItems(FETTERED_SOUL_CHAIN, -1);
        st.takeItems(CHIEF_AMULET, -1);
        st.takeItems(ENCHANTED_EYE_MEAT, -1);
        st.takeItems(TAMRIN_ORC_RING, -1);
        st.takeItems(TAMRIN_ORC_ARROW, -1);

        st.giveItems(FINAL_ORDER, 1);
      }
    }

    return htmltext;
  }
Exemplo n.º 7
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    // Manakia
    if (event.equalsIgnoreCase("30515-03.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.set("condStone", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (event.startsWith("30515-06-")) {
      if (st.getQuestItemsCount(CAVE_BEAST_TOOTH) >= 65
          && st.getQuestItemsCount(DEATH_WAVE_LIGHT) >= 65) {
        htmltext = "30515-06.htm";
        st.playSound(QuestState.SOUND_MIDDLE);

        int[] reward = REWARDS[Integer.parseInt(event.substring(9, 10))];

        st.takeItems(CAVE_BEAST_TOOTH, -1);
        st.takeItems(DEATH_WAVE_LIGHT, -1);

        st.rewardItems(57, reward[2]);
        st.giveItems(reward[0], reward[1]);
      } else htmltext = "30515-07.htm";
    } else if (event.equalsIgnoreCase("30515-08.htm")) {
      st.playSound(QuestState.SOUND_FINISH);
      st.exitQuest(true);
    }
    // Torai
    else if (event.equalsIgnoreCase("30557-02.htm")) {
      if (st.getInt("cond") == 2 && st.hasQuestItems(SEALED_MYSTERIOUS_STONE)) {
        st.set("cond", "3");
        st.takeItems(SEALED_MYSTERIOUS_STONE, -1);
        st.giveItems(MYSTERIOUS_STONE, 1);
        st.playSound(QuestState.SOUND_MIDDLE);
      } else htmltext = "30557-03.htm";
    }
    return htmltext;
  }
Exemplo n.º 8
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("32017-03.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (Util.isDigit(event)) {
      htmltext = "32017-07.htm";
      st.takeItems(CURSED_GRAVE_GOODS, -1);

      final int reward[] = REWARDS[Integer.parseInt(event)];
      st.giveItems(reward[0], reward[1]);

      st.playSound(QuestState.SOUND_FINISH);
      st.exitQuest(true);
    }

    return htmltext;
  }
Exemplo n.º 9
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("31314-03.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (event.equalsIgnoreCase("31315-02.htm")) {
      st.set("cond", "2");
      st.playSound(QuestState.SOUND_MIDDLE);
      st.giveItems(SUPPLY_BOX, 1);
    } else if (event.equalsIgnoreCase("31555-02.htm")) {
      st.takeItems(SUPPLY_BOX, 1);
      st.rewardItems(57, 15000);
      st.rewardExpAndSp(50000, 0);
      st.playSound(QuestState.SOUND_FINISH);
      st.exitQuest(false);
    }

    return htmltext;
  }
Exemplo n.º 10
0
  @Override
  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    String htmltext = event;
    QuestState st = player.getQuestState(qn);
    if (st == null) return htmltext;

    if (event.equalsIgnoreCase("31522-02.htm")) {
      st.setState(STATE_STARTED);
      st.set("cond", "1");
      st.playSound(QuestState.SOUND_ACCEPT);
    } else if (event.equalsIgnoreCase("31523-03.htm")) {
      st.set("cond", "2");
      st.playSound(QuestState.SOUND_MIDDLE);
      spawnVonHellmann(st);
    } else if (event.equalsIgnoreCase("31524-06.htm")) {
      st.set("cond", "3");
      st.playSound(QuestState.SOUND_MIDDLE);

      // Spawn the page.
      if (_vonHellmannPage == null) {
        _vonHellmannPage = addSpawn(VON_HELLMAN_PAGE, 51462, -54539, -3176, 0, false, 90000, true);
        _vonHellmannPage.broadcastNpcSay(
            "My master has instructed me to be your guide, " + player.getName() + ".");

        // Make it move.
        startQuestTimer("1", 4000, _vonHellmannPage, player, false);
        startQuestTimer("pageDespawn", 88000, _vonHellmannPage, player, false);
      }
    } else if (event.equalsIgnoreCase("31526-08.htm")) {
      st.set("cond", "5");
      st.playSound(QuestState.SOUND_MIDDLE);
    } else if (event.equalsIgnoreCase("31526-14.htm")) {
      st.set("cond", "6");
      st.playSound(QuestState.SOUND_MIDDLE);
      st.giveItems(CROSS_OF_EINHASAD, 1);
    } else if (event.equalsIgnoreCase("1")) {
      _vonHellmannPage
          .getAI()
          .setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(52373, -54296, -3136, 0));
      _vonHellmannPage.broadcastNpcSay("Follow me...");
      startQuestTimer("2", 5000, _vonHellmannPage, player, false);
      return null;
    } else if (event.equalsIgnoreCase("2")) {
      _vonHellmannPage
          .getAI()
          .setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(52279, -53064, -3161, 0));
      startQuestTimer("3", 12000, _vonHellmannPage, player, false);
      return null;
    } else if (event.equalsIgnoreCase("3")) {
      _vonHellmannPage
          .getAI()
          .setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(51909, -51725, -3125, 0));
      startQuestTimer("4", 15000, _vonHellmannPage, player, false);
      return null;
    } else if (event.equalsIgnoreCase("4")) {
      _vonHellmannPage
          .getAI()
          .setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(52438, -51240, -3097, 0));
      _vonHellmannPage.broadcastNpcSay("This where that here...");
      startQuestTimer("5", 5000, _vonHellmannPage, player, false);
      return null;
    } else if (event.equalsIgnoreCase("5")) {
      _vonHellmannPage
          .getAI()
          .setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(52143, -51418, -3085, 0));
      _vonHellmannPage.broadcastNpcSay("I want to speak to you...");
      return null;
    } else if (event.equalsIgnoreCase("31328-05.htm")) {
      if (st.hasQuestItems(CROSS_OF_EINHASAD)) {
        st.takeItems(CROSS_OF_EINHASAD, 1);
        st.giveItems(CROSS_OF_EINHASAD_NEXT_QUEST, 1);
        st.playSound(QuestState.SOUND_FINISH);
        st.exitQuest(false);
      }
    } else if (event.equalsIgnoreCase("pageDespawn")) _vonHellmannPage = null;

    return htmltext;
  }
Exemplo n.º 11
0
  @Override
  public String onFirstTalk(L2Npc npc, L2PcInstance player) {
    String htmltext = getNoQuestMsg();
    QuestState st = player.getQuestState(qn);
    if (st == null) st = newQuestState(player);

    final int allianceLevel = player.getAllianceWithVarkaKetra();

    switch (npc.getNpcId()) {
      case KADUN:
        if (allianceLevel > 0) htmltext = "31370-friend.htm";
        else htmltext = "31370-no.htm";
        break;

      case WAHKAN:
        if (allianceLevel > 0) htmltext = "31371-friend.htm";
        else htmltext = "31371-no.htm";
        break;

      case ASEFA:
        st.setState(STATE_STARTED);
        if (allianceLevel < 1) htmltext = "31372-3.htm";
        else if (allianceLevel < 3 && allianceLevel > 0) htmltext = "31372-1.htm";
        else if (allianceLevel > 2) {
          if (st.hasQuestItems(HORN)) htmltext = "31372-4.htm";
          else htmltext = "31372-2.htm";
        }
        break;

      case ATAN:
        if (player.getKarma() >= 1) htmltext = "31373-pk.htm";
        else if (allianceLevel <= 0) htmltext = "31373-no.htm";
        else if (allianceLevel == 1 || allianceLevel == 2) htmltext = "31373-1.htm";
        else htmltext = "31373-2.htm";
        break;

      case JAFF:
        switch (allianceLevel) {
          case 1:
            htmltext = "31374-1.htm";
            break;
          case 2:
          case 3:
            htmltext = "31374-2.htm";
            break;
          default:
            if (allianceLevel <= 0) htmltext = "31374-no.htm";
            else if (player.getWarehouse().getSize() == 0) htmltext = "31374-3.htm";
            else htmltext = "31374-4.htm";
            break;
        }
        break;

      case JUMARA:
        switch (allianceLevel) {
          case 2:
            htmltext = "31375-1.htm";
            break;
          case 3:
          case 4:
            htmltext = "31375-2.htm";
            break;
          case 5:
            htmltext = "31375-3.htm";
            break;
          default:
            htmltext = "31375-no.htm";
            break;
        }
        break;

      case KURFA:
        if (allianceLevel <= 0) htmltext = "31376-no.htm";
        else if (allianceLevel > 0 && allianceLevel < 4) htmltext = "31376-1.htm";
        else if (allianceLevel == 4) htmltext = "31376-2.htm";
        else htmltext = "31376-3.htm";
        break;
    }

    return htmltext;
  }