Browse Source

bugfix - item pricing

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
2990396778
  1. 2
      src/engine/net/client/ClientMessagePump.java
  2. 6
      src/engine/objects/MobEquipment.java

2
src/engine/net/client/ClientMessagePump.java

@ -1406,7 +1406,7 @@ public class ClientMessagePump implements NetMsgHandler { @@ -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;

6
src/engine/objects/MobEquipment.java

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
package engine.objects;
import engine.Enum;
import engine.exception.SerializationException;
import engine.gameManager.PowersManager;
import engine.net.ByteBufferWriter;
@ -107,9 +108,14 @@ public class MobEquipment extends AbstractGameObject { @@ -107,9 +108,14 @@ 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();
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 {
_serializeForClientMsg(mobEquipment, writer, true);

Loading…
Cancel
Save