TR_m4_AT_TG_Q5_NoteSc
TR_Mainland.esm
Variables
2
Local Variables
OnPCEquip
PCSkipEquip
Source
1Begin TR_m4_AT_TG_Q5_NoteSc
2
3short OnPCEquip
4short PCSkipEquip
5
6set PCSkipEquip to 0
7; any actions that might end the script must be placed lower than this line
8
9if ( getJournalIndex TR_m3_TG_AT_Q5 < 10 )
10 if ( getDisabled == 0 )
11 Disable
12 endif
13elseif ( getDisabled )
14 Enable
15endif
16
17; Activating from the inventory
18
19if ( MenuMode )
20
21 ; the vanilla engine fails to set PCSkipEquip under certain
22 ; conditions, so we must do it ourselves for
23 ; OnPCEquip to work properly
24
25 set PCSkipEquip to 1
26 if ( OnPCEquip )
27
28 ; place actions for when the player opened the book from the inventory here
29 if ( getJournalIndex TR_m3_TG_AT_Q5 >= 10 )
30 if ( getJournalIndex TR_m3_TG_AT_Q5 < 20 )
31 Journal TR_m3_TG_AT_Q5 20
32 endif
33 endif
34
35 set OnPCEquip to 0
36 set PCSkipEquip to 0 ; OpenMW fails to open the book without this line
37 Activate
38 endif
39
40 ; this return is important
41 ; we must make sure OnActivate secton is only accessed outside of MenuMode
42 ; or the vanilla engine fails to take the book if opened from the world
43 return
44endif
45
46; Activating in the world
47if ( OnActivate )
48
49 ; place actions for when the player opened the book from the world here
50 if ( getJournalIndex TR_m3_TG_AT_Q5 >= 10 )
51 if ( getJournalIndex TR_m3_TG_AT_Q5 < 20 )
52 Journal TR_m3_TG_AT_Q5 20
53 endif
54 endif
55
56 Activate
57endif
58end