Browse Source

recalc magic value

combat-2
MagicBot 8 months ago
parent
commit
f683201086
  1. 2
      src/engine/net/client/handlers/ItemProductionMsgHandler.java
  2. 2
      src/engine/objects/Item.java

2
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -210,6 +210,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { @@ -210,6 +210,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
}
targetItem.setValue(itemPrice);
targetItem.magicValue = targetItem.value + targetItem.calcMagicValue();
outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT, true);
dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);

2
src/engine/objects/Item.java

@ -991,7 +991,7 @@ public class Item extends AbstractWorldObject { @@ -991,7 +991,7 @@ public class Item extends AbstractWorldObject {
this.effectNames.add(enchantID);
}
protected int calcMagicValue() {
public int calcMagicValue() {
int ret = 0;
for (String enchant : this.effectNames) {
ret += Item.getEnchantValue(enchant + 'A');

Loading…
Cancel
Save