|
|
@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.objects; |
|
|
|
package engine.objects; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum; |
|
|
|
import engine.exception.SerializationException; |
|
|
|
import engine.exception.SerializationException; |
|
|
|
import engine.gameManager.PowersManager; |
|
|
|
import engine.gameManager.PowersManager; |
|
|
|
import engine.net.ByteBufferWriter; |
|
|
|
import engine.net.ByteBufferWriter; |
|
|
@ -107,8 +108,13 @@ public class MobEquipment extends AbstractGameObject { |
|
|
|
public static void serializeForVendor(MobEquipment mobEquipment, ByteBufferWriter writer, float percent) throws SerializationException { |
|
|
|
public static void serializeForVendor(MobEquipment mobEquipment, ByteBufferWriter writer, float percent) throws SerializationException { |
|
|
|
_serializeForClientMsg(mobEquipment, writer, false); |
|
|
|
_serializeForClientMsg(mobEquipment, writer, false); |
|
|
|
int baseValue = mobEquipment.itemBase.getBaseValue() + mobEquipment.itemBase.getMagicValue(); |
|
|
|
int baseValue = mobEquipment.itemBase.getBaseValue() + mobEquipment.itemBase.getMagicValue(); |
|
|
|
writer.putInt(mobEquipment.magicValue); |
|
|
|
if(mobEquipment.itemBase.getType().equals(Enum.ItemType.POTION)){ |
|
|
|
writer.putInt(mobEquipment.magicValue); |
|
|
|
writer.putInt((int)(mobEquipment.itemBase.getBaseValue() * 0.5f)); |
|
|
|
|
|
|
|
writer.putInt((int)(mobEquipment.itemBase.getBaseValue() * 0.5f)); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
writer.putInt(mobEquipment.magicValue); |
|
|
|
|
|
|
|
writer.putInt(mobEquipment.magicValue); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void serializeForClientMsg(MobEquipment mobEquipment, ByteBufferWriter writer) throws SerializationException { |
|
|
|
public static void serializeForClientMsg(MobEquipment mobEquipment, ByteBufferWriter writer) throws SerializationException { |
|
|
|