Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Presentation_HS17/data/levels/ProtectBoss.oxw @ 11747

Last change on this file since 11747 was 11680, checked in by patricwi, 7 years ago

merged ProtectBoss

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