TR_m2_He_TG3_Decode
TR_Mainland.esm
Variables
10
Local Variables
OnPCEquip
PCSkipEquip
button
status
doc1
doc2
doc3
docgiven
rand1
rand2
Source
1Begin TR_m2_He_TG3_Decode
2
3short OnPCEquip
4short PCSkipEquip
5short button
6short status
7short doc1
8short doc2
9short doc3
10short docgiven
11short rand1
12short rand2
13
14set PCSkipEquip to 0
15
16if ( MenuMode )
17 set PCSkipEquip to 1
18 if ( OnPCEquip )
19 Activate
20 if ( Player->GetItemCount T_BKGen_EECCoded_01 >= 1 )
21 if ( DocGiven <= 3 )
22 Messagebox "Do you want to use the code book to decipher the coded document?" "Yes" "No"
23 set status to 1
24 endif
25 endif
26 set OnPCEquip to 0
27 set PCSkipEquip to 0 ; OpenMW fails to open the book without this line
28 endif
29 If ( status == 1)
30 Set button to GetButtonPressed
31 set rand1 to ( Random, 3 )
32 set rand2 to ( Random, 2 )
33 If ( button == -1 )
34 return
35 Elseif ( button == 0 )
36 Set status to 0
37 Player->RemoveItem T_BKGen_EECCoded_01 1
38 if ( docgiven == 0 )
39 if ( rand1 == 0 )
40 Player->Additem TR_m2_He_TG3_Decoded01 1
41 set doc1 to 1
42 elseif (rand1 == 1 )
43 Player->Additem TR_m2_He_TG3_Decoded02 1
44 set doc2 to 1
45 else
46 Player->Additem TR_m2_He_TG3_Decoded03 1
47 set doc3 to 1
48 endif
49 set docgiven to 1
50 elseif ( docgiven == 1 )
51 set docgiven to 2
52 if ( doc1 == 1 )
53 if ( rand2 == 0 )
54 Player->Additem TR_m2_He_TG3_Decoded02 1
55 set doc2 to 1
56 else
57 Player->Additem TR_m2_He_TG3_Decoded03 1
58 set doc3 to 1
59 endif
60 else
61 if ( doc2 == 1 )
62 if ( rand2 == 0 )
63 Player->Additem TR_m2_He_TG3_Decoded01 1
64 set doc1 to 1
65 else
66 Player->Additem TR_m2_He_TG3_Decoded03 1
67 set doc3 to 1
68 endif
69 else
70 if ( doc3 == 1 )
71 if ( rand2 == 0 )
72 Player->Additem TR_m2_He_TG3_Decoded02 1
73 set doc2 to 1
74 else
75 Player->Additem TR_m2_He_TG3_Decoded01 1
76 set doc1 to 1
77 endif
78 endif
79 endif
80 endif
81 elseif ( DocGiven == 2 )
82 set docgiven to 3
83 if ( doc1 == 1 )
84 if ( doc2 == 1 )
85 Player->Additem TR_m2_He_TG3_Decoded03 1
86 set doc3 to 1
87 else
88 Player->Additem TR_m2_He_TG3_Decoded02 1
89 set doc2 to 1
90 endif
91 else
92 Player->Additem TR_m2_He_TG3_Decoded01 1
93 set doc1 to 1
94 endif
95 endif
96 Elseif ( button == 1 )
97 Set status to 0
98 Endif
99 Endif
100 return
101endif
102
103if ( OnActivate )
104 Activate
105endif
106
107end