Example #1
0
  /** 목록에 아이템을 복수개 정리해 추가한다. */
  public S_InvList(L1PcInstance pc) {
    List<L1ItemInstance> items = pc.getInventory().getItems();

    for (L1ItemInstance item : items) {
      if (item.getItemId() == L1ItemId.DRAGON_KEY) {
        if (System.currentTimeMillis() > item.getEndTime().getTime()) {
          pc.getInventory().deleteItem(item);
        }
      }
    }
    writeC(Opcodes.S_OPCODE_INVLIST);
    writeC(items.size());
    byte[] status = null;
    for (L1ItemInstance item : items) {
      writeD(item.getId());
      writeC(item.getItem().getUseType());
      writeC(0);
      writeH(item.get_gfxid());
      writeC(item.getBless());
      writeD(item.getCount());
      writeC((item.isIdentified()) ? 1 : 0);
      writeS(item.getViewName());
      if (!item.isIdentified()) {
        // 미감정의 경우 스테이터스를 보낼 필요는 없다
        writeC(0);
      } else {
        status = item.getStatusBytes();
        writeC(status.length);
        for (byte b : status) {
          writeC(b);
        }
      }
    }
  }
Example #2
0
 @Override
 public void execute(L1PcInstance pc, String cmdName, String arg) {
   try {
     StringTokenizer st = new StringTokenizer(arg);
     int gfxid = Integer.parseInt(st.nextToken(), 10);
     int count = Integer.parseInt(st.nextToken(), 10);
     L1ItemInstance item = null;
     for (int i = 0; i < count; i++) {
       item = ItemTable.getInstance().createItem(40005);
       item.getItem().setGfxId(gfxid + i);
       item.getItem().setName(String.valueOf(gfxid + i));
       item.getItem().setNameId(String.valueOf(gfxid + i));
       pc.getInventory().storeItem(item);
     }
   } catch (Exception exception) {
     pc.sendPackets(new S_SystemMessage(cmdName + " [id] [출현시키는 수]로 입력해 주세요. "));
   }
 }