What I'm trying is this ....
Cast spell on dead actor ...
Dead actor is copied (along with inventory) as a ghost ...
Then actor is deleted.
But does anyone know of a safe anti-bloat-friendly way to get rid of all the copied inventory items?
ScriptName MakeGhostAppearScriptRef SelfRef GhostCopyRef EquippedObject00Ref EquippedObject01...etc.Begin ScriptEffectStart Set Self to GetSelf Set EquippedObject00 to Self.GetEquippedObject 0 Set EquippedObject01 to Self.GetEquippedObject 1 ...etc. Set GhostCopy to ( Self.PlaceAtMe Self 5, 5, 0 ) Resurrect GhostCopy GhostCopy.ResetHealth GhostCopy.SetGhost 1 GhostCopy.AddItem EquippedObject00 1 GhostCopy.AddItem EquippedObject01 1 GhostCopy.AddItem EquippedObject02 1 ...etc.EndBegin ScriptEffectFinish GhostCopy.Disable GhostCopy.DeleteReferenceEnd
ScriptName MakeGhostAppearScriptRef SelfRef GhostCopyRef ItemRef ContainerBegin ScriptEffectStart Set Self to GetBaseObject Set GhostCopy to ( Self.PlaceAtMe Self 5, 5, 0 ) Let Container := Self Resurrect GhostCopy GhostCopy.ResetHealth GhostCopy.SetGhost 1 ForEach Item <- Container ;Only interested in equipped items If Item.IsEquipped Print Item.GetName + " is equipped by " + Container.GetName Item.CopyIR GhostCopy Endif LoopEnd
Scriptname ReleaseGhostScriptRef SelfRef GhostCopyRef ContainerRef ItemRef BaseItemBegin ScriptEffectStart Set Self to GetSelf ;Must be dead If ( Self.GetDead ) && ( Self.IsActor ) ;Continue Else PlaySound MagicFailureSoundDestruction Dispel ReleaseGhost Return Endif Set Self to GetBaseObject Set GhostCopy to ( Player.PlaceAtMe Self 1, 15, 0 ) Let Container := GetSelf PlaySound SPLRestorationHit ForEach Item <- Container ;Only interested in equipped items If Item.IsEquipped Print Item.GetName + " is equipped by " + Container.GetName Item.CopyIR GhostCopy Let BaseItem := Item.GetBaseObject GhostCopy.EquipItem BaseItem Endif Loop aaPaladinGhostCasterRef.MoveTo GhostCopy 10 10 10 aaPaladinGhostCasterRef.Cast GoAwayGhost GhostCopy GhostCopy.ModActorValue2 Aggression -100 GhostCopy.StopCombat GhostCopy.AddSpell AbGhostNPC GhostCopy.SetGhost 1End
ScriptName GoAwayGhostScriptRef SelfBegin ScriptEffectStart Set Self to GetSelfEndBegin ScriptEffectFinish Self.RemoveAllItems Self.Disable Self.PositionCell 0, 0, 0, 0, aaMyDummyCell Self.KillEnd