Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname DLC1PlayerVampireChangeScript extends Quest conditional
- spell Property VampireDrain01 Auto
- Quest Property VampireTrackingQuest Auto
- faction Property PlayerVampireFaction Auto
- spell Property DLC1VampireRaiseDeadLeftHand03 Auto
- spell Property DLC1PlayerVampireLvl10AndBelowAbility Auto
- spell Property DLC1SupernaturalReflexes Auto
- perk Property DLC1UnearthlyWill Auto
- globalvariable Property GameDaysPassed Auto
- globalvariable Property DLC1BloodMagic Auto
- globalvariable Property DLC1VampireTotalPerksEarned Auto
- spell Property VampireSunDamage04 Auto
- spell Property VampireCharm Auto
- String Property BiteStart Auto
- spell Property LeveledRaiseDeadSpell Auto
- spell Property VampireDrain02 Auto
- globalvariable Property DLC1VampireMaxPerks Auto
- effectshader Property DLC1VampireChangeBack02FXS Auto
- {How long (in real seconds) that feeding extends vampire time}
- Float Property UnearthlyWillExtensionTimeSeconds Auto
- Bool Property Untimed Auto
- spell Property DLC1PlayerVampireLvl20AndBelowAbility Auto
- spell Property DLC1NightCloak Auto
- perk Property DLC1VampireBite Auto
- Quest Property DialogueGenericVampire Auto
- spell Property DLC1CorpseCurse Auto
- Bool Property DLC1HasLightfoot Auto
- spell Property AbVampire04 Auto
- spell Property VampireSunDamage01 Auto
- armor Property beastRing Auto
- faction Property HunterFaction Auto
- {How long (in real seconds) the transformation lasts}
- Float Property StandardDurationSeconds Auto
- armor Property gargNecklace Auto
- perk Property DLC1NightCloakPerk Auto
- {Spell FX Art holder for Levitation Glow.}
- spell Property DLC1AbVampireFloatBodyFX Auto
- message Property DLC1VampirePerkEarned Auto
- magiceffect Property DLC1RevertEffect Auto
- spell Property DLC1VampireRaiseDeadLeftHand02 Auto
- {This Global tracks what state the Vampire Lord is in: 0 = Not a Vampire Lord, 1 = Walking, 2 = Levitating}
- globalvariable Property DCL1VampireLevitateStateGlobal Auto
- String Property LandStart Auto
- String Property TransformToHuman Auto
- playervampirequestscript Property PlayerVampireQuest Auto
- spell Property VampireRaiseThrall03 Auto
- spell Property CurrentEquippedLeftSpell Auto
- perk Property DLC1VampiricGrip Auto
- spell Property VampireHuntersSight Auto
- spell Property DLC1ConjureGargoyleLeftHand Auto
- perk Property DLC1CorpseCursePerk Auto
- perk Property DLC1SupernaturalReflexesPerk Auto
- sound Property NPCVampireTransformation Auto
- globalvariable Property DLC1VampirePerkPoints Auto
- spell Property DLC1PlayerVampireLvl50AndOverAbility Auto
- perk Property DLC1MistFormPerk Auto
- globalvariable Property pDLC1nVampireNecklaceGargoyle Auto
- perk Property DLC1DetectLifePerk Auto
- imagespacemodifier Property VampireWarn Auto
- spell Property DLC1VampireChange Auto
- spell Property DLC1VampireLordSunDamage Auto
- armor Property DLC1VampireLordArmor Auto
- spell Property VampireInvisibilityPC Auto
- armor Property batNecklace Auto
- sound Property VampireIMODSound Auto
- spell Property DLC1VampireBats Auto
- spell Property DLC1VampireDrain09 Auto
- effectshader Property DLC1VampireChangeBackFXS Auto
- perk Property DLC1GargoylePerk Auto
- spell Property DLC1VampireDrain08 Auto
- spell Property DLC1Revert Auto
- spell Property LeveledDrainSpell Auto
- spell Property VampireRaiseThrall01 Auto
- globalvariable Property DLC1NightPower Auto
- spell Property VampireDrain04 Auto
- spell Property DLC1VampireDrain06 Auto
- spell Property DLC1VampireMistform Auto
- idle Property SpecialFeeding Auto
- spell Property VampireDrain03 Auto
- {How long (in real seconds) before turning back we should warn the player}
- Float Property DurationWarningTimeSeconds Auto
- globalvariable Property pDLC1nVampireRingBeast Auto
- spell Property VampireSunDamage03 Auto
- globalvariable Property VampireFeedReady Auto
- spell Property VampireSunDamage02 Auto
- armor Property eruditeRing Auto
- formlist Property VampireDispelList Auto
- faction Property DLC1PlayerVampireLordFaction Auto
- spell Property DLC1PlayerVampireLvl45AndBelowAbility Auto
- spell Property AbVampire04b Auto
- spell Property AbVampire03b Auto
- spell Property AbVampire02b Auto
- formlist Property CrimeFactions Auto
- imagespacemodifier Property VampireChange Auto
- spell Property AbVampire01b Auto
- message Property PlayerVampireFeedMessage Auto
- spell Property AbVampire03 Auto
- spell Property AbVampire02 Auto
- spell Property AbVampire01 Auto
- spell Property LeveledAbility Auto
- Float Property DLC1BiteHealthRecover Auto
- perk Property DLC1VampireActivationBlocker Auto
- spell Property DLC1PlayerVampireLvl15AndBelowAbility Auto
- message Property DLC1BloodPointsMsg Auto
- spell Property DLC1VampireDetectLife Auto
- globalvariable Property DLC1VampireNextPerk Auto
- spell Property DLC1VampireDrain07 Auto
- globalvariable Property DLC1VampireBloodPoints Auto
- spell Property VampireRaiseThrall02 Auto
- globalvariable Property PlayerVampireShiftBackTime Auto
- spell Property DLC1VampireRaiseDeadLeftHand01 Auto
- spell Property VampireRaiseThrall04 Auto
- {Visual Effect on Wolf for Feeding Blood}
- visualeffect Property FeedBloodVFX Auto
- perk Property LightFoot Auto
- globalvariable Property TimeScale Auto
- spell Property FeedBoost Auto
- spell Property DLC1VampireRaiseDeadLeftHand04 Auto
- spell Property DLC1PlayerVampireLvl25AndBelowAbility Auto
- race Property VampireLordRace Auto
- spell Property DLC1VampireDrain05 Auto
- String Property LiftoffStart Auto
- String Property Levitate Auto
- globalvariable Property pDLC1nVampireRingErudite Auto
- spell Property DLC1VampireRaiseDeadLeftHand05 Auto
- spell Property DLC1PlayerVampireLvl35AndBelowAbility Auto
- String Property Ground Auto
- spell Property DLC1PlayerVampireLvl30AndBelowAbility Auto
- spell Property DLC1VampiresGrip Auto
- globalvariable Property pDLC1nVampireNecklaceBats Auto
- {This Spell is for making the target of feeding bleed.}
- spell Property BleedingFXSpell Auto
- spell Property DLC1PlayerVampireLvl40AndBelowAbility Auto
- message Property PlayerVampireExpirationWarning Auto
- Bool __tryingToShiftBack = false
- Bool __trackingStarted = false
- Bool __shiftingBack = false
- Bool __prepped = false
- Bool __shuttingDown = false
- Float __durationWarningTime = -1.00000
- Float __UnearthlyWillExtensionTime = -1.00000
- Function StartTracking()
- actor PlayerActor
- Int cfIndex
- Float currentTime
- Float regressTime
- PlayerActor = game.GetPlayer()
- if __trackingStarted
- return
- endif
- __trackingStarted = true
- if game.GetPlayer().isEquipped((beastRing as form))
- pDLC1nVampireRingBeast.setValue((1 as Float))
- endif
- if game.GetPlayer().isEquipped((eruditeRing as form))
- pDLC1nVampireRingErudite.setValue((1 as Float))
- endif
- if game.GetPlayer().isEquipped((batNecklace as form))
- pDLC1nVampireNecklaceBats.setValue((1 as Float))
- endif
- if game.GetPlayer().isEquipped((gargNecklace as form))
- pDLC1nVampireNecklaceGargoyle.setValue((1 as Float))
- endif
- RegisterForEvents()
- DCL1VampireLevitateStateGlobal.setValue((1 as Float))
- debug.Trace("VAMPIRE: Race swap done; starting tracking and effects.", 0)
- PlayerActor.UnequipAll()
- PlayerActor.EquipItem((DLC1VampireLordArmor as form), false, true)
- PlayerActor.SetAttackActorOnSight(true)
- game.SendWereWolfTransformation()
- PlayerActor.AddToFaction(PlayerVampireFaction)
- cfIndex = 0
- while (cfIndex < CrimeFactions.GetSize())
- debug.Trace(("VAMPIRE: Setting enemy flag on " + (CrimeFactions.GetAt(cfIndex) as String)), 0)
- (CrimeFactions.GetAt(cfIndex) as faction).SetPlayerEnemy(true)
- cfIndex = (cfIndex + 1)
- endWhile
- HunterFaction.SetPlayerEnemy(true)
- game.SetPlayerReportCrime(false)
- __durationWarningTime = RealTimeSecondsToGameTimeDays(DurationWarningTimeSeconds)
- __UnearthlyWillExtensionTime = RealTimeSecondsToGameTimeDays(UnearthlyWillExtensionTimeSeconds)
- PlayerActor.RemoveSpell(VampireSunDamage01)
- PlayerActor.RemoveSpell(VampireSunDamage02)
- PlayerActor.RemoveSpell(VampireSunDamage03)
- PlayerActor.RemoveSpell(VampireSunDamage04)
- PlayerActor.AddSpell(DLC1VampireLordSunDamage, false)
- PlayerActor.AddSpell(LeveledAbility, false)
- PlayerActor.AddSpell(VampireHuntersSight, false)
- PlayerActor.AddSpell(DLC1Revert, false)
- PlayerActor.AddSpell(DLC1VampireBats, false)
- PlayerActor.EquipSpell((DialogueGenericVampire as vampirequestscript).LastPower, 2)
- CheckPerkSpells()
- if (PlayerActor.HasPerk(LightFoot) == true)
- DLC1HasLightfoot = true
- endif
- DLC1HasLightfoot = false
- PlayerActor.AddPerk(LightFoot)
- currentTime = GameDaysPassed.GetValue()
- regressTime = (currentTime + RealTimeSecondsToGameTimeDays(StandardDurationSeconds))
- if PlayerActor.HasPerk(DLC1UnearthlyWill)
- regressTime = (regressTime + __UnearthlyWillExtensionTime)
- endif
- PlayerVampireShiftBackTime.setValue(regressTime)
- debug.Trace(("VAMPIRE: Current day -- " + (currentTime as String)), 0)
- debug.Trace(("VAMPIRE: Player will turn back at day " + (regressTime as String)), 0)
- PlayerActor.DispelSpell(DLC1VampireChange)
- RegisterForUpdate((3 as Float))
- SetStage(10)
- EndFunction
- Function SetUntimed(Bool untimedValue)
- Untimed = untimedValue
- if Untimed
- UnregisterForUpdate()
- endif
- EndFunction
- {Function that switches this object to the specified state}
- Function GotoState(String newState)
- onEndState()
- ::State = newState
- onBeginState()
- EndFunction
- Function UnloadSpells()
- LeveledDrainSpell.Unload()
- LeveledRaiseDeadSpell.Unload()
- DLC1VampiresGrip.Unload()
- DLC1ConjureGargoyleLeftHand.Unload()
- DLC1CorpseCurse.Unload()
- EndFunction
- Function PrepShift()
- actor PlayerActor
- Int count
- spell gone
- PlayerActor = game.GetPlayer()
- debug.Trace("VAMPIRE: Prepping shift...", 0)
- VampireChange.Apply(1.00000)
- VampireIMODSound.Play((PlayerActor as objectreference))
- game.SetInCharGen(true, true, false)
- PlayerActor.AddPerk(DLC1VampireActivationBlocker)
- game.SetBeastForm(true)
- game.EnableFastTravel(false)
- PlayerActor.SetActorValue("GrabActorOffset", (70 as Float))
- count = 0
- while (count < VampireDispelList.GetSize())
- gone = (VampireDispelList.GetAt(count) as spell)
- if !((gone == None))
- PlayerActor.DispelSpell(gone)
- endif
- count = (count + 1)
- endWhile
- game.DisablePlayerControls(false, false, true, false, false, false, false, false, 1)
- game.ForceThirdPerson()
- game.ShowFirstPersonGeometry(false)
- EstablishLeveledSpells()
- PreloadSpells()
- __prepped = true
- EndFunction
- Function Revert()
- debug.Trace(("VAMPIRE: Perks stat = " + (game.QueryStat("NumVampirePerks") as String)), 0)
- if ((game.QueryStat("NumVampirePerks") as Float) >= DLC1VampireMaxPerks.value)
- game.AddAchievement(58)
- endif
- UnregisterForUpdate()
- SetStage(100)
- EndFunction
- Function Shutdown()
- actor PlayerActor
- if __shuttingDown
- return
- endif
- __shuttingDown = true
- PlayerActor = game.GetPlayer()
- DCL1VampireLevitateStateGlobal.setValue((0 as Float))
- PlayerActor.GetActorBase()
- PlayerActor.GetActorBase().SetInvulnerable(false)
- PlayerActor.SetGhost(false)
- game.SetBeastForm(false)
- game.EnableFastTravel(true)
- game.SetInCharGen(false, false, false)
- debug.Trace("VAMPIRE: Transform to human done - remove activation blocking perk and allow recast of Vampire Change spell", 0)
- PlayerActor.RemovePerk(DLC1VampireActivationBlocker)
- PlayerActor.RemoveSpell(VampireHuntersSight)
- UnloadSpells()
- game.EnablePlayerControls(false, false, true, true, true, false, false, false, 1)
- stop()
- EndFunction
- Function PreloadSpells()
- LeveledDrainSpell.Preload()
- LeveledRaiseDeadSpell.Preload()
- DLC1VampiresGrip.Preload()
- DLC1ConjureGargoyleLeftHand.Preload()
- DLC1CorpseCurse.Preload()
- EndFunction
- Function ShiftBack()
- actor PlayerActor
- __tryingToShiftBack = true
- PlayerActor = game.GetPlayer()
- while PlayerActor.GetAnimationVariableBool("bIsSynced")
- utility.Wait(0.10000)
- endWhile
- __shiftingBack = false
- ActuallyShiftBackIfNecessary()
- EndFunction
- Function RegisterForEvents()
- actor PlayerActor
- debug.Trace("Registering for Animation Events", 0)
- PlayerActor = game.GetPlayer()
- RegisterForAnimationEvent((PlayerActor as objectreference), Ground)
- RegisterForAnimationEvent((PlayerActor as objectreference), Levitate)
- RegisterForAnimationEvent((PlayerActor as objectreference), BiteStart)
- RegisterForAnimationEvent((PlayerActor as objectreference), LiftoffStart)
- RegisterForAnimationEvent((PlayerActor as objectreference), LandStart)
- RegisterForAnimationEvent((PlayerActor as objectreference), TransformToHuman)
- EndFunction
- Function ActuallyShiftBackIfNecessary()
- actor PlayerActor
- Int count
- spell gone
- Float currHealth
- Int cfIndex
- PlayerActor = game.GetPlayer()
- if __shiftingBack
- return
- endif
- __shiftingBack = true
- PlayerActor.GetActorBase()
- PlayerActor.GetActorBase().SetInvulnerable(true)
- PlayerActor.SetGhost(true)
- if (DLC1HasLightfoot == false)
- PlayerActor.RemovePerk(LightFoot)
- endif
- UnregisterForEvents()
- DCL1VampireLevitateStateGlobal.setValue((1 as Float))
- debug.Trace("VAMPIRE: Player returning to normal.", 0)
- game.SetInCharGen(true, true, false)
- UnregisterForUpdate()
- if PlayerActor.IsDead()
- debug.Trace("VAMPIRE: Player is dead; bailing out.", 0)
- return
- endif
- VampireChange.Apply(1.00000)
- VampireIMODSound.Play((PlayerActor as objectreference))
- DLC1VampireChangeBackFXS.Play((PlayerActor as objectreference), 12.00000)
- count = 0
- while (count < VampireDispelList.GetSize())
- gone = (VampireDispelList.GetAt(count) as spell)
- if !((gone == None))
- PlayerActor.DispelSpell(gone)
- endif
- count = (count + 1)
- endWhile
- CurrentEquippedLeftSpell = PlayerActor.GetEquippedSpell(0)
- (DialogueGenericVampire as vampirequestscript).LastLeftHandSpell = CurrentEquippedLeftSpell
- if (PlayerActor.GetEquippedSpell(2) == DLC1Revert)
- (DialogueGenericVampire as vampirequestscript).LastPower = DLC1VampireBats
- endif
- (DialogueGenericVampire as vampirequestscript).LastPower = PlayerActor.GetEquippedSpell(2)
- PlayerActor.RemoveSpell(LeveledDrainSpell)
- PlayerActor.RemoveSpell(LeveledAbility)
- PlayerActor.RemoveSpell(LeveledRaiseDeadSpell)
- PlayerActor.RemoveSpell(DLC1VampiresGrip)
- PlayerActor.RemoveSpell(DLC1ConjureGargoyleLeftHand)
- PlayerActor.RemoveSpell(DLC1CorpseCurse)
- PlayerActor.RemoveSpell(DLC1VampireDetectLife)
- PlayerActor.RemoveSpell(DLC1VampireMistform)
- PlayerActor.RemoveSpell(DLC1VampireBats)
- PlayerActor.RemoveSpell(DLC1SupernaturalReflexes)
- PlayerActor.RemoveSpell(DLC1NightCloak)
- PlayerActor.RemoveSpell(DLC1Revert)
- PlayerActor.RemoveSpell(DLC1VampireLordSunDamage)
- PlayerActor.DispelSpell(DLC1VampireDetectLife)
- PlayerActor.DispelSpell(DLC1VampireMistform)
- PlayerActor.DispelSpell(DLC1SupernaturalReflexes)
- PlayerActor.DispelSpell(DLC1Revert)
- PlayerActor.DispelSpell(VampireHuntersSight)
- PlayerActor.RemoveSpell(DLC1AbVampireFloatBodyFX)
- pDLC1nVampireNecklaceBats.setValue((0 as Float))
- pDLC1nVampireNecklaceGargoyle.setValue((0 as Float))
- pDLC1nVampireRingBeast.setValue((0 as Float))
- pDLC1nVampireRingErudite.setValue((0 as Float))
- PlayerVampireQuest.VampireProgression(PlayerActor, PlayerVampireQuest.VampireStatus)
- currHealth = PlayerActor.GetAV("Health")
- if (currHealth <= (70 as Float))
- debug.Trace((("VAMPIRE: Player's health is only " + (currHealth as String)) + "; restoring."), 0)
- PlayerActor.RestoreAV("Health", ((70 as Float) - currHealth))
- endif
- debug.Trace(((("VAMPIRE: Setting race " + ((VampireTrackingQuest as dlc1vampiretrackingquest).PlayerRace as String)) + " on ") + (PlayerActor as String)), 0)
- PlayerActor.RemoveItem((DLC1VampireLordArmor as form), 2, true, None)
- PlayerActor.SetRace((VampireTrackingQuest as dlc1vampiretrackingquest).PlayerRace)
- DLC1VampireChangeBackFXS.stop((PlayerActor as objectreference))
- DLC1VampireChangeBack02FXS.Play((PlayerActor as objectreference), 0.10000)
- game.ShowFirstPersonGeometry(true)
- PlayerActor.SetAttackActorOnSight(false)
- HunterFaction.SetPlayerEnemy(false)
- PlayerActor.RemoveFromFaction(PlayerVampireFaction)
- cfIndex = 0
- while (cfIndex < CrimeFactions.GetSize())
- (CrimeFactions.GetAt(cfIndex) as faction).SetPlayerEnemy(false)
- cfIndex = (cfIndex + 1)
- endWhile
- game.SetPlayerReportCrime(true)
- utility.Wait((5 as Float))
- debug.Trace("OnRaceSwitchComplete event took more than 5 seconds, shutting down ourselves.", 0)
- EndFunction
- Function CheckPerkSpells()
- actor PlayerActor
- PlayerActor = game.GetPlayer()
- if ((PlayerActor.HasPerk(DLC1MistFormPerk) == true) as Bool) && ((PlayerActor.HasSpell((DLC1VampireMistform as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1VampireMistform, false)
- endif
- if ((PlayerActor.HasPerk(DLC1DetectLifePerk) == true) as Bool) && ((PlayerActor.HasSpell((DLC1VampireDetectLife as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1VampireDetectLife, false)
- endif
- if ((PlayerActor.HasPerk(DLC1SupernaturalReflexesPerk) == true) as Bool) && ((PlayerActor.HasSpell((DLC1SupernaturalReflexes as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1SupernaturalReflexes, false)
- endif
- if ((PlayerActor.HasPerk(DLC1VampiricGrip) == true) as Bool) && ((PlayerActor.HasSpell((DLC1VampiresGrip as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1VampiresGrip, false)
- endif
- if ((PlayerActor.HasPerk(DLC1CorpseCursePerk) == true) as Bool) && ((PlayerActor.HasSpell((DLC1CorpseCurse as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1CorpseCurse, false)
- endif
- if ((PlayerActor.HasPerk(DLC1GargoylePerk) == true) as Bool) && ((PlayerActor.HasSpell((DLC1ConjureGargoyleLeftHand as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1ConjureGargoyleLeftHand, false)
- endif
- if ((PlayerActor.HasPerk(DLC1NightCloakPerk) == true) as Bool) && ((PlayerActor.HasSpell((DLC1NightCloak as form)) == false) as Bool)
- PlayerActor.AddSpell(DLC1NightCloak, false)
- endif
- EndFunction
- Float Function GameTimeDaysToRealTimeSeconds(Float gametime)
- Float gameSeconds
- gameSeconds = (gametime * (((60 * 60) * 24) as Float))
- return (gameSeconds / TimeScale.value)
- EndFunction
- Function Feed(actor victim)
- EndFunction
- Function WarnPlayer()
- VampireWarn.Apply(1.00000)
- EndFunction
- Function HandlePlayerLoadGame()
- if __prepped
- PreloadSpells()
- endif
- EndFunction
- {Function that returns the current state}
- String Function GetState()
- return ::State
- EndFunction
- Function EstablishLeveledSpells()
- actor PlayerActor
- Int playerLevel
- PlayerActor = game.GetPlayer()
- playerLevel = PlayerActor.GetLevel()
- if (playerLevel <= 10)
- LeveledDrainSpell = DLC1VampireDrain05
- LeveledRaiseDeadSpell = DLC1VampireRaiseDeadLeftHand01
- endif
- if (playerLevel <= 20)
- LeveledDrainSpell = DLC1VampireDrain06
- LeveledRaiseDeadSpell = DLC1VampireRaiseDeadLeftHand02
- endif
- if (playerLevel <= 30)
- LeveledDrainSpell = DLC1VampireDrain07
- LeveledRaiseDeadSpell = DLC1VampireRaiseDeadLeftHand03
- endif
- if (playerLevel <= 40)
- LeveledDrainSpell = DLC1VampireDrain08
- LeveledRaiseDeadSpell = DLC1VampireRaiseDeadLeftHand04
- endif
- LeveledDrainSpell = DLC1VampireDrain09
- LeveledRaiseDeadSpell = DLC1VampireRaiseDeadLeftHand05
- if (playerLevel <= 10)
- LeveledAbility = DLC1PlayerVampireLvl10AndBelowAbility
- endif
- if (playerLevel <= 15)
- LeveledAbility = DLC1PlayerVampireLvl15AndBelowAbility
- endif
- if (playerLevel <= 20)
- LeveledAbility = DLC1PlayerVampireLvl20AndBelowAbility
- endif
- if (playerLevel <= 25)
- LeveledAbility = DLC1PlayerVampireLvl25AndBelowAbility
- endif
- if (playerLevel <= 30)
- LeveledAbility = DLC1PlayerVampireLvl30AndBelowAbility
- endif
- if (playerLevel <= 35)
- LeveledAbility = DLC1PlayerVampireLvl35AndBelowAbility
- endif
- if (playerLevel <= 40)
- LeveledAbility = DLC1PlayerVampireLvl40AndBelowAbility
- endif
- if (playerLevel <= 45)
- LeveledAbility = DLC1PlayerVampireLvl45AndBelowAbility
- endif
- LeveledAbility = DLC1PlayerVampireLvl50AndOverAbility
- EndFunction
- Function OnAnimationEventUnregistered(objectreference akSource, String asEventName)
- debug.Trace(((("Animation Event Unregistered for " + (akSource as String)) + ": ") + asEventName), 0)
- EndFunction
- Function OnAnimationEvent(objectreference akActor, String akEventName)
- actor PlayerActor
- PlayerActor = game.GetPlayer()
- debug.Trace(((("VAMPIRE: Animation Event! " + (akActor as String)) + " ") + akEventName), 0)
- if (akActor == (PlayerActor as objectreference))
- if (akEventName == TransformToHuman)
- ActuallyShiftBackIfNecessary()
- endif
- if (akEventName == BiteStart)
- debug.Trace("VAMPIRE: Handle BiteStart", 0)
- DLC1VampireBloodPoints.value = (DLC1VampireBloodPoints.value + (1 as Float))
- if (DLC1VampireTotalPerksEarned.value < DLC1VampireMaxPerks.value)
- DLC1BloodPointsMsg.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
- debug.Trace(("VAMPIRE: Bite kill move, Blood " + (DLC1VampireBloodPoints.value as String)), 0)
- if (DLC1VampireBloodPoints.value >= DLC1VampireNextPerk.value)
- DLC1VampireBloodPoints.value = (DLC1VampireBloodPoints.value - DLC1VampireNextPerk.value)
- DLC1VampirePerkPoints.value = (DLC1VampirePerkPoints.value + (1 as Float))
- DLC1VampireTotalPerksEarned.value = (DLC1VampireTotalPerksEarned.value + (1 as Float))
- DLC1VampireNextPerk.value = (DLC1VampireNextPerk.value + (2 as Float))
- DLC1VampirePerkEarned.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
- endif
- PlayerActor.SetActorValue("VampirePerks", ((DLC1VampireBloodPoints.value / DLC1VampireNextPerk.value) * (100 as Float)))
- endif
- if (PlayerActor.HasPerk(DLC1VampireBite) == (1 as Bool))
- PlayerActor.RestoreActorValue("Health", DLC1BiteHealthRecover)
- endif
- PlayerActor.SetActorValue("VampirePerks", ((DLC1VampireBloodPoints.value / DLC1VampireNextPerk.value) * (100 as Float)))
- game.IncrementStat("Necks Bitten", 1)
- endif
- if (akEventName == LandStart)
- debug.Trace("VAMPIRE: Handle LandStart", 0)
- DCL1VampireLevitateStateGlobal.setValue((1 as Float))
- endif
- if (akEventName == Ground)
- debug.Trace("VAMPIRE: Handle GroundStart", 0)
- DCL1VampireLevitateStateGlobal.setValue((1 as Float))
- CurrentEquippedLeftSpell = PlayerActor.GetEquippedSpell(0)
- debug.Trace(("VAMPIRE: saving equipped left spell " + (CurrentEquippedLeftSpell as String)), 0)
- if !((CurrentEquippedLeftSpell == None))
- PlayerActor.UnequipSpell(CurrentEquippedLeftSpell, 0)
- endif
- PlayerActor.UnequipSpell(LeveledDrainSpell, 1)
- PlayerActor.RemoveSpell(LeveledRaiseDeadSpell)
- PlayerActor.RemoveSpell(DLC1CorpseCurse)
- PlayerActor.RemoveSpell(DLC1VampiresGrip)
- PlayerActor.RemoveSpell(DLC1ConjureGargoyleLeftHand)
- endif
- if (akEventName == LiftoffStart)
- debug.Trace("VAMPIRE: Handle LiftoffStart", 0)
- DCL1VampireLevitateStateGlobal.setValue((2 as Float))
- endif
- if (akEventName == Levitate)
- debug.Trace("VAMPIRE: Handle LevitateStart", 0)
- DCL1VampireLevitateStateGlobal.setValue((2 as Float))
- PlayerActor.EquipSpell(LeveledDrainSpell, 1)
- if ((DialogueGenericVampire as vampirequestscript).LastLeftHandSpell == None)
- (DialogueGenericVampire as vampirequestscript).LastLeftHandSpell = DLC1VampireRaiseDeadLeftHand01
- endif
- if (CurrentEquippedLeftSpell == None)
- CurrentEquippedLeftSpell = (DialogueGenericVampire as vampirequestscript).LastLeftHandSpell
- debug.Trace(("VAMPIRE: Spell from last session set as current last spell = " + (CurrentEquippedLeftSpell as String)), 0)
- endif
- CheckPerkSpells()
- PlayerActor.AddSpell(LeveledRaiseDeadSpell, false)
- PlayerActor.EquipSpell(CurrentEquippedLeftSpell, 0)
- debug.Trace(("VAMPIRE: Last spell left eqiupped = " + (CurrentEquippedLeftSpell as String)), 0)
- PlayerActor.EquipSpell(LeveledDrainSpell, 1)
- debug.Trace(("VAMPIRE: Last spell right eqiupped = " + (LeveledDrainSpell as String)), 0)
- endif
- endif
- EndFunction
- Function UnregisterForEvents()
- actor PlayerActor
- debug.Trace("Unregistering for Animation Events", 0)
- PlayerActor = game.GetPlayer()
- UnRegisterForAnimationEvent((PlayerActor as objectreference), Ground)
- UnRegisterForAnimationEvent((PlayerActor as objectreference), Levitate)
- UnRegisterForAnimationEvent((PlayerActor as objectreference), BiteStart)
- UnRegisterForAnimationEvent((PlayerActor as objectreference), LiftoffStart)
- UnRegisterForAnimationEvent((PlayerActor as objectreference), LandStart)
- UnRegisterForAnimationEvent((PlayerActor as objectreference), TransformToHuman)
- EndFunction
- Function OnUpdate()
- actor PlayerActor
- PlayerActor = game.GetPlayer()
- game.SetInCharGen(false, false, false)
- debug.Trace(("VAMPIRE: Perks stat = " + (game.QueryStat("NumVampirePerks") as String)), 0)
- if ((game.QueryStat("NumVampirePerks") as Float) >= DLC1VampireMaxPerks.value) game.AddAchievement(58)
- endif
- && Untimed
- return
- endif
- if ((PlayerActor.HasMagicEffect(DLC1RevertEffect) == true) as Bool)
- if ((!(PlayerActor.IsInKillMove()) as Bool) as Bool) && (!(__tryingToShiftBack) as Bool)
- debug.Trace("VAMPIRE: Revert effect detected", 0)
- Revert()
- endif
- game.ForceThirdPerson()
- EndFunction
- Function InitialShift()
- actor PlayerActor
- debug.Trace("VAMPIRE: Player beginning transformation.", 0)
- PlayerActor = game.GetPlayer()
- VampireWarn.Apply(1.00000)
- if PlayerActor.IsDead()
- debug.Trace("VAMPIRE: Player is dead; bailing out.", 0)
- return
- endif
- PlayerActor.GetActorBase()
- PlayerActor.GetActorBase().SetInvulnerable(true)
- PlayerActor.SetGhost(true)
- PlayerActor.SetRace(VampireLordRace)
- PlayerActor.AddSpell(DLC1AbVampireFloatBodyFX, false)
- EndFunction
- Float Function RealTimeSecondsToGameTimeDays(Float realtime)
- Float scaledSeconds
- scaledSeconds = (realtime * TimeScale.value)
- return (scaledSeconds / (((60 * 60) * 24) as Float))
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement