TR_m3_NPC_FerilGothari
TR_Mainland.esm
Variables
9
Local Variables
TR_Map
control
controlQ
T_Local_NPC
NoLore
moveOnce
timer
xPos
yPos
Source
1Begin TR_m3_NPC_FerilGothari
2
3; This script disables and enables Feril Gothari during the quest Cutthroat Bureaucracy,
4; makes him move back and forth, and gives a different journal entry if he is directly killed.
5
6short TR_Map
7short control
8short controlQ
9short T_Local_NPC
10short NoLore
11
12short moveOnce
13float timer
14float xPos
15float yPos
16
17if ( MenuMode )
18 return
19endif
20
21if ( CellChanged )
22 if ( GetJournalIndex "TR_m3_AT_HisDeath" >= 60 )
23 disable
24 elseif ( GetJournalIndex "TR_m3_AT_HisDeath" >= 50 )
25 enable
26 elseif ( GetJournalIndex "TR_m3_AT_HisDeath" >= 41 )
27 disable
28 elseif ( GetJournalIndex "TR_m3_AT_HisDeath" >= 40 )
29 enable
30 else
31 disable
32 endif
33endif
34
35if ( OnDeath )
36 if ( GetJournalIndex "TR_m3_AT_HisDeath" < 50 )
37 Journal "TR_m3_AT_HisDeath" 51
38 endif
39endif
40
41if ( GetJournalIndex "TR_m3_AT_HisDeath" == 50 )
42 if ( moveOnce == 0 )
43 set timer to 0
44 set moveOnce to 1
45 set xPos to ( GetPos X )
46 set yPos to ( GetPos Y )
47 elseif ( moveOnce == 1 )
48 set xPos to ( xPos - ( GetSecondsPassed * 2000 ) )
49 SetPos X xPos
50 set yPos to ( yPos - ( GetSecondsPassed * 3000 ) )
51 SetPos Y yPos
52 Say "Vo\d\m\Hit_DM001.mp3" "Arrgh."
53 set moveOnce to 2
54 elseif ( moveOnce == 2 )
55 set xPos to ( xPos - ( GetSecondsPassed * 1000 ) )
56 SetPos X xPos
57 set yPos to ( yPos - ( GetSecondsPassed * 1500 ) )
58 SetPos Y yPos
59 if ( timer > 0.1 )
60 PlayGroup Death4 1
61 Fall
62 ModCurrentFatigue -400
63 set moveOnce to 3
64 endif
65 elseif ( moveOnce == 3 )
66 set xPos to ( xPos - ( GetSecondsPassed * 600 ) )
67 SetPos X xPos
68 set yPos to ( yPos - ( GetSecondsPassed * 1200 ) )
69 SetPos Y yPos
70 if ( timer > 0.5 )
71 set moveOnce to 4
72 endif
73 elseif ( moveOnce == 4 )
74 if ( timer > 1.3 )
75 set moveOnce to 5
76 setfatigue 300
77 endif
78 elseif ( moveOnce == 5 )
79 if ( GetFatigue > 0 )
80 if ( GetHealth > 0 )
81 PlayGroup Idle
82 sethealth 0
83 endif
84 set moveOnce to -1
85 endif
86 endif
87
88 if ( moveOnce > 0 )
89 set timer to ( timer + GetSecondsPassed )
90 if ( GetHealth <= 0 )
91 set moveOnce to -1
92 endif
93 endif
94endif
95
96if ( TR_Map )
97 return
98endif
99
100set TR_Map to 3
101
102End