Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname DLC1PlayerVampireScript extends ReferenceAlias conditional
- Float Property BatsCooldown Auto
- message Property DLC1BatsWaitMessage Auto
- globalvariable Property DLC1BatsCount Auto
- message Property DLC1BatsReadyMessage Auto
- spell Property CurrentEquippedPower Auto
- spell Property DLC1VampireBats Auto
- race Property VampireLordRace Auto
- spell Property DLC1Mistform Auto
- Int Property BatsOutdoorMaxUses Auto
- Int Property BatsIndoorMaxUses Auto
- {Function that returns the current state}
- String Function GetState()
- return ::State
- EndFunction
- {Function that switches this object to the specified state}
- Function GotoState(String newState)
- onEndState()
- ::State = newState
- onBeginState()
- EndFunction
- Function OnSpellCast(Form akSpellCast)
- debug.Trace("VAMPIRE BATS: Spell detected", 0)
- if (akSpellCast == (DLC1VampireBats as Form))
- if (DLC1BatsCount.value == (0 as Float))
- debug.Trace(("VAMPIRE BATS: Registering single update " + (BatsCooldown as String)), 0)
- RegisterForSingleUpdateGameTime(BatsCooldown)
- endif
- DLC1BatsCount.value = (DLC1BatsCount.value + (1 as Float))
- debug.Trace(("VAMPIRE BATS: Bats count = " + (DLC1BatsCount.value as String)), 0)
- if ((game.GetPlayer().IsInInterior() == false) as Bool) && ((DLC1BatsCount.value >= (BatsOutdoorMaxUses as Float)) as Bool)
- DLC1BatsWaitMessage.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
- GetActorRef()
- GetActorRef().RemoveSpell(DLC1VampireBats)
- endif
- if ((game.GetPlayer().IsInInterior() == true) as Bool) && ((DLC1BatsCount.value >= (BatsIndoorMaxUses as Float)) as Bool)
- DLC1BatsWaitMessage.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
- GetActorRef()
- GetActorRef().RemoveSpell(DLC1VampireBats)
- endif
- endif
- EndFunction
- Function OnUpdateGameTime()
- UnRegisterforUpdateGameTime()
- debug.Trace("VAMPIRE BATS: Bats available again", 0)
- if ((game.GetPlayer().IsInInterior() == false) as Bool)
- if (((DLC1BatsCount.value >= (BatsOutdoorMaxUses as Float)) as Bool) as Bool) if ((game.GetPlayer().IsInInterior() == true) as Bool)
- if (((DLC1BatsCount.value >= (BatsIndoorMaxUses as Float)) as Bool) as Bool)
- DLC1BatsReadyMessage.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
- GetActorRef()
- GetActorRef().AddSpell(DLC1VampireBats, false)
- GetActorRef()
- if (GetActorRef().GetEquippedSpell(2) == None)
- debug.Trace("VAMPIRE BATS: Nothing else equipped, equip bats", 0)
- GetActorRef()
- GetActorRef().EquipSpell(DLC1VampireBats, 2)
- endif
- endif
- DLC1BatsCount.value = (0 as Float)
- EndFunction
- Function OnRaceSwitchComplete()
- if (GetActorReference() == game.GetPlayer())
- game.GetPlayer().GetActorBase()
- game.GetPlayer().GetActorBase().SetInvulnerable(false)
- game.GetPlayer().SetGhost(false)
- endif
- GetActorReference()
- if (GetActorReference().GetRace() == VampireLordRace)
- debug.Trace("VAMPIRE: Getting notification that race swap TO vampire is complete.", 0)
- (GetOwningQuest() as dlc1playervampirechangescript).StartTracking()
- endif
- debug.Trace("VAMPIRE: Getting notification that race swap FROM vampire is complete.", 0)
- (GetOwningQuest() as dlc1playervampirechangescript).Shutdown()
- EndFunction
- Function OnPlayerLoadGame()
- (GetOwningQuest() as dlc1playervampirechangescript).HandlePlayerLoadGame()
- EndFunction
- Function OnInit()
- DLC1BatsCount.value = (0 as Float)
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement