TR_m4_DevaniVampire_Sc
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_DevaniVampire_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
36if ( TR_m4_DredaseDevani )
37 if ( GetDisabled )
38 enable
39 endif
40elseif ( GetDisabled == 0 )
41 disable
42endif
43
44if ( OnDeath )
45 set TR_m4_Barendreth_DeadOrd to ( TR_m4_Barendreth_DeadOrd + 1 )
46 AddItem "ingred_vampire_dust_01" 1
47 if ( TR_m4_Barendreth_DeadOrd >= 10 )
48 if ( GetJournalIndex "TR_m4_VA_BarendrethProtection" >= 10 )
49 if ( GetJournalIndex "TR_m4_VA_BarendrethProtection" < 100 )
50 Journal "TR_m4_VA_BarendrethProtection" 20
51 endif
52 endif
53 endif
54endif
55
56;-----------------------------------------------
57; Check player infection/vampire status
58;-----------------------------------------------
59
60if ( CellChanged )
61 set checkBlood to 0
62 set state to 0
63
64 if ( T_Glob_PorphyricInfected )
65 elseif ( player->GetSpell "Vampire Blood Quarra" )
66 elseif ( player->GetSpell "Vampire Blood Aundae" )
67 elseif ( player->GetSpell "Vampire Blood Berne" )
68 elseif ( PCVampire != 0 )
69 elseif ( PCWerewolf == 1 )
70 else
71 ;Player isn't infected/vampire/cured vampire/werewolf
72 set checkBlood to 1
73 endif
74endif
75
76if ( fixHead )
77 ;Mod-added heads disappear when the Vampirism effect is removed/swapped
78 ;To fix this we equip a helmet and remove it to reset the head model
79 set fixHead to 0
80 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional
81 RemoveItem T_Glb_Var_HeadFixer 1
82endif
83
84if ( MenuMode )
85 return
86endif
87
88;Baluath stuff, see cure script
89set timer to ( timer + GetSecondsPassed )
90if ( timer > 1 )
91 set timer to 0
92 if ( ashStorm )
93 set ashStorm to 0
94 endif
95 if ( GetWindSpeed )
96 if ( GetCurrentWeather >= 6 ) ;ash
97 if ( GetCurrentWeather <= 7 ) ;blight
98 set ashStorm to 1
99 endif
100 endif
101 endif
102 if ( ashStorm )
103 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 )
104 AddSpell "T_Vamp_Ab_Baluath_Ash"
105 AddSpell "T_Vamp_Sp_Baluath_Ash"
106 AddSpell "T_Vamp_Ab_Baluath_SunDmg"
107 RemoveSpell "vampire sun damage"
108 set fixHead to 1
109 endif
110 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" )
111 RemoveSpell "T_Vamp_Ab_Baluath_Ash"
112 RemoveSpell "T_Vamp_Sp_Baluath_Ash"
113 AddSpell "vampire sun damage"
114 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg"
115 set fixHead to 1
116 endif
117endif
118
119
120;------------------------------------------------
121; Player was not infected before changing cell,
122; so constantly check for infection and then run
123; this clan's specific global script
124;------------------------------------------------
125
126if ( checkBlood )
127 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" )
128 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 )
129 StartScript "T_ScVamp_Baluath_PC"
130 endif
131 endif
132
133;------------------------------------------------
134; Player was infected/vampire before changing cell,
135; so check whether player is in an enemy clan
136;------------------------------------------------
137
138elseif ( state != 1 )
139 SetFight 90 ;hostile to everyone
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 ModRestoration 75
156 ;set province-specific location variable for dialogue here
157 set TR_Map to 4
158 set doOnce to 1
159endif
160
161end