TR_m2_q_5_Staron
TR_Mainland.esm
Variables
7
Local Variables
TR_Map
control
controlQ
T_Local_NPC
NoLore
proximityTriggered
timer
Source
1Begin TR_m2_q_5_Staron
2; Script on NPC TR_m2_Staron for quest TR_m2_TMo_GoneToGround.
3
4short TR_Map
5short control
6short controlQ
7float timer ; the timer is only used as a failsafe for GetSoundPlaying being buggy.
8short T_Local_NPC
9short NoLore
10short proximityTriggered
11
12if ( GetDisabled == 1 )
13 SetDelete 1
14 return
15endif
16
17if ( MenuMode == 1 )
18 return
19endif
20
21; New logic when leading Staron to Ordinators with command
22if ( proximityTriggered == 0 )
23 if ( GetJournalIndex "TR_m2_TMo_GoneToGround" >= 30 )
24 if ( GetJournalIndex "TR_m2_TMo_GoneToGround" < 40 )
25 if ( GetDistance "TR_m2_q_5_GalsuMerith" <= 300 )
26 Journal "TR_m2_TMo_GoneToGround" 45
27 set proximityTriggered to 1
28 ; Freeze Staron - he's been apprehended by the Ordinators
29 AiWander 0 0 0 0 0 0 0 0 0 0 0 0
30 endif
31 endif
32 endif
33endif
34
35; The NPC casts a spell (that is supposed to look like teleportation to the
36; player, although technically is telekinesis) and disappears.
37; I've added an "if ( timer > 10 )" loop to account for the chance of getSoundPlaying
38; failing to fire. -- arvisrend, 20 Nov 2012
39if ( controlQ == 3 )
40 Cast, "telekinesis", player
41 set timer to 0
42 set controlQ to 4
43ElseIf ( controlQ == 4 )
44 if ( GetSoundPlaying "mysticism hit" == 1 )
45 set controlQ to 5
46 PositionCell -121 -31 550 1800 "Helnim, Chapel of Kynareth" ;TR_m2_MARK_Staron
47 AiWander 0 0 0 0 0 0 0 0 0 0 0 0
48 elseif ( timer > 10 )
49 set controlQ to 5
50 PositionCell -121 -31 550 1800 "Helnim, Chapel of Kynareth" ;TR_m2_MARK_Staron
51 AiWander 0 0 0 0 0 0 0 0 0 0 0 0
52 endif
53 set timer to ( timer + GetSecondsPassed )
54endif
55
56; Same logic as above, but different teleportation target.
57if ( control == 1 )
58 Cast, "telekinesis", player
59 set timer to 0
60 set control to 2
61ElseIf ( control == 2 )
62 if ( GetSoundPlaying "mysticism hit" == 1 )
63 set control to 0
64 Disable
65 elseif ( timer > 10 )
66 set control to 0
67 Disable
68 endif
69 set timer to ( timer + GetSecondsPassed )
70endif
71
72if ( TR_Map != 2 )
73 set TR_Map to 2
74endif
75
76End