CharGenNameNPC
Morrowind.esm
Variables
3
Local Variables
state
wandering
timer
Source
1begin CharGenNameNPC
2
3;this is the prisoner who asks you you're name
4
5short state
6float timer
7short wandering
8
9if ( menumode == 1)
10 return
11endif
12
13if ( OnActivate == 1 )
14 return
15endif
16
17;done, standing
18if ( state == -1 )
19 if ( GetDistance, Player < 150 )
20 set timer to timer + GetSecondsPassed
21 if ( timer > 14 )
22 set timer to 0
23 say, "vo\Misc\CharGenName4.wav", "You better do what they say."
24 endif
25 endif
26endif
27
28if ( wandering == 0 )
29 if ( GetDistance, Player > 500 )
30 if ( state == -1 )
31 ;AIWander 32 0 0 75 20 20
32 set wandering to 1
33 endif
34 endif
35endif
36
37 if ( state == 0 )
38
39 set timer to ( timer + Getsecondspassed )
40
41 if ( timer >= 1 ) ;fader delay
42 ;he asks if you are ok
43 Say, "Vo\Misc\CharGenName1.wav", "Stand up, there you go. You were dreaming. What's your name?"
44 set State to 10
45 set timer to 0
46 endif
47
48 ;show name menu when done talking
49 elseif ( State == 10 )
50
51 if ( SayDone == 1 )
52 EnableNameMenu
53 set State to 20
54 endif
55
56 ;name is entered, guy says we're there
57 elseif ( State == 20 )
58
59 set timer to ( timer + Getsecondspassed )
60
61 if ( timer >= 1 ) ;delay
62 ;he asks if you are ok
63 Say, "vo\Misc\CharGenName2.wav", "Well, not even last night's storm could wake you. I heard them say we've reached Morrowind. I'm sure they'll let us go."
64 set State to 40
65 set timer to 0
66 endif
67
68 ;says the guard is coming when he gets close
69 elseif ( State == 40 )
70
71 if ( SayDone == 1 )
72 if ( GetDistance, "CharGen Boat Guard 2" <= 400 )
73 ;PlayGroup idle3 1
74 Say, "vo\Misc\CharGenName3.wav", "Quiet, here comes the guard."
75 set State to -1
76 set timer to 5 ;force him to say next line a little earlier
77 endif
78 endif
79
80 endif
81
82
83
84end CharGenNameNPC