Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname PlayerWerewolfChangeScript extends Quest
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition
- ; Author: Brevi from sPwned.net
- ; Version: 1.25
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Actor Property PlayerREF Auto
- Armor Property MTSE_Armor_AncientRing Auto
- ;Werewolf Presets
- Armor Property MTSE_Armor_P001 Auto
- Armor Property MTSE_Armor_P002 Auto
- Armor Property MTSE_Armor_P003 Auto
- Armor Property MTSE_Armor_P004 Auto
- Armor Property MTSE_Armor_P005 Auto
- Armor Property MTSE_Armor_P006 Auto
- Armor Property MTSE_Armor_P007 Auto
- Armor Property MTSE_Armor_P008 Auto
- Armor Property MTSE_Armor_P009 Auto
- Armor Property MTSE_Armor_P010 Auto
- Armor Property MTSE_Armor_P011 Auto
- Armor Property MTSE_Armor_P012 Auto
- Armor Property MTSE_Armor_P013 Auto
- Armor Property MTSE_Armor_P014 Auto
- Armor Property MTSE_Armor_P015 Auto
- Armor Property MTSE_Armor_P016 Auto
- Armor Property MTSE_Armor_P017 Auto
- Armor Property MTSE_Armor_P018 Auto
- Armor Property MTSE_Armor_P019 Auto
- Armor Property MTSE_Armor_P020 Auto
- Armor Property MTSE_Armor_P021 Auto
- Armor Property MTSE_Armor_P022 Auto
- Armor Property MTSE_Armor_P023 Auto
- Armor Property MTSE_Armor_P024 Auto
- Armor Property MTSE_Armor_P025 Auto
- Armor Property MTSE_Armor_P026 Auto
- Armor Property MTSE_Armor_P027 Auto
- Armor Property MTSE_Armor_P028 Auto
- ;Werebear Presets
- Armor Property MTSE_Armor_Wb_P001 Auto
- Armor Property MTSE_Armor_Wb_P002 Auto
- Armor Property MTSE_Armor_Wb_P003 Auto
- Armor Property MTSE_Armor_Wb_P004 Auto
- Armor Property MTSE_Armor_Wb_P005 Auto
- Armor Property MTSE_Armor_Wb_P006 Auto
- Armor Property MTSE_Armor_Wb_P007 Auto
- Armor Property MTSE_Armor_Wb_P008 Auto
- Armor Property MTSE_Armor_Wb_P009 Auto
- Armor Property MTSE_Armor_Wb_P010 Auto
- Armor Property MTSE_Armor_Wb_P011 Auto
- Armor Property MTSE_Armor_Wb_P012 Auto
- Armor Property MTSE_Armor_Wb_P013 Auto
- Armor Property MTSE_Armor_Wb_P014 Auto
- ;Werewolf Transformation Effect Presets
- Armor Property MTSE_Armor_TP001 Auto
- Armor Property MTSE_Armor_TP002 Auto
- Armor Property MTSE_Armor_TP003 Auto
- Armor Property MTSE_Armor_TP004 Auto
- Armor Property MTSE_Armor_TP005 Auto
- Armor Property MTSE_Armor_TP006 Auto
- Armor Property MTSE_Armor_TP007 Auto
- Armor Property MTSE_Armor_TP008 Auto
- Armor Property MTSE_Armor_TP009 Auto
- Armor Property MTSE_Armor_TP010 Auto
- Armor Property MTSE_Armor_TP011 Auto
- Armor Property MTSE_Armor_TP012 Auto
- Armor Property MTSE_Armor_TP013 Auto
- Armor Property MTSE_Armor_TP014 Auto
- Armor Property MTSE_Armor_TP015 Auto
- Armor Property MTSE_Armor_TP016 Auto
- Armor Property MTSE_Armor_TP017 Auto
- Armor Property MTSE_Armor_TP018 Auto
- Armor Property MTSE_Armor_TP019 Auto
- Armor Property MTSE_Armor_TP020 Auto
- Armor Property MTSE_Armor_TP021 Auto
- Armor Property MTSE_Armor_TP022 Auto
- Armor Property MTSE_Armor_TP023 Auto
- Armor Property MTSE_Armor_TP024 Auto
- Armor Property MTSE_Armor_TP025 Auto
- Armor Property MTSE_Armor_TP026 Auto
- Armor Property MTSE_Armor_TP027 Auto
- Armor Property MTSE_Armor_TP028 Auto
- ;Werebear Transformation Effect Presets
- Armor Property MTSE_Armor_Wb_TP001 Auto
- Armor Property MTSE_Armor_Wb_TP002 Auto
- Armor Property MTSE_Armor_Wb_TP003 Auto
- Armor Property MTSE_Armor_Wb_TP004 Auto
- Armor Property MTSE_Armor_Wb_TP005 Auto
- Armor Property MTSE_Armor_Wb_TP006 Auto
- Armor Property MTSE_Armor_Wb_TP007 Auto
- Armor Property MTSE_Armor_Wb_TP008 Auto
- Armor Property MTSE_Armor_Wb_TP009 Auto
- Armor Property MTSE_Armor_Wb_TP010 Auto
- Armor Property MTSE_Armor_Wb_TP011 Auto
- Armor Property MTSE_Armor_Wb_TP012 Auto
- Armor Property MTSE_Armor_Wb_TP013 Auto
- Armor Property MTSE_Armor_Wb_TP014 Auto
- GlobalVariable Property MTSE_Global_Sweep Auto
- GlobalVariable Property MTSE_Global_Difficulty Auto
- GlobalVariable Property MTSE_Global_Rejuvenation Auto
- GlobalVariable Property MTSE_Global_LunarTransformed Auto
- GlobalVariable Property MTSE_Global_NightEye Auto
- GlobalVariable Property MTSE_Global_Appearance Auto
- GlobalVariable Property MTSE_Global_TransformBackAnimation Auto
- GlobalVariable Property MTSE_Global_MoonRoarVolume Auto
- GlobalVariable Property MTSE_Global_MoonHowlVolume Auto
- Idle Property MTSE_Idle_BleedOutStart Auto
- Idle Property MTSE_Idle_HowlStart Auto
- Idle Property MTSE_Idle_HowlStop Auto
- EffectShader Property WerewolfTrans02FXS Auto
- Message Property MTSE_Message_CombatMenu Auto
- Perk Property MTSE_Perk_HircinesBlessing1 Auto
- Perk Property MTSE_Perk_HircinesBlessing2 Auto
- Perk Property MTSE_Perk_AspectOfHircine Auto
- Perk Property MTSE_Perk_HeightenedSenses Auto
- Perk Property MTSE_Perk_HowlAtTheMoon Auto
- Perk Property MTSE_Perk_SavageFeeding2 Auto
- Perk Property MTSE_Perk_HunterInTheNight Auto
- Perk Property MTSE_Perk_RevertForm Auto
- Perk Property MTSE_Perk_EnduranceOfTheWolf1 Auto
- Quest Property PlayerWerewolfQuest Auto
- Quest Property C03 Auto
- Quest Property MTSE_Quest_LunarTransformBack Auto
- Shout Property MTSE_Shout_WerewolfRoar Auto
- Sound Property MTSE_SoundMark_MoonRoar Auto
- Sound Property MTSE_SoundMark_MoonHowl Auto
- Spell Property MTSE_Spell_HeightenedSensesDuration Auto
- Spell Property MTSE_Spell_MoonHowl Auto
- Spell Property MTSE_Spell_SavageFeeding Auto
- Spell Property MTSE_Spell_NightEye Auto
- Spell Property MTSE_Spell_ObjectDMG Auto
- WordOfPower Property MTSE_Word_WerewolfRoar1 Auto
- WordOfPower Property MTSE_Word_WerewolfRoar2 Auto
- WordOfPower Property MTSE_Word_WerewolfRoar3 Auto
- Float MTSE_HealthPercentage = 0.0
- Float MTSE_MaxHealth = 0.0
- Float BaseHealth = 0.0
- Float MaxHealth = 0.0
- Float Heal = 0.0
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- float Property StandardDurationSeconds auto
- {How long (in real seconds) the transformation lasts}
- float Property DurationWarningTimeSeconds auto
- {How long (in real seconds) before turning back we should warn the player}
- float Property FeedExtensionTimeSeconds auto
- {How long (in real seconds) that feeding extends werewolf time}
- VisualEffect property FeedBloodVFX auto
- {Visual Effect on Wolf for Feeding Blood}
- Race Property WerewolfBeastRace auto
- ObjectReference Property LycanStash auto
- Perk Property PlayerWerewolfFeed auto
- Faction Property PlayerWerewolfFaction auto
- Faction Property WerewolfFaction auto
- Message Property PlayerWerewolfExpirationWarning auto
- Message Property PlayerWerewolfFeedMessage auto
- GlobalVariable Property GameDaysPassed auto
- GlobalVariable Property TimeScale auto
- GlobalVariable Property PlayerWerewolfShiftBackTime auto
- ImageSpaceModifier Property WerewolfWarn auto
- ImageSpaceModifier Property WerewolfChange auto
- Race Property WerewolfRace auto
- Sound Property NPCWerewolfTransformation auto
- Sound Property WerewolfIMODSound auto
- Idle Property WerewolfTransformBack auto
- Idle Property SpecialFeeding auto
- Quest Property CompanionsTrackingQuest auto
- Quest Property C03Rampage auto
- Shout Property CurrentHowl auto
- WordOfPower Property CurrentHowlWord1 auto
- WordOfPower Property CurrentHowlWord2 auto
- WordOfPower Property CurrentHowlWord3 auto
- Spell Property PlayerWerewolfLvl10AndBelowAbility auto
- Spell Property PlayerWerewolfLvl15AndBelowAbility auto
- Spell Property PlayerWerewolfLvl20AndBelowAbility auto
- Spell Property PlayerWerewolfLvl25AndBelowAbility auto
- Spell Property PlayerWerewolfLvl30AndBelowAbility auto
- Spell Property PlayerWerewolfLvl35AndBelowAbility auto
- Spell Property PlayerWerewolfLvl40AndBelowAbility auto
- Spell Property PlayerWerewolfLvl45AndBelowAbility auto
- Spell Property PlayerWerewolfLvl50AndOverAbility auto
- Spell Property FeedBoost auto
- Spell property BleedingFXSpell auto
- {This Spell is for making the target of feeding bleed.}
- Armor Property WolfSkinFXArmor auto
- bool Property Untimed auto
- FormList Property CrimeFactions auto
- FormList Property WerewolfDispelList auto
- float __durationWarningTime = -1.0
- float __feedExtensionTime = -1.0
- float __gorgeExtensionTime = -1.0
- bool __tryingToShiftBack = false
- bool __shiftingBack = false
- bool __shuttingDown = false
- bool __trackingStarted = false
- Float Property DLC1GorgingDurationSeconds Auto
- Perk Property DLC1GorgingPerk Auto
- Perk Property DLC1SavageFeedingPerk Auto
- Keyword Property ActorTypeNPC Auto
- Perk Property DLC1AnimalVigor Auto
- GlobalVariable Property DLC1WerewolfTotalPerksEarned Auto
- GlobalVariable Property DLC1WerewolfMaxPerks Auto
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;Events
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Event OnUpdate()
- if (Untimed)
- return
- endif
- ; Debug.Trace("WEREWOLF: NumWerewolfPerks = " + Game.QueryStat("NumWerewolfPerks"))
- if Game.QueryStat("NumWerewolfPerks") >= DLC1WerewolfMaxPerks.Value
- ; debug.trace("WEREWOLF: achievement granted")
- Game.AddAchievement(57)
- endif
- float currentTime = GameDaysPassed.GetValue()
- float regressTime = PlayerWerewolfShiftBackTime.GetValue()
- if ( (currentTime >= regressTime) && (!PlayerREF.IsInKillMove()) && !__tryingToShiftBack )
- UnregisterForUpdate()
- SetStage(100) ; time to go, buddy
- return
- endif
- if (currentTime >= regressTime - __durationWarningTime)
- if (GetStage() == 10)
- SetStage(20) ; almost there
- return
- endif
- endif
- ; Debug.Trace("WEREWOLF: Checking, still have " + GameTimeDaysToRealTimeSeconds(regressTime - currentTime) + " seconds to go.")
- EndEvent
- Event OnAnimationEvent(ObjectReference akSource, string asEventName)
- if (asEventName == "TransformToHuman")
- ActuallyShiftBackIfNecessary()
- endif
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- If (asEventName == "WeaponSheathe")
- WeaponSheathe()
- Endif
- If (asEventName == "WeaponSwing") || (asEventName == "WeaponLeftSwing")
- Attack()
- Endif
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- EndEvent
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;Functions
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- float Function RealTimeSecondsToGameTimeDays(float realtime)
- float scaledSeconds = realtime * TimeScale.Value
- return scaledSeconds / (60 * 60 * 24)
- EndFunction
- float Function GameTimeDaysToRealTimeSeconds(float gametime)
- float gameSeconds = gametime * (60 * 60 * 24)
- return (gameSeconds / TimeScale.Value)
- EndFunction
- Function PrepShift()
- ; Debug.Trace("WEREWOLF: Prepping shift...")
- Actor player = PlayerREF
- ; sets up the UI restrictions
- Game.SetBeastForm(True)
- Game.EnableFastTravel(False)
- ; set up perks/abilities
- ; (don't need to do this anymore since it's on from gamestart)
- ; PlayerREF.AddPerk(PlayerWerewolfFeed)
- ; screen effect
- WerewolfChange.Apply()
- WerewolfIMODSound.Play(PlayerREF)
- ; get rid of your summons
- int count = 0
- while (count < WerewolfDispelList.GetSize())
- Spell gone = WerewolfDispelList.GetAt(count) as Spell
- if (gone != None)
- PlayerREF.DispelSpell(gone)
- endif
- count += 1
- endwhile
- Game.DisablePlayerControls(abMovement = false, abFighting = false, abCamSwitch = true, abMenu = false, abActivate = false, abJournalTabs = false, aiDisablePOVType = 1)
- Game.ForceThirdPerson()
- Game.ShowFirstPersonGeometry(false)
- EndFunction
- Function InitialShift()
- ; Debug.Trace("WEREWOLF: Player beginning transformation.")
- WerewolfWarn.Apply()
- if (PlayerREF.IsDead())
- ; Debug.Trace("WEREWOLF: Player is dead; bailing out.")
- return
- endif
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- PlayerREF.UnequipItem(MTSE_Armor_AncientRing, False, True)
- If PlayerREF.HasPerk(MTSE_Perk_EnduranceOfTheWolf1)
- PlayerREF.RestoreActorValue("Health", 999999999999)
- Utility.Wait(0.1)
- EndIf
- MTSE_Global_Rejuvenation.SetValueInt(1)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; actual switch
- PlayerREF.SetRace(WerewolfBeastRace)
- EndFunction
- Function StartTracking()
- if (__trackingStarted)
- return
- endif
- __trackingStarted = true
- ; Debug.Trace("WEREWOLF: Race swap done; starting tracking and effects.")
- ; take all the player's stuff (since he/she can't use it anyway)
- ; PlayerREF.RemoveAllItems(LycanStash)
- PlayerREF.UnequipAll()
- PlayerREF.EquipItem(WolfSkinFXArmor, False, True)
- ;Add Blood Effects
- ;FeedBloodVFX.Play(PlayerREF)
- ; make everyone hate you
- PlayerREF.SetAttackActorOnSight(true)
- ; alert anyone nearby that they should now know the player is a werewolf
- Game.SendWereWolfTransformation()
- PlayerREF.AddToFaction(PlayerWerewolfFaction)
- PlayerREF.AddToFaction(WerewolfFaction)
- int cfIndex = 0
- ;while (cfIndex < CrimeFactions.GetSize())
- ; ;Debug.Trace("WEREWOLF: Setting enemy flag on " + CrimeFactions.GetAt(cfIndex))
- ;(CrimeFactions.GetAt(cfIndex) as Faction).SetPlayerEnemy()
- ;cfIndex += 1
- ;endwhile
- ; but they also don't know that it's you
- Game.SetPlayerReportCrime(false)
- ; recalc times
- __durationWarningTime = RealTimeSecondsToGameTimeDays(DurationWarningTimeSeconds)
- __feedExtensionTime = RealTimeSecondsToGameTimeDays(FeedExtensionTimeSeconds)
- __gorgeExtensionTime = RealTimeSecondsToGameTimeDays(DLC1GorgingDurationSeconds)
- ; unequip magic
- Spell left = PlayerREF.GetEquippedSpell(0)
- Spell right = PlayerREF.GetEquippedSpell(1)
- Spell power = PlayerREF.GetEquippedSpell(2)
- Shout voice = PlayerREF.GetEquippedShout()
- if (left != None)
- PlayerREF.UnequipSpell(left, 0)
- endif
- if (right != None)
- PlayerREF.UnequipSpell(right, 1)
- endif
- if (power != None)
- ; some players are overly clever and sneak a power equip between casting
- ; beast form and when we rejigger them there. this will teach them.
- ; Debug.Trace("WEREWOLF: " + power + " was equipped; removing.")
- PlayerREF.UnequipSpell(power, 2)
- else
- ; Debug.Trace("WEREWOLF: No power equipped.")
- endif
- if (voice != None)
- ; same deal here, but for shouts
- ; Debug.Trace("WEREWOLF: " + voice + " was equipped; removing.")
- PlayerREF.UnequipShout(voice)
- else
- ; Debug.Trace("WEREWOLF: No shout equipped.")
- endif
- ; but make up for it by giving you the sweet howl
- CurrentHowlWord1 = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowlWord1
- CurrentHowlWord2 = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowlWord2
- CurrentHowlWord3 = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowlWord3
- CurrentHowl = (CompanionsTrackingQuest as CompanionsHousekeepingScript).CurrentHowl
- Game.UnlockWord(MTSE_Word_WerewolfRoar1)
- Game.UnlockWord(MTSE_Word_WerewolfRoar2)
- Game.UnlockWord(MTSE_Word_WerewolfRoar3)
- PlayerREF.AddShout(MTSE_Shout_WerewolfRoar)
- PlayerREF.EquipShout(MTSE_Shout_WerewolfRoar)
- ; and some rad claws
- int playerLevel = PlayerREF.GetLevel()
- if (playerLevel <= 10)
- PlayerREF.AddSpell(PlayerWerewolfLvl10AndBelowAbility, false)
- elseif (playerLevel <= 15)
- PlayerREF.AddSpell(PlayerWerewolfLvl15AndBelowAbility, false)
- elseif (playerLevel <= 20)
- PlayerREF.AddSpell(PlayerWerewolfLvl20AndBelowAbility, false)
- elseif (playerLevel <= 25)
- PlayerREF.AddSpell(PlayerWerewolfLvl25AndBelowAbility, false)
- elseif (playerLevel <= 30)
- PlayerREF.AddSpell(PlayerWerewolfLvl30AndBelowAbility, false)
- elseif (playerLevel <= 35)
- PlayerREF.AddSpell(PlayerWerewolfLvl35AndBelowAbility, false)
- elseif (playerLevel <= 40)
- PlayerREF.AddSpell(PlayerWerewolfLvl40AndBelowAbility, false)
- elseif (playerLevel <= 45)
- PlayerREF.AddSpell(PlayerWerewolfLvl45AndBelowAbility, false)
- else
- PlayerREF.AddSpell(PlayerWerewolfLvl50AndOverAbility, false)
- endif
- ; calculate when the player turns back into a pumpkin
- float currentTime = GameDaysPassed.GetValue()
- float regressTime = currentTime + RealTimeSecondsToGameTimeDays(StandardDurationSeconds)
- PlayerWerewolfShiftBackTime.SetValue(regressTime)
- ; Debug.Trace("WEREWOLF: Current day -- " + currentTime)
- ; Debug.Trace("WEREWOLF: Player will turn back at day " + regressTime)
- ; increment stats
- Game.IncrementStat("Werewolf Transformations")
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- RegisterForAnimationEvent(PlayerREF, "WeaponDraw")
- RegisterForAnimationEvent(PlayerREF, "WeaponSheathe")
- RegisterForAnimationEvent(PlayerREF, "WeaponSwing")
- RegisterForAnimationEvent(PlayerREF, "WeaponLeftSwing")
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; set us up to check when we turn back
- RegisterForUpdate(5)
- SetStage(10) ; we're done with the transformation handling
- EndFunction
- Function SetUntimed(bool untimedValue)
- Untimed = untimedValue
- if (Untimed)
- UnregisterForUpdate()
- endif
- EndFunction
- ; called from stage 11
- Function Feed(Actor victim)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- PlayerREF.PlayIdle(SpecialFeeding)
- BleedingFXSpell.Cast(victim,victim)
- If !C03Rampage.IsRunning()
- If victim.HasKeyword(ActorTypeNPC)
- PlayerWerewolfShiftBackTime.SetValue(PlayerWerewolfShiftBackTime.GetValue() + RealTimeSecondsToGameTimeDays(30))
- ElseIf !victim.HasKeyword(ActorTypeNPC) && PlayerREF.HasPerk(MTSE_Perk_SavageFeeding2)
- PlayerWerewolfShiftBackTime.SetValue(PlayerWerewolfShiftBackTime.GetValue() + RealTimeSecondsToGameTimeDays(21))
- Else
- PlayerWerewolfShiftBackTime.SetValue(PlayerWerewolfShiftBackTime.GetValue() + RealTimeSecondsToGameTimeDays(15))
- EndIf
- If MTSE_Global_LunarTransformed.GetValueInt() == 0
- PlayerWerewolfFeedMessage.Show()
- EndIf
- CalculateMaxHealth()
- If PlayerREF.HasPerk(MTSE_Perk_AspectOfHircine)
- Heal = MaxHealth * 0.5
- PlayerREF.RestoreActorValue("Health", Heal)
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2)
- Heal = MaxHealth * 0.4
- PlayerREF.RestoreActorValue("Health", Heal)
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1)
- Heal = MaxHealth * 0.3
- PlayerREF.RestoreActorValue("Health", Heal)
- Else
- FeedBoost.Cast(PlayerREF)
- EndIf
- If PlayerREF.HasPerk(MTSE_Perk_SavageFeeding2)
- MTSE_Spell_SavageFeeding.Cast(PlayerREF)
- EndIf
- EndIf
- SetStage(10)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- EndFunction
- ; called from stage 20
- Function WarnPlayer()
- ; Debug.Trace("WEREWOLF: Player about to transform back.")
- WerewolfWarn.Apply()
- EndFunction
- ; called from stage 100
- Function ShiftBack()
- __tryingToShiftBack = true
- while (PlayerREF.GetAnimationVariableBool("bIsSynced"))
- ; Debug.Trace("WEREWOLF: Waiting for synced animation to finish...")
- Utility.Wait(0.1)
- endwhile
- ; Debug.Trace("WEREWOLF: Sending transform event to turn player back to normal.")
- __shiftingBack = false
- ; RegisterForAnimationEvent(PlayerREF, "TransformToHuman")
- ; PlayerREF.PlayIdle(WerewolfTransformBack)
- ; Utility.Wait(10)
- ActuallyShiftBackIfNecessary()
- EndFunction
- Function ActuallyShiftBackIfNecessary()
- if (__shiftingBack)
- return
- endif
- __shiftingBack = true
- ; Debug.Trace("WEREWOLF: Player returning to normal.")
- Game.SetInCharGen(true, true, false)
- UnRegisterForAnimationEvent(PlayerREF, "TransformToHuman")
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- If MTSE_Global_NightEye.GetValueInt() != 0
- MTSE_Spell_NightEye.Cast(PlayerREF)
- EndIf
- UnRegisterForAnimationEvent(PlayerREF, "WeaponDraw")
- UnRegisterForAnimationEvent(PlayerREF, "WeaponSheathe")
- UnRegisterForAnimationEvent(PlayerREF, "WeaponSwing")
- UnRegisterForAnimationEvent(PlayerREF, "WeaponLeftSwing")
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- UnRegisterForUpdate() ; just in case
- if (PlayerREF.IsDead())
- ; Debug.Trace("WEREWOLF: Player is dead; bailing out.")
- return
- endif
- ;Remove Blood Effects
- ;FeedBloodVFX.Stop(PlayerREF)
- ; imod
- WerewolfChange.Apply()
- WerewolfIMODSound.Play(PlayerREF)
- ; get rid of your summons if you have any
- int count = 0
- while (count < WerewolfDispelList.GetSize())
- Spell gone = WerewolfDispelList.GetAt(count) as Spell
- if (gone != None)
- ; Debug.Trace("WEREWOLF: Dispelling " + gone)
- PlayerREF.DispelSpell(gone)
- endif
- count += 1
- endwhile
- ; make sure the transition armor is gone. We RemoveItem here, because the SetRace stored all equipped items
- ; at that time, and we equip this armor prior to setting the player to a beast race. When we switch back,
- ; if this were still in the player's inventory it would be re-equipped.
- PlayerREF.SetGhost()
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- If MTSE_Global_TransformBackAnimation.GetValueInt() == 1
- PlayerREF.PlayIdle(MTSE_Idle_BleedOutStart)
- Utility.Wait(2)
- WerewolfTrans02FXS.Play(PlayerREF,-1.0)
- Utility.Wait(1)
- EndIf
- RemoveTransformationEffect()
- AppearanceCleanUp()
- CalculateMaxHealth()
- MTSE_HealthPercentage = (PlayerREF.GetActorValue("Health") / MaxHealth)
- PlayerREF.RestoreActorValue("Health", 999999999999)
- Utility.Wait(0.1)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; change you back
- ; Debug.Trace("WEREWOLF: Setting race " + (CompanionsTrackingQuest as CompanionsHousekeepingScript).PlayerOriginalRace + " on " + PlayerREF)
- PlayerREF.SetRace((CompanionsTrackingQuest as CompanionsHousekeepingScript).PlayerOriginalRace)
- ; release the player controls
- ; Debug.Trace("WEREWOLF: Restoring camera controls")
- Game.EnablePlayerControls(abMovement = false, abFighting = false, abCamSwitch = true, abLooking = false, abSneaking = false, abMenu = false, abActivate = false, abJournalTabs = false, aiDisablePOVType = 1)
- Game.ShowFirstPersonGeometry(true)
- ; no more howling for you
- PlayerREF.UnequipShout(MTSE_Shout_WerewolfRoar)
- PlayerREF.RemoveShout(MTSE_Shout_WerewolfRoar)
- ; or those claws
- PlayerREF.RemoveSpell(PlayerWerewolfLvl10AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl15AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl20AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl25AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl30AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl35AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl40AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl45AndBelowAbility)
- PlayerREF.RemoveSpell(PlayerWerewolfLvl50AndOverAbility)
- ; gimme back mah stuff
- ; LycanStash.RemoveAllItems(PlayerREF)
- ; people don't hate you no more
- PlayerREF.SetAttackActorOnSight(false)
- PlayerREF.RemoveFromFaction(PlayerWerewolfFaction)
- PlayerREF.RemoveFromFaction(WerewolfFaction)
- int cfIndex = 0
- while (cfIndex < CrimeFactions.GetSize())
- ; Debug.Trace("WEREWOLF: Removing enemy flag from " + CrimeFactions.GetAt(cfIndex))
- (CrimeFactions.GetAt(cfIndex) as Faction).SetPlayerEnemy(false)
- cfIndex += 1
- endwhile
- ; and you're now recognized
- Game.SetPlayerReportCrime(true)
- ; alert anyone nearby that they should now know the player is a werewolf
- Game.SendWereWolfTransformation()
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- MTSE_MaxHealth = (PlayerREF.GetActorValue("Health") / PlayerREF.GetActorValuePercentage("Health"))
- If PlayerREF.GetActorValuePercentage("Health") > MTSE_HealthPercentage
- PlayerREF.DamageActorValue("Health", (MTSE_MaxHealth * (1 - MTSE_HealthPercentage)))
- EndIf
- WerewolfTrans02FXS.Stop(PlayerREF)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; give the set race event a chance to come back, otherwise shut us down
- Utility.Wait(5)
- Shutdown()
- EndFunction
- Function Shutdown()
- if (__shuttingDown)
- return
- endif
- __shuttingDown = true
- PlayerREF.GetActorBase().SetInvulnerable(false)
- PlayerREF.SetGhost(false)
- Game.SetBeastForm(False)
- Game.EnableFastTravel(True)
- Game.SetInCharGen(false, false, false)
- Stop()
- EndFunction
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | Start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Function AppearanceCleanUp()
- PlayerREF.RemoveItem(MTSE_Armor_P001, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P002, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P003, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P004, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P005, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P006, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P007, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P008, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P009, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P010, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P011, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P012, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P013, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P014, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P015, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P016, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P017, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P018, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P019, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P020, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P021, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P022, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P023, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P024, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P025, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P026, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P027, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_P028, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P001, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P002, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P003, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P004, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P005, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P006, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P007, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P008, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P009, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P010, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P011, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P012, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P013, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_P014, 10, True)
- EndFunction
- Function RemoveTransformationEffect()
- PlayerREF.RemoveItem(WolfSkinFXArmor, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP001, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP002, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP003, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP004, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP005, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP006, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP007, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP008, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP009, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP010, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP011, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP012, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP013, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP014, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP015, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP016, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP017, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP018, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP019, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP020, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP021, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP022, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP023, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP024, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP025, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP026, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP027, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_TP028, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP001, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP002, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP003, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP004, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP005, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP006, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP007, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP008, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP009, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP010, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP011, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP012, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP013, 10, True)
- PlayerREF.RemoveItem(MTSE_Armor_Wb_TP014, 10, True)
- EndFunction
- Function Howl()
- If PlayerREF.GetVoiceRecoveryTime() != 0
- Return
- EndIf
- PlayerREF.SetVoiceRecoveryTime(35)
- If PlayerREF.HasPerk(MTSE_Perk_HeightenedSenses) == False
- PlayerREF.AddPerk(MTSE_Perk_HeightenedSenses)
- EndIf
- While (PlayerREF.GetAnimationVariableBool("bIsSynced"))
- Utility.Wait(0.1)
- EndWhile
- MTSE_Spell_MoonHowl.Cast(PlayerREF)
- If MTSE_Global_Appearance.GetValueInt() >= 29
- Int SoundID1 = MTSE_SoundMark_MoonRoar.Play(PlayerREF)
- Sound.SetInstanceVolume(SoundID1, MTSE_Global_MoonRoarVolume.GetValue())
- Else
- Int SoundID1 = MTSE_SoundMark_MoonHowl.Play(PlayerREF)
- Sound.SetInstanceVolume(SoundID1, MTSE_Global_MoonHowlVolume.GetValue())
- EndIf
- PlayerREF.PlayIdle(MTSE_Idle_HowlStart)
- Utility.Wait(4.7)
- PlayerREF.PlayIdle(MTSE_Idle_HowlStop)
- MTSE_Spell_HeightenedSensesDuration.Cast(PlayerREF)
- EndFunction
- Function CombatMenu()
- Int MenuSelect = MTSE_Message_CombatMenu.Show()
- If MenuSelect == 0
- Return
- ElseIf MenuSelect == 1
- MTSE_Spell_NightEye.Cast(PlayerREF)
- Return
- ElseIf MenuSelect == 2
- MTSE_Spell_NightEye.Cast(PlayerREF)
- Return
- ElseIf MenuSelect == 3
- If PlayerREF.GetRace() == WerewolfBeastRace
- If (PlayerWerewolfQuest.IsRunning() && PlayerWerewolfQuest.GetStage() < 100)
- PlayerWerewolfQuest.SetStage(100)
- EndIf
- If MTSE_Global_LunarTransformed.GetValueInt() == 1
- MTSE_Global_LunarTransformed.SetValueInt(0)
- (MTSE_Quest_LunarTransformBack as MTSE_Script_LunarTransformBack).UnRegister()
- EndIf
- EndIF
- Return
- ElseIf MenuSelect == 4
- MTSE_Global_Sweep.SetValueInt(1)
- Return
- ElseIf MenuSelect == 5
- MTSE_Global_Sweep.SetValueInt(0)
- Return
- EndIf
- EndFunction
- Function WeaponSheathe()
- If PlayerREF.GetRace() != WerewolfBeastRace
- Return
- EndIf
- If C03.GetCurrentStageID() >= 15 && C03.GetCurrentStageID() < 25
- Return
- EndIf
- Float CurrentTime = GameDaysPassed.GetValue()
- Float EndTime = CurrentTime + RealTimeSecondsToGameTimeDays(10)
- If PlayerWerewolfShiftBackTime.GetValue() <= EndTime
- Return
- EndIf
- If PlayerREF.GetAngleX() <= -18.0 ;&& (GameHour.GetValue() >= 20.0 || GameHour.GetValue() <= 5.0)
- If PlayerREF.HasPerk(MTSE_Perk_HowlAtTheMoon)
- Howl()
- EndIf
- ElseIf PlayerREF.GetAngleX() >= 18.0
- Else
- If PlayerREF.HasPerk(MTSE_Perk_RevertForm) || PlayerREF.HasPerk(MTSE_Perk_HunterInTheNight)
- CombatMenu()
- EndIf
- EndIf
- EndFunction
- Function Attack()
- MTSE_Spell_ObjectDMG.Cast(PlayerREF, None)
- EndFunction
- Function CalculateMaxHealth()
- BaseHealth = 0
- MaxHealth = 0
- BaseHealth = PlayerREF.GetBaseActorValue("Health")
- MaxHealth = BaseHealth
- If PlayerREF.GetRace() == WerewolfBeastRace
- MaxHealth = MaxHealth + 50
- EndIf
- If PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 4
- MaxHealth = MaxHealth + 200
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 3
- MaxHealth = MaxHealth + 150
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 2
- MaxHealth = MaxHealth + 125
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing2) && MTSE_Global_Difficulty.GetValueInt() == 1
- MaxHealth = MaxHealth + 100
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 4
- MaxHealth = MaxHealth + 150
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 3
- MaxHealth = MaxHealth + 113
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 2
- MaxHealth = MaxHealth + 94
- ElseIf PlayerREF.HasPerk(MTSE_Perk_HircinesBlessing1) && MTSE_Global_Difficulty.GetValueInt() == 1
- MaxHealth = MaxHealth + 75
- EndIf
- EndFunction
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Moonlight Tales Special Edition | End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;The End
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement