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