ScriptName MacDIHOBindActivator extends ReferenceAlias
{Script to bind the player's soul to whichever activator they just clicked on.}

Actor Property PlayerRef auto
MagicEffect Property pImmortalityEffect auto
Message Property pChoose auto
ObjectReference Property pSpawnPoint auto

Event OnActivate(ObjectReference akActionRef)
    If (akActionRef == PlayerRef && PlayerRef.HasMagicEffect(pImmortalityEffect))
        int choice = pChoose.Show()
        If (choice == 0)
            pSpawnPoint.MoveTo(akActionRef)
            Debug.Notification("My soul has been bound to this location.")
        EndIf
    EndIf
EndEvent
