;
; Events text for the Fantasy Empires Scenario by C.C.Smith
; Copyright(c) 1999, MicroProse Studios Inc.
; 
;


@BEGINEVENTS

@INITFLAG

@IF
SCENARIOLOADED
@THEN
PLAYCDTRACK
10
DONTPLAYWONDERS
@ENDIF

@IF
NOSCHISM
DEFENDER=anybody 
@THEN
@ENDIF

;set great hoard and frost giant flags to on

@IF
TURN
turn=2
@THEN
JUSTONCE
FLAG
who=EVERYBODY
continuous
mask=0x01000020
state=on
@ENDIF

;bestow unique city styles to the seafolk, orc, and incubus races

@IF
TURN
turn=1
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=93
receiver=Seafolk
@ENDIF

@IF
TURN
turn=1
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=91
receiver=Incubus
@ENDIF

@IF
TURN
turn=1
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=94
receiver=Orcs
@ENDIF


; disperse second settlers to each of the tribes in their own worlds.

@IF
TURN
turn=2
@THEN
JUSTONCE
CREATEUNIT
owner=Seafolk
unit=Sea. Settlers
veteran=false
homecity=none
map=1
locations
30,40,1
30,80,1
60,40,1
90,40,1
90,92,1
90,74,1
51,91,1
60,74,1
30,74,1
60,80,1
endlocations
@ENDIF

@IF
TURN
turn=2
@THEN
JUSTONCE
CREATEUNIT
owner=Orcs
unit=Goblin Miners
veteran=false
homecity=none
map=2
locations
24,40,2
24,80,2
48,40,2
55,51,2
85,71,2
56,74,2
31,31,2
48,22,2
30,60,2
48,80,2
endlocations
@ENDIF

@IF
TURN
turn=2
@THEN
JUSTONCE
CREATEUNIT
owner=Skylords
unit=Sky. Settlers
veteran=false
homecity=none
map=3
locations
30,40,3
30,80,3
60,40,3
90,40,3
90,80,3
90,60,3
51,91,3
60,60,3
30,20,3
60,80,3
endlocations
@ENDIF


; dwarven rebellion

@IF
TURN
turn=1
@THEN
FLAG
who=Dwarves
flag=10
state=on
@ENDIF

@IF
CHECKFLAG
who=Dwarves
flag=10
state=on
@THEN
JUSTONCE
TEXT
No Broadcast
^The Dwarves of Zhor are rebelling!
ENDTEXT
FLAG
flag=10
state=off
ENDIF


; random generation of barbarian creatures

