TR_m4_q_Uvisea
TR_Mainland.esm
Variables
15
Local Variables
T_Local_NPC
T_Local_NoLore
TR_Map
NoLore
control
controlQ
IsParalyzed
MyDay
MyHour
doOnce
CombatCheck
FoundFjorrod
TimeOut
SkipGreeting
IsDead
Source
1Begin TR_m4_q_Uvisea
2
3short T_Local_NPC
4short T_Local_NoLore
5short TR_Map
6short NoLore
7short control
8short controlQ
9short IsParalyzed
10short MyDay
11short MyHour
12short doOnce
13short CombatCheck
14short FoundFjorrod
15short TimeOut
16short SkipGreeting
17short IsDead
18
19If ( MenuMode )
20 Return
21EndIf
22
23If ( CombatCheck == 0 )
24 If ( GetAttacked == 1 )
25 set SkipGreeting to 1 ; do not forcegreet if the PC has attacked
26 set CombatCheck to -1
27 EndIf
28EndIf
29
30If ( IsParalyzed == 0 )
31 addspell TR_m4_NakedWitchParalyzation
32 StartScript "TR_m4_q_Uvisea_Dead" ; needed for the dead body to be spawned by "TR_m4_q_NakedWitchWalkScript"
33 set IsParalyzed to -1
34EndIf
35
36If ( GetJournalIndex "TR_m4_wil_NakedWitch" == 0 )
37 If ( SkipGreeting == 0 )
38 If ( control == 0 )
39 If ( GetDistance Player < 512 )
40 ;If ( GetLOS Player == 1 )
41 ForceGreeting ; forcegreeting starts quest
42 set control to -1
43 ;EndIf
44 EndIf
45 EndIf
46 EndIf
47ElseIf ( GetJournalIndex "TR_m4_wil_NakedWitch" == 40 ) ; Uvisea is following the PC
48 If ( doOnce == 0 )
49 set controlQ to 1
50 set MyHour to GameHour
51 set MyDay to Day
52 set doOnce to -1
53 EndIf
54 If ( Day > MyDay )
55 If (GameHour > MyHour )
56 If (GetDistance TR_m4_Fjorrod > 2048 ) ; if the PC hasn't led Uvisea to Fjorrod within 24 hours, quest ends
57 If ( GetDistance Player < 512 )
58 set TimeOut to 1
59 AiWander 512 0 0 0 0 0 0 0 0 0 0 0
60 ForceGreeting
61 EndIf
62 EndIf
63 EndIf
64 EndIf
65 If (GetDistance TR_m4_Fjorrod < 2048 )
66 If ( TimeOut == 0 )
67 Set FoundFjorrod to 1 ; if the PC leads Uvisea to Fjorrod she attacks
68 ForceGreeting
69 EndIf
70 EndIf
71ElseIf ( GetJournalIndex "TR_m4_wil_NakedWitch" == 104 ) ; if the PC kills Fjorrod Uvisea asks for her clothes
72 If ( controlQ == 0 )
73 set controlQ to 1
74 EndIf
75EndIf
76
77If ( controlQ == 1)
78 If ( GetJournalIndex "TR_m4_wil_NakedWitch" == 46 )
79 If ( Player->GetItemCount "TR_m4_q_NakedWitchRobe" > 0 )
80 If ( Player->GetItemCount "TR_m4_q_NakedWitchShoes" > 0 ) ; if the PC helps Uvisea kill Fjorrod she asks for her clothes
81 If ( GetDistance Player <= 512 )
82 ForceGreeting
83 set controlQ to 0
84 AiWander 512 0 0 0 0 0 0 0 0 0 0 0
85 EndIf
86 EndIf
87 EndIf
88 EndIf
89EndIf
90
91If ( OnDeath )
92 If ( GetJournalIndex "TR_m4_wil_NakedWitch" > 0 )
93 If ( GetJournalIndex "TR_m4_wil_NakedWitch" != 45 )
94 Journal "TR_m4_wil_NakedWitch" 110
95 ElseIf ( GetJournalIndex "TR_m4_wil_NakedWitch" == 45 )
96 Journal "TR_m4_wil_NakedWitch" 108
97 EndIf
98 EndIf
99 Set IsDead to 1
100EndIf
101
102
103If ( GetJournalIndex "TR_m4_wil_NakedWitch" >= 90 ) ; disable on quest end, if not paralyzed and alive
104 If ( GetJournalIndex "TR_m4_wil_NakedWitch" != 104 ) ; this case is handled by TR_m4_q_NakedWitchWalkScript
105 If ( "TR_m4_Uvisea Athin"->GetSpell, TR_m4_NakedWitchParalyzation == 0 )
106 If ( ISDead == 0 )
107 If ( Player->GetDistance, "TR_m4_Uvisea Athin" > 8192 ) ; check that the PC is not nearby
108 If ( "TR_m4_Uvisea Athin"->GetDisabled == 0 )
109 "TR_m4_Uvisea Athin"->Disable
110 EndIf
111 EndIf
112 Endif
113 EndIf
114 EndIf
115EndIf
116
117If ( TR_Map == 4 )
118 return
119EndIf
120
121set TR_Map to 4
122
123End