TR_m3_NPC_YontusKushummu
TR_Mainland.esm
Variables
20
Local Variables
TR_Map
control
controlQ
NoLore
T_Local_NPC
T_Local_NoLore
nohit
noattack
nothief
nointruder
noidle
noflee
nohello
sick
state
done
messageOn
button
doOnce
timer
Source
1Begin TR_m3_NPC_YontusKushummu
2
3; Yontus Kushummu is a valued client of the East Empire Company on the eastern Aanthirin.
4; He makes two appearances in the OE EEC Cano questline:
5; Q2: He shows up at the front desk with his slave in tow.
6; Q6: He and his slave are being held hostage by a smuggler in a cave.
7
8; He is disabled by default, enabled for Q2, disabled again, PositionCell'd around, reenabled for Q6.
9; This local script does the enable/disable.
10; This local script also models how, in Q6, his tongue gets cut out. He's a very unpleasant person.
11
12; Note for the future: He has Corpses Persist enabled because in one outcome for Q6, you have to
13; activate his corpse to progress. Without that ticked, his corpse might despawn after 3 days
14; and the player might be softlocked.
15
16short TR_Map
17short control
18short controlQ
19short NoLore
20short T_Local_NPC
21short T_Local_NoLore
22
23short nohit
24short noattack
25short nothief
26short nointruder
27short noidle
28short noflee
29short nohello
30
31short sick
32
33;global TR_m3_EEC_YontusFreed ;0 by default, 1 when goes free
34
35if ( MenuMode )
36 return
37endif
38
39if ( TR_Map != 3 )
40 set TR_Map to 3
41 disable
42 ; initially set nohit, noattack, etc. to 1 -- this, counterintuitively, makes it so that they have no effect
43 set nohit to 1
44 set noattack to 1
45 set nothief to 1
46 set nointruder to 1
47 set noidle to 1
48 set noflee to 1
49 set nohello to 1
50endif
51
52if ( GetJournalIndex "TR_m3_EEC_Cano2" >= 100 )
53 if ( GetJournalIndex "TR_m3_EEC_Cano2" < 120 )
54 short state
55 if ( state == -1 )
56 disable
57 set state to -10
58 elseif ( CellChanged )
59 set state to -1
60 elseif ( state == 0 )
61 AITravel -160 80 5 1 ;walking to the door...
62 set state to 1
63 elseif ( state == 1 )
64 if ( GetAIPackageDone )
65 set state to 2
66 endif
67 elseif ( state == 2 )
68 float timer
69 if ( timer < 0.5 )
70 set timer to timer + GetSecondsPassed
71 else
72 PlaySound3D "Door Heavy Open"
73 set state to -1
74 endif
75 endif
76 endif
77endif
78
79if ( OnDeath )
80 if ( GetJournalIndex "TR_m3_EEC_Cano2" < 200 )
81 Journal "TR_m3_EEC_Cano2" 300
82 PCExpell "East Empire Company"
83 "TR_m3_Yak gro-Yam"->Disable
84 elseif ( GetJournalIndex "TR_m3_EEC_Cano6" < 200 )
85 if ( TR_m3_EEC_RansomRequested ) ;implies TR_m3_EEC_Cano6 > 0
86 Journal "TR_m3_EEC_Cano6" 150
87 endif
88 endif
89endif
90
91short done
92short messageOn
93if ( sick )
94 if ( done == 0 )
95 if ( GetHealth < 1 )
96 SetParalysis 0
97 SetFatigue 0
98 set done to 1
99 return
100 endif
101 setfatigue -200
102 if ( GetParalysis == 0 )
103 SetParalysis 0
104 elseif ( Random100 > 66 )
105 SetParalysis 0
106 endif
107 elseif ( OnActivate )
108 Activate
109 endif
110 if ( OnActivate )
111 if ( GetPCSneaking )
112 Activate
113 else
114 set messageOn to 1
115 endif
116 endif
117 if ( messageOn == 1 )
118 if ( "Player"->GetItemCount "gold_001" >= 100 )
119 MessageBox "Yontus Kushummu is unconscious.", "Leave him 100 drakes", "Let him be"
120 set messageOn to 2
121 else
122 MessageBox "Yontus Kushummu is unconscious."
123 set messageOn to 0
124 endif
125 endif
126 if ( messageOn == 2 )
127 short button
128 set button to GetButtonPressed
129 if ( button == 0 )
130 "Player"->RemoveItem "gold_001" 100
131 AddItem "gold_001" 100
132 set messageOn to 0
133 elseif ( button == 1 )
134 set messageOn to 0
135 endif
136 endif
137endif
138
139if ( OnActivate )
140 AddTopic "Yontus Kushummu"
141 Activate
142 if ( GetJournalIndex "TR_m3_EEC_Cano6" > 0 )
143 if ( TR_m3_EEC_RansomRequested == 0 )
144 Journal "TR_m3_EEC_Cano6_c" 290 ;rest in peace
145 endif
146 endif
147endif
148
149if ( TR_m3_EEC_RansomRequested == 0 )
150 return
151endif
152
153; gets kidnapped by bandits
154if ( nohit )
155 ; setting these to 0 will, counterintuitively, make them have an effect
156 set nohit to 0
157 set noattack to 0
158 set nothief to 0
159 set nointruder to 0
160 set noidle to 0
161 set noflee to 0
162 set nohello to 0
163endif
164
165; goes to Infirmary of St. Meris after being freed
166short doOnce
167if ( doOnce == 0 )
168 if ( TR_m3_EEC_YontusFreed )
169 if ( GetDistance "TR_m3_EEC_YontusAid" < 1000 )
170 set sick to 1
171 set doOnce to 1
172 endif
173 endif
174endif
175
176End