@IF
RANDOMTURN     
denominator=75
@THEN
CREATEUNIT
owner=Barbarians
unit=Jack O'Lantern
veteran=false
homecity=none
randomize
locations
84,12,0
26,36,0
50,80,0
90,36,0
66,10,0
65,45,0
78,70,0
74,90,0
09,15,0
10,40,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
DELAY
delay=25
CREATEUNIT
owner=Barbarians
unit=Jrmngnd Spit
veteran=false
homecity=none
randomize
locations
24,12,0
26,36,0
50,12,0
50,36,0
66,10,0
65,45,0
78,2,0
74,30,0
09,15,0
10,40,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
DELAY
delay=75
CREATEUNIT
owner=Barbarians
unit=Witches
veteran=false
homecity=none
randomize
locations
24,60,3
26,36,3
50,12,3
50,86,3
66,10,3
65,45,3
78,50,3
74,100,3
09,30,3
10,40,3
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Great Eagles
veteran=false
homecity=none
randomize
locations
34,60,3
36,36,3
40,12,3
50,86,3
66,10,3
75,45,3
88,50,3
94,100,3
09,30,3
10,40,3
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=25
CREATEUNIT
owner=Barbarians
unit=Jrmngnd Spit
veteran=false
homecity=none
randomize
locations
24,12,3
26,36,3
50,12,3
50,36,3
66,10,3
65,45,3
78,2,3
74,30,3
09,15,3
10,40,3
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=25
CREATEUNIT
owner=Barbarians
unit=Jrmngnd Spit
veteran=false
homecity=none
randomize
locations
84,12,3
86,136,3
90,82,3
90,116,3
106,50,3
105,95,3
108,112,3
94,60,3
79,15,3
60,60,3
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
CREATEUNIT
owner=Barbarians
unit=Fairy
veteran=false
homecity=none
randomize
locations
24,12,0
26,36,0
50,12,0
50,36,0
66,10,0
65,45,0
78,2,0
74,30,0
09,15,0
10,40,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
CREATEUNIT
owner=Barbarians
unit=Fairy
veteran=false
homecity=none
randomize
locations
84,12,0
86,136,0
90,82,0
90,116,0
106,50,0
105,95,0
108,112,0
94,60,0
79,15,0
60,60,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=25
CREATEUNIT
owner=Barbarians
unit=Giant Flytrap
veteran=false
homecity=none
randomize
locations
24,12,0
26,36,0
50,12,0
50,36,0
66,10,0
65,45,0
78,2,0
74,30,0
09,15,0
10,40,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=25
CREATEUNIT
owner=Barbarians
unit=Giant Flytrap
veteran=false
homecity=none
randomize
locations
81,15,0
89,133,0
93,79,0
87,119,0
109,47,0
102,98,0
111,109,0
91,63,0
82,12,0
63,57,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
DELAY
delay=25
CREATEUNIT
owner=Barbarians
unit=Giant Flytrap
veteran=false
homecity=none
randomize
locations
24,12,1
102,98,1
26,36,1
111,109,1
50,12,1
91,63,1
50,36,1
82,12,1
66,10,1
63,57,1
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
DELAY
delay=70
CREATEUNIT
owner=Barbarians
unit=Warlocks
veteran=false
homecity=none
randomize
locations
34,12,1
92,98,1
36,36,1
101,109,1
60,12,1
81,63,1
40,36,1
92,12,1
66,10,1
63,57,1
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Frost Giant
veteran=false
homecity=none
randomize
locations
24,12,0
26,36,0
50,12,0
50,36,0
66,10,0
65,45,0
78,2,0
74,30,0
09,15,0
10,40,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Frost Giant
veteran=false
homecity=none
randomize
locations
81,15,0
89,133,0
93,79,0
87,119,0
109,47,0
102,98,0
111,109,0
91,63,0
82,12,0
63,57,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=50
CREATEUNIT
owner=Barbarians
unit=Night Riders
veteran=false
homecity=none
randomize
locations
24,12,1
25,37,1
50,12,1
50,36,1
66,10,1
66,44,1
77,3,1
77,31,1
10,16,1
11,41,1
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=50
CREATEUNIT
owner=Barbarians
unit=Kraken
veteran=false
homecity=none
randomize
locations
81,15,1
89,133,1
93,79,1
87,119,1
109,47,1
102,98,1
111,109,1
91,63,1
82,12,1
63,57,1
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=75
CREATEUNIT
owner=Barbarians
unit=Giant Worm
veteran=false
homecity=none
randomize
locations
24,12,2
25,37,2
50,12,2
50,36,2
66,10,2
66,44,2
77,3,2
77,31,2
10,16,2
11,41,2
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=45
@THEN
DELAY
delay=75
CREATEUNIT
owner=Barbarians
unit=Griffins
veteran=false
homecity=none
randomize
locations
24,12,2
25,87,2
50,12,2
50,96,2
66,10,2
76,44,2
87,3,2
97,61,2
10,16,2
11,51,2
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Giant Spiders
veteran=false
homecity=none
randomize
locations
24,12,2
35,87,2
40,32,2
50,96,2
66,20,2
76,84,2
87,63,2
97,41,2
100,16,2
11,51,2
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=100
@THEN
DELAY
delay=200
CREATEUNIT
owner=Barbarians
unit=Giant Worm
veteran=false
homecity=none
randomize
locations
81,15,2
89,133,2
93,79,2
87,119,2
109,47,2
102,98,2
111,109,2
91,63,2
82,12,2
63,57,2
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=100
@THEN
DELAY
delay=200
CREATEUNIT
owner=Barbarians
unit=Unsp. Horror
veteran=false
homecity=none
randomize
locations
34,12,1
36,26,1
60,22,1
40,46,1
56,20,1
85,65,1
98,32,1
64,40,1
09,35,1
10,70,1
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=100
@THEN
DELAY
delay=200
CREATEUNIT
owner=Barbarians
unit=Unsp. Horror
veteran=false
homecity=none
randomize
locations
84,12,1
86,136,1
90,82,1
90,116,1
106,50,1
105,95,1
108,112,1
94,60,1
79,15,1
60,60,1
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Griffins
veteran=false
homecity=none
randomize
locations
24,12,3
25,37,3
50,12,3
50,36,3
66,10,3
66,44,3
77,3,3
77,31,3
10,16,3
11,41,3
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=75
@THEN
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Griffins
veteran=false
homecity=none
randomize
locations
84,12,3
86,136,3
90,82,3
90,116,3
106,50,3
105,95,3
108,112,3
94,60,3
79,15,3
60,60,3
endlocations
@ENDIF

; Award Troll to Incubus

@IF
RECEIVEDTECHNOLOGY
receiver=Incubus
technology=86
@THEN
JUSTONCE
PLAYWAVEFILE
Fanfare7.wav
TEXT
^The renegade troll, Mur' Orgg, disgusted by the
^pitiful lack of interest in his services displayed by the 
^other races, decides to join the Incubus cause free of charge.
ENDTEXT
CREATEUNIT
incapital
owner=Incubus
unit=Troll
veteran=no
homecity=none
@ENDIF

; allying with dragons

@IF
RANDOMTURN     
denominator=100
@THEN
PLAYWAVEFILE
Fanfare7.wav
TEXT
Dreadful stories of a marauding dragon reach your ears. 
If you can find him, you vow to defeat him and take his
treasures as a reward.
ENDTEXT
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Dragon
veteran=false
homecity=none
randomize
locations
24,12,0
25,37,0
50,12,0
50,36,0
66,10,0
66,44,0
77,3,0
77,31,0
10,16,0
11,41,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=100
@THEN
PLAYWAVEFILE
Fanfare7.wav
TEXT
Dreadful stories of a marauding dragon reach your ears. 
If you can find him, you vow to defeat him and take his
treasures as a reward.
ENDTEXT
DELAY
delay=100
CREATEUNIT
owner=Barbarians
unit=Dragon
veteran=false
homecity=none
randomize
locations
84,12,0
86,136,0
90,82,0
90,116,0
106,50,0
105,95,0
108,112,0
94,60,0
79,15,0
60,60,0
endlocations
@ENDIF

@IF
UNITKILLED
defender only
unit=Dragon
attacker=anybody
defender=Barbarians
@THEN
PLAYWAVEFILE
Shortking.wav
TEXT 
^A dragon has been defeated and must now leave Midgard forever.
^Before he flies away, though, he abandons his hoard of gold and
^ a scroll of Dragon Lore. Perhaps with the study of the race, one
^or more may be convinced to join the struggle for the control of
^Midgard.
ENDTEXT
CHANGEMONEY
receiver=TRIGGERATTACKER
amount=1500
GIVETECHNOLOGY
technology=96
receiver=TRIGGERATTACKER
PLAYCDTRACK
3
@ENDIF

@IF
RECEIVEDTECHNOLOGY    
receiver=Anybody
technology=97
@THEN
JUSTONCE
PLAYWAVEFILE
Fanfare7.wav
TEXT
^Dragon study indicates that learning their language is needed to
^convince the dragon race to help.
ENDTEXT
@ENDIF

@IF
RECEIVEDTECHNOLOGY    
receiver=Anybody
technology=98
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
^The Dragon race is now willing to enter the wars.
ENDTEXT
@ENDIF

; slaying dwarves

@IF
RANDOMTURN     
denominator=50
@THEN
CREATEUNIT
owner=Barbarians
unit=Dwarves
veteran=false
homecity=none
randomize
locations
24,12,0
25,37,0
50,12,0
50,36,0
66,10,0
66,44,0
77,51,0
77,31,0
10,16,0
11,41,0
endlocations
@ENDIF

@IF
RANDOMTURN     
denominator=50
@THEN
CREATEUNIT
owner=Barbarians
unit=Dwarves
veteran=false
homecity=none
randomize
locations
24,12,2
25,37,2
50,12,2
50,36,2
66,10,2
66,44,2
77,51,2
77,31,2
10,16,2
11,41,2
endlocations
@ENDIF

@IF
UNITKILLED
defender only
unit=Dwarves
attacker=anybody
defender=Barbarians
@THEN
JUSTONCE
PLAYWAVEFILE
Fanfare7.wav
TEXT
You received 200 gold for slaying
these renegade dwarves.
ENDTEXT
CHANGEMONEY
receiver=TRIGGERATTACKER
amount=200
@ENDIF

; frost giant and magical incantation

@IF
RANDOMTURN
denominator=150
@THEN
FLAG
who=Humans
flag=31
state=on
@ENDIF

@IF
RANDOMTURN
denominator=150
@THEN
FLAG
who=Dwarves
flag=30
state=on
@ENDIF

@IF
RANDOMTURN
denominator=150
@THEN
who=Elves
FLAG
flag=29
state=on
@ENDIF

@IF
RANDOMTURN
denominator=150
@THEN
FLAG
who=Skylords
flag=28
state=on
@ENDIF

@IF
RANDOMTURN
denominator=150
@THEN
FLAG
who=Seafolk
flag=27
state=on
@ENDIF

@IF
RANDOMTURN
denominator=150
@THEN
FLAG
who=Orcs
flag=26
state=on
@ENDIF

@IF
RANDOMTURN
denominator=150
@THEN
FLAG
who=Incubus
flag=25
state=on
@ENDIF

@IF
CHECKFLAG
who=Humans
mask=0x81000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Humans
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Human cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF

@IF
CHECKFLAG
who=Dwarves
mask=0x41000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Dwarves
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Infidel cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF

@IF
CHECKFLAG
who=Elves
mask=0x21000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Elves
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Elvish cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF

@IF
CHECKFLAG
who=Skylords
mask=0x11000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Skylords
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Buteo cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF

@IF
CHECKFLAG
who=Seafolk
mask=0x09000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Seafolk
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Merfolk cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF

@IF
CHECKFLAG
who=Orcs
mask=0x05000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Orcs
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Goblin cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF

@IF
CHECKFLAG
who=Incubus
mask=0x03000000
count=2
technology=4
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=99
receiver=Incubus
PLAYWAVEFILE
Fanfare7.wav
TEXT
^A strange weirding call from the race of frost giants
^rents the air - they offer to join the Stygian cause.
ENDTEXT
FLAG
flag=24
state=off
@ENDIF


;The Great Hoard

@IF
RECEIVEDTECHNOLOGY
receiver=Anybody
technology=43
@THEN
JUSTONCE
PLAYWAVEFILE
Fanfare7.wav
TEXT
Since a babe, you have heard rumors of a great treasure hoard 
guarded by an ancient dragon in a lost cavern deep underground. 
You have also been told innumerable times that a dangerous curse 
would befall anyone who presumes to steal even a single coin of it.
You've never seriously believed the legend until now. Recently 
somebody translated a runic parchment that describes in detail the 
discovery of this chamber. Unfortunately it was found in the hand of 
a dead man who had wandered lost for many months before his demise, 
thereby preventing anyone from retracing his steps. Despite the threat 
of the curse, everyone has gone treaure mad - perhaps yourself as well!  
ENDTEXT
@ENDIF

@IF
UNITKILLED
unit=Ancient Dragon
attacker=Anybody
defender=Barbarians
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
The Ancient Dragon has been defeated. In his haste to escape he leaves behind
his great hoard of 3,000 gold and an indecipherable scroll. Perhaps one of 
the great sages can translate it.
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=TRIGGERATTACKER
amount=3000
FLAG
who=TRIGGERATTACKER
continuous
flag=1
state=on
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x022
count=2
state=on
@AND
RANDOMTURN
denominator=20
@THEN
JUSTONCE
FLAG
continuous
who=EVERYBODY
flag=4
state=on
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x01C
threshold=1
state=on
@THEN
FLAG
flag=5
state=off
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x022
count=2
state=on
@AND
RANDOMTURN
denominator=20
@THEN
JUSTONCE
FLAG
continuous
who=EVERYBODY
flag=3
state=on
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x01C
threshold=1
state=on
@THEN
FLAG
flag=5
state=off
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x022
count=2
state=on
@AND
RANDOMTURN
denominator=20
@THEN
JUSTONCE
FLAG
continuous
who=EVERYBODY
flag=4
state=on
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x01C
threshold=1
state=on
@THEN
FLAG
flag=5
state=off
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x022
count=2
state=on
@AND
RANDOMTURN
denominator=20
@THEN
JUSTONCE
FLAG
continuous
who=EVERYBODY
flag=2
state=on
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x01C
threshold=1
state=on
@THEN
FLAG
flag=5
state=off
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x00C
threshold=1
state=on
@THEN
JUSTONCE
PLAYWAVEFILE
Rangarok.wav
TEXT
The scroll is finally translated. What a horrible mistake!
It is nothing less than the signal to commence the battle of 
Ragnarok, the final struggle between the gods and the forces of
nature for control of Midgard. The whole world awaits the
outcome.
ENDTEXT
FLAG
flag=7
state=on
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x084
count=2
state=on
@THEN
JUSTONCE
DELAY
randomize
delay=5
PLAYWAVEFILE
Shortking.wav
TEXT
GREAT REJOICING! The gods are victorious and Midgard is forever safe
from threat of ice. Some battle damage was unavoidable though.
ENDTEXT
PLAYCDTRACK
3
CHANGETERRAIN
terraintype=9
map=0
exceptionmask=0x06EE
maprect
0,0,149,0,149,119,0,119
FLAG
flag=6
state=on
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=6
state=on
@THEN
JUSTONCE
CHANGETERRAIN
terraintype=5
map=3
exceptionmask=0x430
maprect
0,0,149,0,149,119,0,119
@ENDIF

@IF
CHECKFLAG
who=Everybody
mask=0x088
count=2
state=on
@THEN
JUSTONCE
DELAY
randomize
delay=5
PLAYWAVEFILE
shortlose.wav
TEXT
The Ice Titans and their allies have won. Almost all 
of Midgard is covered in ice. With perhaps one or two
miraculous exceptions, all wonders cease to exist. 
You may still be able to conquer the world but now it 
will be but a pitiful victory.
ENDTEXT
PLAYCDTRACK
2
CHANGETERRAIN
terraintype=7
map=0
exceptionmask=0x04E1
maprect
0,0,149,0,149,119,0,119
FLAG
flag=8
state=on
GIVETECHNOLOGY
technology=92
receiver=Humans
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=8
state=on
@THEN
JUSTONCE
CHANGETERRAIN
terraintype=7
map=1
exceptionmask=0x0466
maprect
0,0,149,0,149,119,0,119
GIVETECHNOLOGY
technology=92
receiver=Dwarves
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=8
state=on
@THEN
JUSTONCE
CHANGETERRAIN
terraintype=3
map=2
exceptionmask=0x040D
maprect
0,0,149,0,149,119,0,119
GIVETECHNOLOGY
technology=92
receiver=Elves
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=8
state=on
@THEN
JUSTONCE
CHANGETERRAIN
terraintype=10
map=3
exceptionmask=0x020
maprect
0,0,149,0,149,119,0,119
GIVETECHNOLOGY
technology=92
receiver=Seafolk
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=8
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=92
receiver=Skylords
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=8
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=92
receiver=Orcs
@ENDIF

@IF
CHECKFLAG
who=Somebody
flag=8
state=on
@THEN
JUSTONCE
GIVETECHNOLOGY
technology=92
receiver=Incubus
@ENDIF

@IF
CHECKFLAG
who=Humans
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Humans' great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Humans
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Humans
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Humans
MODIFYREPUTATION
who=Humans
betray=0
@ENDIF

@IF
CHECKFLAG
who=Dwarves
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Dwarves' great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Dwarves
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Dwarves
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Dwarves
MODIFYREPUTATION
who=Dwarves
betray=0
@ENDIF

@IF
CHECKFLAG
who=Elves
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Elves' great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Elves
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Elves
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Elves
MODIFYREPUTATION
who=Elves
betray=0
FLAG
flag=6
state=off
@ENDIF

@IF
CHECKFLAG
who=Seafolk
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Seafolk's great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Seafolk
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Seafolk
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Seafolk
MODIFYREPUTATION
who=Seafolk
betray=0
@ENDIF

@IF
CHECKFLAG
who=Skylords
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Skylords' great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Skylords
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Skylords
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Skylords
MODIFYREPUTATION
who=Buteos
betray=0
@ENDIF

@IF
CHECKFLAG
who=Orcs
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Orcs' great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Orcs
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Orcs
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Orcs
MODIFYREPUTATION
who=Orcs
betray=0
@ENDIF

@IF
CHECKFLAG
who=Incubus
mask=0x012
count=2
state=on
@THEN
JUSTONCE
TEXT
The scroll is translated and states, to the Incubus' great delight,
that the conquerer of the Ancient Dragon receives 5,000 more gold,
the wonder, Deus Ex Machina, a spotless reputation, and an 
alliance with the dragon tribe. What fabulous gifts!
ENDTEXT
PLAYCDTRACK
3
CHANGEMONEY
receiver=Incubus
amount=5000
BESTOWIMPROVEMENT
improvement=65
race=Incubus
capital=yes
wonders=yes
GIVETECHNOLOGY
technology=98
receiver=Incubus
MODIFYREPUTATION
who=Incubus
betray=0
@ENDIF


;arrival of heroes keyed to the wonder, crown's emissary

@IF
CITYPRODUCTION
builder=Anybody
improvement=49
@THEN
JUSTONCE
FLAG
continuous
who=triggerreceiver
flag=0
state=on
@ENDIF

@IF
CHECKFLAG
who=Humans
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Humans
unit=Champion
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF

