예제 #1
0
  @Override
  public boolean action(L2PcInstance activeChar, L2Object target, boolean interact) {
    if (activeChar.getAccessLevel().isGm()) {
      activeChar.setTarget(target);
      final L2DoorInstance door = (L2DoorInstance) target;
      activeChar.sendPacket(new StaticObject(door, activeChar.isGM()));

      final NpcHtmlMessage html = new NpcHtmlMessage();
      html.setFile(activeChar.getHtmlPrefix(), "html/admin/doorinfo.htm");
      html.replace("%class%", target.getClass().getSimpleName());
      html.replace("%hp%", String.valueOf((int) door.getCurrentHp()));
      html.replace("%hpmax%", String.valueOf(door.getMaxHp()));
      html.replace("%objid%", String.valueOf(target.getObjectId()));
      html.replace("%doorid%", String.valueOf(door.getId()));

      html.replace("%minx%", String.valueOf(door.getX(0)));
      html.replace("%miny%", String.valueOf(door.getY(0)));
      html.replace("%minz%", String.valueOf(door.getZMin()));

      html.replace("%maxx%", String.valueOf(door.getX(2)));
      html.replace("%maxy%", String.valueOf(door.getY(2)));
      html.replace("%maxz%", String.valueOf(door.getZMax()));
      html.replace(
          "%unlock%",
          door.isOpenableBySkill()
              ? "<font color=00FF00>YES<font>"
              : "<font color=FF0000>NO</font>");

      activeChar.sendPacket(html);
    }
    return true;
  }