diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 069e7b1b..06c2427e 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1406,7 +1406,7 @@ public class ClientMessagePump implements NetMsgHandler { if (!itemMan.hasRoomInventory(ib.getWeight())) { return; } - int cost = me.getMagicValue(); + int cost = me.magicValue; int resourceCost = Warehouse.getCostForResource(me.getItemBase().getUUID()); if (resourceCost != 0) cost = resourceCost; diff --git a/src/engine/objects/MobEquipment.java b/src/engine/objects/MobEquipment.java index b9caec70..0c9809a1 100644 --- a/src/engine/objects/MobEquipment.java +++ b/src/engine/objects/MobEquipment.java @@ -9,6 +9,7 @@ package engine.objects; +import engine.Enum; import engine.exception.SerializationException; import engine.gameManager.PowersManager; 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 { _serializeForClientMsg(mobEquipment, writer, false); int baseValue = mobEquipment.itemBase.getBaseValue() + mobEquipment.itemBase.getMagicValue(); - writer.putInt(mobEquipment.magicValue); - writer.putInt(mobEquipment.magicValue); + if(mobEquipment.itemBase.getType().equals(Enum.ItemType.POTION)){ + 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 {