Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Some hacky shit

By: Mellen on Nov 13th, 2013  |  syntax: None  |  size: 3.62 KB  |  hits: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Scriptname aaaHijackDeathAlias extends ReferenceAlias
  2.  
  3. Actor Property pBones  Auto  
  4. Armor Property pAmulet  Auto  
  5. Book Property pTome  Auto
  6. EffectShader Property decayEffect  Auto  
  7. EffectShader Property decayEffect2  Auto
  8. GlobalVariable Property pLostSouls  Auto  
  9. Quest Property pMainQuest  Auto
  10. Quest Property pMQSovngarde  Auto
  11. Quest Property pMQSovngarde2  Auto
  12. Quest Property pWerewolfQuest  Auto
  13. Sound Property pDeathFXSound  Auto  
  14. Idle property idlestoploose auto
  15. Idle property bleedoutstart auto
  16. Idle property bleedoutstop auto
  17. ObjectReference Property fallBackSite  Auto
  18. ObjectReference Property fallBackSovn  Auto  
  19. ObjectReference Property pSpawnPoint  Auto  
  20. ObjectReference Property pDeathStorage  Auto  
  21. ObjectReference Property pPanicStorage  Auto  
  22. ObjectReference Property pDeathMark  Auto  
  23. ObjectReference Property pDeathMarkFX  Auto    
  24.  
  25. Event OnInit()
  26.         GetActorReference().StartDeferredKill()
  27.         RegisterForSingleUpdate(1.0)
  28.         Debug.Notification("You have been cursed...")
  29.         pSpawnPoint.MoveTo(fallBackSite)
  30.         GetActorReference().AddItem(pTome, 1)
  31. EndEvent
  32.  
  33. ;/ Event OnPlayerLoadGame()
  34.         GetActorReference().EquipSpell(pPrayer, 2)
  35. EndEvent /;
  36.  
  37. Event OnUpdate()
  38.         If GetActorReference().GetAV("Health") <= 0
  39.                 disNiggaDed()
  40.         Else
  41.                 RegisterForSingleUpdate(1.0)
  42.                 ;Debug.Notification("Registering again...")
  43.         EndIf
  44. EndEvent
  45.  
  46. Function disNiggaDed()
  47.         Int numSouls = GetActorReference().GetActorValue("dragonsouls") as Int
  48.         If pMainQuest.IsRunning()
  49.                 Debug.MessageBox("You haven't even finished the intro yet, dummy!")
  50.                 GetActorReference().EndDeferredKill()
  51.         Else
  52.                 If pMQSovngarde.IsRunning() || pMQSovngarde2.IsRunning()
  53.                         pSpawnPoint.MoveTo(fallBackSovn)
  54.                 EndIf
  55.                 deathFX()
  56.                 Utility.Wait(5)
  57.                 If GetActorReference().IsEquipped(pAmulet)
  58.                         GetActorReference().RemoveItem(pAmulet, 1, true)
  59.                         reBirth()
  60.                         Debug.Notification("Your Amulet of Arkay crumbles to dust.")
  61.                 Else
  62.                         pLostSouls.SetValue(numSouls)
  63.                         GetActorReference().SetActorValue("dragonsouls", 0)
  64.                         pDeathStorage.RemoveAllItems(pPanicStorage, true)
  65.                         GetActorReference().RemoveAllItems(pDeathStorage, true)
  66.                         pDeathMark.MoveTo(GetActorReference(), abMatchRotation = false)
  67.                         pDeathMarkFX.MoveTo(GetActorReference(), abMatchRotation = false)
  68.                         pBones.MoveTo(pDeathMarkFX)
  69.                         pBones.Kill()
  70.                         reBirth()
  71.                 EndIf
  72.         EndIf
  73. EndFunction
  74.  
  75. Function deathFX()
  76.         ;Debug.MessageBox("Starting Death Effects")
  77.         Game.DisablePlayerControls()   
  78.         Game.ForceThirdPerson()
  79.         If (pWerewolfQuest.GetCurrentStageID() < 100 && pWerewolfQuest.isRunning())
  80.                 pWerewolfQuest.SetCurrentStageID(100)
  81.         ElseIf (pWerewolfQuest.isRunning())
  82.                 ;I guess it will fix itself or something?
  83.         EndIf
  84.         Debug.Notification("Your vessel has broken.  Soul is now routing through last opened channel...")
  85.         Debug.Notification("YOU DIED")
  86.         GetActorReference().PlayIdle(bleedoutstart)
  87.         Utility.Wait(3.5)      
  88.         GetActorReference().SetAlpha(0, true)
  89.         decayEffect.Play(GetActorReference())
  90.         Utility.Wait(2.0)
  91.         decayEffect2.Play(GetActorReference(), 5.0)
  92.         pDeathFXSound.Play(GetActorReference())
  93.         Game.FadeOutGame(true, true, 5.0, 5.0)
  94. EndFunction
  95.  
  96. Function reBirth()
  97.         GetActorReference().RestoreAV("Health", 9999999)
  98.         ;Debug.MessageBox("You should now be reborn")
  99.         GetActorReference().MoveTo(pSpawnPoint)
  100.         GetActorReference().PlayIdle(bleedoutstop)
  101.         Utility.Wait(2)
  102.         Game.EnablePlayerControls()    
  103.         decayEffect.Stop(GetActorReference())
  104.         decayEffect2.Stop(GetActorReference())
  105.         GetActorReference().PlayIdle(idlestoploose)
  106.         RegisterForSingleUpdate(1.0)
  107.         ;Debug.MessageBox("Update Registered.")
  108.         Utility.Wait(10)
  109.         GetActorReference().SetAlpha(1, true)
  110. EndFunction