TR_m4_VA_VarosSc
TR_Mainland.esm
Variables
21
Local Variables
nolore
TR_Map
TR_Vamp
control
controlQ
NoHello
NoFlee
NoIdle
NoIntruder
NoThief
T_Local_NPC
T_Local_NoLore
checkBlood
doOnce
andasOnce
state
teleportoutonce
teleportawaypermanent
teleporttimer
teleporttimertwo
HealTimer
Source
1begin TR_m4_VA_VarosSc
2
3short nolore
4short TR_Map
5short TR_Vamp
6short control
7short controlQ
8
9short NoHello
10short NoFlee
11short NoIdle
12short NoIntruder
13short NoThief
14short T_Local_NPC
15short T_Local_NoLore
16
17short checkBlood
18short doOnce
19short andasOnce
20short state
21float teleporttimer
22float teleporttimertwo
23float HealTimer
24short teleportoutonce
25short teleportawaypermanent
26
27
28;-----------------------------------------------
29; Drop vampire dust on death like vanilla
30;-----------------------------------------------
31
32if ( OnDeath )
33 AddItem "ingred_vampire_dust_01" 1
34 if ( GetJournalIndex "TR_m4_TT_STF_destroy_ancient" >= 10 )
35 Journal "TR_m4_TT_STF_destroy_ancient" 20
36 endif
37 if ( GetJournalIndex "TR_m4_Bal_KillOrlukh" >= 10 )
38 Journal "TR_m4_Bal_KillOrlukh" 20
39 endif
40endif
41
42if ( GetPCCell "Bal Foyen, Andas Estate: Treasure Vault" ) ;If I am in the Vault
43 if ( GetDistance Player < 10000 )
44 if ( andasOnce == 0 )
45 AiFollow Player 0 0 0 0
46 Startcombat TR_m4_q_HlaVaultGuard
47 Set andasOnce to 1
48 elseif ( andasOnce == 1 )
49 if ( TR_m4_VA_DeadAndas >= 3 )
50 AiWander 0 0 0
51 set andasOnce to 2
52 endif
53 endif
54 endif
55endif
56
57if ( andasOnce == 1 )
58 if ( MenuMode )
59 return
60 endif
61 set HealTimer to ( HealTimer + GetSecondsPassed )
62 if ( HealTimer > 0.5 )
63 ModCurrentHealth 15
64 set HealTimer to 0
65 endif
66endif
67
68if ( GetJournalIndex TR_m4_VA_Namira == 150 )
69 if ( MenuMode )
70 return
71 endif
72
73 if ( teleportoutonce == 1 )
74 return
75 endif
76
77 set teleporttimer to (teleporttimer + GetSecondsPassed)
78 if ( teleporttimer > 2 )
79 disable
80 set teleportoutonce to 1
81 endif
82endif
83
84if ( GetJournalIndex TR_m4_VA_Namira == 200 )
85 if ( MenuMode )
86 return
87 endif
88
89 if ( teleportawaypermanent == 1 )
90 return
91 endif
92
93 set teleporttimertwo to (teleporttimertwo + GetSecondsPassed)
94 if ( teleporttimertwo > 2 )
95 disable
96 set teleportawaypermanent to 1
97 endif
98endif
99
100;-----------------------------------------------
101; Check player infection/vampire status
102;-----------------------------------------------
103
104if ( CellChanged )
105 set checkBlood to 0
106 set state to 0
107
108 if ( T_Glob_PorphyricInfected )
109 elseif ( player->GetSpell "Vampire Blood Quarra" )
110 elseif ( player->GetSpell "Vampire Blood Aundae" )
111 elseif ( player->GetSpell "Vampire Blood Berne" )
112 elseif ( PCVampire != 0 )
113 elseif ( PCWerewolf == 1 )
114 else
115 ;Player isn't infected/vampire/cured vampire/werewolf
116 set checkBlood to 1
117 endif
118endif
119
120if ( MenuMode )
121 return
122endif
123
124;------------------------------------------------
125; Player was not infected before changing cell,
126; so constantly check for infection and then run
127; this clan's specific global script
128;------------------------------------------------
129
130if ( checkBlood )
131 if ( player->GetSpellEffects "T_Vamp_Dis_Orlukh" )
132 if ( ScriptRunning "T_ScVamp_Orlukh_PC" != 1 )
133 StartScript "T_ScVamp_Orlukh_PC"
134 endif
135 endif
136
137;------------------------------------------------
138; Player was infected/vampire before changing cell,
139; so check whether player is in an enemy clan
140;------------------------------------------------
141
142elseif ( state != 1 )
143 if ( VampClan == 101 )
144 SetFight 30 ;Player is a friendly vampire
145 else
146 SetFight 90 ;Player is an enemy vampire
147 endif
148
149 set state to 1
150endif
151
152;------------------------------------------------
153; Apply vampire spells/abilities to this NPC once
154;------------------------------------------------
155
156if ( doOnce == 0 )
157 AddSpell "T_Vamp_Dis_Orlukh"
158 AddSpell "T_Vamp_Ab_Orlukh"
159 AddSpell "Vampire Attributes"
160 AddSpell "Vampire Skills"
161 AddSpell "Vampire Immunities"
162 AddSpell "Vampire Sun Damage"
163 ModRestoration 75
164 ;set province-specific location variable for dialogue here
165 set TR_Map to 4
166 set TR_Vamp to 1
167 set doOnce to 1
168endif
169
170end