TR_m3_q_3_Captain_sc
TR_Mainland.esm
Variables
10
Local Variables
TR_Map
NoLore
state
dead
hisDisposition
PCBounty
theDoor
T_Local_NPC
T_Local_NoLore
timer
Source
1Begin TR_m3_q_3_Captain_sc
2
3;script on the copy of Relamus Saravyne placed in the Vault at the end of the quest
4;is not Guard class so as not to break the quest with guard behavior wrt bounties
5
6short TR_Map
7short NoLore
8short state
9short dead
10float timer
11short hisDisposition
12short PCBounty ;dialogue
13short theDoor
14short T_Local_NPC
15short T_Local_NoLore
16
17If ( GetDisabled == 1 )
18 SetDelete 1
19 Return
20Endif
21
22If ( MenuMode == 1 )
23 Return
24Endif
25
26If ( dead == 1 )
27 Return
28ElseIf ( OnDeath == 1 )
29 set dead to 1
30 "TR_m3_Relamus_Saravyne"->Disable
31 if ( GetJournalIndex "TR_m3_Bo_Burglar2" >= 10 )
32 if ( GetJournalIndex "TR_m3_Bo_Burglar2" < 97 )
33 Journal "TR_m3_Bo_Burglar2" 96
34 endif
35 endif
36endif
37
38If ( CellChanged == 1 ) ;make sure he doesn't stay in this cell if the player exits before him then comes back
39 If ( state >= 2 )
40 Disable
41 Return
42 ElseIf ( GetJournalIndex, "TR_m3_Bo_Burglar2" >= 96 )
43 Disable
44 Return
45 Endif
46Endif
47
48If ( state == 0 ) ;the moment he's placed in the vault by the global script...
49 set timer to ( timer + GetSecondsPassed )
50 if ( timer >= 0.8 )
51 set hisDisposition to ( TR_m3_Relamus_Saravyne->GetDisposition )
52 set hisDisposition to ( hisDisposition - GetDisposition )
53 ModDisposition hisDisposition
54 AiTravel 4400, 4200, 12350 ;...moves inside till he gets close to the player
55 PlaySound3D "Wooden Door Open 1"
56 set timer to 0
57 set state to 1
58 endif
59ElseIf ( state == 1 )
60 set timer to ( timer + GetSecondsPassed )
61 If ( TR_m3_q_3_thieving == 1 ) ;... and (unless the thief's still sneaking around - unlikely)...
62 If ( GetDistance, Player < 250 )
63 AiFollow Player 0 0 0 0
64 Endif
65 Return
66 ElseIf ( GetDistance, Player < 250 )
67 set timer to 0
68 ForceGreeting ;... greets to "finish" the quest
69 Return
70 ElseIf ( timer > 8 ) ;make sure he forcegreets even if he gets stuck/...
71 set timer to 0
72 ForceGreeting
73 Return
74 Endif
75 If ( GetPos, X >= 4100 ) ;open door if in his way
76 If ( GetPos, Y >= 4000 )
77 If ( theDoor == 0 )
78 If ( "TR_m3_q_3_VaultDoor02"->GetLocked == 1 )
79 "TR_m3_q_3_VaultDoor02"->PlaySound3D "Open Lock"
80 "TR_m3_q_3_VaultDoor02"->Unlock
81 Endif
82 If ( "TR_m3_q_3_VaultDoor02".isOpen == 0 )
83 Set "TR_m3_q_3_VaultDoor02".beOpen to 1
84 Endif
85 set theDoor to 1
86 Endif
87 Endif
88 Endif
89ElseIf ( state == 2 ) ;after this dialogue with the PC, will have to speak to his (non-copy) version in his cell for the reward
90 if ( timer == 0 )
91 EnablePlayerControls ; restore controls disabled by script _Burglar_sc
92 SetHello 0
93 AiWander 0 0 0
94 if ( GetDeadCount, "TR_m3_q_3_Burglar" == 0 )
95 if ( TR_m3_q_3_thieving == 3 )
96 Say, "Vo\d\m\OP_DM008.mp3", "Seize him!"
97 endif
98 endif
99 If ( GetJournalIndex, "TR_m3_Bo_Burglar2" >= 101 )
100 AiTravel 3800, 3845, 12350, 1 ;goes back right away
101 set state to 3
102 endif
103 endif
104 set timer to ( timer + GetSecondsPassed )
105 if ( timer >= 2 ) ;or gives captured burglar headstart
106 AiTravel 3800, 3845, 12350, 1
107 set state to 3
108 endif
109ElseIf ( state == 3 )
110 If ( GetAIPackageDone == 1 )
111 set state to 4 ;he leaves
112 Disable
113 Endif
114Endif
115
116
117; regional filter & nolore
118
119if ( TR_Map == 3 )
120 return
121endif
122
123set TR_Map to 3
124
125End