LorkhanHeart
Morrowind.esm
Tribunal.esm
Bloodmoon.esm
Variables
5
Local Variables
sunderHit
keeningHit
countHits
countSays
doOnce
Source
1begin LorkhanHeart
2
3short sunderHit
4;were hit by Sunder THIS FRAME
5short keeningHit
6;were hit by Keening THIS FRAME
7short countHits
8;number of times you hit with Keening
9short countSays
10;make sure you don't Say over and over
11short doOnce
12;teleport Dagoth Ur once
13
14
15if ( menumode == 1 )
16 return
17endif
18
19if ( HeartDestroyed == 1 )
20 if ( doOnce == 2 )
21 return
22 endif
23
24 if ( CellChanged == 1 )
25 Disable
26 Set doOnce to 2
27 endif
28
29 if ( CellChanged == 0 )
30 if ( GetSoundPlaying "endrumble" == 0 )
31 ;play rumbling sound after heart is dead, until player leaves
32 PlayLoopSound3D "endrumble"
33 endif
34 endif
35 if ( GetSoundPlaying "heart" == 1 )
36 StopSound "heart"
37 endif
38 if ( GetSoundPlaying "heartSunder" == 1 )
39 StopSound "heartSunder"
40 endif
41
42 return
43endif
44
45if ( sunderHit == 0 )
46 ;test if you hit with Sunder until you hit with Sunder
47 Set sunderHit to HitOnMe Sunder
48endif
49
50;test if you hit with Keening every frame, also make heart immortal
51Set keeningHit to HitOnMe Keening
52SetHealth 5000
53
54if ( doOnce == 0 )
55 if ( GetDistance Player < 500 )
56 "dagoth_ur_2"->PositionCell -40 2590 -180 320 "Akulakhan's Chamber"
57 "dagoth_ur_2"->StartCombat Player
58 Set doOnce to 1
59 endif
60endif
61
62if ( sunderHit == 1 )
63 ;play correct sounds before & after sunder
64 ;return if you've never hit with Sunder
65 if ( HeartDestroyed == 0 )
66 if ( CellChanged == 0 )
67 if ( GetSoundPlaying "heartSunder" == 0 )
68 PlayLoopSound3D "heartsunder"
69 endif
70 endif
71 endif
72else
73 if ( CellChanged == 0 )
74 if ( GetSoundPlaying "heart" == 0 )
75 PlayLoopSound3D, "heart"
76 endif
77 endif
78 return
79endif
80
81if ( keeningHit == 0 )
82 ;only process rest of script when hit with keening
83 return
84endif
85
86;if player hit with Keening THIS FRAME, do all this stuff...
87
88Set countHits to ( countHits + 1 )
89
90if ( countHits == 0 )
91 if ( countSays != 0 )
92 Set countSays to 0
93 endif
94 return
95endif
96
97if ( countHits == 1 )
98 if ( countSays == 0 )
99 Say "vo\misc\Hit Heart 1.wav" "What are you doing?"
100 "dagoth_ur_2"->SetFight 100
101 "dagoth_ur_2"->StartCombat Player
102 Set countSays to 1
103 endif
104 PlayGroup Idle2
105endif
106
107if ( countHits == 2 )
108 if ( countSays == 1 )
109 Say "vo\misc\Hit Heart 2.wav" "WHAT ARE YOU DOING?!"
110 Set countSays to 2
111 endif
112 PlayGroup Idle3
113endif
114
115if ( countHits == 3 )
116 if ( countSays == 2 )
117 Say "vo\misc\Hit Heart 3.wav" "FOOL!"
118 Set countSays to 3
119 endif
120 PlayGroup Idle4
121endif
122
123if ( countHits == 4 )
124 if ( countSays == 3 )
125 Say "vo\misc\Hit Heart 4.wav" "STOP!"
126 Set countSays to 4
127 endif
128 PlayGroup Idle5
129endif
130
131if ( countHits > 4 )
132 if ( countSays == 4 )
133 Say "vo\misc\Hit Heart 6.wav" "This is the end. The bitter, bitter end."
134 Set countSays to 5
135 endif
136 if ( GetSoundPlaying "heart" == 1 )
137 StopSound "heart"
138 endif
139 if ( GetSoundPlaying "heartSunder" == 1 )
140 StopSound "heartSunder"
141 endif
142 PlayGroup Death1
143 set HeartDestroyed to 1
144endif
145
146End