TR_m3_OE_Beru_sc
TR_Mainland.esm
Variables
7
Local Variables
TR_Map
control
controlQ
NoLore
noattack
T_Local_NPC
T_Local_NoLore
Source
1Begin TR_m3_OE_Beru_sc
2
3; copies behavior of T_ScNpc_Mw_Map3_OE_towerNolore
4; and adds behavior required by TR_m3_OE_DukeAffair quest
5
6short TR_Map
7short control
8short controlQ
9short NoLore
10short noattack
11short T_Local_NPC
12short T_Local_NoLore
13
14if ( MenuMode )
15 return
16endif
17
18if ( CellChanged )
19 if ( GetJournalIndex "TR_m3_OE_DukeAffair" >= 200 )
20 SetAgility 40
21 SetFatigue 150
22 set noattack to 1
23 enable
24 elseif ( GetJournalIndex "TR_m3_OE_DukeAffair" >= 90 )
25 if ( GetJournalIndex "TR_m3_OE_DA_duke" >= 20 ) ; returns her to her cell if player sided with the Duke
26 SetAgility 40
27 SetFatigue 150
28 set noattack to 1
29 enable
30 else
31 disable
32 endif
33 else
34 enable
35 endif
36endif
37
38if ( GetJournalIndex "TR_m3_OE_DukeAffair" >= 200 )
39 return
40endif
41
42; stops her from fighting back and advances the quest when she faints
43if ( GetJournalIndex "TR_m3_OE_DukeAffair" >= 70 )
44 if ( GetFatigue > 1 )
45 ; keeps her quiet
46 set noattack to 0
47 ; speeds up the process
48 SetAgility 0
49 SetFatigue 1
50 elseif ( GetFatigue < 0 )
51 if ( GetJournalIndex "TR_m3_OE_DukeAffair" < 80 )
52 ; if player spoke to the Duke use different timer
53 Journal "TR_m3_OE_DukeAffair" 80
54 set TR_m3_OE_BeruTimer.DayTarget to 0
55 set TR_m3_OE_BeruTimer.HourTarget to 0
56 StartScript TR_m3_OE_BeruTimer
57 SetFatigue -10 ; otherwise she gets up too soon
58 endif
59 endif
60 ; we don't stop doing this when she faints because combat music
61 SetFight 0
62 StopCombat
63endif
64
65; finishes the quest if she is dead
66if ( OnDeath )
67 if ( GetJournalIndex "TR_m3_OE_DukeAffair" >= 10 )
68 if ( GetJournalIndex "TR_m3_OE_DukeAffair" < 100 )
69 Journal "TR_m3_OE_DukeAffair" 200
70 endif
71 endif
72endif
73
74if ( TR_Map )
75 return
76endif
77
78set TR_Map to 3
79set noattack to 1
80
81End