Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/masterserver/data/levels/Quest_PirateAttack.oxw @ 7896

Last change on this file since 7896 was 7463, checked in by dafrick, 14 years ago

Fixing "bug", that caused crash in dedicated mode.
Script object can now specify whether the code that is executed by it needs graphics to work.

  • Property svn:eol-style set to native
File size: 25.5 KB
Line 
1<?lua
2  include("hudtemplates3.oxo")
3  include("stats.oxo")
4  include("templates/spaceship_assff.oxt")
5  include("templates/spaceship_HXY_SL.oxt")
6  include("templates/spaceship_pirate.oxt")
7  include("templates/lodinformation.oxt")
8?>
9
10<Template name=spaceshipassffplayer defaults=0>
11  <SpaceShip template=spaceshipassff name=player>
12    <attached>
13    <DistanceTriggerBeacon name=Me/>
14    </attached>
15  </SpaceShip>
16</Template>
17
18<?lua
19    dofile("includes/CuboidSpaceStation.lua")
20?>
21   
22<Level
23name="Dani's Testlevel"
24description="Erste Versuche mit den Quests"
25gametype=TeamDeathmatch
26>
27
28  <templates>
29    <Template link=lodtemplate_default />
30  </templates>
31
32    <Scene
33        ambientlight = "0.3, 0.3, 0.3"
34        skybox       = "Orxonox/skypanoramagen1"
35    >
36
37        <Script code="showGUI NotificationLayer false true" needsGraphics="true" />
38
39        <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" />
40
41
42          <GlobalQuest id="dbd02b4c-ab7c-46fd-bdaf-fd4c19ac1551">
43        <QuestDescription title="Fight for freedom"
44                    description="Just a few hours ago, a group of pirates attacked an killed all your  squad members. Now you are very angry and you want to take revenge. Find the pirates and kill them!"
45                    failmessage="You are a loser, now the whole universe will be controlled by the pirates!"
46                    completeMessage="Yeah, you did it! You,ve eliminated the enemies. But why attacked them the Humans here? For tousands of years, there was peace in this sun system.
47                                You have to find out what happened exactly and why the pirates attacked..."/>
48            <subquests>
49                <GlobalQuest id="3159b4d4-bc86-4190-ba1d-4530668dfe31">
50                    <QuestDescription title="The stolen stick..."
51                    description="Now you can see it: There are more pirates... the pirates you killed were only a small part of the whole fleet. You received a message from your Headquarter: The pirates have stolen
52                            a very important memory stick with secret infos (military locations etc.), the holy stick. You must get it back! Otherwise the humans are in great danger..."
53                    failmessage=""
54                    completeMessage="Unbelievable, you annihilated all pirates and got the stolen memory stick.
55                                But wait... this isn't the memory stick you looked for, this stick is one from a pirate... anyway, it's helpful: There is a map saved on it, which leads you to a pirate - base. Perhaps you'll find more
56                                about their plans there..."/>
57                </GlobalQuest>
58                <GlobalQuest id="8d8ed3a6-74a6-4491-9172-26155cff151d">
59                    <QuestDescription title="Find the Base"
60                    description="Now you are in possession of the map and it should be easy to find the base. Because you are a Member of an elite-fight-squad, your ship has been pimped before you started your mission.
61                        They installed a very modern navigation system, which leads you precisely to your desired destination. Use it to find the pirate - base."
62                    failmessage=""
63                    completeMessage="The navigation system worked very well and now you should be near a pirate -base." />
64                    <hints>
65                        <QuestHint id="965101b3-26ce-4fcf-bc71-17cc2a87d2e9">
66                        <QuestDescription title="3 Ways?"
67                        description="The different ways leads you to the possible positions where the base could be. The problem is that the map is encrypted and your on board system is not
68                                able to decrypt it exactly. Therefore you have to try 3 possible ways...Tha base is Huge, but it could be that it's invisible when ou are in longer distance (some Big Ships
69                                have a special shield aroud them which make them invisible at longer range)."/>
70                        </QuestHint>
71                    </hints>
72                </GlobalQuest>
73                <GlobalQuest  id="9930a598-98bc-4ff8-8cc0-31311a6ccaaa">
74                    <QuestDescription title=":(" description="Here isn't the base you look for... try another way."/>
75                </GlobalQuest>
76                <GlobalQuest id="9930a598-98bc-4ff8-8cc0-31311a6ccaab">
77                    <QuestDescription title=":(" description="Here isn't the base you look for... try another way."/>
78                </GlobalQuest>
79                <GlobalQuest id="8a62408b-c47b-4e02-bd3d-06bb9ec0b363">
80                    <QuestDescription title="The Base"
81                    description="Yeah, you found the Base... now let's check if there is the important holy stick..."
82                    failmessage=""
83                    completeMessage="There it is, the Holy stick. Yes, you're right. It looks like a rocket because there are so many rockets in the universe, that it's nearly impossible to find the holy stick between them.
84                                Anyway, the pirates found the stick... another part which is confusing. Why did they know where the holy stick is? Perpaps they know more about the humans than you think."/>
85                </GlobalQuest>
86                <GlobalQuest id="85380d05-b791-45d1-82e9-01f0bc930367">
87                    <QuestDescription title="Find out more about the pirates"
88                    description= "Now, the Holy stick is back in your possession. Your new mission is to get some more infos about the pirates. You've got an info about a near mining company
89                    which delivers Hydrogen out of special asteroids. Hydrogen is a very rare ressource on earth and is delivered by a few great mining companys. There is no oil anymore on earth since many years.
90                    Therefore hydrogen became the most important energy source for all humans.
91                    But back to your mission. The mining company has it's own security. Ask some of their security staff if they know more about the pirates... it's actually your only hope to get more infos.
92                    You'll find the mining company at the near planet with the asteroid belt."
93                    failmessage=""
94                    completeMessage=""/>
95                </GlobalQuest>
96                <GlobalQuest id="d8afe2eb-b3b9-4c98-8ed7-cc1a2a8e3734">
97                    <QuestDescription title="Interesting..."
98                    description= "You're very lucky. The first security man has interesting infos about the pirates. He said that they made a few attacks in de last few weeks and they intensified the attacks in the last days...
99                    Shit, they attack one more time. Fight them back!"
100                    failmessage=""
101                    completeMessage=""/>
102                </GlobalQuest>
103            </subquests>
104            <hints>
105                <QuestHint id="2b85f32c-2433-4f1a-bdd4-f24d20c9403c">
106                    <QuestDescription title="Useful to know" description="Pirates like to hide themselves behind asteroids."/>
107                </QuestHint>
108            </hints>
109            <fail-effects>
110            </fail-effects>
111            <complete-effects>
112            </complete-effects>
113        </GlobalQuest>
114   
115          <ParticleSpawner position="0,0,0" source="Orxonox/BigExplosion1part3" lifetime=2.0 loop=0 autostart=0>
116          <events>
117            <spawn>
118              <EventTrigger delay=1>
119            <events>
120              <trigger>
121                <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassffplayer name=spawnpoint1 team=0 active=true/>
122              </trigger>
123            </events>
124              </EventTrigger>
125            </spawn>
126          </events>
127          <attached>
128            <QuestEffectBeacon position="0,0,0" times=1>
129            <effects>
130                <AddQuest questId="dbd02b4c-ab7c-46fd-bdaf-fd4c19ac1551" />
131            </effects>
132            <events>
133                <execute>
134                <EventListener event=questbeacon1 />
135                </execute>
136            </events>
137            <attached>
138                <DistanceTrigger name=questbeacon1 position="0,0,0" distance=100 target=DistanceTriggerBeacon targetname=Me/>
139            </attached>
140            </QuestEffectBeacon>
141          </attached>
142        </ParticleSpawner>
143   
144        <SpawnPoint position="600,300,-6000" spawnclass=SpaceShip pawndesign=spaceshipassffplayer name=spawnpoint2 active=false/>
145   
146   
147   
148        <!-- Add second Quest-->
149        <QuestEffectBeacon position="250,-300,-1500" times=1>
150                    <attached>
151                        <Billboard position="0,0,0" scale=3 colour="1.0,1.0,0" material="Examples/Flare" />
152                        <DistanceTrigger name=questbeacon2 targetname=Me position="0,0,0" target=DistanceTriggerBeacon distance=400 />
153                    </attached>
154                    <effects>
155                        <AddQuest questId="3159b4d4-bc86-4190-ba1d-4530668dfe31" />
156                    </effects>
157                    <events>
158                        <execute>
159                            <EventListener event=questbeacon2 />
160                        </execute>
161                    </events>
162                </QuestEffectBeacon>
163   
164        <!-- Hint to first Quest-->
165        <QuestEffectBeacon position="0,0,0" times=1>
166                    <attached>
167                        <DistanceTrigger name=questbeacon3  position="0,0,0" distance=300 target=DistanceTriggerBeacon targetname=Me delay="5" />
168                    </attached>
169                    <effects>
170                        <AddQuestHint hintId="2b85f32c-2433-4f1a-bdd4-f24d20c9403c" />
171                    </effects>
172                    <events>
173                        <execute>
174                            <EventListener event=questbeacon3 />
175                        </execute>
176                    </events>
177                </QuestEffectBeacon>
178   
179   
180        <!--Pirates killed... navi leads you to possible Base stations-->
181        <QuestEffectBeacon position="600,300,-6000" times=1>
182                    <attached>
183                        <Billboard position="0,0,0" scale=3 colour="0,1.0,0" material="Examples/Flare" />
184                        <DistanceTrigger name=questbeacon4  position="0,0,0" distance=200 target=DistanceTriggerBeacon targetname=Me />
185                    </attached>
186   
187                    <effects>
188                        <CompleteQuest questId="3159b4d4-bc86-4190-ba1d-4530668dfe31" />
189                        <AddQuest questId="8d8ed3a6-74a6-4491-9172-26155cff151d" />
190                        <AddQuestHint hintId="965101b3-26ce-4fcf-bc71-17cc2a87d2e9" />
191                    </effects>
192                    <events>
193                        <execute>
194                            <EventListener event=questbeacon4 />
195                        </execute>
196                    </events>
197                </QuestEffectBeacon>
198   
199   
200        <!-- Wrong way 1-->
201        <QuestEffectBeacon position="7600,300,-8000" times=1>
202                    <attached>
203                        <DistanceTrigger name=questbeacon5  position="0,0,0" distance=300 target=DistanceTriggerBeacon targetname=Me />
204                    </attached>
205                    <effects>
206                        <AddQuest questId="9930a598-98bc-4ff8-8cc0-31311a6ccaaa" />
207                    </effects>
208                    <events>
209                        <execute>
210                            <EventListener event=questbeacon5 />
211                        </execute>
212                    </events>
213                </QuestEffectBeacon>
214   
215        <!-- Wrong way 2-->
216        <QuestEffectBeacon position="1600,2300,-10000" times=1>
217                    <attached>
218                        <DistanceTrigger name=questbeacon8  position="0,0,0" distance=300 target=DistanceTriggerBeacon targetname=Me />
219                    </attached>
220                    <effects>
221                        <AddQuest questId="9930a598-98bc-4ff8-8cc0-31311a6ccaab" />
222                    </effects>
223                    <events>
224                        <execute>
225                            <EventListener event=questbeacon8 />
226                        </execute>
227                    </events>
228                </QuestEffectBeacon>
229   
230        <!-- Base found!-->
231        <QuestEffectBeacon position="4600,5300,-11000" times=1>
232                    <attached>
233                        <DistanceTrigger name=questbeacon6  position="0,0,0" distance=600 target=DistanceTriggerBeacon targetname=Me />
234                    </attached>
235                    <effects>
236                        <CompleteQuest questId="8d8ed3a6-74a6-4491-9172-26155cff151d" />
237                        <AddQuest questId="8a62408b-c47b-4e02-bd3d-06bb9ec0b363" />
238                        <CompleteQuest questId="9930a598-98bc-4ff8-8cc0-31311a6ccaaa" />
239                        <CompleteQuest questId="9930a598-98bc-4ff8-8cc0-31311a6ccaab" />
240   
241                    </effects>
242                    <events>
243                        <execute>
244                            <EventListener event=questbeacon6 />
245                        </execute>
246                    </events>
247                </QuestEffectBeacon>
248        <!--Stick found-->
249        <QuestEffectBeacon position="4800,5785,-10725" times=1>
250                    <attached>
251                        <DistanceTrigger name=questbeacon7  position="0,0,0" distance=30 target=DistanceTriggerBeacon targetname=Me />
252                    </attached>
253                    <effects>
254                        <CompleteQuest questId="8a62408b-c47b-4e02-bd3d-06bb9ec0b363" />
255                        <AddQuest questId="85380d05-b791-45d1-82e9-01f0bc930367" />
256   
257                    </effects>
258                    <events>
259                        <execute>
260                            <EventListener event=questbeacon7 />
261                        </execute>
262                    </events>
263                </QuestEffectBeacon>
264   
265   
266        <!--Security Man found-->
267        <QuestEffectBeacon position="4000,4000,-20000" times=1>
268                    <attached>
269                        <Billboard position="0,0,0" scale=3 colour="0,0,1.0" material="Examples/Flare" />
270                        <DistanceTrigger name=questbeacon9 position="0,0,0" distance=500 target=DistanceTriggerBeacon targetname=Me />
271                    </attached>
272                    <effects>
273                        <CompleteQuest questId="85380d05-b791-45d1-82e9-01f0bc930367" />
274                        <AddQuest questId="d8afe2eb-b3b9-4c98-8ed7-cc1a2a8e3734" />
275   
276                    </effects>
277                    <events>
278                        <execute>
279                            <EventListener event=questbeacon9 />
280                        </execute>
281                    </events>
282        </QuestEffectBeacon>
283   
284    <!--Navigation System which shows possiple positions of base-->
285    <EventDispatcher>
286                <targets>
287                    <EventTarget target=Navi />
288                </targets>
289                <events>
290                    <visibility>
291                        <QuestListener questId="3159b4d4-bc86-4190-ba1d-4530668dfe31" mode="complete" />
292                    </visibility>
293                    <activity>
294                        <QuestListener questId="3159b4d4-bc86-4190-ba1d-4530668dfe31" mode="complete" />
295                    </activity>
296                </events>
297            </EventDispatcher>
298
299            <?lua
300                for i = 0, 30
301                do
302            ?>
303        <Billboard position="<?lua print(i*1000/30+600) ?>,<?lua print(i*2000/30+300) ?>,<?lua print(-i*4000/30-6000) ?>" colour="1.0,0,0" scale=1 material="Examples/Flare" name=Navi visible=false/><!--endpos:1600,2300,-10000-->
304        <Billboard position="<?lua print(i*7000/30+600) ?>,<?lua print(i*0/30+300) ?>,<?lua print(-i*2000/30-6000) ?>" colour="0,1.0,0" scale=1 material="Examples/Flare" name=Navi visible=false/><!--endpos:7600,300,-8000-->
305        <Billboard position="<?lua print(i*4000/30+600) ?>,<?lua print(i*5000/30+300) ?>,<?lua print(-i*5000/30-6000) ?>" colour="0,0,1.0" scale=1 material="Examples/Flare" name=Navi visible=false/><!--endpos:4600,5300,-11000-->
306            <?lua
307                end
308            ?>
309   
310    <!--Base&Stick spawn*****************************************************************-->
311    <StaticEntity scale=1 position="4650,5350,-11050" name=base visible=true active=true yaw=60>
312                <attached>
313                    <?lua
314                        createSpaceStationPar(9851,2,1,2,1,2,1,100)
315                    ?>
316                </attached>
317            </StaticEntity>
318   
319    <ParticleSpawner position="4650,5350,-11050" source="Orxonox/explosion1" name=base visible=false active=false loop=0/>
320    <Model position="4800,5785,-10725" scale=3 mesh="rocket.mesh" visible=true active=true name=base />
321    <EventDispatcher>
322                <targets>
323                    <EventTarget target=base />
324             <EventTarget target=navipirate1 />
325              <EventTarget target=navipirate2 />
326                </targets>
327                <events>
328                    <visibility>
329          <EventTrigger invert=true>
330            <events>
331              <trigger>
332                <QuestListener questId="dbd02b4c-ab7c-46fd-bdaf-fd4c19ac1551" mode="start" />
333              </trigger>
334            </events>
335          </EventTrigger>
336                    </visibility>
337                    <activity>
338                <EventTrigger invert=true>
339            <events>
340              <trigger>
341                             <QuestListener questId="dbd02b4c-ab7c-46fd-bdaf-fd4c19ac1551" mode="start" />
342              </trigger>
343            </events>
344          </EventTrigger>
345                    </activity>
346                </events>
347            </EventDispatcher>
348
349   
350    <EventDispatcher>
351                <targets>
352                    <EventTarget target=base />
353                </targets>
354                <events>
355                    <visibility>
356                        <QuestListener questId="8d8ed3a6-74a6-4491-9172-26155cff151d" mode="complete" />
357                    </visibility>
358                    <activity>
359                        <QuestListener questId="8d8ed3a6-74a6-4491-9172-26155cff151d" mode="complete" />
360                    </activity>
361                </events>
362            </EventDispatcher>
363   
364    <!--Base&Stick spawn********end*****************************************************-->
365   
366    <!--Change spawnoint-->
367    <EventDispatcher>
368                <targets>
369                    <EventTarget target=spawnpoint1 />
370                </targets>
371                <events>
372                    <activity>
373                <EventTrigger invert=true>
374            <events>
375              <trigger>
376                             <QuestListener questId="3159b4d4-bc86-4190-ba1d-4530668dfe31" mode="complete" />
377              </trigger>
378            </events>
379          </EventTrigger>
380                    </activity>
381                </events>
382   
383            </EventDispatcher>
384            <EventDispatcher>
385                <targets>
386                    <EventTarget target=spawnpoint2/>
387                </targets>
388                <events>
389                    <activity>
390                             <QuestListener questId="3159b4d4-bc86-4190-ba1d-4530668dfe31" mode="complete" />
391                    </activity>
392                </events>
393            </EventDispatcher>
394    <!--Change spawnoint end-->
395   
396    <!-- pirates -->
397        <?lua
398        for i = 1,1, 1
399        do
400        ?>
401            <SpaceShip position="<?lua print(math.random()*100)?>,<?lua print(math.random()*100)?>,<?lua print(math.random()*100-2000)?>">
402              <templates>
403            <Template link=spaceshippirate />
404              </templates>
405              <controller>
406            <WaypointPatrolController alertnessradius=1000 active=true team=1>
407              <waypoints>
408                <StaticEntity position="0,<?lua print(math.random()*50)?> ,<?lua print(i*50 -2000) ?>" />
409              </waypoints>
410            </WaypointPatrolController>
411              </controller>
412            </SpaceShip>
413        <?lua
414        end
415        ?>
416   
417        <?lua
418        for i = 1,2, 1
419        do
420        ?>
421            <SpaceShip position="600,300,-6000">
422              <templates>
423            <Template link=spaceshippirate />
424              </templates>
425              <controller>
426            <WaypointPatrolController alertnessradius=1000 active=true team=1>
427              <waypoints>
428                <StaticEntity position="600,300,-6000" />
429              </waypoints>
430            </WaypointPatrolController>
431              </controller>
432            </SpaceShip>
433        <?lua
434        end
435        ?>
436   
437    <!-- Pirates at the end of wrong Navi line (get visible when you get near them)-->
438     <SpaceShip position="1600,2300,-10000" active=true visible=true name=navipirate1>
439              <templates>
440            <Template link=spaceshippirate />
441              </templates>
442              <controller>
443            <WaypointPatrolController alertnessradius=1000 name=navipirate1 active=true team=1>
444              <waypoints>
445                <StaticEntity position="1600,2300,-10000" />
446              </waypoints>
447            </WaypointPatrolController>
448              </controller>
449            </SpaceShip>
450   
451    <SpaceShip position="7600,300,-8000" active=true visible=true name=navipirate2>
452              <templates>
453            <Template link=spaceshippirate />
454              </templates>
455              <controller>
456            <WaypointPatrolController alertnessradius=1000 name=navipirate2 active=true team=1>
457              <waypoints>
458                <StaticEntity position="7600,300,-8000" />
459              </waypoints>
460            </WaypointPatrolController>
461              </controller>
462        </SpaceShip>
463   
464   
465    <EventDispatcher>
466                <targets>
467                    <EventTarget target=navipirate1 />
468                </targets>
469                <events>
470                    <visibility>
471                        <QuestListener questId="9930a598-98bc-4ff8-8cc0-31311a6ccaab" mode="start" />
472                    </visibility>
473                    <activity>
474                        <QuestListener questId="9930a598-98bc-4ff8-8cc0-31311a6ccaab" mode="start" />
475                    </activity>
476                </events>
477            </EventDispatcher>
478   
479    <EventDispatcher>
480                <targets>
481                    <EventTarget target=navipirate2 />
482                </targets>
483                <events>
484                    <visibility>
485                        <QuestListener questId="9930a598-98bc-4ff8-8cc0-31311a6ccaaa" mode="start" />
486                    </visibility>
487                    <activity>
488                        <QuestListener questId="9930a598-98bc-4ff8-8cc0-31311a6ccaaa" mode="start" />
489                    </activity>
490                </events>
491            </EventDispatcher>
492    <!-- Pirates at the end of wrong Navi line **** end-->
493   
494    <!--Security man from mining corp.-->
495    <SpaceShip position="4000,4000,-20000">
496              <templates>
497            <Template link=spaceshipassff/>
498              </templates>
499              <controller>
500            <WaypointPatrolController alertnessradius=1000 team=0 active=false>
501              <waypoints>
502                <StaticEntity position="4000,4000,-20000" />
503              </waypoints>
504            </WaypointPatrolController>
505              </controller>
506    </SpaceShip>
507   
508    <!-- Asteroid field-->
509            <StaticEntity position="-400,2000,-7000">
510                <attached>
511                    <?lua
512                        for i = 1, 180
513                        do ?>
514                        <MovableEntity position="<?lua print(math.random() * 10000 -5000)?>, <?lua print(math.random() * 10000-5000) ?>, <?lua print(math.random() * 10000 -7000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.abs(math.random() * 30 -10)) ?>">
515                            <attached>
516                                <Model scale="<?lua print(math.random() * 100) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
517                            </attached>
518                        </MovableEntity>
519                    <?lua
520                        end
521                    ?>
522            </attached>
523        </StaticEntity>
524    <!--Planet with asteroid belt-->
525    <Planet mesh="iceplanet.mesh" position="2600,4300,-20000" scale=1000 atmosphere="atmosphere1" atmospheresize=224.0f imagesize=1024.0f/>
526    <StaticEntity position="2600,4300,-20000" collisionType=static>
527          <collisionShapes>
528            <SphereCollisionShape radius="1000" />
529          </collisionShapes>
530                          <attached>
531                <?lua
532                for i = 1, 100
533                do
534                k=(math.random() * 2600 -1300)
535                if math.random()<0.5 then
536                l=(1300^2-k^2)^(0.5)
537                else
538                l=-(1300^2-k^2)^(0.5)
539                end
540                ?>
541   
542                <MovableEntity position="<?lua print(k) ?>,<?lua print(l) ?>, <?lua print(math.random() * 100) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.abs(math.random() * 30 -10)) ?>">
543
544                    <attached>
545                    <Model scale="<?lua print(math.random() * 25) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
546                    </attached>
547                </MovableEntity>
548                <?lua
549                end
550                ?>
551                            </attached>
552        </StaticEntity>
553   
554    </Scene>
555</Level>
Note: See TracBrowser for help on using the repository browser.