Exemplo n.º 1
0
  @Override
  protected final void writeImpl() {
    writeC(0xE9);
    writeD(_money); // money
    writeD(0x00); // lease ?
    writeH(_sellList.size()); // list size

    for (L2ItemInstance item : _sellList.keySet()) {
      writeH(item.getItem().getType1());
      writeD(item.getObjectId());
      writeD(item.getItemId());
      writeD(_sellList.get(item)); // count
      writeH(item.getItem().getType2());
      writeH(0); // unknown
      writeD(0); // price, u shouldnt get any adena for crops, only raw materials
    }
  }
Exemplo n.º 2
0
  @Override
  public void setLevel(byte value) {
    getActiveChar()
        .setPetData(
            PetDataTable.getInstance()
                .getPetLevelData(getActiveChar().getTemplate().getNpcId(), value));

    getActiveChar().stopFeed();
    super.setLevel(value); // Set level.
    getActiveChar().startFeed();

    // If a control item exists and its level is different of the new level.
    final L2ItemInstance controlItem = getActiveChar().getControlItem();
    if (controlItem != null && controlItem.getEnchantLevel() != getLevel()) {
      getActiveChar().sendPetInfosToOwner();

      controlItem.setEnchantLevel(getLevel());

      // Update item
      InventoryUpdate iu = new InventoryUpdate();
      iu.addModifiedItem(controlItem);
      getActiveChar().getOwner().sendPacket(iu);
    }
  }
Exemplo n.º 3
0
 public final SystemMessage addItemName(final L2ItemInstance item) {
   return addItemName(item.getItem().getItemId());
 }