1 | <LevelInfo |
---|
2 | name = "ProtectBoss" |
---|
3 | description = "Protect a disabled cargo ship!" |
---|
4 | tags = "mission" |
---|
5 | screenshot = "emptylevel.png" |
---|
6 | /> |
---|
7 | |
---|
8 | |
---|
9 | <?lua |
---|
10 | include("stats.oxo") |
---|
11 | include("HUDTemplates3.oxo") |
---|
12 | include("templates/lodInformation.oxt") |
---|
13 | include("templates/HeavyCruiser.oxt") |
---|
14 | include("templates/pickupRepresentationTemplates.oxt") |
---|
15 | ?> |
---|
16 | |
---|
17 | <?lua |
---|
18 | include("templates/spaceshipEscort.oxt") |
---|
19 | include("templates/spaceshipAssff.oxt") |
---|
20 | include("templates/endurancetest_template.oxt") |
---|
21 | include("templates/spaceshipPirate.oxt") |
---|
22 | ?> |
---|
23 | |
---|
24 | <Level gametype="Mission"> |
---|
25 | <templates> |
---|
26 | <Template link=lodtemplate_default /> |
---|
27 | </templates> |
---|
28 | <?lua include("includes/notifications.oxi") ?> |
---|
29 | |
---|
30 | <NotificationQueueCEGUI |
---|
31 | name="narrative" |
---|
32 | targets="simpleNotification" |
---|
33 | size=3 |
---|
34 | displayTime=7 |
---|
35 | position="0.2, 0, 0.1, 0" |
---|
36 | fontSize="16" |
---|
37 | fontColor="0.3, 1, 0.2, 0.8" |
---|
38 | alignment="HorzCentred" |
---|
39 | displaySize="0.6, 0, 0, 0" |
---|
40 | /> |
---|
41 | |
---|
42 | <Scene |
---|
43 | ambientlight = "0.8, 0.8, 0.8" |
---|
44 | skybox = "Orxonox/Starbox" |
---|
45 | > |
---|
46 | |
---|
47 | <?lua |
---|
48 | include("includes/pickups.oxi") |
---|
49 | ?> |
---|
50 | |
---|
51 | <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg--> |
---|
52 | |
---|
53 | <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> |
---|
54 | |
---|
55 | <EventMultiTrigger name=spawntrigger> |
---|
56 | <events> |
---|
57 | <trigger> |
---|
58 | <SpawnPoint team=0 position="0,0,1" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /> |
---|
59 | </trigger> |
---|
60 | </events> |
---|
61 | </EventMultiTrigger> |
---|
62 | |
---|
63 | <Pawn |
---|
64 | team = 0 |
---|
65 | collisionType = kinematic |
---|
66 | enablecollisiondamage=true |
---|
67 | collisiondamage = 5 |
---|
68 | position = "0,0,-2500" |
---|
69 | mass = 100000 |
---|
70 | health = 2500 initialhealth=2500 maxhealth="2500" |
---|
71 | direction = "1,0,0" |
---|
72 | rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30" |
---|
73 | vulnerable=true |
---|
74 | name = "CargoShip" |
---|
75 | radarname = "Cargo Ship" > |
---|
76 | <attached> |
---|
77 | <DistanceTriggerBeacon name="CargoShip" /> |
---|
78 | <Model mesh="escortShip.mesh" mass=10000 position="0,0,0" scale=100 /> |
---|
79 | </attached> |
---|
80 | <collisionShapes> |
---|
81 | <BoxCollisionShape position="0,0,0" halfExtents="300,100,200" /> <!-- laenge , dicke , breite --> |
---|
82 | <BoxCollisionShape position="-100,-50,-280" halfExtents="220,70,100" /> |
---|
83 | <BoxCollisionShape position="-100,-50,280" halfExtents="220,70,100" /> |
---|
84 | </collisionShapes> |
---|
85 | <explosion> |
---|
86 | <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" /> |
---|
87 | <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" /> |
---|
88 | <ExplosionPart scale = 12 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" /> |
---|
89 | <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" /> |
---|
90 | <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" /> |
---|
91 | <ExplosionPart offset="94,33,-50" delay=1 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" /> |
---|
92 | |
---|
93 | <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
94 | <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
95 | <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
96 | <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
97 | <ExplosionPart scale = 5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
98 | <ExplosionPart scale = 5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
99 | <ExplosionPart scale = 5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
100 | <ExplosionPart scale = 5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
101 | <ExplosionPart delay=0.8 scale = 2.5 mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
102 | <ExplosionPart delay=0.8 scale = 2.5 mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
103 | <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
104 | <ExplosionPart delay=0.8 scale = 2.5 mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" /> |
---|
105 | |
---|
106 | <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" /> |
---|
107 | <ExplosionPart offset="30,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" /> |
---|
108 | <ExplosionPart offset="20,13,-15" scale=7 delay=1.3 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" /> |
---|
109 | <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" /> |
---|
110 | <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" /> |
---|
111 | <ExplosionPart offset="-20,-13,-15" scale=5 delay=1.8 minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" /> |
---|
112 | </explosion> |
---|
113 | </Pawn> |
---|
114 | |
---|
115 | <!-- triggers some time after start --> |
---|
116 | <DistanceTrigger name="someTimeAfterStart" beaconMode=identify position="0,0,1000" distance=1000 target="Pawn" targetname="CargoShip" /> |
---|
117 | |
---|
118 | <!-- triggers when first quest is completed --> |
---|
119 | <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,3000" distance=1000 target="Pawn" targetname="CargoShip" /> |
---|
120 | |
---|
121 | <!-- triggers when first pirate wave is defeated --> |
---|
122 | |
---|
123 | <Trigger name="firstPirateWaveKilled" mode="and"> |
---|
124 | <?lua |
---|
125 | for n = 1, 3, 1 do |
---|
126 | print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p" .. n .. "/></trigger></events></EventTrigger>") |
---|
127 | end |
---|
128 | ?> |
---|
129 | </Trigger> |
---|
130 | |
---|
131 | <!-- triggers when second pirate wave is defeated --> |
---|
132 | <Trigger name="secondPirateWaveKilled" mode="and"> |
---|
133 | <?lua |
---|
134 | for n = 1, 6, 1 do |
---|
135 | print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p1" .. n .. "/></trigger></events></EventTrigger>") |
---|
136 | end |
---|
137 | ?> |
---|
138 | </Trigger> |
---|
139 | |
---|
140 | <!-- triggers some time after the second pirate wave was defeated --> |
---|
141 | <Trigger name="thirdPirateWaveStarting" delay=15> |
---|
142 | <EventTrigger activations="1" stayactive="true" > |
---|
143 | <events> |
---|
144 | <trigger> |
---|
145 | <EventListener event="secondPirateWaveKilled" /> |
---|
146 | </trigger> |
---|
147 | </events> |
---|
148 | </EventTrigger> |
---|
149 | </Trigger> |
---|
150 | |
---|
151 | <!-- triggers when third pirate wave is defeated --> |
---|
152 | <Trigger name="thirdPirateWaveKilled" mode="and"> |
---|
153 | <?lua |
---|
154 | for n = 1, 7, 1 do |
---|
155 | print("<EventTrigger activations=1 stayactive=true><events><trigger><EventListener event=p2" .. n .. "/></trigger></events></EventTrigger>") |
---|
156 | end |
---|
157 | ?> |
---|
158 | </Trigger> |
---|
159 | |
---|
160 | <Trigger name="succeedMission" mode=and delay=1> |
---|
161 | <EventTrigger activations="1" stayactive="true" > |
---|
162 | <events> |
---|
163 | <trigger> |
---|
164 | <EventListener event="thirdPirateWaveKilled" /> |
---|
165 | </trigger> |
---|
166 | </events> |
---|
167 | </EventTrigger> |
---|
168 | <EventTrigger activations="1" stayactive="false" name="cargoShipStillAlive" invert=true> |
---|
169 | <events> |
---|
170 | <trigger> |
---|
171 | <EventListener event="CargoShip" /> |
---|
172 | </trigger> |
---|
173 | </events> |
---|
174 | </EventTrigger> |
---|
175 | </Trigger> |
---|
176 | |
---|
177 | <EventTrigger activations="1" stayactive="true" name="failMission" delay=0.1> |
---|
178 | <events> |
---|
179 | <trigger> |
---|
180 | <EventListener event="CargoShip" /> |
---|
181 | </trigger> |
---|
182 | </events> |
---|
183 | </EventTrigger> |
---|
184 | |
---|
185 | <!-- create asteroids and pickups --> |
---|
186 | <?lua |
---|
187 | function asteroidMesh() |
---|
188 | x = math.random(8) |
---|
189 | if x < 7 then |
---|
190 | return "ast" .. x .. ".mesh" |
---|
191 | elseif x == 7 then |
---|
192 | return "asteroid_ice.mesh" |
---|
193 | else |
---|
194 | return "asteroid_UV.mesh" |
---|
195 | end |
---|
196 | end |
---|
197 | |
---|
198 | for count = 1, 60, 1 do |
---|
199 | x = math.random(-1000, 1000) |
---|
200 | y = math.random(-1000, 1000) |
---|
201 | z = 125 * count + math.random(-250, 250) |
---|
202 | vmax = 7 |
---|
203 | if count > 30 then |
---|
204 | vmax = 2 |
---|
205 | end |
---|
206 | rx = math.random(-vmax, vmax) |
---|
207 | ry = math.random(-vmax, vmax) |
---|
208 | rz = math.random(-vmax, vmax) |
---|
209 | vx = math.random(-vmax, vmax) |
---|
210 | vy = math.random(-vmax, vmax) |
---|
211 | vz = math.random(-vmax, vmax) |
---|
212 | rr = math.random() * 10 |
---|
213 | print("<ShootableObstacle team=1 enablecollisiondamage=true collisiondamage=10 health=100 maxhealth=100 initialhealth=100 position=\"" .. x .. "," .. y .. "," .. z .. "\" direction=\"0,0,-1\" velocity=\"" .. vx .. "," .. vy .. "," .. vz .. "\"rotationaxis=\"" .. rx .. "," .. ry .. "," .. rz .. "\" rotationrate=" .. rr .. " collisionType=dynamic mass=1 name=asteroid radarname=Asteroid> <attached> <Model position=\"0,0,0\" mesh=\"" .. asteroidMesh() .. "\" scale3D=\"10,10,10\" /> </attached> <collisionShapes> <SphereCollisionShape position=\"0,0,0\" radius=5 /> </collisionShapes> <controller> <WaypointController team=1> </WaypointController> </controller> <explosion> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_flash2\" effect2=\"orxonox/explosion_flame2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_shockwave2\" effect2=\"orxonox/explosion_sparks2\" /> <ExplosionPart minspeed=0 maxspeed=0 effect1=\"orxonox/explosion_streak2\" effect2=\"orxonox/explosion_afterglow\" /> </explosion> </ShootableObstacle>") |
---|
214 | end |
---|
215 | |
---|
216 | for count = 1, 60, 1 do |
---|
217 | x = math.random(-1000, 1000) |
---|
218 | y = math.random(-1000, 1000) |
---|
219 | z = 3000 + 125 * count + math.random(-250, 250) |
---|
220 | typenum = math.random(11) |
---|
221 | type = "" |
---|
222 | if typenum == 1 then |
---|
223 | type = "smallmunition" |
---|
224 | elseif typenum == 2 then |
---|
225 | type = "mediummunition" |
---|
226 | elseif typenum == 3 then |
---|
227 | type = "hugemunition" |
---|
228 | elseif typenum == 4 then |
---|
229 | type = "smallhealth" |
---|
230 | elseif typenum == 5 then |
---|
231 | type = "mediumhealth" |
---|
232 | elseif typenum == 6 then |
---|
233 | type = "hugehealth" |
---|
234 | elseif typenum == 7 then |
---|
235 | type = "crazyhealth" |
---|
236 | elseif typenum == 8 then |
---|
237 | type = "smallshield" |
---|
238 | elseif typenum == 9 then |
---|
239 | type = "mediumshield" |
---|
240 | elseif typenum == 10 then |
---|
241 | type = "hugeshield" |
---|
242 | else |
---|
243 | type = "drone" |
---|
244 | end |
---|
245 | type = type .. "pickup" |
---|
246 | print("<PickupSpawner pickup=\"" .. type .. "\" position=\"" .. x .. "," .. y .. "," .. z .. "\" triggerDistance=10 respawnTime=5 maxSpawnedItems=1 />") |
---|
247 | end |
---|
248 | ?> |
---|
249 | |
---|
250 | <!-- start first quest --> |
---|
251 | <QuestEffectBeacon times=1> |
---|
252 | <effects> |
---|
253 | <AddQuest questId="ProtectBoss.AsteroidField" /> |
---|
254 | </effects> |
---|
255 | <events> |
---|
256 | <execute> |
---|
257 | <EventListener event=spawntrigger /> |
---|
258 | </execute> |
---|
259 | </events> |
---|
260 | </QuestEffectBeacon> |
---|
261 | |
---|
262 | <!-- start second quest (doesn't work yet) --> |
---|
263 | <QuestEffectBeacon times=1> |
---|
264 | <effects> |
---|
265 | <CompleteQuest questId="ProtectBoss.AsteroidField" /> |
---|
266 | <!--AddQuest questId="ProtectBoss.PirateAttack" /--> |
---|
267 | </effects> |
---|
268 | <events> |
---|
269 | <execute> |
---|
270 | <EventListener event=passedAsteroidFieldOne /> |
---|
271 | </execute> |
---|
272 | </events> |
---|
273 | </QuestEffectBeacon> |
---|
274 | |
---|
275 | <SimpleNotification message="Protect the cargo ship! (Info: F3)" broadcast="true"> |
---|
276 | <events> |
---|
277 | <trigger> |
---|
278 | <EventListener event=spawntrigger /> |
---|
279 | </trigger> |
---|
280 | </events> |
---|
281 | </SimpleNotification> |
---|
282 | |
---|
283 | <LocalQuest id="ProtectBoss.AsteroidField"> |
---|
284 | <QuestDescription title="Protect the Cargo Ship" description="The cargo ship in front of you is disabled and is drifting uncontrolled! Shoot the asteroids out of the way to protect it!" failmessage="The cargo ship has been hit!" completeMessage="" /> |
---|
285 | <complete-effects> |
---|
286 | <AddQuest questId="ProtectBoss.PirateAttack" /> |
---|
287 | </complete-effects> |
---|
288 | </LocalQuest> |
---|
289 | |
---|
290 | <LocalQuest id="ProtectBoss.PirateAttack"> |
---|
291 | <QuestDescription title="Pirate Attack" description="Protect the cargo ship from the attacking pirates!" failmessage="The pirates boarded the cargo ship!" completeMessage="" /> |
---|
292 | </LocalQuest> |
---|
293 | |
---|
294 | <SimpleNotification message="There are pirates around!" broadcast="true" > |
---|
295 | <events> |
---|
296 | <trigger> |
---|
297 | <EventListener event="someTimeAfterStart" /> |
---|
298 | </trigger> |
---|
299 | </events> |
---|
300 | </SimpleNotification> |
---|
301 | |
---|
302 | <SimpleNotification message="The cargo ship got destroyed! Game over!" broadcast=true > |
---|
303 | <events> |
---|
304 | <trigger> |
---|
305 | <EventListener event="CargoShip" /> |
---|
306 | </trigger> |
---|
307 | </events> |
---|
308 | </SimpleNotification> |
---|
309 | |
---|
310 | <SimpleNotification message="A second pirate wave is approaching!" broadcast=true > |
---|
311 | <events> |
---|
312 | <trigger> |
---|
313 | <EventListener event="firstPirateWaveKilled" /> |
---|
314 | </trigger> |
---|
315 | </events> |
---|
316 | </SimpleNotification> |
---|
317 | |
---|
318 | <SimpleNotification message="The third and last pirate wave is near!" broadcast=true > |
---|
319 | <events> |
---|
320 | <trigger> |
---|
321 | <EventListener event="secondPirateWaveKilled" /> |
---|
322 | </trigger> |
---|
323 | </events> |
---|
324 | </SimpleNotification> |
---|
325 | |
---|
326 | <SimpleNotification message="The cargo ship is out of danger. You made it!" broadcast=true > |
---|
327 | <events> |
---|
328 | <trigger> |
---|
329 | <EventListener event="succeedMission" /> |
---|
330 | </trigger> |
---|
331 | </events> |
---|
332 | </SimpleNotification> |
---|
333 | |
---|
334 | <!-- A function to put pirates to a certain location --> |
---|
335 | <?lua |
---|
336 | function placePirate(posX, posY, posZ, name, trigger) |
---|
337 | print("<SpaceShip mass=10 health=25 initialhealth=25 maxhealth=25 shieldhealth=10 maxshieldhealth=10 initialshieldhealth=10 shieldabsorption=0.3 shieldrechargerate=1 shieldrechargewaittime=1 primaryThrust=20 auxiliaryThrust=5 rotationThrust=5 boostpower=2 boostrate=1 boostCooldownDuration = 50 accuracy=1 position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\" name=\"" .. name .. "\" radarname=Pirate><!--events><visibility><EventListener event=\"" .. trigger .. "\"/></visibility><activity><EventListener event=\"" .. trigger .. "\"/></activity></events--><templates><Template link=spaceshippirate /></templates><controller><WaypointPatrolController alertnessradius=2700 attackradius=1850 team=1 active=true><waypoints><StaticEntity position=\"" .. posX .. "," .. posY .. "," .. posZ .. "\"/><StaticEntity position=\"" .. (posX + 100) .. "," .. posY .. "," .. posZ .. "\"/><!--Model mesh=\"cube.mesh\" scale=0 position=\"-1300,-600,900\" /><Model mesh=\"cube.mesh\" scale=0 position=\"0,0,0\" /--></waypoints><events><activity><EventListener event=attack /></activity></events></WaypointPatrolController></controller></SpaceShip>") |
---|
338 | end |
---|
339 | ?> |
---|
340 | |
---|
341 | <?lua |
---|
342 | placePirate(0, 0, 4800, "p1", "passedAsteroidFieldOne") |
---|
343 | placePirate(50, 0, 4900, "p2", "passedAsteroidFieldOne") |
---|
344 | placePirate(0, 50, 5000, "p3", "passedAsteroidFieldOne") |
---|
345 | placePirate(0, 0, 6500, "p11", "firstPirateWaveKilled") |
---|
346 | placePirate(50, 0, 6600, "p12", "firstPirateWaveKilled") |
---|
347 | placePirate(-50, 0, 6700, "p13", "firstPirateWaveKilled") |
---|
348 | placePirate(0, 50, 6800, "p14", "firstPirateWaveKilled") |
---|
349 | placePirate(0, -50, 6900, "p15", "firstPirateWaveKilled") |
---|
350 | placePirate(0, 0, 7000, "p16", "firstPirateWaveKilled") |
---|
351 | placePirate(0, 0, 8000, "p21", "thirdPirateWaveStarting") |
---|
352 | placePirate(50, 0, 8100, "p22", "thirdPirateWaveStarting") |
---|
353 | placePirate(-50, 0, 8200, "p23", "thirdPirateWaveStarting") |
---|
354 | placePirate(0, 50, 8300, "p24", "thirdPirateWaveStarting") |
---|
355 | placePirate(0, -50, 8400, "p25", "thirdPirateWaveStarting") |
---|
356 | placePirate(50, 50, 8500, "p26", "thirdPirateWaveStarting") |
---|
357 | placePirate(-50, -50, 8600, "p27", "thirdPirateWaveStarting") |
---|
358 | ?> |
---|
359 | |
---|
360 | </Scene> |
---|
361 | </Level> |
---|
362 | |
---|