- Scriptname aaaHijackDeathScript extends Quest
- ActorBase Property pPlayer Auto
- Actor Property pBones Auto
- Actor Property PlayerRef 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
- 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
- ObjectReference Property pDeathMarkFX2 Auto
- Event OnInit()
- PlayerRef.StartDeferredKill()
- RegisterForSingleUpdate(1.0)
- Debug.Notification("You have been cursed...")
- pSpawnPoint.MoveTo(fallBackSite)
- PlayerRef.AddItem(pTome, 1)
- self.SetObjectiveDisplayed(0, true, true)
- EndEvent
- ;/ Event OnPlayerLoadGame()
- PlayerRef.EquipSpell(pPrayer, 2)
- EndEvent /;
- Event OnUpdate()
- If PlayerRef.GetAV("Health") <= 0
- disNiggaDed()
- Else
- RegisterForSingleUpdate(3.0)
- ;Debug.Notification("Registering again...")
- EndIf
- EndEvent
- Event OnHit()
- If PlayerRef.GetAV("Health") <= 0
- disNiggaDed()
- EndIf
- EndEvent
- Function disNiggaDed()
- Int numSouls = PlayerRef.GetActorValue("dragonsouls") as Int
- If pMainQuest.IsRunning()
- Debug.MessageBox("You haven't even finished the intro yet, dummy!")
- PlayerRef.EndDeferredKill()
- Else
- If pMQSovngarde.IsRunning() || pMQSovngarde2.IsRunning()
- pSpawnPoint.MoveTo(fallBackSovn)
- EndIf
- deathFX()
- Utility.Wait(5)
- If PlayerRef.IsEquipped(pAmulet)
- PlayerRef.RemoveItem(pAmulet, 1, true)
- reBirth()
- Debug.Notification("Your Amulet of Arkay crumbles to dust.")
- Else
- pLostSouls.SetValue(numSouls)
- PlayerRef.SetActorValue("dragonsouls", 0)
- pDeathStorage.RemoveAllItems(pPanicStorage, true)
- PlayerRef.RemoveAllItems(pDeathStorage, true)
- pDeathMark.MoveTo(PlayerRef, abMatchRotation = false)
- pDeathMarkFX.MoveTo(pDeathMark, abMatchRotation = false)
- pDeathMarkFX2.MoveTo(pDeathMark, abMatchRotation = false)
- pBones.MoveTo(pDeathMarkFX)
- pBones.Kill()
- reBirth()
- EndIf
- EndIf
- EndFunction
- Function deathFX()
- ;Debug.MessageBox("Starting Death Effects")
- Debug.Notification("Your vessel has broken. Opening Aetherial channel for soul recursion...")
- Game.DisablePlayerControls()
- Game.ForceThirdPerson()
- PlayerRef.PlayIdle(bleedoutstart)
- Utility.Wait(3.5)
- PlayerRef.SetAlpha(0, true)
- decayEffect.Play(PlayerRef)
- Utility.Wait(2.0)
- decayEffect2.Play(PlayerRef, 5.0)
- pDeathFXSound.Play(PlayerRef)
- Game.FadeOutGame(true, true, 5.0, 5.0)
- EndFunction
- Function reBirth()
- PlayerRef.RestoreAV("Health", 9999999)
- ;Debug.MessageBox("You should now be reborn")
- PlayerRef.MoveTo(pSpawnPoint)
- PlayerRef.PlayIdle(bleedoutstop)
- Utility.Wait(2)
- Game.EnablePlayerControls()
- decayEffect.Stop(PlayerRef)
- decayEffect2.Stop(PlayerRef)
- playerRef.PlayIdle(idlestoploose)
- RegisterForSingleUpdate(1.0)
- ;Debug.MessageBox("Update Registered.")
- Utility.Wait(10)
- PlayerRef.SetAlpha(1, true)
- EndFunction