Advertisement
AbyssWolf

UDA_DragonAspect_Arms.psc

Dec 28th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. Scriptname UDA_DragonAspect_Arms extends ActiveMagicEffect
  2.  
  3. import game
  4. import utility
  5. import debug
  6.  
  7. ;properties
  8. Actor Property PlayerREF Auto
  9.  
  10. ;variables
  11. int weapLeftBaseDmg = 0
  12. int weapRightBaseDmg = 0
  13. int weapLeftModDmg = 0
  14. int weapRightModDmg = 0
  15. string avCarryWeight = "CarryWeight"
  16. float playerCarryWeightBase = 0.0
  17. float playerCarryWeightMod = 0.0
  18. float fUDA_ModValue = 0.25
  19.  
  20. Event OnEffectStart(Actor akTarget, Actor akCaster)
  21. ;initialize and set base values
  22. initWeaponBaseDamage(true) ;LeftHand
  23. initWeaponBaseDamage(false) ;RightHand
  24. initCarryWeight()
  25. ;Modify Values
  26. modWeaponValues(true);Left Hand
  27. modWeaponValues(false);Right Hand
  28. modCarryWeight()
  29.  
  30. EndEvent
  31.  
  32. Event onEffectFinish(Actor akTarget, Actor akCaster)
  33. resetWeaponValues(true);Reset weapon Values Left hand
  34. resetWeaponValues(false);Reset weapon Values Right hand
  35. resetCarryWeight() ;Reset carry Weight
  36. EndEvent
  37.  
  38. ;Weapon functions
  39. int Function initWeaponBaseDamage(bool isLeftHand)
  40. If (isLeftHand == true)
  41. weapLeftBaseDmg = PlayerREF.GetEquippedWeapon(true).GetBaseDamage()
  42. return weapLeftBaseDmg
  43. ElseIf (isLeftHand == false)
  44. weapRightBaseDmg = PlayerREF.GetEquippedWeapon(false).GetBaseDamage()
  45. return weapRightBaseDmg
  46. EndIf
  47. EndFunction
  48.  
  49. int Function modWeaponValues(bool isLeftHand)
  50. if (isLeftHand == true)
  51. weapLeftModDmg = (weapLeftBaseDmg + (weapLeftBaseDmg * fUDA_ModValue)) as int
  52. PlayerREF.GetEquippedWeapon(true).SetBaseDamage(weapLeftModDmg) ;Set weapon damage to modified value
  53. return weapLeftModDmg
  54. elseif (isLeftHand == false)
  55. weapRightModDmg = (weapRightBaseDmg + (weapRightBaseDmg * fUDA_ModValue)) as int
  56. PlayerREF.GetEquippedWeapon(false).SetBaseDamage(weapRightModDmg) ;set weapon damge to modified Value
  57. return weapRightModDmg
  58. EndIf
  59. EndFunction
  60.  
  61. Function resetWeaponValues(bool isLeftHand)
  62. if(isLeftHand == true)
  63. PlayerREF.GetEquippedWeapon(true).SetBaseDamage(weapLeftBaseDmg)
  64. elseif(isLeftHand == false)
  65. PlayerREF.GetEquippedWeapon(false).SetBaseDamage(weapRightBaseDmg)
  66. EndIf
  67. weapLeftBaseDmg = 0
  68. weapLeftModDmg = 0
  69. weapRightBaseDmg = 0
  70. weapRightModDmg = 0
  71. EndFunction
  72.  
  73. ;Carry Weight Functions
  74. float Function initCarryWeight()
  75. playerCarryWeightBase = PlayerREF.GetAV(avCarryWeight)
  76. return playerCarryWeightBase
  77. EndFunction
  78.  
  79. float Function modCarryWeight()
  80. playerCarryWeightMod = (playerCarryWeightBase + (playerCarryWeightBase * fUDA_ModValue))
  81. PlayerREF.SetAV(avCarryWeight, playerCarryWeightMod)
  82. return playerCarryWeightMod
  83. EndFunction
  84.  
  85. Function resetCarryWeight()
  86. PlayerREF.SetAV(avCarryWeight, playerCarryWeightBase)
  87. playerCarryWeightBase = 0.0
  88. playerCarryWeightMod = 0.0
  89. EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement