improved end of 2-nd and 3-rd tutorial
[megaglest-data.git] / tutorials / 3_advanced_tutorial / 3_advanced_tutorial.xml
blob07ed6f94ee8fbe7196569d83759b945301690cca
1 <?xml version="1.0" standalone="yes" ?>
2 <scenario>
3         <difficulty value="1"/>
4         <players>
5                 <player control="cpu" faction="tech" team="1"/>
6                 <player control="human" faction="magic" team="2"/>
7                 <player control="closed"/>
8                 <player control="closed"/>
9         </players>
10         <map value="valley_of_death"/>
11         <tileset value="spring"/>
12         <tech-tree value="megapack"/>
13         <default-resources value="false"/>
14         <default-units value="false"/>
15         <default-victory-conditions value="false"/>
16         <scripts>
17                 <startup>
18                         disableAi(0)
19                         createUnit('mage_tower', 1, startLocation(1))
20                         setCameraPosition(unitPosition(lastCreatedUnit()))
21                         createUnit('energy_source', 1, startLocation(1))
22                         createUnit('initiate', 1, startLocation(1))
23                         createUnit('initiate', 1, startLocation(1))
24                         giveResource('gold', 1, 500)
25                         giveResource('stone', 1, 500)
26                         giveResource('wood', 1, 500)
27                         showMessage('Welcome', 'GlestAdvancedTutorial')
28                         showMessage('MagicBrief', 'GlestAdvancedTutorial')
29                         showMessage('InitiateBrief', 'GlestAdvancedTutorial')
30                         showMessage('InitiatePromotion', 'Promoting')
31                         setDisplayText('PromoteInitiate')
32                         objective= 'produce_battlemage'
33                         combatUnitCount= 0
34                 </startup>
35                 <unitCreated>
36                 </unitCreated>
37                 <unitCreatedOfType type="battlemage">
38                         if objective=='produce_battlemage' then
39                                 showMessage('BattlemageBrief', 'WellDone')
40                                 showMessage('EnergyBrief', 'Energy')
41                                 setDisplayText('BuildEnergySource')
42                                 objective= 'build_energy_source'
43                         end
44                 </unitCreatedOfType>
45                 <unitCreatedOfType type="energy_source">
46                         if objective=='build_energy_source' then
47                                 showMessage('EnergyBrief2', 'WellDone')
48                                 showMessage('SummonedUnitsBrief', 'Summoning')
49                                 setDisplayText('ProduceSummoner')
50                                 objective= 'produce_summoner'
51                         end
52                 </unitCreatedOfType>
53                 <unitCreatedOfType type="summoner">
54                         if objective=='produce_summoner' then
55                                 showMessage('SummonerBrief', 'WellDone')
56                                 setDisplayText('ProduceDaemon')
57                                 objective= 'produce_daemon'
58                         end
59                 </unitCreatedOfType>
60                 <unitCreatedOfType type="daemon">
61                         if objective=='produce_daemon' then
62                                 showMessage('DaemonBrief', 'WellDone')
63                                 showMessage('OtherSummonedCreatures', 'Summoning')
64                                 showMessage('GhostArmorRequirements', 'Summoning')
65                                 setDisplayText('ProduceGhostArmor')
66                                 objective= 'produce_ghost_armor'
67                         end
68                 </unitCreatedOfType>
69                 <unitCreatedOfType type="ghost_armor">
70                         if objective=='produce_ghost_armor' then
71                                 showMessage('GhostArmorBrief', 'WellDone')
72                                 showMessage('RitualBrief', 'Ritual')
73                                 setDisplayText('ProduceGolem')
74                                 objective= 'produce_golem'
75                         end
76                 </unitCreatedOfType>
77                 <unitCreatedOfType type="golem">
78                         if objective=='produce_golem' then
79                                 showMessage('GolemBrief', 'WellDone')
80                                 showMessage('ArmyManagement', 'Armies')
81                                 showMessage('DoubleClickBrief', 'Armies')
82                                 showMessage('GroupSelectBrief', 'Armies')
83                                 showMessage('FinalMission', 'Armies')
84                                 objective= 'defeat_enemy'
85                                 setDisplayText('DefeatEnemy')
86                                 createUnit('farm', 0, startLocation(0))
87                                 createUnit('barracks', 0, startLocation(0))
88                                 createUnit('swordman', 0, startLocation(0))
89                                 createUnit('swordman', 0, startLocation(0))
90                                 createUnit('archer', 0, startLocation(0))
91                         end
92                 </unitCreatedOfType>
93                 <unitDied>
94                         if objective=='defeat_enemy' and unitCount(0)==0 then
95                                 setDisplayText('WellDoneNextScenarios')
96                                 setPlayerAsWinner(1)
97                                 timer_event1 = startTimerEvent()
98                                 objective= 'end'
99                         end
100                 </unitDied>
101                 <timerTriggerEvent>
102                         if triggeredTimerEventId() == timer_event1 then
103                                 if timerEventSecondsElapsed(triggeredTimerEventId()) >= 5 then
104                                         endGame()
105                                         stopTimerEvent(triggeredTimerEventId())
106                                 end
107                         end
108                 </timerTriggerEvent>
109         </scripts>
110 </scenario>