public void run() {
    System.out.println(PremiumAinThread.class.getName() + " 시작");
    while (true) {
      try {
        for (L1PcInstance _client : L1World.getInstance().getAllPlayers()) {
          if (_client == null || _client.getNetConnection() == null) {
            continue;
          } else {
            try {
              int tc = _client.getTimeCount();
              if (tc >= 11) giveFeather(_client);
              else _client.setTimeCount(tc + 1);

              if (_client.getLevel() >= 49) {
                int sc = _client.getSafeCount();
                if (CharPosUtil.getZoneType(_client) == 1 && !_client.isPrivateShop()) {
                  if (sc >= 14) {
                    if (_client.getAinHasad() <= 1999999) _client.calAinHasad(10000 * 2);
                    _client.setSafeCount(0);
                  } else {
                    _client.setSafeCount(sc + 1);
                  }
                } else {
                  if (sc > 0) _client.setSafeCount(0);
                }
              }

              if (_client.getMapId() >= 53 && _client.getMapId() <= 56) // 기란던전
              GungeonTimeCheck(_client);

              int keycount = _client.getInventory().countItems(L1ItemId.DRAGON_KEY);
              if (keycount > 0) DragonkeyTimeCheck(_client, keycount);

            } catch (Exception e) {
              _log.warning("Primeum give failure.");
              _log.log(Level.SEVERE, e.getLocalizedMessage(), e);
              throw e;
            }
          }
        }
        Thread.sleep(60000);
      } catch (Exception e) {
        _log.log(Level.SEVERE, e.getLocalizedMessage(), e);
        // cancel();
      }
    }
  }
Example #2
0
  private void buttonPolyClicked(MouseEvent evt) {

    String kname1 = 닉네임.getText();

    for (L1PcInstance pc : L1World.getInstance().getAllPlayers()) {

      if (pc.getName().equalsIgnoreCase(kname1)) {

        int Polyid = Integer.parseInt(변신번호.getText());
        pc.setTempCharGfxAtDead(Polyid);
        pc.sendPackets(new S_ChangeShape(pc.getId(), Polyid));
        // pc.broadcastPacket(this, new S_ChangeShape(pc.getId(), 0));
        pc.getInventory().takeoffEquip(Polyid);
        bone.LogServerAppend("변신 시켜 주었습니다..", "확인바람");
      } else if (!pc.getName().equalsIgnoreCase(kname1)) {

        bone.LogServerAppend("변신실패 했습니다...", "확인바람");
      }
    }
  }