Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ProtectBoss_HS17/data/levels/ProtectBoss.oxw @ 11672

Last change on this file since 11672 was 11672, checked in by lrigoni, 7 years ago

Final changes

File size: 16.1 KB
RevLine 
[11500]1<LevelInfo
2 name = "ProtectBoss"
3 description = "Protect a disabled cargo ship!"
[11672]4 tags = "mission"
[11500]5 screenshot = "emptylevel.png"
6/>
7
[11639]8
[11500]9<?lua
10  include("stats.oxo")
11  include("HUDTemplates3.oxo")
12  include("templates/lodInformation.oxt")
13  include("templates/HeavyCruiser.oxt")
[11604]14  include("HUDPickupTemplate.oxo")
15  include("templates/pickupRepresentationTemplates.oxt")
[11500]16?>
17
18<?lua
19  include("templates/spaceshipEscort.oxt")
20  include("templates/spaceshipAssff.oxt")
21  include("templates/endurancetest_template.oxt")
[11557]22  include("templates/spaceshipPirate.oxt")
[11500]23?>
24
25<Level gametype="Mission">
26  <templates>
27    <Template link=lodtemplate_default />
28  </templates>
29  <?lua include("includes/notifications.oxi") ?>
30
[11522]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
[11500]43  <Scene
44    ambientlight = "0.8, 0.8, 0.8"
45    skybox       = "Orxonox/Starbox"
46  >
47
[11639]48    <?lua
49      include("includes/pickups.oxi")
50    ?>
51
[11500]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"/>
[11557]55
[11522]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>
[11557]63   
[11585]64    <Pawn
[11522]65        team      = 0
[11585]66        collisionType = kinematic
[11604]67        enablecollisiondamage=true
[11672]68        collisiondamage = 5
[11522]69        position  = "0,0,-2500"
[11604]70        mass      = 100000
[11672]71        health    = 2500 initialhealth=2500 maxhealth="2500"
[11585]72        direction = "1,0,0"
[11522]73        rotationaxis="0,0,1" rotationrate="4.5" velocity="0,0,30"
[11604]74        vulnerable=true
[11585]75        name      = "CargoShip"
76        radarname = "Cargo Ship" >
[11522]77      <attached>
[11542]78        <DistanceTriggerBeacon name="CargoShip" />
[11557]79        <Model mesh="escortShip.mesh" mass=10000 position="0,0,0" scale=100 />
[11522]80      </attached>
[11557]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" />
[11522]85      </collisionShapes>
[11585]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>
[11522]115
[11672]116    <!-- triggers some time after start -->
117    <DistanceTrigger name="someTimeAfterStart" beaconMode=identify position="0,0,1000" distance=1000 target="Pawn" targetname="CargoShip" />
118
[11557]119    <!-- triggers when first quest is completed -->
[11585]120    <DistanceTrigger name="passedAsteroidFieldOne" beaconMode=identify position="0,0,3000" distance=1000 target="Pawn" targetname="CargoShip" />
[11542]121
[11604]122    <!-- triggers when first pirate wave is defeated -->
[11639]123
[11604]124    <Trigger name="firstPirateWaveKilled" mode="and">
[11639]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      ?>
[11604]139    </Trigger>
140
[11639]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 -->
[11672]153    <Trigger name="thirdPirateWaveKilled" mode="and">
[11639]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
[11672]161    <Trigger name="succeedMission" mode=and delay=1>
[11639]162      <EventTrigger activations="1" stayactive="true" >
163        <events>
164          <trigger>
165             <EventListener event="thirdPirateWaveKilled" />
166          </trigger>
167        </events>
168      </EventTrigger>
[11672]169      <EventTrigger activations="1" stayactive="false" name="cargoShipStillAlive" invert=true>
[11639]170        <events>
171          <trigger>
172             <EventListener event="CargoShip" />
173          </trigger>
174        </events>
175      </EventTrigger>
[11672]176    </Trigger>
[11639]177
[11672]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
[11639]186    <!-- create asteroids and pickups -->
[11522]187    <?lua
[11604]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
[11672]199      for count = 1, 60, 1 do
[11522]200        x = math.random(-1000, 1000)
201        y = math.random(-1000, 1000)
202        z = 125 * count + math.random(-250, 250)
[11557]203        vmax = 7
[11672]204        if count > 30 then
205          vmax = 2
206        end
[11542]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
[11639]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>")
[11522]215      end
[11604]216
[11672]217      for count = 1, 60, 1 do
[11604]218        x = math.random(-1000, 1000)
219        y = math.random(-1000, 1000)
[11672]220        z = 3000 + 125 * count + math.random(-250, 250)
[11639]221        typenum = math.random(11)
[11604]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"
[11639]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"
[11604]243        else
[11639]244          type = "drone"
[11604]245        end
246        type = type .. "pickup"
[11639]247        print("<PickupSpawner pickup=\"" .. type .. "\" position=\"" .. x .. "," .. y .. "," .. z .. "\" triggerDistance=10 respawnTime=5 maxSpawnedItems=1 />")
[11604]248      end
[11522]249    ?>
250
[11557]251    <!-- start first quest -->
[11522]252    <QuestEffectBeacon times=1>
253      <effects>
254        <AddQuest questId="ProtectBoss.AsteroidField" />
255      </effects>
256      <events>
[11542]257        <execute>
[11522]258          <EventListener event=spawntrigger />
259        </execute>
260      </events>
261    </QuestEffectBeacon>
262
[11557]263    <!-- start second quest (doesn't work yet) -->
264    <QuestEffectBeacon times=1>
265      <effects>
266        <CompleteQuest questId="ProtectBoss.AsteroidField" />
[11585]267        <!--AddQuest questId="ProtectBoss.PirateAttack" /-->
[11557]268      </effects>
269      <events>
270        <execute>
[11585]271          <EventListener event=passedAsteroidFieldOne />
[11557]272        </execute>
273      </events>
274    </QuestEffectBeacon>
275
[11522]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">
[11672]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="" />
[11585]286        <complete-effects>
[11542]287            <AddQuest questId="ProtectBoss.PirateAttack" />
[11585]288        </complete-effects>
[11522]289    </LocalQuest>
[11542]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
[11672]295    <SimpleNotification message="There are pirates around!" broadcast="true" >
[11542]296        <events>
297            <trigger>
[11672]298                <EventListener event="someTimeAfterStart" />
[11542]299            </trigger>
300        </events>
301    </SimpleNotification>
302
[11639]303    <SimpleNotification message="The cargo ship got destroyed! Game over!" broadcast=true >
[11585]304      <events>
305            <trigger>
306                <EventListener event="CargoShip" />
307            </trigger>
[11542]308        </events>
[11585]309    </SimpleNotification>
310
[11604]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
[11672]319    <SimpleNotification message="The third and last pirate wave is near!" broadcast=true >
[11639]320      <events>
321            <trigger>
322                <EventListener event="secondPirateWaveKilled" />
323            </trigger>
324        </events>
325    </SimpleNotification>
[11604]326
[11672]327    <SimpleNotification message="The cargo ship is out of danger. You made it!" broadcast=true >
[11639]328      <events>
329            <trigger>
[11672]330                <EventListener event="succeedMission" />
[11639]331            </trigger>
332        </events>
333    </SimpleNotification>
334
335    <!-- A function to put pirates to a certain location -->
[11585]336    <?lua
[11604]337      function placePirate(posX, posY, posZ, name, trigger)
[11672]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>")
[11585]339      end
340    ?>
341
342    <?lua
[11672]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")
[11585]359    ?>
360
[11500]361  </Scene>
362</Level>
363
Note: See TracBrowser for help on using the repository browser.