/** * For copyright information see the LICENSE document. */ /** * Auto-generated by PacketCodeGen, on 2012-09-28 */ package com.gamerevision.gwlpr.actions.gameserver.stoc; import com.realityshard.shardlet.utils.GenericAction; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * This is an automatically generated ShardletAction. * It resembles the packet template that has been * parsed from our packet templates xml. * * * @author GWLPR Template Updater */ public final class P340_ArmorGeneralAction extends GenericAction { private int iD; private int armorID; private byte type; private byte data4; private short dyeColor; private short material; private byte data7; private int flags; private int data9; public short getHeader() { return 340; } public void setID(int newValue) { iD = newValue; } public void setArmorID(int newValue) { armorID = newValue; } public void setType(byte newValue) { type = newValue; } public void setData4(byte newValue) { data4 = newValue; } public void setDyeColor(short newValue) { dyeColor = newValue; } public void setMaterial(short newValue) { material = newValue; } public void setData7(byte newValue) { data7 = newValue; } public void setFlags(int newValue) { flags = newValue; } public void setData9(int newValue) { data9 = newValue; } private int getSize() { return 25; } @Override public boolean serialize() { int size = getSize(); if (size == 0) { return false; } ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); try { buffer.putShort(getHeader()); buffer.putInt(iD); buffer.putInt(armorID); buffer.put(type); buffer.put(data4); buffer.putShort(dyeColor); buffer.putShort(material); buffer.put(data7); buffer.putInt(flags); buffer.putInt(data9); } catch (BufferOverflowException e) { return false; } setBuffer(buffer); return true; } }