/**
* License
* THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
* CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE").
* THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.
* ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR
* COPYRIGHT LAW IS PROHIBITED.
*
* BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND
* AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE
* MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED
* HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
*
*/
package l1j.server.server.serverpackets;
import l1j.server.server.Opcodes;
import l1j.server.server.model.Instance.L1ItemInstance;
// Referenced classes of package l1j.server.server.serverpackets:
// ServerBasePacket
public class S_ItemStatus extends ServerBasePacket {
private static final String S_ITEM_STATUS = "[S] S_ItemStatus";
/**
* アイテムの名前、状態、特性、重量などの表示を変更する
*/
public S_ItemStatus(L1ItemInstance item) {
writeC(Opcodes.S_OPCODE_ITEMSTATUS);
writeD(item.getId());
writeS(item.getViewName());
writeD(item.getCount());
if (!item.isIdentified()) {
// 未鑑定の場合ステータスを送る必要はない
writeC(0);
}
else {
byte[] status = item.getStatusBytes();
writeC(status.length);
for (byte b : status) {
writeC(b);
}
}
}
@Override
public byte[] getContent() {
return _bao.toByteArray();
}
@Override
public String getType() {
return S_ITEM_STATUS;
}
}