CharGenClassNPC
Morrowind.esm
Variables
3
Local Variables
state
NoLore
timer
Source
1begin CharGenClassNPC
2
3;This is on the guy who creates your class.
4
5
6short state ;tracks state of questioning. -1 when over.
7Short NoLore ;blocks discussion of general topics
8float timer
9
10if ( menumode == 1)
11 return
12endif
13
14if ( state == -1 )
15 if ( OnActivate == 1 )
16 Activate
17 endif
18endif
19
20if ( GetHealth == 0 )
21 return
22endif
23
24;return if you've talked to captain and don't have papers
25if ( "CharGen Captain".state == -1 )
26 SetHello 30
27 return
28endif
29
30 ;greeting
31 if ( State == 0 )
32
33 "CharGen StatsSheet"->Disable ;hide the actual scroll itself
34
35 ;disable all the boat stuff outside and the guys
36 "CharGen Boat"->Disable
37 "CharGen Boat Guard 1"->disable
38 "CharGen Boat Guard 2"->disable
39 "CharGen Dock Guard"->disable
40 "CharGen_cabindoor"->disable
41 "CharGen_chest_02_empty"->disable
42 "CharGen_crate_01"->disable
43 "CharGen_crate_01_empty"->disable
44 "CharGen_crate_01_misc01"->disable
45 "CharGen_crate_02"->disable
46 "CharGen_lantern_03_sway"->disable
47 "CharGen_ship_trapdoor"->disable
48 "CharGen_barrel_01"->disable
49 "CharGen_barrel_02"->disable
50 "CharGenbarrel_01_drinks"->disable
51 "CharGen_plank"->disable
52
53 if ( GetDistance, Player < 100 )
54 if ( State == 0 )
55 Say "vo\Misc\CharGen Class1.wav", "Ahh yes, we've been expecting you. You'll have to be recorded before you're officially released. There are a few ways we can do this, and the choice is yours."
56 DisablePlayerControls
57 set state to 10
58 endif
59 endif
60
61 if ( OnActivate == 1 ) ;in case they activate him instead of moving in
62 if ( State == 0 )
63 Say "vo\Misc\CharGen Class1.wav", "Ahh yes, we've been expecting you. You'll have to be recorded before you're officially released. There are a few ways we can do this, and the choice is yours."
64 DisablePlayerControls
65 set state to 10
66 endif
67 endif
68
69 elseif ( State == 10 )
70 if ( SayDone == 1 )
71 EnableClassMenu
72 set State to 12
73 endif
74
75 elseif ( State == 12 )
76 if ( SayDone == 1 )
77
78 set timer to timer + GetSecondsPassed
79
80 if ( timer > 1 )
81 Say "vo\Misc\CharGen Birth.wav", "Very good. The letter that preceded you mentioned you were born under a certain sign. And what would that be?"
82 set State to 14
83 set timer to 0
84 endif
85
86 endif
87
88 elseif ( State == 14 )
89 if ( SayDone == 1 )
90 EnableBirthMenu
91 set State to 15
92 endif
93
94 elseif ( State == 15 )
95 if ( SayDone == 1 )
96
97 set timer to timer + GetSecondsPassed
98
99 if ( timer > 1 )
100 Say "vo\Misc\CharGen Class2.wav", "Interesting. Now before I stamp these papers, make sure this information is correct."
101 set State to 16
102 set timer to 0
103 endif
104
105 endif
106
107 ;show statreview menu
108 elseif ( State == 16 )
109 if ( SayDone == 1 )
110 EnableStatReviewMenu
111 set State to 17
112 endif
113
114 ;show popup messages
115 elseif ( State == 17 )
116
117 if ( SayDone == 1 )
118
119 set timer to timer + GetSecondsPassed
120
121 if ( timer > 1 )
122 set timer to 0
123 EnableStatsMenu
124 EnablePlayerControls
125 StartScript RaceCheck ;sets the PCRace global flag for dialogue and such
126 MessageBox "You now have a Stats Menu, where you can always view your information." "Ok"
127 set state to 18
128 endif
129
130 endif
131
132 elseif ( State == 18 )
133 if ( Xbox == 1 )
134 MessageBox "Press B to use your menus. When you are done with them, press B again to close them." "Ok"
135 else
136 MessageBox "Right Clicking allows you to use your menus. When you are done with them, right click again to close them." "Ok"
137 endif
138
139 set state to 20
140
141 ;show papers
142 elseif ( State == 20 )
143
144 Say "vo\Misc\CharGen Class3.wav", "Show your papers to the Captain when you exit to get your release fee."
145 "CharGen StatsSheet"->Enable ;make the actual scroll show itself
146 set State to 30
147
148 ;show how to pick them up
149 elseif ( State == 30 )
150
151 if ( SayDone == 1 )
152
153 set timer to timer + GetSecondsPassed
154
155 if ( timer > 1 )
156 set timer to 0
157
158 if ( Xbox == 1 )
159 MessageBox "Read your papers by pressing A while looking at them. Then select 'Take' to pick them up." "Ok"
160 else
161 MessageBox "Read your papers by pressing the ^ActionActivate while looking at them. Then select 'Take' to pick them up." "Ok"
162 endif
163
164 EnablePlayerViewSwitch
165 EnableVanityMode
166
167 set State to -1
168
169 endif
170
171 endif
172
173 elseif ( State == -1 )
174
175 if ( CharGenState != -1 )
176
177 ;this may need to be here for flow
178 if ( OnActivate == 1 )
179 Activate
180 endif
181
182 if ( GetDistance, Player < 180 )
183
184 if ( Player->GetItemCount "CharGen StatsSheet" == 0 ) ;does not have sheet yet
185
186 if ( SayDone == 1)
187
188 set timer to timer + GetSecondsPassed
189
190 if ( timer > 5 )
191 set timer to 0
192 say, "vo\Misc\CharGen Class4.wav", "Take your papers off the table and go see Captain Gravius."
193 endif
194
195 endif
196
197 endif
198
199 endif
200
201 endif
202
203 endif
204
205end CharGenClassNPC