TR_m4_Bal_NPC_VelynThindo_Sc
TR_Mainland.esm
Variables
20
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
timer
Source
1begin TR_m4_Bal_NPC_VelynThindo_Sc
2
3; Baluath Questline
4; Script running on Velyn Thindo.
5
6; PROVINCE LOCAL VARIABLES HERE
7short nolore
8short TR_Map
9short T_Local_Vampire
10short control
11short controlQ
12
13short NoHello
14short NoFlee
15short NoIdle
16short NoIntruder
17short NoThief
18short T_Local_NPC
19short T_Local_NoLore
20
21short checkBlood
22short doOnce
23short state
24
25;Vanilla global PCVampire
26;Vanilla global PCWerewolf
27;Tamriel_Data global T_Glob_PorphyricInfected
28
29;Baluath ash storm benefits variables
30float timer
31short ashStorm
32short fixHead
33
34; Velyn Thindo
35short TR_m4_Bal_ClanMember
36short greeting
37
38;-----------------------------------------------
39; Drop vampire dust on death like vanilla
40;-----------------------------------------------
41
42if ( OnDeath )
43 AddItem "ingred_vampire_dust_01" 1
44
45 ; Velyn Thindo
46 if ( TR_m4_Bal_ClanMember == 1 )
47 set TR_m4_baluathdead to ( TR_m4_baluathdead + 1 )
48 endif
49endif
50
51;-----------------------------------------------
52; Check player infection/vampire status
53;-----------------------------------------------
54
55if ( CellChanged )
56 set checkBlood to 0
57 set state to 0
58
59 if ( T_Glob_PorphyricInfected )
60 elseif ( player->GetSpell "Vampire Blood Quarra" )
61 elseif ( player->GetSpell "Vampire Blood Aundae" )
62 elseif ( player->GetSpell "Vampire Blood Berne" )
63 elseif ( PCVampire != 0 )
64 elseif ( PCWerewolf == 1 )
65 else
66 ;Player isn't infected/vampire/cured vampire/werewolf
67 set checkBlood to 1
68 endif
69endif
70
71if ( fixHead )
72 ;Mod-added heads disappear when the Vampirism effect is removed/swapped
73 ;To fix this we equip a helmet and remove it to reset the head model
74 set fixHead to 0
75 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional
76 RemoveItem T_Glb_Var_HeadFixer 1
77endif
78
79if ( MenuMode )
80 return
81endif
82
83;Baluath stuff, see cure script
84set timer to ( timer + GetSecondsPassed )
85if ( timer > 1 )
86 set timer to 0
87 if ( ashStorm )
88 set ashStorm to 0
89 endif
90 if ( GetWindSpeed )
91 if ( GetCurrentWeather >= 6 ) ;ash
92 if ( GetCurrentWeather <= 7 ) ;blight
93 set ashStorm to 1
94 endif
95 endif
96 endif
97 if ( ashStorm )
98 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 )
99 AddSpell "T_Vamp_Ab_Baluath_Ash"
100 AddSpell "T_Vamp_Sp_Baluath_Ash"
101 AddSpell "T_Vamp_Ab_Baluath_SunDmg"
102 RemoveSpell "vampire sun damage"
103 set fixHead to 1
104 endif
105 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" )
106 RemoveSpell "T_Vamp_Ab_Baluath_Ash"
107 RemoveSpell "T_Vamp_Sp_Baluath_Ash"
108 AddSpell "vampire sun damage"
109 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg"
110 set fixHead to 1
111 endif
112endif
113
114
115;------------------------------------------------
116; Player was not infected before changing cell,
117; so constantly check for infection and then run
118; this clan's specific global script
119;------------------------------------------------
120
121if ( checkBlood )
122 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" )
123 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 )
124 StartScript "T_ScVamp_Baluath_PC"
125 endif
126 endif
127
128;------------------------------------------------
129; Player was infected/vampire before changing cell,
130; so check whether player is in an enemy clan
131;------------------------------------------------
132
133elseif ( state != 1 )
134 if ( VampClan == 100 )
135 SetFight 30 ;Player is a friendly vampire
136 else
137 SetFight 90 ;Player is an enemy vampire
138 endif
139
140 set state to 1
141endif
142
143;------------------------------------------------
144; Apply vampire spells/abilities to this NPC once
145;------------------------------------------------
146
147if ( doOnce == 0 )
148 AddSpell "T_Vamp_Dis_Baluath"
149 AddSpell "T_Vamp_Ab_Baluath"
150 AddSpell "Vampire Attributes"
151 AddSpell "Vampire Skills"
152 AddSpell "Vampire Immunities"
153 AddSpell "Vampire Sun Damage"
154 AddSpell "Vampire Touch"
155 ;set province-specific location variable for dialogue here
156 set TR_Map to 4
157 set doOnce to 1
158
159 ; Velyn Thindo
160 set TR_m4_Bal_ClanMember to 1
161endif
162
163;------------------------------------------------
164; Velyn Thindo quest-specific behavior
165;------------------------------------------------
166
167; QUEST 4
168; greeting = 1: first greeting in Ald Balaal
169
170; disable before quest
171if ( GetJournalIndex "TR_m4_Bal4_Sathram" < 40 )
172 if ( GetDisabled )
173 return
174 else
175 disable
176 return
177 endif
178elseif ( GetDisabled )
179 enable
180 return
181endif
182
183end