Пример #1
0
  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();
      }
    }
  }
Пример #2
0
  private void giveFeather(L1PcInstance pc) {

    pc.setTimeCount(0);
    int featherCount = 0;

    if (Config.GAME_SERVER_TYPE == 1) {
      featherCount = 600;
    } else {
      if (pc.isPrivateShop()) {
        featherCount = 1;
      } else {
        featherCount = 18;
      }
    }
    featherCount *= pc.getadFeature();

    pc.getInventory().storeItem(41159, featherCount); // 신비한 날개깃털 지급
    pc.sendPackets(new S_ServerMessage(403, "$5116 (" + featherCount + ")"));
  }