TR_m4_NPC_V_Suripalk
TR_Mainland.esm
Variables
18
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
timer
Source
1begin TR_m4_NPC_V_Suripalk
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
36if ( GetJournalIndex TR_m4_Bal_KillOrlukh >= 100 )
37 if ( GetDisabled == 0 )
38 disable
39 endif
40 return
41elseif ( GetDeadCount "TR_m4_v_Kashshaptu" > 0 )
42 if ( GetDisabled )
43 enable
44 endif
45elseif ( GetDeadCount "TR_m4_v_Etemmu" > 0 )
46 if ( GetDisabled )
47 enable
48 endif
49elseif ( GetDeadCount "TR_m4_v_UtukkuSeri" > 0 )
50 if ( GetDisabled )
51 enable
52 endif
53elseif ( GetDeadCount "TR_m4_v_Ofelia" > 0 )
54 if ( GetDisabled )
55 enable
56 endif
57elseif ( PCExpelled "T_Mw_Clan_Baluath" )
58 if ( GetDisabled )
59 enable
60 endif
61elseif ( PCVampire == 0 )
62 if ( GetDisabled == 0 )
63 disable
64 endif
65 return
66elseif ( PCVampire == -1 )
67 if ( GetDisabled )
68 enable
69 endif
70elseif ( VampClan != 100 )
71 if ( GetDisabled )
72 enable
73 endif
74else
75 if ( GetDisabled == 0 )
76 disable
77 endif
78 return
79endif
80
81;-----------------------------------------------
82; Drop vampire dust on death like vanilla
83;-----------------------------------------------
84
85if ( OnDeath )
86 AddItem "ingred_vampire_dust_01" 1
87endif
88
89;-----------------------------------------------
90; Check player infection/vampire status
91;-----------------------------------------------
92
93if ( CellChanged )
94 set checkBlood to 0
95 set state to 0
96
97 if ( T_Glob_PorphyricInfected )
98 elseif ( player->GetSpell "Vampire Blood Quarra" )
99 elseif ( player->GetSpell "Vampire Blood Aundae" )
100 elseif ( player->GetSpell "Vampire Blood Berne" )
101 elseif ( PCVampire != 0 )
102 elseif ( PCWerewolf == 1 )
103 else
104 ;Player isn't infected/vampire/cured vampire/werewolf
105 set checkBlood to 1
106 endif
107endif
108
109if ( fixHead )
110 ;Mod-added heads disappear when the Vampirism effect is removed/swapped
111 ;To fix this we equip a helmet and remove it to reset the head model
112 set fixHead to 0
113 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional
114 RemoveItem T_Glb_Var_HeadFixer 1
115endif
116
117if ( MenuMode )
118 return
119endif
120
121;Baluath stuff, see cure script
122set timer to ( timer + GetSecondsPassed )
123if ( timer > 1 )
124 set timer to 0
125 if ( ashStorm )
126 set ashStorm to 0
127 endif
128 if ( GetWindSpeed )
129 if ( GetCurrentWeather >= 6 ) ;ash
130 if ( GetCurrentWeather <= 7 ) ;blight
131 set ashStorm to 1
132 endif
133 endif
134 endif
135 if ( ashStorm )
136 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 )
137 AddSpell "T_Vamp_Ab_Baluath_Ash"
138 AddSpell "T_Vamp_Sp_Baluath_Ash"
139 AddSpell "T_Vamp_Ab_Baluath_SunDmg"
140 RemoveSpell "vampire sun damage"
141 set fixHead to 1
142 endif
143 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" )
144 RemoveSpell "T_Vamp_Ab_Baluath_Ash"
145 RemoveSpell "T_Vamp_Sp_Baluath_Ash"
146 AddSpell "vampire sun damage"
147 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg"
148 set fixHead to 1
149 endif
150endif
151
152
153;------------------------------------------------
154; Player was not infected before changing cell,
155; so constantly check for infection and then run
156; this clan's specific global script
157;------------------------------------------------
158
159if ( checkBlood )
160 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" )
161 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 )
162 StartScript "T_ScVamp_Baluath_PC"
163 endif
164 endif
165
166;------------------------------------------------
167; Player was infected/vampire before changing cell,
168; so check whether player is in an enemy clan
169;------------------------------------------------
170
171elseif ( state != 1 )
172 if ( VampClan == 100 )
173 SetFight 30 ;Player is a friendly vampire
174 else
175 SetFight 90 ;Player is an enemy vampire
176 endif
177
178 set state to 1
179endif
180
181;------------------------------------------------
182; Apply vampire spells/abilities to this NPC once
183;------------------------------------------------
184
185if ( doOnce == 0 )
186 AddSpell "T_Vamp_Dis_Baluath"
187 AddSpell "T_Vamp_Ab_Baluath"
188 AddSpell "Vampire Attributes"
189 AddSpell "Vampire Skills"
190 AddSpell "Vampire Immunities"
191 AddSpell "Vampire Sun Damage"
192 AddSpell "Vampire Touch"
193 ModRestoration 75
194 ;set province-specific location variable for dialogue here
195 set TR_Map to 4
196 set doOnce to 1
197endif
198
199end