TR_m4_V_Kashshaptu_scr
TR_Mainland.esm
Variables
24
Local Variables
nolore
TR_Map
T_Local_Vampire
control
controlQ
NoHello
NoFlee
NoIdle
NoIntruder
NoThief
T_Local_NPC
T_Local_NoLore
checkBlood
doOnce
state
ashStorm
fixHead
TR_m4_Bal_ClanMember
greeting
levitateDay
AnotherClanInfected
OnPCHitMe
hostile
timer
Source
1begin TR_m4_V_Kashshaptu_scr
2
3;Should check for all vanilla and T_D province mod infection
4;---
5;Checks run on cellchange and then constantly if applicable
6;No need for always-running global scripts like vanilla
7
8; PROVINCE LOCAL VARIABLES HERE
9short nolore
10short TR_Map
11short T_Local_Vampire
12short control
13short controlQ
14
15short NoHello
16short NoFlee
17short NoIdle
18short NoIntruder
19short NoThief
20short T_Local_NPC
21short T_Local_NoLore
22
23short checkBlood
24short doOnce
25short state
26
27;Vanilla global PCVampire
28;Vanilla global PCWerewolf
29;Tamriel_Data global T_Glob_PorphyricInfected
30
31;Baluath ash storm benefits variables
32float timer
33short ashStorm
34short fixHead
35
36; Kashshaptu
37short TR_m4_Bal_ClanMember
38short greeting
39short levitateDay
40short AnotherClanInfected
41
42short OnPCHitMe
43short hostile
44
45;-----------------------------------------------
46; Drop vampire dust on death like vanilla
47; Also a kill target for Orlukh
48; And a kill target for Troubles on the Road
49;-----------------------------------------------
50
51if ( OnPCHitMe )
52 if ( VampClan != 100 )
53 if ( hostile == 0 )
54 set hostile to 1
55 set "TR_m4_v_Etemmu".hostile to 1
56 set "TR_m4_v_UtukkuSeri".hostile to 1
57 endif
58 endif
59 startcombat player
60endif
61
62if ( hostile == 1 )
63 set hostile to 2
64 setfight 100
65endif
66
67if ( OnDeath )
68 AddItem "ingred_vampire_dust_01" 1
69 set TR_m4_baluathdead to ( TR_m4_baluathdead + 1 )
70 if ( GetJournalIndex TR_m4_VA_DestroyBaluath >= 10 )
71 if ( TR_m4_baluathdead >= 3 )
72 Journal TR_m4_VA_DestroyBaluath 150
73 endif
74 elseif ( GetJournalIndex TR_m4_Bal0_Troubles >= 20 )
75 if ( GetJournalIndex TR_m4_Bal0_Troubles < 80 )
76 if ( TR_m4_baluathdead >= 3 )
77 Journal TR_m4_Bal0_Troubles 80
78 endif
79 endif
80 endif
81endif
82
83;-----------------------------------------------
84; Check player infection/vampire status
85;-----------------------------------------------
86
87if ( CellChanged )
88 set checkBlood to 0
89 set state to 0
90
91 if ( T_Glob_PorphyricInfected )
92 elseif ( player->GetSpell "Vampire Blood Quarra" )
93 elseif ( player->GetSpell "Vampire Blood Aundae" )
94 elseif ( player->GetSpell "Vampire Blood Berne" )
95 elseif ( PCVampire != 0 )
96 elseif ( PCWerewolf == 1 )
97 else
98 ;Player isn't infected/vampire/cured vampire/werewolf
99 set checkBlood to 1
100 endif
101endif
102
103if ( fixHead )
104 ;Mod-added heads disappear when the Vampirism effect is removed/swapped
105 ;To fix this we equip a helmet and remove it to reset the head model
106 set fixHead to 0
107 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional
108 RemoveItem T_Glb_Var_HeadFixer 1
109endif
110
111if ( MenuMode )
112 return
113endif
114
115;Baluath stuff, see cure script
116set timer to ( timer + GetSecondsPassed )
117if ( timer > 1 )
118 set timer to 0
119 if ( ashStorm )
120 set ashStorm to 0
121 endif
122 if ( GetWindSpeed )
123 if ( GetCurrentWeather >= 6 ) ;ash
124 if ( GetCurrentWeather <= 7 ) ;blight
125 set ashStorm to 1
126 endif
127 endif
128 endif
129 if ( ashStorm )
130 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 )
131 AddSpell "T_Vamp_Ab_Baluath_Ash"
132 AddSpell "T_Vamp_Sp_Baluath_Ash"
133 AddSpell "T_Vamp_Ab_Baluath_SunDmg"
134 RemoveSpell "vampire sun damage"
135 set fixHead to 1
136 endif
137 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" )
138 RemoveSpell "T_Vamp_Ab_Baluath_Ash"
139 RemoveSpell "T_Vamp_Sp_Baluath_Ash"
140 AddSpell "vampire sun damage"
141 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg"
142 set fixHead to 1
143 endif
144endif
145
146
147;------------------------------------------------
148; Player was not infected before changing cell,
149; so constantly check for infection and then run
150; this clan's specific global script
151;------------------------------------------------
152
153if ( checkBlood )
154 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" )
155 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 )
156 StartScript "T_ScVamp_Baluath_PC"
157 endif
158 endif
159
160;------------------------------------------------
161; Player was infected/vampire before changing cell,
162; so check whether player is in an enemy clan
163;------------------------------------------------
164
165elseif ( state != 1 )
166 if ( VampClan == 100 )
167 SetFight 30 ;Player is a friendly vampire
168 elseif ( GetJournalIndex TR_m4_Bal0_Troubles == 70 )
169 if ( T_Glob_PorphyricInfected == 100 )
170 SetFight 30 ;Player was infected by Kashshaptu
171 endif
172 else
173 SetFight 90 ;Player is an enemy vampire
174 endif
175
176 set state to 1
177endif
178
179;------------------------------------------------
180; Apply vampire spells/abilities to this NPC once
181;------------------------------------------------
182
183if ( doOnce == 0 )
184 AddSpell "T_Vamp_Dis_Baluath"
185 AddSpell "T_Vamp_Ab_Baluath"
186 AddSpell "Vampire Attributes"
187 AddSpell "Vampire Skills"
188 AddSpell "Vampire Immunities"
189 AddSpell "Vampire Sun Damage"
190 AddSpell "Vampire Touch"
191 ModRestoration 75
192 ;set province-specific location variable for dialogue here
193 set TR_Map to 4
194 set doOnce to 1
195
196 ; Kashshaptu
197 set TR_m4_Bal_ClanMember to 1
198endif
199
200;------------------------------------------------
201; Kashshaptu quest-specific behavior
202;------------------------------------------------
203
204; QUEST 1
205; controlQ = 1: asked 'have potential'
206; controlQ = 2: asked 'our situation'
207; greeting = 1: forcegreeted plain mortal
208; greeting = 2: forcegreeted before attacking
209; greeting = 3: flavour dialogue in Q2
210
211if ( GetJournalIndex "TR_m4_Bal0_Troubles" < 100 )
212
213 if ( AnotherClanInfected == 0 )
214 if ( player->getspell "vampire blood aundae" == 1 )
215 set AnotherClanInfected to 1
216 elseif ( player->getspell "vampire blood berne" == 1 )
217 set AnotherClanInfected to 1
218 elseif ( player->getspell "vampire blood quarra" == 1 )
219 set AnotherClanInfected to 1
220 elseif ( T_Glob_PorphyricInfected > 0 )
221 if ( T_Glob_PorphyricInfected != 100 )
222 set AnotherClanInfected to 1
223 endif
224 endif
225 endif
226
227 if ( greeting < 2 )
228
229 ; forcegreet enemy vampires when detected
230 if ( PCVampire == 1 )
231 if ( VampClan != 100 )
232 if ( GetDetected player )
233 ForceGreeting
234 set greeting to 2
235 return
236 endif
237 endif
238
239 ; forcegreet werewolves when detected
240 elseif ( PCWerewolf == 1 )
241 if ( GetDetected player )
242 ForceGreeting
243 set greeting to 2
244 return
245 endif
246
247 ; forcegreet other clan's disease when detected
248 elseif ( AnotherClanInfected == 1 )
249 if ( GetDetected player )
250 ForceGreeting
251 set greeting to 2
252 return
253 endif
254
255 ; forcegreet if you cured the Dark Gift when detected
256 ; EDIT: commented because she forcegreets you before T_Glob_PorphyricInfected is set to 100
257 ;elseif ( GetJournalIndex "TR_m4_Bal0_Troubles" == 70 )
258 ; if ( T_Glob_PorphyricInfected != 100 )
259 ; if ( PCVampire < 1 )
260 ; if ( GetDetected player )
261 ; ForceGreeting
262 ; set greeting to 2
263 ; return
264 ; endif
265 ; endif
266 ; endif
267
268 endif
269 endif
270
271 if ( greeting < 1 )
272 ; forcegreet plain mortal when detected
273 if ( T_Glob_PorphyricInfected == 0 )
274 if ( PCVampire == 0 )
275 if ( GetDetected player )
276 ForceGreeting
277 set greeting to 1
278 return
279 endif
280 endif
281 endif
282 endif
283
284endif
285
286if ( control == 0 )
287 if ( levitateDay < DaysPassed )
288 set levitateDay to DaysPassed
289 set control to 1
290 endif
291endif
292
293end