- Scriptname aaaHijackDeathAlias extends ReferenceAlias
- Actor Property pBones Auto
- Armor Property pAmulet Auto
- Book Property pTome Auto
- EffectShader Property decayEffect Auto
- EffectShader Property decayEffect2 Auto
- GlobalVariable Property pLostSouls Auto
- Quest Property pMainQuest Auto
- Quest Property pMQSovngarde Auto
- Quest Property pMQSovngarde2 Auto
- Quest Property pWerewolfQuest Auto
- Sound Property pDeathFXSound Auto
- Idle property idlestoploose auto
- Idle property bleedoutstart auto
- Idle property bleedoutstop auto
- ObjectReference Property fallBackSite Auto
- ObjectReference Property fallBackSovn Auto
- ObjectReference Property pSpawnPoint Auto
- ObjectReference Property pDeathStorage Auto
- ObjectReference Property pPanicStorage Auto
- ObjectReference Property pDeathMark Auto
- ObjectReference Property pDeathMarkFX Auto
- Event OnInit()
- GetActorReference().StartDeferredKill()
- RegisterForSingleUpdate(1.0)
- Debug.Notification("You have been cursed...")
- pSpawnPoint.MoveTo(fallBackSite)
- GetActorReference().AddItem(pTome, 1)
- EndEvent
- ;/ Event OnPlayerLoadGame()
- GetActorReference().EquipSpell(pPrayer, 2)
- EndEvent /;
- Event OnUpdate()
- If GetActorReference().GetAV("Health") <= 0
- disNiggaDed()
- Else
- RegisterForSingleUpdate(1.0)
- ;Debug.Notification("Registering again...")
- EndIf
- EndEvent
- Function disNiggaDed()
- Int numSouls = GetActorReference().GetActorValue("dragonsouls") as Int
- If pMainQuest.IsRunning()
- Debug.MessageBox("You haven't even finished the intro yet, dummy!")
- GetActorReference().EndDeferredKill()
- Else
- If pMQSovngarde.IsRunning() || pMQSovngarde2.IsRunning()
- pSpawnPoint.MoveTo(fallBackSovn)
- EndIf
- deathFX()
- Utility.Wait(5)
- If GetActorReference().IsEquipped(pAmulet)
- GetActorReference().RemoveItem(pAmulet, 1, true)
- reBirth()
- Debug.Notification("Your Amulet of Arkay crumbles to dust.")
- Else
- pLostSouls.SetValue(numSouls)
- GetActorReference().SetActorValue("dragonsouls", 0)
- pDeathStorage.RemoveAllItems(pPanicStorage, true)
- GetActorReference().RemoveAllItems(pDeathStorage, true)
- pDeathMark.MoveTo(GetActorReference(), abMatchRotation = false)
- pDeathMarkFX.MoveTo(GetActorReference(), abMatchRotation = false)
- pBones.MoveTo(pDeathMarkFX)
- pBones.Kill()
- reBirth()
- EndIf
- EndIf
- EndFunction
- Function deathFX()
- ;Debug.MessageBox("Starting Death Effects")
- Game.DisablePlayerControls()
- Game.ForceThirdPerson()
- If (pWerewolfQuest.GetCurrentStageID() < 100 && pWerewolfQuest.isRunning())
- pWerewolfQuest.SetCurrentStageID(100)
- ElseIf (pWerewolfQuest.isRunning())
- ;I guess it will fix itself or something?
- EndIf
- Debug.Notification("Your vessel has broken. Soul is now routing through last opened channel...")
- Debug.Notification("YOU DIED")
- GetActorReference().PlayIdle(bleedoutstart)
- Utility.Wait(3.5)
- GetActorReference().SetAlpha(0, true)
- decayEffect.Play(GetActorReference())
- Utility.Wait(2.0)
- decayEffect2.Play(GetActorReference(), 5.0)
- pDeathFXSound.Play(GetActorReference())
- Game.FadeOutGame(true, true, 5.0, 5.0)
- EndFunction
- Function reBirth()
- GetActorReference().RestoreAV("Health", 9999999)
- ;Debug.MessageBox("You should now be reborn")
- GetActorReference().MoveTo(pSpawnPoint)
- GetActorReference().PlayIdle(bleedoutstop)
- Utility.Wait(2)
- Game.EnablePlayerControls()
- decayEffect.Stop(GetActorReference())
- decayEffect2.Stop(GetActorReference())
- GetActorReference().PlayIdle(idlestoploose)
- RegisterForSingleUpdate(1.0)
- ;Debug.MessageBox("Update Registered.")
- Utility.Wait(10)
- GetActorReference().SetAlpha(1, true)
- EndFunction