@Override
  public void onBypassFeedback(Player player, String command) {
    if (!canBypassCheck(player, this)) return;

    UndergroundColiseumEvent coliseumEvent =
        EventHolder.getInstance().getEvent(EventType.MAIN_EVENT, _coliseumId);

    if (command.equals("register")) {
      Party party = player.getParty();
      if (party == null) showChatWindow(player, "events/kerthang_manager008.htm");
      else if (party.getPartyLeader() != player)
        showChatWindow(player, "events/kerthang_manager004.htm");
      else
        for (Player $player : party)
          if ($player.getLevel() < coliseumEvent.getMinLevel()
              || $player.getLevel() > coliseumEvent.getMaxLevel()) {
            showChatWindow(player, "events/kerthang_manager011.htm", "%name%", $player.getName());
            return;
          }
    } else if (command.equals("viewTeams")) {

      List<Player> reg = coliseumEvent.getRegisteredPlayers();

      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("events/kerthang_manager003.htm");
      for (int i = 0; i < 5; i++) {
        Player $player = CollectionUtils.safeGet(reg, i);

        msg.replace("%team" + i + "%", $player == null ? StringUtils.EMPTY : $player.getName());
      }

      player.sendPacket(msg);
    } else super.onBypassFeedback(player, command);
  }
示例#2
0
  public void tele() {
    Player player = getSelf();
    NpcInstance npc = getNpc();

    if (player != null && npc != null)
      if (player.getLevel() < 75) show("teleporter/" + npc.getNpcId() + "-4.htm", player);
      else if (player.getAdena() >= 150000) {
        player.reduceAdena(150000, true);
        player.teleToLocation(-149406, 255247, -80);
      } else show("teleporter/" + npc.getNpcId() + "-2.htm", player);
  }
 @Override
 public final boolean checkCondition(Player player) {
   return player.getLevel() >= min && player.getLevel() <= max;
 }