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