The issue here is that there is some inconsistent behavior here, if you have the same enchanted item, and have a "On Use" effect on it, if you break the item through the "On Use" spell, the item WILL be destroyed and removed entirely from the inventory.
So I figured out why this is, the method used to decrease condition damage of Weapons and Armor from physical combat does not discriminate between magic and non-magic items, so no matter what item is having it's condition reduced from combat, it is automatically assumed to be a "normal" item that follows the same rules when they break, and just go into the player's inventory. Unlike the method that does damage to enchanted items with "On Use" effects and such, which does specify that the item should be removed from the inventory once it breaks.
From FormulaHelper.cs:
Code: Select all
/// <summary>
/// Applies condition damage to an item based on physical hit damage.
/// </summary>
public static void ApplyConditionDamageThroughPhysicalHit(DaggerfallUnityItem item, DaggerfallEntity owner, int damage)
{
Func<DaggerfallUnityItem, DaggerfallEntity, int, bool> del;
if (TryGetOverride("ApplyConditionDamageThroughPhysicalHit", out del))
if (del(item, owner, damage))
return; // Only return if override returns true
int amount = (10 * damage + 50) / 100;
if ((amount == 0) && Dice100.SuccessRoll(20))
amount = 1;
item.LowerCondition(amount, owner);
}
I did this in my mod for the desired effect, if that would be useful:
Code: Select all
if (1 == 1) // Only runs if "Fading Enchanted Items" module is active.
{
if (item.IsEnchanted) // If the Weapon or Armor piece is enchanted, when broken it will be Destroyed from the player inventory.
item.LowerCondition(amount, owner, playerItems);
else
item.LowerCondition(amount, owner);
}
else
item.LowerCondition(amount, owner);