TR_FM_Companion_sc
TR_Mainland.esm
Variables
11
Local Variables
T_Local_NPC
T_Local_Khajiit
T_Local_NoLore
TR_Map
NoLore
companion
TR_FM_Companion
control
controlQ
posX
posY
Source
1Begin TR_FM_Companion_sc
2
3short T_Local_NPC
4short T_Local_Khajiit
5short T_Local_NoLore
6short TR_Map
7short NoLore
8short companion
9short TR_FM_Companion
10; 0 - not a companion
11; 1 - ready to follow
12; 2 - post quest
13; 3 - following
14; 4 - following post quest
15short control
16; 0 - not on the island
17; 1 - on the island
18; 2 - Firemoth
19; 21 - near Dozhir
20; 22 - in secret tunnel
21; 23 - prison area
22; 3 - Sulfurwatch
23; 4 - Saros Mine
24; 41 - near ladder
25short controlQ
26; 1 - been there
27; 2 - teleported out
28; 3 - rewarded the player
29float posX
30float posY
31
32if ( GetDisabled )
33 Return
34endif
35
36if ( OnActivate )
37 if ( GetForceSneak )
38 ForceGreeting
39 Return
40 endif
41 Activate
42endif
43
44if ( TR_FM_Companion >= 3 )
45 if ( GetPCSneaking )
46 if ( GetForceSneak == 0 )
47 ForceSneak
48 endif
49 elseif ( GetForceSneak )
50 ClearForceSneak
51 endif
52elseif ( TR_FM_Companion == 2 )
53 if ( T_Local_Khajiit )
54 Return
55 endif
56endif
57
58if ( CellChanged )
59 if ( GetPCCell "Firemoth Legion Fort" )
60 set control to 2
61 elseif ( GetPCCell "Sulfurwatch Keep" )
62 set control to 3
63 elseif ( GetPCCell "Saros Mine" )
64 set control to 4
65 elseif ( GetInterior )
66 set control to 0
67 else
68 set control to 0
69 set posX to ( GetPos X )
70 set posY to ( GetPos Y )
71 if ( posX < -51200 )
72 if ( posX > -68608 )
73 if ( posY < -69632 )
74 if ( posY > -91136 )
75 set control to 1
76 endif
77 endif
78 endif
79 endif
80 endif
81endif
82
83if ( control == 4 )
84 if ( GetDistance TR_FM_Act_Ladder < 700 )
85 if ( TR_FM_Act_Ladder->GetDisabled == 0 )
86 set control to 41
87 endif
88 endif
89elseif ( control == 41 )
90 if ( GetDistance TR_FM_Act_Ladder > 700 )
91 set control to 4
92 elseif ( TR_FM_Act_Ladder->GetDisabled )
93 set control to 4
94 endif
95elseif ( control == 2 )
96 if ( GetPCCell "Firemoth Legion Fort, Sacked Keep" == 0 )
97 Return
98 endif
99 set posY to ( GetPos Y )
100 if ( posY > 4410 )
101 set control to 22
102 Return
103 endif
104 set posX to ( GetPos Z )
105 if ( posX < 15300 )
106 set control to 23
107 endif
108elseif ( control == 22 )
109 set posY to ( GetPos Y )
110 if ( posY < 4410 )
111 set control to 2
112 endif
113elseif ( control == 23 )
114 set posY to ( GetPos Y )
115 if ( posY > 4410 )
116 set control to 22
117 Return
118 endif
119 set posX to ( GetPos Z )
120 if ( posX > 15300 )
121 set control to 2
122 endif
123endif
124
125if ( T_Local_Khajiit )
126 Return
127endif
128
129if ( GetRace khajiit )
130 set T_Local_Khajiit to 1
131else
132 set T_Local_Khajiit to -1
133endif
134
135End