TR_m3_q_3_VaultClerk
TR_Mainland.esm
Variables
13
Local Variables
TR_Map
control
NoLore
dead
getmoving
greetonce
forcegreetonce
PCUnlockedTheDoor
PCKilledMe
reset
T_Local_NPC
T_Local_NoLore
timer
Source
1Begin TR_m3_q_3_VaultClerk
2
3;script on Ararvyne Saram
4;stays inside during the quest to 'make sure' the player doesn't rob the vaults
5;when the quest starts, teleports from uptairs to the locked area of the Vaults
6;teleports the guards in and out of it, so as not to mess with the locked doors and their traps
7
8short TR_Map
9short control
10short NoLore
11short dead
12
13short getmoving
14short greetonce
15short forcegreetonce
16short PCUnlockedTheDoor
17short PCKilledMe
18float timer
19short reset
20short T_Local_NPC
21short T_Local_NoLore
22
23
24If ( MenuMode == 1 )
25 Return
26Endif
27
28
29If ( dead == 1 ) ;if he's somehow dead before the quest...
30 Return ;don't want his corpse teleporting around or breaking stuff
31ElseIf ( OnDeath == 1 )
32 set dead to 1
33 if ( GetJournalIndex, "TR_m3_Bo_Burglar2" >= 21 )
34 if ( GetJournalIndex, "TR_m3_Bo_Burglar2" < 95 )
35 set TR_m3_q_3_info to 99 ;if he dies inside during the quest, the player will get blamed
36 endif
37 endif
38Endif
39
40
41;----------- Al movements and teleports
42
43If ( reset == 0 ) ;reset his position if PC fails quest
44 If ( TR_m3_q_3_guardsGone == -1 ) ;or if player slept into next day or wasn't in the cell when he should've teleported back up
45 If ( GameHour < 22 )
46 set reset to 1
47 Endif
48 Endif
49 If ( getmoving >= 1 )
50 If ( getmoving <= 10 )
51 If ( GetJournalIndex, "TR_m3_Bo_Burglar2" == 98 )
52 set reset to 1
53 ElseIf ( GetJournalIndex, "TR_m3_Bo_Burglar2" >= 25 )
54 If ( GetJournalIndex, "TR_m3_Bo_Burglar2" <= 27 )
55 set reset to 1
56 Endif
57 Endif
58 Endif
59 Endif
60 If ( reset == 1 )
61 If ( ( Player->GetPos, Y ) < 4200 )
62 "TR_m3_q_3_VaultDoor02"->Lock 100
63 Endif
64 "TR_m3_q_3_VaultDoor_03"->Lock 100
65 set timer to 1.5
66 set getmoving to 11
67 Endif
68Endif
69
70If ( getmoving == 1 ) ;set from dialogue
71 AiTravel 4170, 4200, 12350, 1 ;moves to open the door for the PC
72 "TR_m3_q_3_VaultDoor_03"->Lock 100 ;making sure the second door's closed and locked
73 set timer to 0
74 SetHello, 0
75 set getmoving to 2
76ElseIf ( getmoving == 2 )
77 If ( GetAIPackageDone == 1 )
78 Face, 4400, 4200
79 AiWander 0 0 0 0 0 0 0 0 0
80 If ( "TR_m3_q_3_VaultDoor02"->GetLocked == 1 )
81 "TR_m3_q_3_VaultDoor02"->PlaySound3D "Open Lock"
82 set timer to 0.1
83 Else
84 set "TR_m3_q_3_VaultDoor02".beOpen to 1
85 SetHello, 30
86 set getmoving to 3
87 Endif
88 Endif
89 If ( timer > 0 )
90 set timer to ( timer + GetSecondsPassed )
91 If ( timer > 1 )
92 "TR_m3_q_3_VaultDoor02"->Unlock
93 set "TR_m3_q_3_VaultDoor02".beOpen to 1
94 SetHello, 30
95 set timer to 0
96 set getmoving to 3
97 Endif
98 Endif
99ElseIf ( getmoving == 3 )
100 set timer to ( timer + GetSecondsPassed )
101 If ( timer > 1 )
102 set getmoving to 4
103 set timer to 0
104 ForceGreeting
105 Return
106 Endif
107ElseIf ( getmoving == 4 ) ;closes the door after the PC gets in
108 If ( ( Player->GetPos, Y ) > 4350 )
109 set "TR_m3_q_3_VaultDoor02".beClosed to 1
110 set getmoving to 5
111 Endif
112ElseIf ( getmoving == 5 )
113 set timer to ( timer + GetSecondsPassed )
114 If ( timer > 0.3 )
115 set getmoving to 6
116 set timer to 0
117 ForceGreeting
118 Return
119 Endif
120ElseIf ( getmoving == 6 ) ;locks the door
121 "TR_m3_q_3_VaultDoor02"->Lock 100
122 "TR_m3_q_3_VaultDoor02"->PlaySound3D "Open Lock"
123 AiTravel 3800, 4250, 12100 ;prepare him for his new position, or he'll try to get back here as he's SetPos-ed while casting
124 set getmoving to 7
125ElseIf ( getmoving == 7 ) ;teleports downstairs
126 set timer to ( timer + GetSecondsPassed )
127 If ( timer > 1 )
128 Cast, telekinesis, "TR_m3_Ararvyne_Saram"
129 set timer to 0
130 set getmoving to 8
131 Endif
132ElseIf ( getmoving == 8 )
133 set timer to ( timer + GetSecondsPassed )
134 If ( timer > 1.5 )
135 SetPos, X, 3800
136 SetPos, Y, 4250
137 SetPos, Z, 12100
138 set getmoving to 9
139 Endif
140ElseIf ( getmoving == 9 )
141 set timer to ( timer + GetSecondsPassed )
142 If ( timer > 2 )
143 AiWander 0 0 0
144 set timer to 0
145 set TR_m3_q_3_guardsGone to 1 ;tell the guards in the Vault to teleport away
146 set getmoving to 10
147 Endif
148ElseIf ( getmoving == 10 ) ;is downstairs, and should stay here till the guards come back
149 If ( "TR_m3_q_3_VaultDoor_03"->GetAngle, Z > 210 ) ;if the PC opens that door he's standing in front of...
150 If ( PCUnlockedTheDoor == 0 )
151 "TR_m3_q_3_VaultDoor_03"->Lock 100
152 Set PCUnlockedTheDoor to 1
153 set TR_m3_q_3_info to 98 ;Saravyne could know when completing the quest -unused
154 ForceGreeting ;is not happy, because it's supposed to be locked
155 Return
156 ElseIf ( PCUnlockedTheDoor == 2 )
157 StartCombat, player
158 set PCUnlockedTheDoor to 3
159 Endif
160 Endif
161 If ( GameHour > 22 ) ;guards are back
162 AiTravel 3920, 4185, 12350, 0
163 set timer to 0
164 Cast, telekinesis, "TR_m3_Ararvyne_Saram"
165 set getmoving to 11
166 Endif
167ElseIf ( getmoving == 11 ) ;teleports back upstairs
168 set timer to ( timer + GetSecondsPassed )
169 If ( timer > 1.5 )
170 SetPos, X, 3920
171 SetPos, Y, 4185
172 SetPos, Z, 12350
173 set timer to 0
174 set getmoving to 12
175 Endif
176Endif
177
178
179;----------- Alarm rating
180
181If ( TR_m3_q_3_thieving == 1 ) ;during the vault burglary
182 If ( player->GetPos, y > 4300 ) ;player isn't in the enclosed loot area
183 If ( GetAlarm > 0 )
184 SetAlarm 0 ;make sure he doesn't report the PC if they're assaulting the burglar
185 Endif
186 ElseIf ( player->GetPos, z > 12300 )
187 If ( GetAlarm > 0 )
188 SetAlarm 0
189 Endif
190 Else ;but set back his Alarm in that area, in case the PC's stealing things
191 If ( GetAlarm < 100 ) ;the thief won't go that far on his own anyway
192 SetAlarm 100
193 Endif
194 Endif
195Else
196 If ( GetAlarm < 100 )
197 SetAlarm 100
198 Endif
199Endif
200
201
202;----------- Force-start
203
204If ( forcegreetonce == 0 ) ;forcegreet to start the quest if the player hasn't already from topic,
205 If ( getmoving == 0 ) ;just so that he won't say "you're too late" if they were hanging around in time...
206 If ( GetJournalIndex "TR_m3_Bo_Burglar2" >= 19 ) ;( WakeUpPC doesn't work in the Vault, illegal to sleep )
207 If ( GetJournalIndex "TR_m3_Bo_Burglar2" < 25 )
208 If ( GameHour >= 7 )
209 If ( GameHour < 12 ) ;the _global script fails the quest if it wasn't started by 12 AM
210 set forcegreetonce to 1
211 ForceGreeting
212 Return
213 Endif
214 Endif
215 Endif
216 Endif
217 Endif
218Endif
219
220
221; regional filter & nolore
222
223if ( TR_Map == 3 )
224 return
225endif
226
227set TR_Map to 3
228
229End