Here's the door's script:
Code: Select all
// Make it stay open or close
IfSpawned
KeepAction
tmpargument = passage
ClosePassage
//Open door and close it
IfTimeOut
KeepAction
tmpargument = 10
SetTime
tmpargument = passage + 1
SetTargetToWhoeverIsInPassage
IfTargetCanOpenStuff //Only open for intelligent creatures
OpenPassage
Else
tmpargument = 0
IfContentIs //Only close unlocked doors
tmpargument = passage
ClosePassage
//Magic unlock
IfOrdered
tmpx = selforder
tmpy = 491 // The unique code for an unlock order
IfXIsEqualToY
tmpargument = 3
SendMessageNear
// Handle the animation and sound
tmpargument = passage // Is the passage clear?
IfPassageOpen //
tmpargument = 0 //
IfStateIs // State 0 ( Closed )
tmpargument = ACTIONMG //
DoAction //
tmpargument = 1 // Open it
SetState //
tmpargument = 0 //
PlaySound //
Else
tmpargument = 1 //
IfStateIs // State 1 ( Open )
tmpargument = ACTIONMJ //
DoAction //
tmpargument = 0 // Close it
SetState //
tmpargument = 1 //
PlaySound //
End // Finished with this character
Code: Select all
4 Gate1: 52 30 53 31 F T F
5 Gate1Open: 52 31 53 32 T T F
6 Gate2: 35 17 36 18 F T F
7 Gate2Open: 35 18 36 19 T T F
8 Gate3: 10 4 11 5 F T F
9 Gate3Open: 10 5 11 6 T T F