Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.95 KB | None | 0 0
  1. Scriptname PlayerWerewolfChangeScript extends Quest
  2.  
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4. ; Moonlight Tales Special Edition
  5. ; Author: Brevi from sPwned.net
  6. ; Version: 1.25
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  10. ; Moonlight Tales Special Edition | Start
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13. Actor Property PlayerREF Auto
  14.  
  15. Armor Property MTSE_Armor_AncientRing Auto
  16.  
  17. ;Werewolf Presets
  18. Armor Property MTSE_Armor_P001 Auto
  19. Armor Property MTSE_Armor_P002 Auto
  20. Armor Property MTSE_Armor_P003 Auto
  21. Armor Property MTSE_Armor_P004 Auto
  22. Armor Property MTSE_Armor_P005 Auto
  23. Armor Property MTSE_Armor_P006 Auto
  24. Armor Property MTSE_Armor_P007 Auto
  25. Armor Property MTSE_Armor_P008 Auto
  26. Armor Property MTSE_Armor_P009 Auto
  27. Armor Property MTSE_Armor_P010 Auto
  28. Armor Property MTSE_Armor_P011 Auto
  29. Armor Property MTSE_Armor_P012 Auto
  30. Armor Property MTSE_Armor_P013 Auto
  31. Armor Property MTSE_Armor_P014 Auto
  32. Armor Property MTSE_Armor_P015 Auto
  33. Armor Property MTSE_Armor_P016 Auto
  34. Armor Property MTSE_Armor_P017 Auto
  35. Armor Property MTSE_Armor_P018 Auto
  36. Armor Property MTSE_Armor_P019 Auto
  37. Armor Property MTSE_Armor_P020 Auto
  38. Armor Property MTSE_Armor_P021 Auto
  39. Armor Property MTSE_Armor_P022 Auto
  40. Armor Property MTSE_Armor_P023 Auto
  41. Armor Property MTSE_Armor_P024 Auto
  42. Armor Property MTSE_Armor_P025 Auto
  43. Armor Property MTSE_Armor_P026 Auto
  44. Armor Property MTSE_Armor_P027 Auto
  45. Armor Property MTSE_Armor_P028 Auto
  46.  
  47. ;Werebear Presets
  48. Armor Property MTSE_Armor_Wb_P001 Auto
  49. Armor Property MTSE_Armor_Wb_P002 Auto
  50. Armor Property MTSE_Armor_Wb_P003 Auto
  51. Armor Property MTSE_Armor_Wb_P004 Auto
  52. Armor Property MTSE_Armor_Wb_P005 Auto
  53. Armor Property MTSE_Armor_Wb_P006 Auto
  54. Armor Property MTSE_Armor_Wb_P007 Auto
  55. Armor Property MTSE_Armor_Wb_P008 Auto
  56. Armor Property MTSE_Armor_Wb_P009 Auto
  57. Armor Property MTSE_Armor_Wb_P010 Auto
  58. Armor Property MTSE_Armor_Wb_P011 Auto
  59. Armor Property MTSE_Armor_Wb_P012 Auto
  60. Armor Property MTSE_Armor_Wb_P013 Auto
  61. Armor Property MTSE_Armor_Wb_P014 Auto
  62.  
  63. ;Werewolf Transformation Effect Presets
  64. Armor Property MTSE_Armor_TP001 Auto
  65. Armor Property MTSE_Armor_TP002 Auto
  66. Armor Property MTSE_Armor_TP003 Auto
  67. Armor Property MTSE_Armor_TP004 Auto
  68. Armor Property MTSE_Armor_TP005 Auto
  69. Armor Property MTSE_Armor_TP006 Auto
  70. Armor Property MTSE_Armor_TP007 Auto
  71. Armor Property MTSE_Armor_TP008 Auto
  72. Armor Property MTSE_Armor_TP009 Auto
  73. Armor Property MTSE_Armor_TP010 Auto
  74. Armor Property MTSE_Armor_TP011 Auto
  75. Armor Property MTSE_Armor_TP012 Auto
  76. Armor Property MTSE_Armor_TP013 Auto
  77. Armor Property MTSE_Armor_TP014 Auto
  78. Armor Property MTSE_Armor_TP015 Auto
  79. Armor Property MTSE_Armor_TP016 Auto
  80. Armor Property MTSE_Armor_TP017 Auto
  81. Armor Property MTSE_Armor_TP018 Auto
  82. Armor Property MTSE_Armor_TP019 Auto
  83. Armor Property MTSE_Armor_TP020 Auto
  84. Armor Property MTSE_Armor_TP021 Auto
  85. Armor Property MTSE_Armor_TP022 Auto
  86. Armor Property MTSE_Armor_TP023 Auto
  87. Armor Property MTSE_Armor_TP024 Auto
  88. Armor Property MTSE_Armor_TP025 Auto
  89. Armor Property MTSE_Armor_TP026 Auto
  90. Armor Property MTSE_Armor_TP027 Auto
  91. Armor Property MTSE_Armor_TP028 Auto
  92.  
  93. ;Werebear Transformation Effect Presets
  94. Armor Property MTSE_Armor_Wb_TP001 Auto
  95. Armor Property MTSE_Armor_Wb_TP002 Auto
  96. Armor Property MTSE_Armor_Wb_TP003 Auto
  97. Armor Property MTSE_Armor_Wb_TP004 Auto
  98. Armor Property MTSE_Armor_Wb_TP005 Auto
  99. Armor Property MTSE_Armor_Wb_TP006 Auto
  100. Armor Property MTSE_Armor_Wb_TP007 Auto
  101. Armor Property MTSE_Armor_Wb_TP008 Auto
  102. Armor Property MTSE_Armor_Wb_TP009 Auto
  103. Armor Property MTSE_Armor_Wb_TP010 Auto
  104. Armor Property MTSE_Armor_Wb_TP011 Auto
  105. Armor Property MTSE_Armor_Wb_TP012 Auto
  106. Armor Property MTSE_Armor_Wb_TP013 Auto
  107. Armor Property MTSE_Armor_Wb_TP014 Auto
  108.  
  109. GlobalVariable Property MTSE_Global_Sweep Auto
  110. GlobalVariable Property MTSE_Global_Difficulty Auto
  111. GlobalVariable Property MTSE_Global_Rejuvenation Auto
  112. GlobalVariable Property MTSE_Global_LunarTransformed Auto
  113. GlobalVariable Property MTSE_Global_NightEye Auto
  114. GlobalVariable Property MTSE_Global_Appearance Auto
  115. GlobalVariable Property MTSE_Global_TransformBackAnimation Auto
  116. GlobalVariable Property MTSE_Global_MoonRoarVolume Auto
  117. GlobalVariable Property MTSE_Global_MoonHowlVolume Auto
  118.  
  119. Idle Property MTSE_Idle_BleedOutStart Auto
  120. Idle Property MTSE_Idle_HowlStart Auto
  121. Idle Property MTSE_Idle_HowlStop Auto
  122.  
  123. EffectShader Property WerewolfTrans02FXS Auto
  124.  
  125. Message Property MTSE_Message_CombatMenu Auto
  126.  
  127. Perk Property MTSE_Perk_HircinesBlessing1 Auto
  128. Perk Property MTSE_Perk_HircinesBlessing2 Auto
  129. Perk Property MTSE_Perk_AspectOfHircine Auto
  130. Perk Property MTSE_Perk_HeightenedSenses Auto
  131. Perk Property MTSE_Perk_HowlAtTheMoon Auto
  132. Perk Property MTSE_Perk_SavageFeeding2 Auto
  133. Perk Property MTSE_Perk_HunterInTheNight Auto
  134. Perk Property MTSE_Perk_RevertForm Auto
  135. Perk Property MTSE_Perk_EnduranceOfTheWolf1 Auto
  136.  
  137. Quest Property PlayerWerewolfQuest Auto
  138. Quest Property C03 Auto
  139. Quest Property MTSE_Quest_LunarTransformBack Auto
  140.  
  141. Shout Property MTSE_Shout_WerewolfRoar Auto
  142.  
  143. Sound Property MTSE_SoundMark_MoonRoar Auto
  144. Sound Property MTSE_SoundMark_MoonHowl Auto
  145.  
  146. Spell Property MTSE_Spell_HeightenedSensesDuration Auto
  147. Spell Property MTSE_Spell_MoonHowl Auto
  148. Spell Property MTSE_Spell_SavageFeeding Auto
  149. Spell Property MTSE_Spell_NightEye Auto
  150. Spell Property MTSE_Spell_ObjectDMG Auto
  151.  
  152. WordOfPower Property MTSE_Word_WerewolfRoar1 Auto
  153. WordOfPower Property MTSE_Word_WerewolfRoar2 Auto
  154. WordOfPower Property MTSE_Word_WerewolfRoar3 Auto
  155.  
  156. Float MTSE_HealthPercentage = 0.0
  157. Float MTSE_MaxHealth = 0.0
  158. Float BaseHealth = 0.0
  159. Float MaxHealth = 0.0
  160. Float Heal = 0.0
  161.  
  162. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  163. ; Moonlight Tales Special Edition | End
  164. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  165.  
  166. float Property StandardDurationSeconds auto
  167. {How long (in real seconds) the transformation lasts}
  168.  
  169. float Property DurationWarningTimeSeconds auto
  170. {How long (in real seconds) before turning back we should warn the player}
  171.  
  172. float Property FeedExtensionTimeSeconds auto
  173. {How long (in real seconds) that feeding extends werewolf time}
  174.  
  175. VisualEffect property FeedBloodVFX auto
  176. {Visual Effect on Wolf for Feeding Blood}
  177.  
  178. Race Property WerewolfBeastRace auto
  179. ObjectReference Property LycanStash auto
  180. Perk Property PlayerWerewolfFeed auto
  181.  
  182. Faction Property PlayerWerewolfFaction auto
  183. Faction Property WerewolfFaction auto
  184.  
  185. Message Property PlayerWerewolfExpirationWarning auto
  186. Message Property PlayerWerewolfFeedMessage auto
  187. GlobalVariable Property GameDaysPassed auto
  188. GlobalVariable Property TimeScale auto
  189. GlobalVariable Property PlayerWerewolfShiftBackTime auto
  190.  
  191. ImageSpaceModifier Property WerewolfWarn auto
  192. ImageSpaceModifier Property WerewolfChange auto
  193.  
  194. Race Property WerewolfRace auto
  195. Sound Property NPCWerewolfTransformation auto
  196. Sound Property WerewolfIMODSound auto
  197. Idle Property WerewolfTransformBack auto
  198. Idle Property SpecialFeeding auto
  199.  
  200. Quest Property CompanionsTrackingQuest auto
  201. Quest Property C03Rampage auto
  202.  
  203. Shout Property CurrentHowl auto
  204. WordOfPower Property CurrentHowlWord1 auto
  205. WordOfPower Property CurrentHowlWord2 auto
  206. WordOfPower Property CurrentHowlWord3 auto
  207.  
  208. Spell Property PlayerWerewolfLvl10AndBelowAbility auto
  209. Spell Property PlayerWerewolfLvl15AndBelowAbility auto
  210. Spell Property PlayerWerewolfLvl20AndBelowAbility auto
  211. Spell Property PlayerWerewolfLvl25AndBelowAbility auto
  212. Spell Property PlayerWerewolfLvl30AndBelowAbility auto
  213. Spell Property PlayerWerewolfLvl35AndBelowAbility auto
  214. Spell Property PlayerWerewolfLvl40AndBelowAbility auto
  215. Spell Property PlayerWerewolfLvl45AndBelowAbility auto
  216. Spell Property PlayerWerewolfLvl50AndOverAbility auto
  217.  
  218. Spell Property FeedBoost auto
  219. Spell property BleedingFXSpell auto
  220. {This Spell is for making the target of feeding bleed.}
  221.  
  222. Armor Property WolfSkinFXArmor auto
  223.  
  224. bool Property Untimed auto
  225.  
  226. FormList Property CrimeFactions auto
  227. FormList Property WerewolfDispelList auto
  228.  
  229. float __durationWarningTime = -1.0
  230. float __feedExtensionTime = -1.0
  231. float __gorgeExtensionTime = -1.0
  232. bool __tryingToShiftBack = false
  233. bool __shiftingBack = false
  234. bool __shuttingDown = false
  235. bool __trackingStarted = false
  236.  
  237. Float Property DLC1GorgingDurationSeconds Auto
  238.  
  239. Perk Property DLC1GorgingPerk Auto
  240.  
  241. Perk Property DLC1SavageFeedingPerk Auto
  242.  
  243. Keyword Property ActorTypeNPC Auto
  244.  
  245. Perk Property DLC1AnimalVigor Auto
  246.  
  247. GlobalVariable Property DLC1WerewolfTotalPerksEarned Auto
  248.  
  249. GlobalVariable Property DLC1WerewolfMaxPerks Auto
  250.  
  251. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  252. ;Events
  253. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  254.  
  255. Event OnUpdate()
  256. if (Untimed)
  257. return
  258. endif
  259. ; Debug.Trace("WEREWOLF: NumWerewolfPerks = " + Game.QueryStat("NumWerewolfPerks"))
  260. if Game.QueryStat("NumWerewolfPerks") >= DLC1WerewolfMaxPerks.Value
  261. ; debug.trace("WEREWOLF: achievement granted")
  262. Game.AddAchievement(57)
  263. endif
  264.  
  265. float currentTime = GameDaysPassed.GetValue()
  266. float regressTime = PlayerWerewolfShiftBackTime.GetValue()
  267.  
  268. if ( (currentTime >= regressTime) && (!PlayerREF.IsInKillMove()) && !__tryingToShiftBack )
  269. UnregisterForUpdate()
  270. SetStage(100) ; time to go, buddy
  271. return
  272. endif
  273.  
  274. if (currentTime >= regressTime - __durationWarningTime)
  275. if (GetStage() == 10)
  276. SetStage(20) ; almost there
  277. return
  278. endif
  279. endif
  280.  
  281. ; Debug.Trace("WEREWOLF: Checking, still have " + GameTimeDaysToRealTimeSeconds(regressTime - currentTime) + " seconds to go.")
  282. EndEvent
  283.  
  284. Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  285. if (asEventName == "TransformToHuman")
  286. ActuallyShiftBackIfNecessary()
  287. endif
  288.  
  289. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  290. ; Moonlight Tales Special Edition | Start
  291. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  292.  
  293. If (asEventName == "WeaponSheathe")
  294. WeaponSheathe()
  295. Endif
  296.  
  297. If (asEventName == "WeaponSwing") || (asEventName == "WeaponLeftSwing")
  298. Attack()
  299. Endif
  300.  
  301. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  302. ; Moonlight Tales Special Edition | End
  303. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  304.  
  305. EndEvent
  306.  
  307. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  308. ;Functions
  309. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  310.  
  311. float Function RealTimeSecondsToGameTimeDays(float realtime)
  312. float scaledSeconds = realtime * TimeScale.Value
  313. return scaledSeconds / (60 * 60 * 24)
  314. EndFunction
  315.  
  316. float Function GameTimeDaysToRealTimeSeconds(float gametime)
  317. float gameSeconds = gametime * (60 * 60 * 24)
  318. return (gameSeconds / TimeScale.Value)
  319. EndFunction
  320.  
  321. Function PrepShift()
  322. ; Debug.Trace("WEREWOLF: Prepping shift...")
  323. Actor player = PlayerREF
  324.  
  325. ; sets up the UI restrictions
  326. Game.SetBeastForm(True)
  327. Game.EnableFastTravel(False)
  328.  
  329. ; set up perks/abilities
  330. ; (don't need to do this anymore since it's on from gamestart)
  331. ; PlayerREF.AddPerk(PlayerWerewolfFeed)
  332.  
  333. ; screen effect
  334. WerewolfChange.Apply()
  335. WerewolfIMODSound.Play(PlayerREF)
  336.  
  337. ; get rid of your summons
  338. int count = 0
  339. while (count < WerewolfDispelList.GetSize())
  340. Spell gone = WerewolfDispelList.GetAt(count) as Spell
  341. if (gone != None)
  342. PlayerREF.DispelSpell(gone)
  343. endif
  344. count += 1
  345. endwhile
  346.  
  347.  
  348. Game.DisablePlayerControls(abMovement = false, abFighting = false, abCamSwitch = true, abMenu = false, abActivate = false, abJournalTabs = false, aiDisablePOVType = 1)
  349. Game.ForceThirdPerson()
  350. Game.ShowFirstPersonGeometry(false)
  351. EndFunction
  352.  
  353. Function InitialShift()
  354. ; Debug.Trace("WEREWOLF: Player beginning transformation.")
  355.  
  356. WerewolfWarn.Apply()
  357.  
  358. if (PlayerREF.IsDead())
  359. ; Debug.Trace("WEREWOLF: Player is dead; bailing out.")
  360. return
  361. endif
  362.  
  363. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  364. ; Moonlight Tales Special Edition | Start
  365. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  366.  
  367. PlayerREF.UnequipItem(MTSE_Armor_AncientRing, False, True)
  368.  
  369. If PlayerREF.HasPerk(MTSE_Perk_EnduranceOfTheWolf1)
  370. PlayerREF.RestoreActorValue("Health", 999999999999)
  371. Utility.Wait(0.1)
  372. EndIf
  373.  
  374. MTSE_Global_Rejuvenation.SetValueInt(1)
  375.  
  376. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  377. ; Moonlight Tales Special Edition | End
  378. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  379.  
  380. ; actual switch
  381. PlayerREF.SetRace(WerewolfBeastRace)
  382. EndFunction
  383.  
  384. Function StartTracking()
  385. if (__trackingStarted)
  386. return
  387. endif
  388.  
  389. __trackingStarted = true
  390.  
  391. ; Debug.Trace("WEREWOLF: Race swap done; starting tracking and effects.")
  392.  
  393. ; take all the player's stuff (since he/she can't use it anyway)
  394. ; PlayerREF.RemoveAllItems(LycanStash)
  395. PlayerREF.UnequipAll()
  396. PlayerREF.EquipItem(WolfSkinFXArmor, False, True)
  397.  
  398. ;Add Blood Effects
  399. ;FeedBloodVFX.Play(PlayerREF)
  400.  
  401. ; make everyone hate you
  402. PlayerREF.SetAttackActorOnSight(true)
  403.  
  404. ; alert anyone nearby that they should now know the player is a werewolf
  405. Game.SendWereWolfTransformation()
  406.  
  407. PlayerREF.AddToFaction(PlayerWerewolfFaction)
  408. PlayerREF.AddToFaction(WerewolfFaction)
  409. int cfIndex = 0
  410. ;while (cfIndex < CrimeFactions.GetSize())
  411. ; ;Debug.Trace("WEREWOLF: Setting enemy flag on " + CrimeFactions.GetAt(cfIndex))
  412. ;(CrimeFactions.GetAt(cfIndex) as Faction).SetPlayerEnemy()
  413. ;cfIndex += 1
  414. ;endwhile
  415.  
  416. ; but they also don't know that it's you
  417. Game.SetPlayerReportCrime(false)
  418.  
  419. ; recalc times
  420. __durationWarningTime = RealTimeSecondsToGameTimeDays(DurationWarningTimeSeconds)
  421. __feedExtensionTime = RealTimeSecondsToGameTimeDays(FeedExtensionTimeSeconds)
  422. __gorgeExtensionTime = RealTimeSecondsToGameTimeDays(DLC1GorgingDurationSeconds)
  423.  
  424. ; unequip magic
  425. Spell left = PlayerREF.GetEquippedSpell(0)
  426. Spell right = PlayerREF.GetEquippedSpell(1)
  427. Spell power = PlayerREF.GetEquippedSpell(2)
  428. Shout voice = PlayerREF.GetEquippedShout()
  429. if (left != None)
  430. PlayerREF.UnequipSpell(left, 0)
  431. endif
  432. if (right != None)
  433. PlayerREF.UnequipSpell(right, 1)
  434. endif
  435. if (power != None)
  436. ; some players are overly clever and sneak a power equip between casting
  437. ; beast form and when we rejigger them there. this will teach them.
  438. ; Debug.Trace("WEREWOLF: " + power + " was equipped; removing.")
  439. PlayerREF.UnequipSpell(power, 2)
  440. else
  441. ; Debug.Trace("WEREWOLF: No power equipped.")
  442. endif
  443. if (voice != None)
  444. ; same deal here, but for shouts
  445. ; Debug.Trace("WEREWOLF: " + voice + " was equipped; removing.")
  446. PlayerREF.UnequipShout(voice)
  447. else
  448. ; Debug.Trace("WEREWOLF: No shout equipped.")
  449. endif
  450.  
  451. ; but make up for it by giving you the sweet howl
  452. CurrentHowlWord1 = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowlWord1
  453. CurrentHowlWord2 = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowlWord2
  454. CurrentHowlWord3 = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowlWord3
  455. CurrentHowl = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowl
  456.  
  457. Game.UnlockWord(MTSE_Word_WerewolfRoar1)
  458. Game.UnlockWord(MTSE_Word_WerewolfRoar2)
  459. Game.UnlockWord(MTSE_Word_WerewolfRoar3)
  460. PlayerREF.AddShout(MTSE_Shout_WerewolfRoar)
  461. PlayerREF.EquipShout(MTSE_Shout_WerewolfRoar)
  462.  
  463. ; and some rad claws
  464. int playerLevel = PlayerREF.GetLevel()
  465. if (playerLevel <= 10)
  466. PlayerREF.AddSpell(PlayerWerewolfLvl10AndBelowAbility, false)
  467. elseif (playerLevel <= 15)
  468. PlayerREF.AddSpell(PlayerWerewolfLvl15AndBelowAbility, false)
  469. elseif (playerLevel <= 20)
  470. PlayerREF.AddSpell(PlayerWerewolfLvl20AndBelowAbility, false)
  471. elseif (playerLevel <= 25)
  472. PlayerREF.AddSpell(PlayerWerewolfLvl25AndBelowAbility, false)
  473. elseif (playerLevel <= 30)
  474. PlayerREF.AddSpell(PlayerWerewolfLvl30AndBelowAbility, false)
  475. elseif (playerLevel <= 35)
  476. PlayerREF.AddSpell(PlayerWerewolfLvl35AndBelowAbility, false)
  477. elseif (playerLevel <= 40)
  478. PlayerREF.AddSpell(PlayerWerewolfLvl40AndBelowAbility, false)
  479. elseif (playerLevel <= 45)
  480. PlayerREF.AddSpell(PlayerWerewolfLvl45AndBelowAbility, false)
  481. else
  482. PlayerREF.AddSpell(PlayerWerewolfLvl50AndOverAbility, false)
  483. endif
  484.  
  485. ; calculate when the player turns back into a pumpkin
  486. float currentTime = GameDaysPassed.GetValue()
  487. float regressTime = currentTime + RealTimeSecondsToGameTimeDays(StandardDurationSeconds)
  488. PlayerWerewolfShiftBackTime.SetValue(regressTime)
  489. ; Debug.Trace("WEREWOLF: Current day -- " + currentTime)
  490. ; Debug.Trace("WEREWOLF: Player will turn back at day " + regressTime)
  491.  
  492. ; increment stats
  493. Game.IncrementStat("Werewolf Transformations")
  494.  
  495. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  496. ; Moonlight Tales Special Edition | Start
  497. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  498.  
  499. RegisterForAnimationEvent(PlayerREF, "WeaponDraw")
  500. RegisterForAnimationEvent(PlayerREF, "WeaponSheathe")
  501. RegisterForAnimationEvent(PlayerREF, "WeaponSwing")
  502. RegisterForAnimationEvent(PlayerREF, "WeaponLeftSwing")
  503.  
  504. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  505. ; Moonlight Tales Special Edition | End
  506. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  507.  
  508. ; set us up to check when we turn back
  509. RegisterForUpdate(5)
  510.  
  511. SetStage(10) ; we're done with the transformation handling
  512. EndFunction
  513.  
  514. Function SetUntimed(bool untimedValue)
  515. Untimed = untimedValue
  516. if (Untimed)
  517. UnregisterForUpdate()
  518. endif
  519. EndFunction
  520.  
  521. ; called from stage 11
  522. Function Feed(Actor victim)
  523.  
  524. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  525. ; Moonlight Tales Special Edition | Start
  526. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  527.  
  528. PlayerREF.PlayIdle(SpecialFeeding)
  529.  
  530. BleedingFXSpell.Cast(victim,victim)
  531.  
  532. If !C03Rampage.IsRunning()
  533.  
  534. If victim.HasKeyword(ActorTypeNPC)
  535. PlayerWerewolfShiftBackTime.SetValue(PlayerWerewolfShiftBackTime.GetValue() + RealTimeSecondsToGameTimeDays(30))
  536. ElseIf !victim.HasKeyword(ActorTypeNPC) && PlayerREF.HasPerk(MTSE_Perk_SavageFeeding2)
  537. PlayerWerewolfShiftBackTime.SetValue(PlayerWerewolfShiftBackTime.GetValue() + RealTimeSecondsToGameTimeDays(21))
  538. Else
  539. PlayerWerewolfShiftBackTime.SetValue(PlayerWerewolfShiftBackTime.GetValue() + RealTimeSecondsToGameTimeDays(15))
  540. EndIf
  541.  
  542. If MTSE_Global_LunarTransformed.GetValueInt() == 0
  543. PlayerWerewolfFeedMessage.Show()
  544. EndIf
  545.  
  546. CalculateMaxHealth()
  547. If PlayerREF.HasPerk(MTSE_Perk_AspectOfHircine)
  548. Heal = MaxHealth * 0.5
  549. PlayerREF.RestoreActorValue("Health", Heal)
  550. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2)
  551. Heal = MaxHealth * 0.4
  552. PlayerREF.RestoreActorValue("Health", Heal)
  553. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1)
  554. Heal = MaxHealth * 0.3
  555. PlayerREF.RestoreActorValue("Health", Heal)
  556. Else
  557. FeedBoost.Cast(PlayerREF)
  558. EndIf
  559.  
  560. If PlayerREF.HasPerk(MTSE_Perk_SavageFeeding2)
  561. MTSE_Spell_SavageFeeding.Cast(PlayerREF)
  562. EndIf
  563.  
  564. EndIf
  565. SetStage(10)
  566.  
  567. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  568. ; Moonlight Tales Special Edition | End
  569. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  570.  
  571. EndFunction
  572.  
  573.  
  574. ; called from stage 20
  575. Function WarnPlayer()
  576. ; Debug.Trace("WEREWOLF: Player about to transform back.")
  577. WerewolfWarn.Apply()
  578. EndFunction
  579.  
  580.  
  581. ; called from stage 100
  582. Function ShiftBack()
  583. __tryingToShiftBack = true
  584.  
  585. while (PlayerREF.GetAnimationVariableBool("bIsSynced"))
  586. ; Debug.Trace("WEREWOLF: Waiting for synced animation to finish...")
  587. Utility.Wait(0.1)
  588. endwhile
  589. ; Debug.Trace("WEREWOLF: Sending transform event to turn player back to normal.")
  590.  
  591. __shiftingBack = false
  592. ; RegisterForAnimationEvent(PlayerREF, "TransformToHuman")
  593. ; PlayerREF.PlayIdle(WerewolfTransformBack)
  594. ; Utility.Wait(10)
  595. ActuallyShiftBackIfNecessary()
  596. EndFunction
  597.  
  598. Function ActuallyShiftBackIfNecessary()
  599. if (__shiftingBack)
  600. return
  601. endif
  602.  
  603. __shiftingBack = true
  604.  
  605. ; Debug.Trace("WEREWOLF: Player returning to normal.")
  606.  
  607. Game.SetInCharGen(true, true, false)
  608.  
  609. UnRegisterForAnimationEvent(PlayerREF, "TransformToHuman")
  610.  
  611. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  612. ; Moonlight Tales Special Edition | Start
  613. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  614.  
  615. If MTSE_Global_NightEye.GetValueInt() != 0
  616. MTSE_Spell_NightEye.Cast(PlayerREF)
  617. EndIf
  618.  
  619. UnRegisterForAnimationEvent(PlayerREF, "WeaponDraw")
  620. UnRegisterForAnimationEvent(PlayerREF, "WeaponSheathe")
  621. UnRegisterForAnimationEvent(PlayerREF, "WeaponSwing")
  622. UnRegisterForAnimationEvent(PlayerREF, "WeaponLeftSwing")
  623.  
  624. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  625. ; Moonlight Tales Special Edition | End
  626. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  627.  
  628. UnRegisterForUpdate() ; just in case
  629.  
  630. if (PlayerREF.IsDead())
  631. ; Debug.Trace("WEREWOLF: Player is dead; bailing out.")
  632. return
  633. endif
  634.  
  635. ;Remove Blood Effects
  636. ;FeedBloodVFX.Stop(PlayerREF)
  637.  
  638. ; imod
  639. WerewolfChange.Apply()
  640. WerewolfIMODSound.Play(PlayerREF)
  641.  
  642. ; get rid of your summons if you have any
  643. int count = 0
  644. while (count < WerewolfDispelList.GetSize())
  645. Spell gone = WerewolfDispelList.GetAt(count) as Spell
  646. if (gone != None)
  647. ; Debug.Trace("WEREWOLF: Dispelling " + gone)
  648. PlayerREF.DispelSpell(gone)
  649. endif
  650. count += 1
  651. endwhile
  652.  
  653. ; make sure the transition armor is gone. We RemoveItem here, because the SetRace stored all equipped items
  654. ; at that time, and we equip this armor prior to setting the player to a beast race. When we switch back,
  655. ; if this were still in the player's inventory it would be re-equipped.
  656.  
  657. PlayerREF.SetGhost()
  658.  
  659. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  660. ; Moonlight Tales Special Edition | Start
  661. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  662.  
  663. If MTSE_Global_TransformBackAnimation.GetValueInt() == 1
  664. PlayerREF.PlayIdle(MTSE_Idle_BleedOutStart)
  665. Utility.Wait(2)
  666. WerewolfTrans02FXS.Play(PlayerREF,-1.0)
  667. Utility.Wait(1)
  668. EndIf
  669. RemoveTransformationEffect()
  670. AppearanceCleanUp()
  671.  
  672. CalculateMaxHealth()
  673. MTSE_HealthPercentage = (PlayerREF.GetActorValue("Health") / MaxHealth)
  674. PlayerREF.RestoreActorValue("Health", 999999999999)
  675. Utility.Wait(0.1)
  676.  
  677. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  678. ; Moonlight Tales Special Edition | End
  679. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  680.  
  681. ; change you back
  682. ; Debug.Trace("WEREWOLF: Setting race " + (CompanionsTrackingQuest as CompanionsHousekeepingScript).PlayerOriginalRace + " on " + PlayerREF)
  683. PlayerREF.SetRace((CompanionsTrackingQuest as CompanionsHousekeepingScript).PlayerOriginalRace)
  684. ; release the player controls
  685. ; Debug.Trace("WEREWOLF: Restoring camera controls")
  686. Game.EnablePlayerControls(abMovement = false, abFighting = false, abCamSwitch = true, abLooking = false, abSneaking = false, abMenu = false, abActivate = false, abJournalTabs = false, aiDisablePOVType = 1)
  687. Game.ShowFirstPersonGeometry(true)
  688.  
  689. ; no more howling for you
  690. PlayerREF.UnequipShout(MTSE_Shout_WerewolfRoar)
  691. PlayerREF.RemoveShout(MTSE_Shout_WerewolfRoar)
  692.  
  693. ; or those claws
  694. PlayerREF.RemoveSpell(PlayerWerewolfLvl10AndBelowAbility)
  695. PlayerREF.RemoveSpell(PlayerWerewolfLvl15AndBelowAbility)
  696. PlayerREF.RemoveSpell(PlayerWerewolfLvl20AndBelowAbility)
  697. PlayerREF.RemoveSpell(PlayerWerewolfLvl25AndBelowAbility)
  698. PlayerREF.RemoveSpell(PlayerWerewolfLvl30AndBelowAbility)
  699. PlayerREF.RemoveSpell(PlayerWerewolfLvl35AndBelowAbility)
  700. PlayerREF.RemoveSpell(PlayerWerewolfLvl40AndBelowAbility)
  701. PlayerREF.RemoveSpell(PlayerWerewolfLvl45AndBelowAbility)
  702. PlayerREF.RemoveSpell(PlayerWerewolfLvl50AndOverAbility)
  703.  
  704. ; gimme back mah stuff
  705. ; LycanStash.RemoveAllItems(PlayerREF)
  706.  
  707. ; people don't hate you no more
  708. PlayerREF.SetAttackActorOnSight(false)
  709. PlayerREF.RemoveFromFaction(PlayerWerewolfFaction)
  710. PlayerREF.RemoveFromFaction(WerewolfFaction)
  711. int cfIndex = 0
  712. while (cfIndex < CrimeFactions.GetSize())
  713. ; Debug.Trace("WEREWOLF: Removing enemy flag from " + CrimeFactions.GetAt(cfIndex))
  714. (CrimeFactions.GetAt(cfIndex) as Faction).SetPlayerEnemy(false)
  715. cfIndex += 1
  716. endwhile
  717.  
  718. ; and you're now recognized
  719. Game.SetPlayerReportCrime(true)
  720.  
  721. ; alert anyone nearby that they should now know the player is a werewolf
  722. Game.SendWereWolfTransformation()
  723.  
  724. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  725. ; Moonlight Tales Special Edition | Start
  726. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  727.  
  728. MTSE_MaxHealth = (PlayerREF.GetActorValue("Health") / PlayerREF.GetActorValuePercentage("Health"))
  729. If PlayerREF.GetActorValuePercentage("Health") > MTSE_HealthPercentage
  730. PlayerREF.DamageActorValue("Health", (MTSE_MaxHealth * (1 - MTSE_HealthPercentage)))
  731. EndIf
  732.  
  733. WerewolfTrans02FXS.Stop(PlayerREF)
  734.  
  735. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  736. ; Moonlight Tales Special Edition | End
  737. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  738.  
  739. ; give the set race event a chance to come back, otherwise shut us down
  740. Utility.Wait(5)
  741. Shutdown()
  742. EndFunction
  743.  
  744. Function Shutdown()
  745. if (__shuttingDown)
  746. return
  747. endif
  748.  
  749. __shuttingDown = true
  750.  
  751. PlayerREF.GetActorBase().SetInvulnerable(false)
  752. PlayerREF.SetGhost(false)
  753.  
  754. Game.SetBeastForm(False)
  755. Game.EnableFastTravel(True)
  756.  
  757. Game.SetInCharGen(false, false, false)
  758.  
  759. Stop()
  760. EndFunction
  761.  
  762. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  763. ; Moonlight Tales Special Edition | Start
  764. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  765.  
  766. Function AppearanceCleanUp()
  767.  
  768. PlayerREF.RemoveItem(MTSE_Armor_P001, 10, True)
  769. PlayerREF.RemoveItem(MTSE_Armor_P002, 10, True)
  770. PlayerREF.RemoveItem(MTSE_Armor_P003, 10, True)
  771. PlayerREF.RemoveItem(MTSE_Armor_P004, 10, True)
  772. PlayerREF.RemoveItem(MTSE_Armor_P005, 10, True)
  773. PlayerREF.RemoveItem(MTSE_Armor_P006, 10, True)
  774. PlayerREF.RemoveItem(MTSE_Armor_P007, 10, True)
  775. PlayerREF.RemoveItem(MTSE_Armor_P008, 10, True)
  776. PlayerREF.RemoveItem(MTSE_Armor_P009, 10, True)
  777. PlayerREF.RemoveItem(MTSE_Armor_P010, 10, True)
  778. PlayerREF.RemoveItem(MTSE_Armor_P011, 10, True)
  779. PlayerREF.RemoveItem(MTSE_Armor_P012, 10, True)
  780. PlayerREF.RemoveItem(MTSE_Armor_P013, 10, True)
  781. PlayerREF.RemoveItem(MTSE_Armor_P014, 10, True)
  782. PlayerREF.RemoveItem(MTSE_Armor_P015, 10, True)
  783. PlayerREF.RemoveItem(MTSE_Armor_P016, 10, True)
  784. PlayerREF.RemoveItem(MTSE_Armor_P017, 10, True)
  785. PlayerREF.RemoveItem(MTSE_Armor_P018, 10, True)
  786. PlayerREF.RemoveItem(MTSE_Armor_P019, 10, True)
  787. PlayerREF.RemoveItem(MTSE_Armor_P020, 10, True)
  788. PlayerREF.RemoveItem(MTSE_Armor_P021, 10, True)
  789. PlayerREF.RemoveItem(MTSE_Armor_P022, 10, True)
  790. PlayerREF.RemoveItem(MTSE_Armor_P023, 10, True)
  791. PlayerREF.RemoveItem(MTSE_Armor_P024, 10, True)
  792. PlayerREF.RemoveItem(MTSE_Armor_P025, 10, True)
  793. PlayerREF.RemoveItem(MTSE_Armor_P026, 10, True)
  794. PlayerREF.RemoveItem(MTSE_Armor_P027, 10, True)
  795. PlayerREF.RemoveItem(MTSE_Armor_P028, 10, True)
  796.  
  797. PlayerREF.RemoveItem(MTSE_Armor_Wb_P001, 10, True)
  798. PlayerREF.RemoveItem(MTSE_Armor_Wb_P002, 10, True)
  799. PlayerREF.RemoveItem(MTSE_Armor_Wb_P003, 10, True)
  800. PlayerREF.RemoveItem(MTSE_Armor_Wb_P004, 10, True)
  801. PlayerREF.RemoveItem(MTSE_Armor_Wb_P005, 10, True)
  802. PlayerREF.RemoveItem(MTSE_Armor_Wb_P006, 10, True)
  803. PlayerREF.RemoveItem(MTSE_Armor_Wb_P007, 10, True)
  804. PlayerREF.RemoveItem(MTSE_Armor_Wb_P008, 10, True)
  805. PlayerREF.RemoveItem(MTSE_Armor_Wb_P009, 10, True)
  806. PlayerREF.RemoveItem(MTSE_Armor_Wb_P010, 10, True)
  807. PlayerREF.RemoveItem(MTSE_Armor_Wb_P011, 10, True)
  808. PlayerREF.RemoveItem(MTSE_Armor_Wb_P012, 10, True)
  809. PlayerREF.RemoveItem(MTSE_Armor_Wb_P013, 10, True)
  810. PlayerREF.RemoveItem(MTSE_Armor_Wb_P014, 10, True)
  811.  
  812. EndFunction
  813.  
  814. Function RemoveTransformationEffect()
  815.  
  816. PlayerREF.RemoveItem(WolfSkinFXArmor, 10, True)
  817. PlayerREF.RemoveItem(MTSE_Armor_TP001, 10, True)
  818. PlayerREF.RemoveItem(MTSE_Armor_TP002, 10, True)
  819. PlayerREF.RemoveItem(MTSE_Armor_TP003, 10, True)
  820. PlayerREF.RemoveItem(MTSE_Armor_TP004, 10, True)
  821. PlayerREF.RemoveItem(MTSE_Armor_TP005, 10, True)
  822. PlayerREF.RemoveItem(MTSE_Armor_TP006, 10, True)
  823. PlayerREF.RemoveItem(MTSE_Armor_TP007, 10, True)
  824. PlayerREF.RemoveItem(MTSE_Armor_TP008, 10, True)
  825. PlayerREF.RemoveItem(MTSE_Armor_TP009, 10, True)
  826. PlayerREF.RemoveItem(MTSE_Armor_TP010, 10, True)
  827. PlayerREF.RemoveItem(MTSE_Armor_TP011, 10, True)
  828. PlayerREF.RemoveItem(MTSE_Armor_TP012, 10, True)
  829. PlayerREF.RemoveItem(MTSE_Armor_TP013, 10, True)
  830. PlayerREF.RemoveItem(MTSE_Armor_TP014, 10, True)
  831. PlayerREF.RemoveItem(MTSE_Armor_TP015, 10, True)
  832. PlayerREF.RemoveItem(MTSE_Armor_TP016, 10, True)
  833. PlayerREF.RemoveItem(MTSE_Armor_TP017, 10, True)
  834. PlayerREF.RemoveItem(MTSE_Armor_TP018, 10, True)
  835. PlayerREF.RemoveItem(MTSE_Armor_TP019, 10, True)
  836. PlayerREF.RemoveItem(MTSE_Armor_TP020, 10, True)
  837. PlayerREF.RemoveItem(MTSE_Armor_TP021, 10, True)
  838. PlayerREF.RemoveItem(MTSE_Armor_TP022, 10, True)
  839. PlayerREF.RemoveItem(MTSE_Armor_TP023, 10, True)
  840. PlayerREF.RemoveItem(MTSE_Armor_TP024, 10, True)
  841. PlayerREF.RemoveItem(MTSE_Armor_TP025, 10, True)
  842. PlayerREF.RemoveItem(MTSE_Armor_TP026, 10, True)
  843. PlayerREF.RemoveItem(MTSE_Armor_TP027, 10, True)
  844. PlayerREF.RemoveItem(MTSE_Armor_TP028, 10, True)
  845.  
  846. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP001, 10, True)
  847. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP002, 10, True)
  848. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP003, 10, True)
  849. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP004, 10, True)
  850. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP005, 10, True)
  851. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP006, 10, True)
  852. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP007, 10, True)
  853. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP008, 10, True)
  854. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP009, 10, True)
  855. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP010, 10, True)
  856. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP011, 10, True)
  857. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP012, 10, True)
  858. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP013, 10, True)
  859. PlayerREF.RemoveItem(MTSE_Armor_Wb_TP014, 10, True)
  860.  
  861. EndFunction
  862.  
  863. Function Howl()
  864.  
  865. If PlayerREF.GetVoiceRecoveryTime() != 0
  866. Return
  867. EndIf
  868.  
  869. PlayerREF.SetVoiceRecoveryTime(35)
  870.  
  871. If PlayerREF.HasPerk(MTSE_Perk_HeightenedSenses) == False
  872. PlayerREF.AddPerk(MTSE_Perk_HeightenedSenses)
  873. EndIf
  874.  
  875. While (PlayerREF.GetAnimationVariableBool("bIsSynced"))
  876. Utility.Wait(0.1)
  877. EndWhile
  878.  
  879. MTSE_Spell_MoonHowl.Cast(PlayerREF)
  880.  
  881. If MTSE_Global_Appearance.GetValueInt() >= 29
  882. Int SoundID1 = MTSE_SoundMark_MoonRoar.Play(PlayerREF)
  883. Sound.SetInstanceVolume(SoundID1, MTSE_Global_MoonRoarVolume.GetValue())
  884. Else
  885. Int SoundID1 = MTSE_SoundMark_MoonHowl.Play(PlayerREF)
  886. Sound.SetInstanceVolume(SoundID1, MTSE_Global_MoonHowlVolume.GetValue())
  887. EndIf
  888.  
  889. PlayerREF.PlayIdle(MTSE_Idle_HowlStart)
  890. Utility.Wait(4.7)
  891. PlayerREF.PlayIdle(MTSE_Idle_HowlStop)
  892. MTSE_Spell_HeightenedSensesDuration.Cast(PlayerREF)
  893.  
  894. EndFunction
  895.  
  896. Function CombatMenu()
  897.  
  898. Int MenuSelect = MTSE_Message_CombatMenu.Show()
  899.  
  900. If MenuSelect == 0
  901. Return
  902.  
  903. ElseIf MenuSelect == 1
  904. MTSE_Spell_NightEye.Cast(PlayerREF)
  905. Return
  906.  
  907. ElseIf MenuSelect == 2
  908. MTSE_Spell_NightEye.Cast(PlayerREF)
  909. Return
  910.  
  911. ElseIf MenuSelect == 3
  912. If PlayerREF.GetRace() == WerewolfBeastRace
  913. If (PlayerWerewolfQuest.IsRunning() && PlayerWerewolfQuest.GetStage() < 100)
  914. PlayerWerewolfQuest.SetStage(100)
  915. EndIf
  916. If MTSE_Global_LunarTransformed.GetValueInt() == 1
  917. MTSE_Global_LunarTransformed.SetValueInt(0)
  918. (MTSE_Quest_LunarTransformBack as MTSE_Script_LunarTransformBack).UnRegister()
  919. EndIf
  920. EndIF
  921. Return
  922.  
  923. ElseIf MenuSelect == 4
  924. MTSE_Global_Sweep.SetValueInt(1)
  925. Return
  926.  
  927. ElseIf MenuSelect == 5
  928. MTSE_Global_Sweep.SetValueInt(0)
  929. Return
  930.  
  931. EndIf
  932.  
  933. EndFunction
  934.  
  935. Function WeaponSheathe()
  936.  
  937. If PlayerREF.GetRace() != WerewolfBeastRace
  938. Return
  939. EndIf
  940.  
  941. If C03.GetCurrentStageID() >= 15 && C03.GetCurrentStageID() < 25
  942. Return
  943. EndIf
  944.  
  945. Float CurrentTime = GameDaysPassed.GetValue()
  946. Float EndTime = CurrentTime + RealTimeSecondsToGameTimeDays(10)
  947.  
  948. If PlayerWerewolfShiftBackTime.GetValue() <= EndTime
  949. Return
  950. EndIf
  951.  
  952. If PlayerREF.GetAngleX() <= -18.0 ;&& (GameHour.GetValue() >= 20.0 || GameHour.GetValue() <= 5.0)
  953. If PlayerREF.HasPerk(MTSE_Perk_HowlAtTheMoon)
  954. Howl()
  955. EndIf
  956. ElseIf PlayerREF.GetAngleX() >= 18.0
  957. Else
  958. If PlayerREF.HasPerk(MTSE_Perk_RevertForm) || PlayerREF.HasPerk(MTSE_Perk_HunterInTheNight)
  959. CombatMenu()
  960. EndIf
  961. EndIf
  962.  
  963. EndFunction
  964.  
  965. Function Attack()
  966.  
  967. MTSE_Spell_ObjectDMG.Cast(PlayerREF, None)
  968.  
  969. EndFunction
  970.  
  971. Function CalculateMaxHealth()
  972.  
  973. BaseHealth = 0
  974. MaxHealth = 0
  975. BaseHealth = PlayerREF.GetBaseActorValue("Health")
  976. MaxHealth = BaseHealth
  977.  
  978. If PlayerREF.GetRace() == WerewolfBeastRace
  979. MaxHealth = MaxHealth + 50
  980. EndIf
  981.  
  982. If PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 4
  983. MaxHealth = MaxHealth + 200
  984. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 3
  985. MaxHealth = MaxHealth + 150
  986. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 2
  987. MaxHealth = MaxHealth + 125
  988. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 1
  989. MaxHealth = MaxHealth + 100
  990. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 4
  991. MaxHealth = MaxHealth + 150
  992. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 3
  993. MaxHealth = MaxHealth + 113
  994. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 2
  995. MaxHealth = MaxHealth + 94
  996. ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 1
  997. MaxHealth = MaxHealth + 75
  998. EndIf
  999.  
  1000. EndFunction
  1001.  
  1002. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1003. ; Moonlight Tales Special Edition | End
  1004. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1005.  
  1006. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1007. ;The End
  1008. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement