; get the created item
set CreatedItem to GetLastEnchantedItem
PrintToConsole "New Item is %n" CreatedItem
let TempEnchnew := GetEnchantment CreatedItem
let numEffectsnew := GetMagicItemEffectCount TempEnchnew
let TempEnchorig := GetEnchantment itemObj
let numEffectsorig := GetMagicItemEffectCount TempEnchorig
printToConsole "num enchantments %n %f" CreatedItem numEffectsnew
printToConsole "num enchantments %n %f" ItemObj numEffectsorig
CopyAllEffectItems TempEnchorig CreatedItem ; <===========================
let TempEnchnew := GetEnchantment CreatedItem
let numEffectsTest := GetMagicItemEffectCount TempEnchnew
printToConsole "num enchantments %n %f" CreatedItem numEffectsTest
This code is similar to CandleMaster's Unenchanting chest. The problem is the original effects are not copied to the new item. For testing, the original item has 2 enchantments and the new item has the 1 from the Enchantment station. After the call to Copy All EffectItems, the new item still only has one effect. I have also tried the following code to no avail:
While ( numEffectsOrig > 0)
set numEffectsOrig to (numEffectsOrig -1)
CopyNthEffectItem TempEnchorig CreatedItem numEffectsOrig
set CurrentEffect to GetNthEffectItemCode TempEnchorig numEffectsOrig
PrintToConsole "new effect no %.0f should be %f" numEffectsOrig CurrentEffect
Loop
using this, my debug comments show the expected 2 lines with the effect codes, but here CopyNthEffectItem also is not putting the enchantment onto the item. This is the final itemI need for my current mod. Any help or thoughts are appreciated.