コード例 #1
0
 private void sayScreenMessage(Player player) {
   if (player.isInParty()) {
     for (Player players : player.getParty().getPartyMembers()) {
       if (players.isInRange(player, 1000)) {
         players.sendPacket(
             new ExShowScreenMessage(
                 Rnd.get(FUCKED_HARNAK),
                 5000,
                 ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER,
                 true,
                 ExShowScreenMessage.STRING_TYPE,
                 0,
                 true,
                 0));
       }
     }
   } else {
     player.sendPacket(
         new ExShowScreenMessage(
             Rnd.get(FUCKED_HARNAK),
             5000,
             ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER,
             true,
             ExShowScreenMessage.STRING_TYPE,
             0,
             true,
             0));
   }
 }
コード例 #2
0
 /**
  * Method onBypassFeedback.
  *
  * @param npc NpcInstance
  * @param player Player
  * @param command String
  * @see lineage2.gameserver.handlers.IBypassHandler#onBypassFeedback(NpcInstance, Player, String)
  */
 @Override
 public void onBypassFeedback(NpcInstance npc, Player player, String command) {
   if (player.isInParty()
       && player.getParty().isInReflection()
       && (player.getParty().getReflection() instanceof DelusionChamber)) {
     ((DelusionChamber) player.getParty().getReflection()).manualExitChamber(player, npc);
   }
 }
コード例 #3
0
  @Override
  public void onBypassFeedback(Player player, String command) {
    if (!canBypassCheck(player, this)) {
      return;
    }

    if (command.startsWith("teleport_harnak")) {
      if ((player.getLevel() >= 85) && player.isAwaking()) {
        player.teleToLocation(-114712, 147848, -7740);
      } else {
        showChatWindow(player, "default/33344-noreq.htm");
      }
    }

    if (command.startsWith("teleport_first_floor")) {
      player.teleToLocation(-114712, 147848, -7740);
    }

    if (command.startsWith("teleport_second_floor")) {
      player.teleToLocation(-114712, 149160, -10800);
    }

    if (command.startsWith("teleport_third_floor")) {
      player.teleToLocation(-114728, 183288, -13860);
    }

    if (command.startsWith("teleport_outside")) {
      player.teleToLocation(-116160, 236370, -3088);
    }

    if (command.startsWith("teleport_next")) {
      List<int[]> lst = Arrays.asList(cycleEndTeleports);

      if (lst.contains(getId())) {
        player.teleToLocation(teleCoords.get(Integer.valueOf(getId() - 7)));
      } else {
        player.teleToLocation(teleCoords.get(Integer.valueOf(getId() + 1)));
      }
    }

    if (command.startsWith("teleport_prev")) {
      List<int[]> lst = Arrays.asList(cycleStartTeleports);

      if (lst.contains(getId())) {
        player.teleToLocation(teleCoords.get(Integer.valueOf(getId() + 7)));
      } else {
        player.teleToLocation(teleCoords.get(Integer.valueOf(getId() - 1)));
      }
    }

    if (command.startsWith("key_altar")) {
      if (player.getInventory().getItemByItemId(SEALED_HARNAK_KEY) != null) {
        if (HarnakUndegroundManager.getInstance().addSecondStagePoint(getId(), player)) {
          showChatWindow(player, "default/altar-ok.htm");
          player.getInventory().removeItemByItemId(30429, 1);
          sayScreenMessage(player);

          if (getNpcState() == 0) {
            ThreadPoolManager.getInstance().schedule(new runNpcStateChangeSecond(), 1000L);
          }

          NpcInstance Noktum =
              NpcUtils.spawnSingle(
                  NOKTUM,
                  player.getLoc().getX() + 15,
                  player.getLoc().getY(),
                  player.getLoc().getZ(),
                  1800000L);
          Noktum.addListener(_deathListener);
        } else if (player.isInParty() && player.getParty().isLeader(player)) {
          sayScreenMessage(player);
          NpcInstance Noktum =
              NpcUtils.spawnSingle(
                  NOKTUM,
                  player.getLoc().getX() + 15,
                  player.getLoc().getY(),
                  player.getLoc().getZ(),
                  1800000L);
          Noktum.addListener(_deathListener);
        } else {
          showChatWindow(player, "default/altar-no.htm");
        }
      } else {
        showChatWindow(player, "default/" + getId() + "-1.htm");
      }
    }

    if (command.startsWith("key_prison")) {
      if (player.getInventory().getItemByItemId(HARNAK_KEY) != null) {
        if (HarnakUndegroundManager.getInstance().addThirdStagePoint(getId(), player)) {
          showChatWindow(player, "default/prison-ok.htm");
          player.getInventory().removeItemByItemId(30430, 1);
          sayScreenMessage(player);

          if (getNpcState() == 0) {
            ThreadPoolManager.getInstance().schedule(new runNpcStateChangeThird(), 1000L);
          }

          NpcInstance demonikNoktum =
              NpcUtils.spawnSingle(
                  DEMONIC_NOKTUM,
                  player.getLoc().getX() + 15,
                  player.getLoc().getY(),
                  player.getLoc().getZ(),
                  1800000L);
          demonikNoktum.addListener(_deathListener);
        } else if (player.isInParty() && player.getParty().isLeader(player)) {
          sayScreenMessage(player);
          NpcInstance demonikNoktum =
              NpcUtils.spawnSingle(
                  DEMONIC_NOKTUM,
                  player.getLoc().getX() + 15,
                  player.getLoc().getY(),
                  player.getLoc().getZ(),
                  1800000L);
          demonikNoktum.addListener(_deathListener);
        } else {
          showChatWindow(player, "default/prison-no.htm");
        }
      } else {
        showChatWindow(player, "default/" + getId() + "-1.htm");
      }
    } else {
      super.onBypassFeedback(player, command);
    }
  }