TR_m7_NPC_MervisLlarel
TR_Mainland.esm
Variables
9
Local Variables
TR_Map
control
controlQ
NoLore
T_Local_NPC
T_Local_NoLore
moveOnce
yPos
timer
Source
1Begin TR_m7_NPC_MervisLlarel
2
3short TR_Map
4short control
5short controlQ
6short NoLore
7short T_Local_NPC
8short T_Local_NoLore
9
10short moveOnce
11float yPos
12float timer
13
14if ( MenuMode )
15 return
16endif
17
18if ( CellChanged )
19 if ( GetInterior )
20 return
21 endif
22
23 if ( GetJournalIndex "TR_m7_JNS_TheBoss_EndOfTheLine" >= 100 )
24 if ( GetDisabled == 0 )
25 disable
26 endif
27 PositionCell 0 0 0 0 T_ScriptHolder ; no marker
28 AiWander 0 0 0
29 return
30 elseif ( GetJournalIndex "TR_m7_JNS_TheBoss_EndOfTheLine" == 20 )
31 if ( player->GetPos Z >= 4000 )
32 Journal "TR_m7_JNS_TheBoss_EndOfTheLine" 30
33 PositionCell 58900 -403949 4535 10800 "Narsis, Waterfront" ; TR_m7_MARK_Ns_JNS_Mervis
34 AiWander 0 0 0
35 return
36 elseif ( controlQ == 0 )
37 set controlQ to 1
38 ForceGreeting
39 return
40 endif
41 endif
42endif
43
44if ( OnDeath )
45 set controlQ to -1
46 return
47endif
48
49if ( GetJournalIndex "TR_m7_HH_GM_3za" >= 10 )
50 if ( controlQ == 0 )
51 set controlQ to 1
52 setfight 100
53 "TR_m7_Diradenu Llarel"->setfight 100
54 startcombat player
55 cast "TR_m7_MervisLlarelBound" "TR_m7_Mervis Llarel"
56 return
57 else
58 return
59 endif
60endif
61
62if ( GetJournalIndex "TR_m7_JNS_TheBoss_EndOfTheLine" == 10 )
63 if ( controlQ == 0 )
64 set controlQ to 1
65 setfight 100
66 startcombat player
67 cast "TR_m7_MervisLlarelBound" "TR_m7_Mervis Llarel"
68 return
69 elseif ( controlQ == 1 )
70 if ( GetHealthGetRatio < 0.3 )
71 set controlQ to 2
72 setfight 30
73 stopcombat
74 forcegreeting
75 return
76 endif
77 endif
78endif
79
80if ( GetJournalIndex "TR_m7_JNS_TheBoss_EndOfTheLine" == 50 )
81 if ( moveOnce == 0 )
82 set timer to 0
83 set moveOnce to 1
84 set yPos to ( GetPos Y )
85 elseif ( moveOnce == 1 )
86 set yPos to ( yPos + ( GetSecondsPassed * 1200 ) )
87 SetPos Y yPos
88 Say "Vo\d\m\Hit_DM001.mp3" "Arrgh."
89 set moveOnce to 2
90 elseif ( moveOnce == 2 )
91 set yPos to ( yPos + ( GetSecondsPassed * 1200 ) )
92 SetPos Y yPos
93 if ( timer > 0.1 )
94 PlayGroup Death4 1
95 Fall
96 ModCurrentFatigue -400
97 set moveOnce to 3
98 endif
99 elseif ( moveOnce == 3 )
100 set yPos to ( yPos + ( GetSecondsPassed * 100 ) )
101 SetPos Y yPos
102 if ( timer > 3.5 )
103 set moveOnce to 4
104 setfatigue 300
105 endif
106 elseif ( moveOnce == 4 )
107 if ( GetFatigue > 0 )
108 if ( GetHealth > 0 )
109 PlayGroup Idle
110 sethealth 0
111 endif
112 set moveOnce to -1
113 endif
114 endif
115
116 if ( moveOnce > 0 )
117 set timer to ( timer + GetSecondsPassed )
118 if ( GetHealth <= 0 )
119 set moveOnce to -1
120 endif
121 endif
122endif
123
124if ( TR_Map )
125 return
126endif
127
128set TR_Map to 7
129
130End