From f6832010867e32d31ca35d6ecfa47a7b97c8960c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 12 May 2024 11:18:22 -0400 Subject: [PATCH] recalc magic value --- src/engine/net/client/handlers/ItemProductionMsgHandler.java | 2 ++ src/engine/objects/Item.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index febb1df0..6b5c2980 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -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); diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index bc437ea7..578e87f1 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -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');