home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 54 / ClassicFond54.iso / games / stars.rar / multiplayer / DM_Impact.cs < prev    next >
Text File  |  1999-02-19  |  3KB  |  123 lines

  1. // FILENAME:    DM_Impact.cs
  2. //
  3. // AUTHORS:      Chupie Doll & Youth in Asia
  4. //------------------------------------------------------------------------------
  5.  
  6. $missionName = "DM_Impact";
  7.  
  8. exec("multiplayerStdLib.cs");
  9. exec("DMstdLib.cs");
  10.  
  11. function setDefaultMissionOptions()
  12. {
  13.     $server::TeamPlay = false;
  14.     $server::AllowDeathmatch = true;
  15.     $server::AllowTeamPlay = true;    
  16. }
  17.  
  18. function onMissionStart()
  19. {
  20.     // Keep tracks of hercs near a door
  21.     $HercsAtDoor1 = 0;
  22.     $HercsAtDoor2 = 0;   
  23.    
  24.     // Start the meteor showers
  25.     dropMeteor("default", -40, -1,-100, -4000, 100, -4100, -854, -620, 844, 1935);
  26.     
  27.     // Schedule a meteor storm
  28.     %randomTime = randomInt(60, 200);
  29.     schedule("randomDeathStorm();", %randomTime);
  30.  
  31.     $healRate = 100;   
  32.     $ammoRate = 3;
  33.        $padWaitTime = 45;
  34.       $zenWaitTime = 90;
  35.     
  36.     europaSounds();
  37. }
  38.  
  39. function onMissionLoad(){
  40.    cdAudioCycle("Gnash", "Cloudburst", "Cyberntx"); 
  41. }
  42.  
  43. // Healing Pad Functionality
  44. //------------------------------------------------------------------------------
  45. function ZenHeal::trigger::onEnter(%this, %object)
  46. {
  47.        Zen::onEnter(%this, %object, *IDMULT_CHAT_HEALPAD, true, true);  
  48. }
  49. function ZenHeal::trigger::onContact(%this, %object)
  50. {
  51.        Zen::work(%this, %object, $healRate, 0, $padWaitTime, true); 
  52. }
  53.  
  54. // Ammo Pad Functionality
  55. //------------------------------------------------------------------------------
  56. function ZenAmmo::trigger::onEnter(%this, %object)
  57. {
  58.        Zen::onEnter(%this, %object, *IDMULT_CHAT_AMMOPAD, true, true);  
  59. }
  60.  
  61. function ZenAmmo::trigger::onContact(%this, %object)
  62. {
  63.        Zen::work(%this, %object, 0, $ammoRate, $padWaitTime, true); 
  64. }
  65.  
  66. // ZenAll Pad Functionality
  67. //------------------------------------------------------------------------------
  68. function ZenAll::trigger::onEnter(%this, %object)
  69. {
  70.        Zen::onEnter(%this, %object, *IDMULT_CHAT_ALLPAD, true, true);  
  71. }
  72. function ZenAll::trigger::onContact(%this, %object)
  73. {
  74.        Zen::work(%this, %object, $healRate, $ammoRate, $padWaitTime, true); 
  75. }
  76.  
  77. function randomDeathStorm(){
  78.     %nextStorm = randomInt(120, 400);
  79.  
  80.     Say(0, 0, "WARNING:  Meteor shower detected!");
  81.     dropMeteor("default", 1, 3, -100, -4000, 100, -4100, -854, -620, 844, 1935);
  82.     
  83.     %dropMeteors = "dropMeteor(\"default\", 1, 3, -100, -4000, 100, -4100, -854, -620, 844, 1935);";
  84.  
  85.     schedule(%dropMeteors, 4);
  86.     schedule(%dropMeteors, 8);
  87.     schedule(%dropMeteors, 12);
  88.     schedule(%dropMeteors, 16);
  89.     schedule(%dropMeteors, 20);
  90.     schedule(%dropMeteors, 24);
  91.     schedule(%dropMeteors, 28);
  92.     schedule(%dropMeteors, 32);
  93.     schedule(%dropMeteors, 36);
  94.  
  95.     schedule("randomDeathStorm();", %nextStorm);
  96. }
  97.  
  98. function door1::trigger::onEnter(%this, %vehicleId){
  99.     if($hercsAtDoor1 == 0){
  100.         playAnimSequence(getObjectId("MissionGroup\\Stuff\\Door1"), 0, true);
  101.     }
  102.     $hercsAtDoor1 = $hercsAtDoor1 + 1;
  103. }
  104. function door1::trigger::onLeave(%this, %vehicleId){
  105.     $hercsAtDoor1 = $hercsAtDoor1 - 1;
  106.     if($hercsAtDoor1 == 0){
  107.         playAnimSequence(getObjectId("MissionGroup\\Stuff\\Door1"), 0, false);
  108.     }
  109. }
  110. function door2::trigger::onEnter(%this, %vehicleId){
  111.     if($hercsAtDoor2 == 0){
  112.         playAnimSequence(getObjectId("MissionGroup\\Stuff\\Door2"), 0, true);
  113.     }
  114.     $hercsAtDoor2 = $hercsAtDoor2 + 1;
  115. }
  116. function door2::trigger::onLeave(%this, %vehicleId){
  117.     $hercsAtDoor2 = $hercsAtDoor2 - 1;
  118.     if($hercsAtDoor2 == 0){
  119.         playAnimSequence(getObjectId("MissionGroup\\Stuff\\Door2"), 0, false);
  120.     }
  121. }
  122.  
  123.