TR_m4_TT_OrcVivecScript
TR_Mainland.esm
Variables
14
Local Variables
TR_Map
NoLore
control
controlQ
respect
T_Local_NPC
T_Local_NoLore
companion
OnPCHitMe
bookABCs
noHit
timer
Zpos
ZposOld
Source
1Begin TR_m4_TT_OrcVivecScript
2
3; Script on the "troublesome orc" (NPC TR_m4_TT_OrcVivec, aka Garash gro-Vivec)
4; for the Bal Foyen Temple questline.
5
6short TR_Map
7short NoLore
8short control
9short controlQ
10short respect
11short T_Local_NPC
12short T_Local_NoLore
13short companion
14short OnPCHitMe
15short bookABCs
16float timer
17float Zpos
18float ZposOld
19short noHit
20
21if ( GetJournalIndex TR_m4_TT_TroublesomeOrc < 10 )
22 if ( GetDisabled == 0 )
23 Disable
24 endif
25 Return
26elseif ( GetJournalIndex TR_m4_TT_TroublesomeOrc <= 20 )
27 if ( GetDisabled )
28 Enable
29 endif
30elseif ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 150 )
31 ; not sure what this is for
32 if ( controlQ == 39 )
33 if ( GetDisabled == 0 )
34 if ( CellChanged )
35 Disable
36 endif
37 endif
38 endif
39elseif ( GetJournalIndex TR_m4_TT_TroublesomeOrc >= 50 )
40 if ( controlQ >= 0 )
41 if ( controlQ <= 20 )
42 if ( GetDisabled == 0 )
43 if ( CellChanged )
44 Disable
45 endif
46 endif
47 endif
48 endif
49endif
50
51if ( OnPCHitMe == 1 )
52 set OnPCHitMe to 0
53 if ( controlQ > 0 )
54 if ( controlQ < 8 )
55 ; if you hit him during his sequence, no conversation.
56 set controlQ to -1
57 SetFight 100
58 StartCombat player
59 endif
60 endif
61 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 120 )
62 if ( GetTarget player )
63 set controlQ to -1
64 SetFight 100
65 StartCombat player
66 endif
67 endif
68endif
69
70if ( OnDeath )
71 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc >= 10 )
72 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc <= 100 )
73 Journal TR_m4_TT_TroublesomeOrc 200
74 endif
75 endif
76 if ( GetJournalIndex TR_m4_TT_BooksBarbarians > 0 )
77 if ( GetJournalIndex TR_m4_TT_BooksBarbarians < 100 )
78 Journal TR_m4_TT_BooksBarbarians 110
79 endif
80 endif
81 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 120 )
82 if ( controlQ < 0 )
83 Journal TR_m4_TT_ArmunAdventure_e 100
84 else
85 Journal TR_m4_TT_ArmunAdventure_e 90
86 endif
87 endif
88 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 130 )
89 Journal TR_m4_TT_ArmunAdventure_e 100
90 endif
91 set controlQ to -1
92endif
93
94if ( OnActivate )
95; MessageBox "Activated"'
96 if ( companion >= 101 )
97 set control to 1
98 endif
99 if ( controlQ >= 2 )
100 if ( controlQ < 5 )
101 set controlQ to 5
102 Return
103 endif
104 endif
105 if ( controlQ <= 101 )
106 Activate
107 endif
108endif
109
110; script routine for unequiping certain pieces of clothing after opening the party share menu
111if ( control == 1 )
112 if ( MenuMode == 0 )
113; MessageBox "Trigger"
114 set control to 2
115 endif
116endif
117if ( control == 2 )
118 additem "TR_m4_TT_OrcNoRobe" 1
119 additem "TR_m4_TT_OrcNoShirt" 1
120 additem "TR_m4_TT_OrcNoPants" 1
121 additem "TR_m4_TT_OrcNoCuirass" 1
122 additem "TR_m4_TT_OrcNoGreaves" 1
123 additem "TR_m4_TT_OrcNoHelm" 1
124 equip "TR_m4_TT_OrcNoRobe"
125 equip "TR_m4_TT_OrcNoShirt"
126 equip "TR_m4_TT_OrcNoPants"
127 equip "TR_m4_TT_OrcNoCuirass"
128 equip "TR_m4_TT_OrcNoGreaves"
129 equip "TR_m4_TT_OrcNoHelm"
130 removeitem "TR_m4_TT_OrcNoRobe" 1
131 removeitem "TR_m4_TT_OrcNoShirt" 1
132 removeitem "TR_m4_TT_OrcNoPants" 1
133 removeitem "TR_m4_TT_OrcNoCuirass" 1
134 removeitem "TR_m4_TT_OrcNoGreaves" 1
135 removeitem "TR_m4_TT_OrcNoHelm" 1
136 set control to 0
137endif
138
139if ( MenuMode )
140 Return
141endif
142
143if ( controlQ < 0 )
144 if ( TR_m4_TT_OrcHostile == 0 )
145 set TR_m4_TT_OrcHostile to 1
146 endif
147 Return
148elseif ( controlQ == 0 )
149 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc >= 10 )
150 set controlQ to 1
151 endif
152elseif ( controlQ == 1 )
153 if ( GetDistance player < 850 )
154 if ( player->GetPos Y > -146765 )
155 ; player is N of orc
156; MessageBox "move orc north"
157 set controlQ to 2
158 else
159 ; player is S of orc
160; MessageBox "move orc south"
161 set controlQ to 3
162 endif
163 Say "vo\o\m\Atk_OM002.mp3" "Waargh!"
164 endif
165elseif ( controlQ == 2 )
166 ForceRun
167 AITravel -101768 -146228 3228 0
168 set controlQ to 4
169elseif ( controlQ == 3 )
170 ForceRun
171 AITravel -102036 -147194 3228 0
172 set controlQ to 4
173elseif ( controlQ == 4 )
174 set timer to ( timer + GetSecondsPassed )
175 if ( timer >= 5 )
176 set controlQ to 5
177 endif
178 if ( GetAIPackageDone == 1 )
179 set controlQ to 5
180 endif
181 if ( GetDistance player < 200 )
182 set controlQ to 5
183 endif
184elseif ( controlQ == 5 )
185 AIWander 0 0 0 0 30 20 0 30 0 0 20 20
186 set controlQ to 6
187elseif ( controlQ == 6 )
188 if ( GetDistance player < 1000 )
189 set controlQ to 7
190 ForceGreeting
191 endif
192elseif ( controlQ == 8 )
193 if ( GetHealthGetRatio < 0.5 )
194 Say "vo\o\m\Fle_OM005.mp3" "I have no more quarrel with you."
195 ModCurrentHealth 100
196 set controlQ to 9
197 set respect to 1
198 StopCombat
199 AIFollow Player 0 0 0 0
200 set timer to 0
201 Return
202 endif
203 if ( player->GetHealthGetRatio < 0.5 )
204 Say "vo\o\m\Fle_OM003.mp3" "This fight is over."
205 set controlQ to 9
206 StopCombat
207 AIFollow Player 0 0 0 0
208 set timer to 0
209 Return
210 endif
211elseif ( controlQ == 9 )
212 if ( timer > -0.5 )
213 set timer to ( timer + GetSecondsPassed )
214 endif
215 if ( timer > 3.5 )
216 if ( timer > 4.5 )
217 AIWander 0 0 0 0
218 set timer to 0
219 set controlQ to 10
220 endif
221 elseif ( timer > 2.5 )
222 if ( respect == 0 )
223 if ( player->GetWeaponDrawn == 1 )
224 Say "vo\o\m\Hlo_OM133.mp3" "Put that away."
225 elseif ( player->GetSpellReadied == 1 )
226 Say "vo\o\m\Hlo_OM133.mp3" "Put that away."
227 endif
228 endif
229 set timer to ( timer + 1 )
230 endif
231elseif ( controlQ == 11 )
232 if ( GetHealthGetRatio < 0.5 )
233 Say "vo\o\m\Fle_OM005.mp3" "I have no more quarrel with you."
234 set controlQ to 9 ; loop back, re-use script
235 set respect to 1
236 StopCombat
237 AIFollow Player 0 0 0 0
238 set timer to 0
239 Return
240 endif
241elseif ( controlQ == 12 )
242 ; Player tells the orc to jump down the bridge.
243 ; Currently, this quest path is unavailable, but may be implemented letter.
244elseif ( controlQ == 13 )
245; MessageBox "Travel 1"
246 set controlQ to 14
247 SetHello 0
248 ForceRun
249 AITravel -102011 -147039 3361
250elseif ( controlQ == 14 )
251 if ( TR_m4_TT_OrcVivec->GetAIPackageDone )
252; MessageBox "Travel 2"
253 AITravel -102100 -147039 3361
254 set controlQ to 15
255 endif
256elseif ( controlQ == 15 )
257 if ( TR_m4_TT_OrcVivec->GetAIPackageDone )
258; MessageBox "Jump!"
259 set controlQ to 16
260 SetAcrobatics 50
261 ForceJump
262 set Zpos to ( GetPos Z )
263 endif
264elseif ( controlQ == 16 )
265 set ZposOld to Zpos
266 set Zpos to ( GetPos Z )
267
268 set timer to ( timer + GetSecondsPassed )
269 if ( timer > 3 )
270 Say "Vo\o\m\Hit_OM006.mp3" "AAAIIEE."
271 set controlQ to 17
272 set Zpos to ( GetPos Z )
273 elseif ( timer > 1 )
274 Move Y 300
275 Move X 50
276 elseif ( timer > 0.1 )
277 if ( Zpos <= ZposOld )
278 set controlQ to 19
279 Return
280 endif
281 set timer to ( timer + 1 )
282 endif
283elseif ( controlQ == 17 )
284 set ZposOld to Zpos
285 set Zpos to ( GetPos Z )
286 set controlQ to 18
287elseif ( controlQ == 18 )
288 set Zpos to ( GetPos Z )
289 if ( Zpos >= ZposOld )
290 set controlQ to 19
291 else
292 set ZposOld to Zpos
293 endif
294elseif ( controlQ == 19 )
295; MessageBox "Done"
296 if ( Zpos > 2000 )
297 elseif ( GetEffect sEffectSlowFall == 1 )
298 else
299 TR_m4_TT_OrcVivec->SetHealth 0
300 endif
301 ClearForceJump
302 set controlQ to 20
303elseif ( controlQ == 30 )
304 ; The orc appears in Bal Foyen near the shrine.
305 if ( GetDisabled )
306 Enable
307 endif
308 set controlQ to 31
309elseif ( controlQ == 33 )
310 ; The orc goes to Hummurushtapi.
311 if ( GetDisabled == 0 )
312 Disable
313 endif
314 set controlQ to 34
315elseif ( controlQ == 34 )
316 ; ... and gets enabled right in time to serve as a scapegoat.
317 if ( GetJournalIndex TR_m4_TT_ArmunAdventure > 0 )
318 if ( GetDisabled )
319 Enable
320 endif
321 set controlQ to 35
322 endif
323elseif ( controlQ == 35 )
324 if ( GetDistance player < 1000 )
325 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 130 )
326 ; Serve Malacath and fight the player.
327 SetFight 100
328 else
329 ; Denounce Malacath and fight all the other orcs.
330 TR_m4_Orkrat->StartCombat TR_m4_TT_OrcVivec
331 "TR_m4_Rulka gra-Bolg"->StartCombat TR_m4_TT_OrcVivec
332 "TR_m4_Grash gra-Aragras"->StartCombat TR_m4_TT_OrcVivec
333 endif
334 set controlQ to 36
335 endif
336elseif ( controlQ == 36 )
337 if ( GetDistance player < 400 )
338 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 130 )
339 if ( GetTarget player )
340 set controlQ to 37
341 ForceGreeting
342 endif
343 else
344 set controlQ to 37
345 ForceGreeting
346 endif
347 endif
348elseif ( controlQ == 38 )
349 ; After forcegreeting the player:
350 if ( GetJournalIndex TR_m4_TT_ArmunAdventure_b == 100 )
351 if ( GetDistance player < 750 )
352 set controlQ to 39
353 ForceGreeting
354 endif
355 endif
356elseif ( controlQ == 40 )
357 ; The Red Mountain is calling!
358 if ( GetDisabled )
359 Enable
360 endif
361 set noHit to 0
362 sethealth 0
363 set controlQ to 41
364elseif ( controlQ == 101 )
365 ; companion stage!
366elseif ( controlQ == 102 )
367 if ( MenuMode == 0 )
368 set timer to ( timer + GetSecondsPassed )
369 if ( timer > 1.2 )
370 set controlQ to 103
371 PlaceAtMe T_Glb_Var_SummonFX 1 0 0
372 Return
373 endif
374 endif
375elseif ( controlQ == 103 )
376 if ( MenuMode == 0 )
377 set timer to ( timer + GetSecondsPassed )
378 if ( timer > 2 )
379 set controlQ to 101
380 PositionCell 3235, -134270, 700, 0, "Bal Foyen"
381 AIWander 200, 0, 5, 30, 20, 0, 30, 0, 0, 20, 20
382 set timer to 0
383 Return
384 endif
385 endif
386endif
387
388if ( TR_Map == 0 )
389 set TR_Map to 4
390 set noHit to -1
391endif
392
393End