TR_m2_q_27_HeelkurSCN
TR_Mainland.esm
Variables
10
Local Variables
NoLore
OnPCHitMe
dontforcegreet
scene
scenestate
PChitme
T_Local_NPC
T_Local_NoLore
TR_Map
timer
Source
1begin TR_m2_q_27_HeelkurSCN
2
3; quest NPC for quest TR_m2_FG_Amiro3.
4
5short NoLore
6short OnPCHitMe
7
8; TR_m2_FG_Amiro3 quest variables:
9short dontforcegreet
10; dontforcegreet is a multipurpose variable.
11; dontforcegreet is set to 2 when the player first talks to Lijarra before talking to Heel-Kur. This causes
12; Heel-Kur to forcegreet the player ("Lijarra is exhausted. [...]").
13; dontforcegreet is set to 1 once the player knows that Lijarra won't talk because she is exhausted.
14; dontforcegreet is set to 5 when Heel-Kur has been enslaved again.
15; dontforcegreet is set to 9 when you arrive with Heel-Kur at the mine.
16; dontforcegreet is set to 10 when Heel-Kur is back at work.
17short scene
18; scene is a variable that is set to 1 for the duration of a cutscene in which the two slaves free
19; from the Miner's Residence. The rest of the time it equals 0.
20float timer
21short scenestate
22short PChitme
23short T_Local_NPC
24short T_Local_NoLore
25short TR_Map
26
27if ( TR_Map != 2 )
28 set TR_Map to 2
29endif
30
31if ( dontforcegreet == 5 )
32 if ( getPCCell "Akamora, Aravel-Senim Egg Mine" ) ; once in the mine, stop following the player
33 ; and forcegreet the player.
34 set dontforcegreet to 9
35 ForceGreeting
36 return
37 endif
38 if ( gethealth < 40 ) ; as long as he is following the player,
39 ; Heel-Kur should not be able to die except
40 ; if the player wants him to.
41 if ( GetInterior != 1 )
42 if ( PChitme < 3 )
43 ModCurrentHealth 15
44 endif
45 endif
46 endif
47elseif ( dontforcegreet == 10 )
48 if ( GetAIPackageDone ) ; once arrived at the destination in the
49 ; mine, start wandering around.
50 AiWander 256 0 0 40 20 20 0 0 0 0 0 0
51 set dontforcegreet to 11
52 ;elseif ( CellChanged )
53 ; positioncell 2643 1495 15003 0 "Akamora, Aravel-Senim Egg Mine"
54 ; AiWander 256 0 0 40 20 20 0 0 0 0 0 0
55 ; set dontforcegreet to 11
56 endif
57endif
58
59; The following counts how often the player hits Heel-Kur, so that Heel-Kur loses his
60; scripted immortality if the player REALLY wants to kill him.
61if ( OnPCHitMe == 1 )
62 set OnPCHitMe to 0
63 set PChitme to PChitme + 1
64 if ( PChitme >= 3 )
65 startcombat player
66 endif
67endif
68
69if ( OnDeath )
70 journal TR_m2_FG_Amiro3 240
71endif
72
73if ( MenuMode )
74 return
75endif
76
77; flight cutscene (where both Heel-Kur and Lijarra flee from the Miner's Residence):
78
79if ( scene == 1 )
80 if ( CellChanged ) ; if player leaves & reenters cell, end the scene immediately.
81 disable
82 TR_m2_q_27_Lijarra->disable
83 set scene to 0
84 endif
85 if ( scenestate == 0 ) ; start fleeing
86 AITravel 3825 4003 13516 ;TR_m2_MARK_HeelKur
87 TR_m2_q_27_Lijarra->AITravel 3825 4003 13516 ;TR_m2_MARK_HeelKur
88 set scenestate to 1
89 elseif ( scenestate == 1 ) ; flee
90 set timer to timer + GetSecondsPassed
91 if ( timer >= 15 )
92 disable
93 TR_m2_q_27_Lijarra->disable
94 TR_m2_q_27_fleemark->playsound3Dvp "Door Creaky Open" 1.0 1.0
95 set timer to 0
96 set scenestate to 2
97 elseif ( GetDistance TR_m2_q_27_fleemark < 150 )
98 disable
99 TR_m2_q_27_Lijarra->disable
100 TR_m2_q_27_fleemark->playsound3Dvp "Door Creaky Open" 1.0 1.0
101 set timer to 0
102 set scenestate to 2
103 endif
104 else ; exit the house
105 set timer to timer + GetSecondsPassed
106 if ( timer >= 2 )
107 TR_m2_q_27_fleemark->playsound3Dvp "Door Creaky Close" 0.8 1.0
108 set scene to 0
109 endif
110 endif
111endif
112
113if ( onActivate ) ; don't allow activation when they are fleeing
114 if ( scene == 0 )
115 Activate
116 endif
117endif
118
119end