TR_m7_Ns_IC2_ghost_sc
TR_Mainland.esm
Variables
13
Local Variables
TR_Map
control
controlQ
NoLore
stage
killed
NoHello
nothief
DoOnce
T_Local_NPC
T_Local_NoLore
time
timer
Source
1Begin TR_m7_Ns_IC2_ghost_sc
2;This script copies TR_m3_Kha_GhostNoLore
3;Allows ghost to resurrect if killed
4;Also ensures only present during Narsis Imperial Cult quest 2
5
6short TR_Map
7short control
8short controlQ
9short NoLore
10short stage
11short killed
12short NoHello
13short nothief
14short DoOnce
15float time
16float timer
17short T_Local_NPC
18short T_Local_NoLore
19
20set TR_Map to 7
21
22if ( OnActivate == 1 )
23 if ( GetHealth < 1 )
24 return
25 else
26 Activate
27 endif
28endif
29
30if ( GetJournalIndex TR_m7_Ns_IC2 <= 0 )
31 Disable
32endif
33
34if ( GetJournalIndex TR_m7_NS_IC2 >= 40 )
35 Disable
36endif
37
38if ( DoOnce == 0 )
39 if ( GetJournalIndex TR_m7_Ns_IC2 > 0 )
40 Enable
41 set DoOnce to 1
42 endif
43endif
44
45if ( stage == 2 )
46 if ( MenuMode )
47 return
48 endif
49
50 set time to ( time + GetSecondsPassed )
51
52 if ( time > 3.7 )
53 set stage to 0
54 Enable
55 PlaceAtMe "T_Glb_Var_GhostDeathFX2" 1 64 0
56 Resurrect
57 return
58 endif
59
60 if ( GetDisabled == 0 )
61 Disable
62 endif
63endif
64
65if ( stage == 0 )
66 If ( GetHealth < 1 )
67 set stage to 1
68 If ( GetFatigue <= 0 )
69 PlaceAtMe "T_Glb_Var_GhostDeathFX1" 1 0 0
70 else
71 PlaceAtMe "T_Glb_Var_GhostDeathFX2" 1 0 0
72 endif
73 endif
74endif
75
76If ( OnDeath )
77 set time to 0
78 set stage to 2
79 if ( killed < 1 )
80 set killed to 1
81 endif
82endif
83
84End