Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. Scriptname InnerPowerAnimationScript extends activemagiceffect
  2.  
  3. event OnEffectStart(Actor akTarget, Actor akCaster)
  4. Debug.trace("player effect starting")
  5. tryToLoadDlcForms()
  6.  
  7. isCancelled = false
  8. wasFirstPerson = false
  9. if(akTarget == Game.getPlayer() && checkDlcLocations() && checkMiraak())
  10. makePlayerPlayTheAnim(akTarget)
  11. else
  12. self.dispel()
  13. endif
  14. endevent
  15.  
  16. function makePlayerPlayTheAnim(Actor player)
  17. Utility.wait(preAnimationWait)
  18. recheckMiraakAndMaybeCancel()
  19. if(isCancelled)
  20. return
  21. endif
  22.  
  23. Debug.trace("will play the anim")
  24. ; Disable movement and combat
  25. Game.DisablePlayerControls()
  26. wasFirstPerson = player.GetAnimationVariableBool("IsFirstPerson")
  27. Game.ForceThirdPerson()
  28.  
  29. if(player.isWeaponDrawn())
  30. player.playIdle(DefaultSheathe)
  31. Utility.wait(weaponSheatheTime)
  32. endif
  33. if(isCancelled)
  34. return
  35. endif
  36. ;THIS IS WHERE THE DISMOUNT SCRIPT STARTS
  37. Debug.trace("player dismount effect starting")
  38. if(akTarget == Game.getPlayer() && checkDlcLocations() && checkMiraak())
  39. if(akTarget.isOnMount())
  40. if(akTarget.dismount())
  41. Utility.wait(4.0) ; wait for them to dismount
  42. else ; dismounting failed
  43. self.dispel()
  44. return
  45. endif
  46. endif
  47. endif
  48. ;THIS IS WHERE THE DISMOUNT SCRIPT ENDS
  49. player.playIdle(RitualSpellStart)
  50. Utility.wait(spellHoldingTime)
  51. recheckMiraakAndMaybeCancel()
  52. if(isCancelled)
  53. return
  54. endif
  55. player.playIdle(RitualSpellRelease)
  56. Utility.wait(spellReleaseTime)
  57.  
  58. ; spell
  59. if(SpellToAdd)
  60. SpellToAdd.cast(player)
  61. endif
  62.  
  63. Utility.wait(afterEffectTime)
  64.  
  65. ; Enable all controls
  66. Game.EnablePlayerControls()
  67. if(wasFirstPerson)
  68. Game.ForceFirstPerson()
  69. endif
  70. self.dispel()
  71. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement