4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

104 lines
2.9 KiB

scriptName defaultPillarPuzzleLeverNoFurn extends ObjectReference
{
- This script lives on the lever that controls each of the pillars
- Each pillar should have its linkedRef point to the lever that this script is on
}
import debug
import utility
bool property puzzleSolved auto hidden
bool property doorOpened auto hidden
int property numPillarsSolved auto hidden
objectReference property puzzleDoorActivator auto
{The Parent Activator Dummy Ref for Door}
int property pillarCount auto
{Number of Puzzle Pillars}
objectReference property refActOnSuccess01 auto
{This ref is activated when puzzle is solved and lever is pulled}
objectReference property refActOnFailure01 auto
{This ref is activated when puzzle is not solved and lever is pulled}
objectReference property refActOnFailure02 auto
{This ref is activated when puzzle is not solved and lever is pulled}
objectReference property refActOnFailure03 auto
{This ref is activated when puzzle is not solved and lever is pulled}
objectReference property refActOnFailure04 auto
{This ref is activated when puzzle is not solved and lever is pulled}
;*****************************************
Function doorOrDarts()
;if the puzzle is solved, activate the refActonSuccess01
;else if the puzzle is not solved, activate the refActOnFailures (the dart traps
;in the case of BleakFallsBarrow01)
;wait(6)
if (numPillarsSolved == PillarCount)
puzzleSolved = true
refActOnSuccess01.activate(puzzleDoorActivator)
int openState = refActOnSuccess01.getOpenState()
if (openState == 1 || openState == 2)
doorOpened = true
else
doorOpened = false
endif
else
puzzleSolved = false
;USKP 2.0.1 - Sanity checks. Not all of these are used in each instance of this script.
if( refActOnFailure01 != None )
refActOnFailure01.activate (self as objectReference)
EndIf
if( refActOnFailure02 != None )
refActOnFailure02.activate (self as objectReference)
EndIf
if( refActOnFailure03 != None )
refActOnFailure03.activate (self as objectReference)
EndIf
if( refActOnFailure04 != None )
refActOnFailure04.activate (self as objectReference)
EndIf
endif
endFunction
;*****************************************
Auto STATE pulledPosition
EVENT onActivate (objectReference triggerRef)
Actor actorRef = triggerRef as Actor
gotoState("busy")
;notification("just activated lever")
doorOrDarts()
playAnimationandWait("FullPush","FullPushedUp")
gotoState("pushedPosition")
endEVENT
endState
;*****************************************
STATE pushedPosition
EVENT onActivate (objectReference triggerRef)
gotoState ("busy")
;notification("just activated lever")
doorOrDarts()
playAnimationandWait("FullPull","FullPulledDown")
gotoState("pulledPosition")
endEVENT
endState
;*****************************************
STATE busy
; This is the state when I'm busy animating
EVENT onActivate (objectReference triggerRef)
;do nothing
endEVENT
endState
;*****************************************