@IF
CHECKFLAG
who=Dwarves
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Dwarves
unit=Scorpion Rider
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF

@IF
CHECKFLAG
who=Elves
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Elves
unit=Elven Hero
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF

@IF
CHECKFLAG
who=Seafolk
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Seafolk
unit=Seafolk Hero
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF

@IF
CHECKFLAG
who=Skylords
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Skylords
unit=Skylords Hero
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF

@IF
CHECKFLAG
who=Orcs
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Orcs
unit=Great Orc
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF

@IF
CHECKFLAG
who=Incubus
flag=0
state=on
@AND
RANDOMTURN
denominator=15
@THEN
JUSTONCE
PLAYWAVEFILE
Shortking.wav
TEXT
no broadcast
^The Crown's Emissary finally locates your long-lost great 
^champion. He had been wandering the countryside for many years
^in search of the meaning of life. He decides to postpone the 
^search to return to service. He wasn't getting anywhere anyway.
ENDTEXT
CREATEUNIT
incapital
owner=Incubus
unit=Incubus Lord
veteran=false
homecity=none
PLAYCDTRACK
3
@ENDIF


;siege engine

@IF
ALPHACENTAURIARRIVAL
race=anybody
size=1
@THEN
TEXT
^After a long journey filled with many delays and perils, the siege engine 
^arrives at the temporal residence of Loki, the mischief-maker god. It launches 
^the infernal sphere at the fortress - destroying it and Loki's power to
^interfere in worldly matters. There is great celebration everywhere as 
^without Loki's meddling all of the races agree to live in harmony. 
^The magicians wag their heads however and are heard to mutter, 
^"He was not sent far enough away. He could return in less than a lifetime."
^YOU HAVE WON though your victory might have been greater if you had
^fashioned a larger weapon!
ENDTEXT
ENDGAME
endscreens=yes
@ENDIF

@IF
ALPHACENTAURIARRIVAL
race=anybody
size=2
@THEN
TEXT
^After a long journey filled with many delays and perils, the siege engine 
^arrives at the temporal residence of Loki, the mischief-maker god. It launches 
^the infernal sphere at the fortress - destroying it and Loki's power to
^interfere in worldly matters. There is great celebration everywhere as 
^without Loki's meddling all of the races agree to live in harmony. 
^The magicians wag their heads however and are heard to mutter, 
^"He was not sent far enough away. He could return in less than two lifetimes."
^YOU HAVE WON though your victory might have been greater if you had
^fashioned a larger weapon!
ENDTEXT
ENDGAME
endscreens=yes
@ENDIF

@IF
ALPHACENTAURIARRIVAL
race=anybody
size=3
@THEN
TEXT
^After a long journey filled with many delays and perils, the siege engine 
^arrives at the temporal residence of Loki, the mischief-maker god. It launches 
^the infernal sphere at the fortress - destroying it and Loki's power to
^interfere in worldly matters. There is great celebration everywhere as 
^without Loki's meddling all of the races agree to live in harmony. 
^The magicians wag their heads however and are heard to mutter, 
^"He was not sent far enough away. He could return in less than three lifetimes."
^YOU HAVE WON though your victory might have been greater if you had
^fashioned a larger weapon!
ENDTEXT
ENDGAME
endscreens=yes
@ENDIF

@IF
ALPHACENTAURIARRIVAL
race=anybody
size=4
@THEN
TEXT
^After a long journey filled with many delays and perils, the siege engine 
^arrives at the temporal residence of Loki, the mischief-maker god. It launches 
^the infernal sphere at the fortress - destroying it and Loki's power to
^interfere in worldly matters. There is great celebration everywhere as 
^without Loki's meddling all of the races agree to live in harmony. The 
^magicians nod their heads in approval.. "You have rid us of Loki forever.", 
^they cry.
YOU HAVE WON A COMPLETE VICTORY!
ENDTEXT
ENDGAME
endscreens=yes
@ENDIF

; Research Win

@IF
RECEIVEDTECHNOLOGY
receiver=anybody
futuretech=8
@AND
RANDOMTURN
denominator=35
@THEN
TEXT
^While hanging from Yggdrasil, the tree of life, a magician accidently discovers 
^the location of Bifrost, the rainbow bridge, that joins the four planes of existence 
^to the ultimate plane, Asgard, the home of the Gods!
YOU HAVE WON THE GAME! 
ENDTEXT
ENDGAME
endscreens=yes
PLAYAVIFILE
Scene8.avi
@ENDIF

@ENDEVENTS




