Пример #1
0
  @Override
  public void onTrod(L1PcInstance trodFrom, L1Object trapObj) {
    sendEffect(trapObj);

    L1Teleport.teleport(trodFrom, _loc.getX(), _loc.getY(), (short) _loc.getMapId(), 5, true);
  }
  private void doFinalAction(L1PcInstance pc, String action) {
    int objid = getId();

    int npcid = getNpcTemplate().getNpcId();
    String htmlid = null;
    boolean isTeleport = true;

    if (npcid == 50014) { // ディロン
      if (!pc.getInventory().checkItem(40581)) { // アンデッドのキー
        isTeleport = false;
        htmlid = "dilongn";
      }
    } else if (npcid == 50043) { // ラムダ
      if (_isNowDely) { // テレポートディレイ中
        isTeleport = false;
      }
    } else if (npcid == 50625) { // 古代人(Lv50クエスト古代の空間2F)
      if (_isNowDely) { // テレポートディレイ中
        isTeleport = false;
      }
    }

    if (isTeleport) { // テレポート実行
      try {
        // ミュータントアントダンジョン(君主Lv30クエスト)
        if (action.equalsIgnoreCase("teleport mutant-dungen")) {
          // 3マス以内のPc
          for (L1PcInstance otherPc : L1World.getInstance().getVisiblePlayer(pc, 3)) {
            if (otherPc.getClanId() == pc.getClanId() && otherPc.getId() != pc.getId()) {
              L1Teleport.teleport(otherPc, 32740, 32800, (short) 217, 5, true);
            }
          }
          L1Teleport.teleport(pc, 32740, 32800, (short) 217, 5, true);
        }
        // 試練のダンジョン(ウィザードLv30クエスト)
        else if (action.equalsIgnoreCase("teleport mage-quest-dungen")) {
          L1Teleport.teleport(pc, 32791, 32788, (short) 201, 5, true);
        } else if (action.equalsIgnoreCase("teleport 29")) { // ラムダ
          L1PcInstance kni = null;
          L1PcInstance elf = null;
          L1PcInstance wiz = null;
          // 3マス以内のPc
          for (L1PcInstance otherPc : L1World.getInstance().getVisiblePlayer(pc, 3)) {
            L1Quest quest = otherPc.getQuest();
            if (otherPc.isKnight() // ナイト
                && quest.getStep(L1Quest.QUEST_LEVEL50) == 1) { // ディガルディン同意済み
              if (kni == null) {
                kni = otherPc;
              }
            } else if (otherPc.isElf() // エルフ
                && quest.getStep(L1Quest.QUEST_LEVEL50) == 1) { // ディガルディン同意済み
              if (elf == null) {
                elf = otherPc;
              }
            } else if (otherPc.isWizard() // ウィザード
                && quest.getStep(L1Quest.QUEST_LEVEL50) == 1) { // ディガルディン同意済み
              if (wiz == null) {
                wiz = otherPc;
              }
            }
          }
          if (kni != null && elf != null && wiz != null) { // 全クラス揃っている
            L1Teleport.teleport(pc, 32723, 32850, (short) 2000, 2, true);
            L1Teleport.teleport(kni, 32750, 32851, (short) 2000, 6, true);
            L1Teleport.teleport(elf, 32878, 32980, (short) 2000, 6, true);
            L1Teleport.teleport(wiz, 32876, 33003, (short) 2000, 0, true);
            TeleportDelyTimer timer = new TeleportDelyTimer();
            GeneralThreadPool.getInstance().execute(timer);
          }
        } else if (action.equalsIgnoreCase("teleport barlog")) {
          // 古代人(Lv50クエスト古代の空間2F)
          L1Teleport.teleport(pc, 32755, 32844, (short) 2002, 5, true);
          TeleportDelyTimer timer = new TeleportDelyTimer();
          GeneralThreadPool.getInstance().execute(timer);
        }
      } catch (Exception e) {
      }
    }
    if (htmlid != null) { // 表示するhtmlがある場合
      pc.sendPackets(new S_NpcTalkReturn(objid, htmlid));
    }
  }