TR_m7_ShiSha_Haunt_Ghst_sc
TR_Mainland.esm
Variables
3
Local Variables
controlQ
doonce
timer
Source
1Begin TR_m7_ShiSha_Haunt_Ghst_sc
2; Script used on TR_m7_ShiSha_Haunt_Ghst in Shipal-Sharai's abandoned apartment
3; Handles behavior of ghost in quest TR_m7_ShiSha_Haunt
4
5short controlQ ; used in ghost's Greeting 1 dialogue and set here, in ghost's haunted music topic, and in TR_m7_ShiSha_Haunt_Shiratar_sc
6
7; variables used for disabling ghost after his death animation when he retires peacefully during quest
8short doonce
9float timer
10
11; if player attacks ghost
12if ( GetAttacked )
13 set controlQ to 2 ; triggers ghost's enraged Greeting 1 dialogue
14endif
15
16; before quest, disable ghost
17; during quest, perform death handling (enabling ghost is done in TR_m7_ShiSha_Haunt_Shiratar_sc)
18; and disable ghost after he retires peacefully so player cannot loot him
19if ( GetJournalIndex "TR_m7_ShiSha_Haunt" < 10 )
20 if ( GetDisabled == 0 )
21 Disable
22 endif
23elseif ( GetJournalIndex "TR_m7_ShiSha_Haunt" < 50 )
24 if ( OnDeath )
25 Journal TR_m7_ShiSha_Haunt 70
26 endif
27elseif ( GetJournalIndex "TR_m7_ShiSha_Haunt" >= 110 )
28 if ( GetDisabled == 0 )
29 Disable
30 endif
31elseif ( controlQ == -1 ) ; ghost is retiring peacefully
32 if ( MenuMode ) ; so timer doesn't increase while still in dialogue
33 return
34 elseif ( doonce == 0 )
35 set timer to ( timer + GetSecondsPassed )
36 if ( timer > 1 )
37 set doonce to 1
38 Disable
39 endif
40 endif
41endif
42
43End