Condensing this script and adding a GameHour condition

Post » Sat Feb 09, 2013 1:38 am

I've written a quest which about halfway through this happens. Player activates a gravestone. Five sailor ghosts and 1 Captain ghost appear along with an FXsummon light to announce their arrival. On appearing the Capt attacks the sailors or vice-versa. A fight ensues of which only the Captain can win - he is lvl 40 + a few perks and essential, the sailors are lvl 5. I have all of this scripted but I need 2 things. I want the gravestone so it can only be activated between the hours of 5 am and 6 am anyday of the week - this ties in with the story, I don't know how the math is scripted for this. The second thing is if you look at the script it is quite long. All the sailors, not Captain, are the same Actor (not unique) so could I change the 5 Actor Properties to 1 ActorBase? Thanks for any help.

Quest Property MyQuest Auto
Actor Property ActorCapt
Actor Property Actor1
Actor Property Actor2
Actor Property Actor3
Actor Property Actor4
Actor Property Actor5
Light Property LightCapt
Light Property Light1
Light Property Light2
Light Property Light3
Light Property Light4
Light Property Light5

Auto State Waiting

Event OnActivate(ObjectReference Whodid)

if Whodid == Game.GetPlayer()
if myQuest.GetStage()==100
LightCapt.Enable()
Light1.Enable()
Light2.Enable()
Light3.Enable()
Light4.Enable()
Light5.Enable()
ActorCapt.Enable()
Actor1.Enable()
Actor2.Enable()
Actor3.Enable()
Actor4.Enable()
Actor5.Enable()
Actor1.StartCombat(ActorCapt)
Actor2.StartCombat(ActorCapt)
Actor3.StartCombat(ActorCapt)
Actor4.StartCombat(ActorCapt)
Actor5.StartCombat(ActorCapt)

GoToState("Dormant")
endif
endif

EndEvent

EndState

State Dormant
;does nothing
EndState
User avatar
Cameron Wood
 
Posts: 3384
Joined: Wed Oct 31, 2007 3:01 pm

Return to V - Skyrim