From 4268d39d1799c6bb46bd7133df16bc14b84317e9 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 11 Mar 2025 20:12:53 -0500 Subject: [PATCH] strip hones and procs when buying or taking from NPC inventory --- src/engine/net/client/ClientMessagePump.java | 1 + src/engine/net/client/handlers/ItemProductionMsgHandler.java | 2 ++ src/engine/objects/CharacterItemManager.java | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index d483ae60..c1b9a256 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1480,6 +1480,7 @@ public class ClientMessagePump implements NetMsgHandler { if (buy != null) { me.transferEnchants(buy); itemMan.addItemToInventory(buy); + buy.stripCastableEnchants(); if(npc.contractUUID == 900 && buy.getItemBaseID() == 1705032){ buy.setNumOfItems(10); DbManager.ItemQueries.UPDATE_NUM_ITEMS(buy,buy.getNumOfItems()); diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index d4d754e1..e16aaa6a 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -415,6 +415,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { if (player.getCharItemManager().hasRoomInventory(targetItem.getItemBase().getWeight()) == false) return; + targetItem.stripCastableEnchants(); + player.getCharItemManager().buyFromNPC(targetItem, vendor); } diff --git a/src/engine/objects/CharacterItemManager.java b/src/engine/objects/CharacterItemManager.java index 16376023..1b594644 100644 --- a/src/engine/objects/CharacterItemManager.java +++ b/src/engine/objects/CharacterItemManager.java @@ -1510,6 +1510,8 @@ public class CharacterItemManager { if (purchasedItem == null || npc == null) return false; + purchasedItem.stripCastableEnchants(); + itemMan = npc.getCharItemManager(); if (itemMan == null)