updated translations, Chinese-China again supported
[megaglest-data.git] / scenarios / storming / storming.xml
blob6dc99a0bd096083df168bb24e603a47e5727173c
1 <?xml version="1.0" standalone="yes" ?> 
2 <scenario>
3         <difficulty value="3"/>
4         <players>
5                 <player control="human" faction="magic" team="1"/>
6                 <player control="cpu" faction="magic" team="1"/>
7                 <player control="cpu" faction="magic" team="2"/>
8                 <player control="cpu" faction="tech" team="2"/>         
9         </players>
10         <map value="in_the_forest"/>
11         <tileset value="forest"/>
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                         --disable AI
19                         disableAi(1)
20                         disableAi(2)
21                         disableAi(3)
22                         
23                         --allied units
24                         createUnit('mage_tower', 1, startLocation(2))   
25                         giveResource('gold', 1, 1000); 
26                         giveResource('wood', 1, 1000); 
27                         createUnit('summoner_guild', 1, startLocation(2))       
28                         giveUpgradeCommand(lastCreatedUnit(), 'ancient_summoning')
29                         createUnit('energy_source', 1, startLocation(2))
30                         createUnit('summoner', 1, startLocation(2))
31                         summonerUnit= lastCreatedUnit()
32                         setCameraPosition(unitPosition(summonerUnit))
33                         givePositionCommand(summonerUnit, 'attack', startLocation(1))
34                         
35                         --player units
36                         for i=1, 3 do
37                                 createUnit('battlemage', 0, startLocation(2))
38                         end             
39                         for i=1, 5 do
40                                 createUnit('daemon', 0, startLocation(2))
41                         end                             
42                         
43                         --enemy units village
44                         createUnit('library', 2, startLocation(1))      
45                         libraryUnit= lastCreatedUnit()
46                         createUnit('golem', 2, startLocation(1))        
47                         
48                         --create enemy attackers
49                         for i=1, 2 do
50                                 createUnit('daemon', 2, startLocation(1))
51                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(2))      
52                         end
53                         createUnit('ghost_armor', 2, startLocation(1))
54                         givePositionCommand(lastCreatedUnit(), 'attack', startLocation(2))      
55                         
56                         --objectives
57                         objective='destroy_west_village'
58                         showMessage('Brief1', 'Storming')
59                         setDisplayText('ObjectiveWest')
60                         
61                 </startup>
62                 
63                 <unitCreated>           
64                         --send units attack location 0
65                         if objective=='destroy_north_east_village' and unitFaction(lastCreatedUnit())==1 then
66                                 firstArmorUnit=lastCreatedUnit()
67                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))
68                                 if summonerUnit ~= nil then
69                                         givePositionCommand(summonerUnit, 'attack', startLocation(0))
70                                 end
71                                 
72                                 for i=1, 2 do
73                                         createUnit('guard', 3, startLocation(0))
74                                         givePositionCommand(lastCreatedUnit(), 'attack', startLocation(1))      
75                                 end                             
76                         end     
77                         
78                         --send units attack location 3
79                         if objective=='destroy_south_east_village' and unitFaction(lastCreatedUnit())==1 then
80                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(3))
82                                 if firstArmorUnit ~= nil then
83                                         givePositionCommand(firstArmorUnit, 'attack', startLocation(3))
84                                 end
85                                 if summonerUnit ~= nil then
86                                         givePositionCommand(summonerUnit, 'attack', startLocation(3))
87                                 end
88                                 
89                                 --create enemy attackers
90                                 createUnit('ornithopter', 3, startLocation(3))
91                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))      
92                                 createUnit('archmage', 2, startLocation(3))
93                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))      
94                                 createUnit('battlemage', 2, startLocation(3))
95                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))                                      
96                         end                             
97                 </unitCreated>  
98                 
99                 <unitDied>
100                         if lastDeadUnit()==firstArmorUnit then
101                                 firstArmorUnit = nil
102                         end
104                         --check for summoner dying
105                         if lastDeadUnit()==summonerUnit then
106                                 summonerUnit = nil
107                                 clearDisplayText()
108                                 setPlayerAsWinner(2)
109                                 setPlayerAsWinner(3)                            
110                                 endGame()
111                         end
112                         
113                         --check for first village destroyed
114                         if lastDeadUnit()==libraryUnit then
115                                 libraryUnit = nil
116                                 --summon ghost armor
117                                 if summonerUnit ~= nil then
118                                         giveProductionCommand(summonerUnit, 'ghost_armor')
119                                 end
120                                 
121                                 --send reinforcements
122                                 createUnit('daemon', 0, startLocation(2))
123                                 givePositionCommand(lastCreatedUnit(), 'move', startLocation(1))
124                                 
125                                 --send reinforcements
126                                 createUnit('battlemage', 0, startLocation(2))
127                                 givePositionCommand(lastCreatedUnit(), 'move', startLocation(1))                                
128                                 
129                                 --create next village
130                                 createUnit('guard', 3, startLocation(0))        
131                                 createUnit('farm', 3, startLocation(0))
132                                 createUnit('technodrome', 3, startLocation(0))
133                                 technodromeUnit= lastCreatedUnit()
135                                 --create enemy attackers
136                                 for i=1, 2 do
137                                         createUnit('archer', 3, startLocation(0))
138                                         givePositionCommand(lastCreatedUnit(), 'attack', startLocation(1))      
139                                 end
140                                 createUnit('swordman', 3, startLocation(0))
141                                 givePositionCommand(lastCreatedUnit(), 'attack', startLocation(1))                                              
143                                 --change objective
144                                 objective='destroy_north_east_village'
145                                 setDisplayText('ObjectiveNorthEast')                            
146                         end     
148                         --check for second village destroyed
149                         if lastDeadUnit()==technodromeUnit then
150                                 
151                                 technodromeUnit = nil
152                                 --summon ghost armor
153                                 if summonerUnit ~= nil then
154                                         giveProductionCommand(summonerUnit, 'ghost_armor')
155                                 end
156                                 
157                                 --create next village
158                                 createUnit('farm', 3, startLocation(3))
159                                 createUnit('aerodrome', 3, startLocation(3))
160                                 createUnit('behemoth', 2, startLocation(3))                             
161                                 createUnit('archmage_tower', 2, startLocation(3))
162                                 archmageTowerUnit= lastCreatedUnit()
163                                 
164                                 --change objective
165                                 objective='destroy_south_east_village'
166                                 setDisplayText('ObjectiveSouthEast')                                    
167                         end             
169                         --check for last village destroyed
170                         if lastDeadUnit()==archmageTowerUnit then
171                                 archmageTowerUnit = nil
173                                 clearDisplayText()
174                                 setPlayerAsWinner(0)
175                                 setPlayerAsWinner(1)                            
176                                 endGame()
177                         end
178                         
179                 </unitDied>             
180         </scripts>              
181 </scenario>