Scripts

CharGenWalkNPC

Morrowind.esm
Variables 2
Local Variables
state
timer
Source
1begin CharGenWalkNPC 2 3;this is the guard who walks you through the boat 4 5 6short state 7float timer 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 > 6 ) 22 set timer to 0 23 say, "vo\Misc\CharGenWalk3.wav", "On deck now, prisoner." 24 endif 25 endif 26endif 27 28;start walking to below deck 29if ( state == 0 ) 30 31 set timer to timer + GetSecondsPassed 32 33 if ( timer > 8 ) 34 set state to 5 35 set timer to 0 36 endif 37 38;walk on down after pause 39elseif ( state == 5 ) 40 AITravel 90, -90, -88 41 set state to 10 42 43elseif ( state == 10 ) 44 45 if ( GetAIPackageDone == 1 ) ;he's reached the player 46 set state to 20 47 endif 48 49;he's at the PC, start talking 50elseif ( State == 20 ) 51 52 say "Vo\Misc\CharGenWalk1.wav", "This is where you get off, come with me." 53 set State to 30 54 set timer to 0 55 56;give message on how to move 57elseif ( State == 30 ) 58 59 if ( SayDone == 1 ) 60 61 if ( Xbox == 1) 62 MessageBox "The LEFT THUMBSTICK moves you, and the RIGHT THUMBSTICK looks around.", "Ok" 63 else 64 MessageBox "^ActionForward and ^ActionBack move forward and back. ^ActionSlideLeft and ^ActionSlideRight move side to side, and the mouse looks around.", "Ok" 65 ;MessageBox "W and S move forward and back. A and D move side to side, and the mouse looks around.", "Ok" 66 endif 67 68 set State to 40 69 endif 70 71;you now have to walk up to dock 72elseif ( State == 40 ) 73 74 EnablePlayerControls 75 ;AITravel 185, 174, 170 76 AIEscort Player, 12, 195, 100, 170 77 set State to 50 78 79elseif ( state == 50 ) 80 81 if ( GetAIPackageDone == 1 ) ;he's reached the player 82 set state to 53 83 endif 84 85;get him to travel back a little so he turns around 86elseif ( state == 53 ) 87 AITravel 185, 174, 170 88 ;face -500 500 89 set state to 57 90 ;set state to 60 91 92elseif ( state == 57 ) 93 if ( GetAIPackageDone == 1 ) ;he's turned around 94 set state to 60 95 endif 96 97;he's at the stairs, tell PC to get up on board 98elseif ( state == 60 ) 99 100 if ( GetDistance, Player <= 200 ) 101 Say "Vo\Misc\CharGenWalk2.wav", "Get yourself up on deck, and let's keep this as civil as possible." 102 set state to -1 103 endif 104 105endif ;this is end of big elseifs for CharGenState 106 107 108end CharGenWalkNPC