home *** CD-ROM | disk | FTP | other *** search
/ IO CD 1999 May / IO_maj_99.iso / GRY / starsiege.exe / data1.cab / Demo_Files / campaign / Human / HA1.cs < prev    next >
Text File  |  1999-04-07  |  19KB  |  661 lines

  1. // HA1
  2.  
  3. //--Mission Briefing and Objectives
  4.  
  5. // 1.Chase down and destroy Imperial Convoy
  6. // 2.Return to Rebel Access tunnel when convoy is destroyed
  7. // 3.Destroy all enemies encountered ( secondary )
  8. // 4.Harabec must survive
  9.  
  10. $server::HudMapViewOffsetX = 5000;
  11. $server::HudMapViewOffsetY = 500; 
  12.  
  13. function db(%msg)
  14. {
  15.     if($DB)
  16.         echo(%msg);
  17. }
  18.  
  19. DropPoint dropPoint1
  20. {
  21.     name = "foo";
  22.     desc = "foo";
  23. };
  24.  
  25. Pilot Squadmate
  26. {
  27.    id = 28;
  28.    
  29.    name = Mary;
  30.    skill = 0.7;
  31.    accuracy = 0.7;
  32.    aggressiveness = 0.2;
  33.    activateDist = 300.0;
  34.    deactivateBuff = 100.0;
  35.    targetFreq = 4.0;
  36.    trackFreq = 0.2;
  37.    fireFreq = 0.5;
  38.    LOSFreq = 0.4;
  39.    orderFreq = 4.0;
  40. };
  41.  
  42. Pilot Harabec
  43. {
  44.    id = 29;
  45.    
  46.    name = Harabec;
  47.    skill = 1.0;
  48.    accuracy = 1.0;
  49.    aggressiveness = 0.9;
  50.    activateDist = 250.0;
  51.    deactivateBuff = 100.0;
  52.    targetFreq = 5.0;
  53.    trackFreq = 1.0;
  54.    fireFreq = 0.2;
  55.    LOSFreq = 0.1;
  56.    orderFreq = 3.0;    
  57. };
  58.  
  59. MissionBriefInfo missionData
  60. {
  61.     title =             *IDSTR_HA1_TITLE;
  62.     planet =            *IDSTR_PLANET_MARS;           
  63.     campaign =             *IDSTR_HA1_CAMPAIGN;           
  64.     dateOnMissionEnd =  *IDSTR_HA1_DATE;               
  65.     shortDesc =         *IDSTR_HA1_SHORTBRIEF;       
  66.     longDescRichText =     *IDSTR_HA1_LONGBRIEF;           
  67.     media =              *IDSTR_HA1_MEDIA;
  68.     nextMission =       "";
  69.     successDescRichText = *IDSTR_HA1_DEBRIEF_SUCC;
  70.     failDescRichText =  *IDSTR_HA1_DEBRIEF_FAIL;
  71.     location =          *IDSTR_HA1_LOCATION;
  72.     successWavFile       = "HA1_Debriefing.wav";
  73.     soundvol             = "ha1.vol";
  74. };
  75.  
  76. MissionBriefObjective missionObjective1
  77. {
  78.     isPrimary     = true;
  79.     status         = *IDSTR_OBJ_ACTIVE;
  80.     shortTxt    = *IDSTR_HA1_OBJ1_SHORT;
  81.     longTxt        = *IDSTR_HA1_OBJ1_LONG;
  82.     bmpname        = *IDSTR_HA1_OBJ1_BMPNAME;
  83. }; 
  84.  
  85. MissionBriefObjective missionObjective2
  86. {
  87.     isPrimary     = true;
  88.     status         = *IDSTR_OBJ_ACTIVE;
  89.     shortTxt    = *IDSTR_HA1_OBJ2_SHORT;
  90.     longTxt        = *IDSTR_HA1_OBJ2_LONG;
  91.     bmpname        = *IDSTR_HA1_OBJ2_BMPNAME;
  92. }; 
  93.  
  94. MissionBriefObjective missionObjective3
  95. {
  96.     isPrimary     = false;
  97.     status         = *IDSTR_OBJ_ACTIVE;
  98.     shortTxt    = *IDSTR_HA1_OBJ3_SHORT;
  99.     longTxt        = *IDSTR_HA1_OBJ3_LONG;
  100.     bmpname        = *IDSTR_HA1_OBJ3_BMPNAME;
  101. };
  102.  
  103. MissionBriefObjective missionObjective4
  104. {
  105.     isPrimary     = true;
  106.     status         = *IDSTR_OBJ_ACTIVE;
  107.     shortTxt    = *IDSTR_HA1_OBJ4_SHORT;
  108.     longTxt        = *IDSTR_HA1_OBJ4_LONG;
  109.     bmpname        = *IDSTR_HA1_OBJ4_BMPNAME;
  110. };
  111.  
  112. function win()
  113. {
  114.     missionObjective1.status = *IDSTR_OBJ_COMPLETED;
  115.     missionObjective2.status = *IDSTR_OBJ_COMPLETED;
  116.     missionObjective3.status = *IDSTR_OBJ_COMPLETED;
  117.     missionObjective4.status = *IDSTR_OBJ_COMPLETED;
  118.  
  119.     updatePlanetInventory(ha1);
  120.     schedule("forceToDebrief();", 5.0);
  121. }
  122.  
  123. function onMissionstart()
  124. {
  125.     cdAudioCycle(Newtech, ss4, Gnash);
  126. }
  127.  
  128. function onSPClientInit()
  129. {  
  130.    $DB = false;
  131.    setHostile(*IDSTR_TEAM_YELLOW, *IDSTR_TEAM_RED);
  132.    setHostile(*IDSTR_TEAM_RED, *IDSTR_TEAM_YELLOW);
  133.    initFormations();
  134.    initActors();
  135.    actorTalks($rebel.harabec, IDSTR_HA1_HAR01, "HA1_HAR01.wav" );
  136.    marsSounds();
  137.    windSounds();
  138. }
  139.  
  140. function initFormations()
  141. {
  142.     newFormation(rebelFormation, 0,0,0,
  143.                                  15,-10,0);
  144.                                                                
  145.     newFormation(patrolAFormation, 0,0,0,
  146.                                    0,-40,0);
  147.                                                                     
  148.     newFormation(patrolBFormation, 0,0,0,
  149.                                    -20,-30,0,
  150.                                     40,-30,0 );
  151.                                     
  152.     newFormation(convoyFormation, 0,0,0,        
  153.                                   10,80,0,
  154.                                   10,-40,0,
  155.                                   10,-120,0,
  156.                                   -40,-150,0,
  157.                                   40,-150,0
  158.                                   );
  159. }
  160.  
  161. function initActors()
  162. {
  163.     initPlayer();
  164.     initRebel();
  165.     initConvoy();
  166.     initPatrol();
  167.     initFlyer();
  168. }
  169.  
  170. // PLAYER FUNCTIONS
  171. function initPlayer()
  172. {
  173.     db("initPlayer()");
  174.     $playerNum.missionFailed = false;
  175.     $playerNum.flybyTriggered = false;
  176.     schedule("playerDistanceCheck(boundaryFail);", 8.0);
  177.     schedule("playerDistanceCheck(boundaryWarning);", 8.0); 
  178.     $playerNum.attacked = false;  
  179. }
  180.  
  181. function player::onAdd(%this)
  182. {
  183.     $playerNum = %this;
  184. }
  185.  
  186. function vehicle::onAdd(%this)
  187. {
  188.     if(%this == playerManager::playerNumToVehicleId($playerNum))
  189.         $playerNum.id = %this;
  190. }
  191.  
  192. function vehicle::onAttacked(%this, %who)
  193. {
  194.     // if the player is attacked, and harabec and co. are returning to tunnel
  195.     if( %this == ($playerNum.id) && ($rebel.state) == "return" && 
  196.         getTeam(%this) != getTeam(%who))
  197.     {
  198.         order($rebel.harabec, Attack, %who);
  199.         
  200.         if(!$playerNum.attacked)
  201.         {   
  202.             schedule("actorTalks($rebel.harabec, IDSTR_GEN_HAR11, \"GEN_HAR11.wav\");", randomInt(1,2));
  203.             $playerNum.attacked = true; 
  204.         }
  205.     }
  206. }
  207.  
  208. function vehicle::onDestroyed(%this, %who)
  209. {
  210.     if(%this == $playerNum.id)
  211.         $playerNum.missionFailed = true;
  212. }
  213.  
  214. function actorTalks(%actorId, %txt, %snd)
  215. {
  216.     if(!($playerNum.missionFailed))
  217.     {
  218.         say(0,%actorId, *(%txt), %snd);     
  219.     }    
  220. }
  221.  
  222. function checkImperialsDestroyed()
  223. {
  224.     if($patrolA.count == 0 && $patrolB.count == 0 && $convoy.count == 0)
  225.     {
  226.         missionObjective3.status = *IDSTR_OBJ_COMPLETED;
  227.         playSound(0, "GEN_OC01.wav", IDPRF_2D);
  228.     }
  229. }
  230.  
  231. function playerDistanceCheck(%arg)
  232. {
  233.     db("playerDistanceCheck = " @ %arg);
  234.     
  235.     if(%arg == boundaryWarning)
  236.     {
  237.         if(getDistance($playerNum.id, $rebel.harabec) > 3500 ) 
  238.             actorTalks(0, IDSTR_GEN_TCM1, "GEN_TCM01.wav");
  239.         
  240.         else
  241.             schedule("playerDistanceCheck(boundaryWarning);", 8.0);
  242.     }
  243.     
  244.     else if(%arg == boundaryFail)
  245.     {
  246.         if(getDistance($playerNum.id, $rebel.harabec) > 4500 )
  247.         {
  248.             actorTalks(0, IDSTR_GEN_TCM2, "GEN_TCM02.wav");
  249.             schedule("forceToDebrief();", 10.0);
  250.         }
  251.         else
  252.             schedule("playerDistanceCheck(boundaryFail);", 8.0);    
  253.     }
  254.     
  255.     else if(%arg == navAlpha)
  256.     {
  257.         if(getDistance($playerNum.id, getObjectId("MissionGroup/navMarkers/navAlpha")) < 200 &&
  258.             isSafe(*IDSTR_TEAM_YELLOW, $playerNum.id, 750) &&
  259.             isSafe(*IDSTR_TEAM_YELLOW, $rebel.harabec,750))
  260.         {
  261.             missionObjective2.status = *IDSTR_OBJ_COMPLETED;
  262.             missionObjective4.status = *IDSTR_OBJ_COMPLETED;
  263.             //playSound(0, "GEN_OC01.wav", IDPRF_2D);
  264.             updatePlanetInventory(ha1);
  265.             schedule("forceToDebrief();", 3.0);
  266.         }
  267.         else 
  268.             schedule("playerDistanceCheck(navAlpha);", 2.0);
  269.     }
  270. }
  271.  
  272. // REBEL FUNCTIONS
  273. function initRebel()
  274. {
  275.     db("initRebel()");
  276.     
  277.     $rebel = getObjectId("MissionGroup/rebelGroup");
  278.     $rebel.harabec      = getObjectId("MissionGroup/rebelGroup/harabec");
  279.     $rebel.squadmate    = getObjectId("MissionGroup/rebelGroup/squadmate");
  280.     $rebel.route1       = getObjectId("MissionGroup/rebelGroup/rebelRoute1");
  281.     $rebel.route2       = getObjectId("MissionGroup/rebelGroup/rebelRoute2");
  282.     $rebel.hitByPlayer  = 0;
  283.     $rebel.attacked     = false;
  284.     $rebel.kills        = 0;
  285.     $rebel.returned     = false;
  286.     $rebel.state        = enroute;  // enroute
  287.                                     // holdfire
  288.                                     // return
  289.     
  290.     order($rebel.harabec, MakeLeader, true);
  291.     order($rebel, Formation, rebelFormation);
  292.     order($rebel.harabec, Speed, High);
  293.     schedule("order($rebel.harabec, HoldPosition, true);",1.0);
  294.     
  295.     schedule("order($rebel.harabec, Guard, $rebel.route1);", 1.0);
  296.     
  297.     schedule("harabecSlowsDown();",5.0);    
  298.     // check if player gets too far away
  299.     schedule("playerDistanceCheck(rebel);", 10.0);
  300.     
  301.     // check distance from convoy
  302.     schedule("rebelDistanceCheck(convoy1);", 10.0);
  303.     schedule("rebelDistanceCheck(convoy2);", 10.0);
  304. }
  305.  
  306. function harabecSlowsDown()
  307. {
  308.      %navAlpha = getObjectId("MissionGroup/navMarkers/navAlpha"); 
  309.      
  310.      if(getDistance($rebel.harabec,$playerNum.id) > 100 && !$rebel.attacked &&
  311.         getDistance($rebel.harabec, %navAlpha) < getDistance($playerNum.id,%navAlpha))
  312.      {
  313.         order($rebel.harabec, Speed, Medium);
  314.         order($convoy.leader, Speed, Low);  
  315.      } 
  316.      else
  317.      {
  318.         order($rebel.harabec,Speed, High);
  319.         order($convoy.leader, Speed, medium);
  320.      }
  321.      schedule("harabecSlowsDown();",4.0);   
  322. }
  323.  
  324. function rebelDistanceCheck(%arg)
  325. {
  326.     db("rebelDistanceCheck() = " @ %arg);
  327.     if(%arg == convoy1)
  328.     {
  329.         if(getDistance($rebel.harabec, $convoy.leader) < 1200)
  330.         {
  331.             actorTalks($rebel.squadmate, IDSTR_HA1_1SQ01, "HA1_1SQ01.wav" );
  332.             schedule("actorTalks($rebel.harabec, IDSTR_HA1_HAR02, \"HA1_HAR02.wav\" );", 5.0);
  333.         }
  334.         else 
  335.             schedule("rebelDistanceCheck(convoy1);", 3.0);
  336.             
  337.     }
  338.     else if(%arg == convoy2)
  339.     {
  340.         if(getDistance($rebel.harabec, $convoy.leader) < 450)
  341.         {
  342.             convoyAttacked();
  343.         }
  344.         else 
  345.             schedule("rebelDistanceCheck(convoy2);", 3.0);
  346.     }
  347.     
  348.     else if(%arg == flyer)
  349.     {
  350.         if(getDistance($rebel.harabec, $flyer.id1) < 500 &&
  351.              isSafe(*IDSTR_TEAM_YELLOW, $playerNum.id, 650) &&
  352.              !isGroupDestroyed($flyer.id1))
  353.         {
  354.             setDominantCamera($flyer.id1, $rebel.harabec);
  355.             schedule("setOrbitCamera($patrolA.leader);",7.0);
  356.             schedule("setPlayerCamera();", 10.5);
  357.                 
  358.             actorTalks($flyer.id1, IDSTR_HA1_1IF01, "HA1_1IF01.wav" );
  359.             actorTalks($flyer.id1, IDSTR_HA1_2IP02, "HA1_2IP02.wav" );
  360.             order($patrolA.leader, Guard, $playerNum.id);    
  361.         }
  362.         
  363.         else
  364.             schedule("rebelDistanceCheck(flyer);", 2.0);
  365.     }
  366.  
  367. function rebel::vehicle::onAttacked(%this, %who)
  368. {
  369.     if(%who == $playerNum.id)
  370.     {
  371.         $rebel.hitByPlayer++;
  372.         
  373.         if($rebel.hitByPlayer == 2 && !isGroupDestroyed($rebel.squadmate))
  374.         {
  375.             if($rebel.harabec == %this)
  376.                 schedule("actorTalks($rebel.harabec, IDSTR_GEN_HAR4, \"GEN_HAR04.wav\");", 1.0);
  377.             else
  378.                 schedule("actorTalks($rebel.harabec, IDSTR_HA1_1SQ02, \"HA1_1SQ02.wav\");", 1.0);    
  379.         }
  380.         
  381.         if($rebel.hitByPlayer == 5)
  382.         {
  383.             schedule("actorTalks($rebel.harabec, IDSTR_GEN_HAR5, \"GEN_HAR05.wav\");", 1.0);
  384.             order($rebel, Attack, %who);
  385.             $playerNum.missionFailed = true;
  386.         }        
  387.     }
  388.     
  389.     else if(!($rebel.attacked) && getTeam(%this) != getTeam(%who))
  390.     {
  391.         schedule("actorTalks($rebel.squadmate, IDSTR_HA1_1SQ04, \"HA1_1SQ04.wav\" );", 1.0);
  392.         order($rebel.squadmate, Attack, %who);
  393.         $rebel.attacked = true;
  394.     }
  395.     else if(($rebel.state) == "return" && 
  396.         getTeam(%this) != getTeam(%who))
  397.     {
  398.         order($rebel, Attack, %who);
  399.         schedule("actorTalks($rebel.harabec, IDSTR_GEN_HAR8,\"GEN_HAR08.wav\");",1.0);
  400.         $rebel.state = "attack";
  401.     }
  402.    
  403. }
  404.  
  405. function rebel::vehicle::onArrived(%this, %where)
  406. {
  407.     if(%where == getObjectId("MissionGroup/rebelGroup/Rebelroute2/marker5") && !($rebel.returned) &&
  408.        getDistance($playerNum.id, %where) > 400)
  409.     {
  410.         order($rebel.harabec, Guard, "MissionGroup/rebelGroup/Rebelroute2/tunnelMarker");
  411.         $rebel.returned = true;
  412.     }
  413.     
  414.     else if(%where == getObjectId("MissionGroup/rebelGroup/rebelRoute1/marker6"))
  415.     {
  416.         order($rebel.harabec, Attack, $convoy.leader);    
  417.         order($rebel.harabec, Holdfire, true);
  418.     }
  419. }
  420.  
  421. function rebel::vehicle::onDestroyed(%this, %who)
  422. {
  423.     killChannel(%this);
  424.     
  425.     if(%this == $rebel.harabec)
  426.     {
  427.         $playerNum.missionFailed = true;
  428.         setDominantCamera($rebel.harabec, $playerNum.id);
  429.         schedule("forceToDebrief();", 5.0);
  430.         return;
  431.     }
  432.     else if(%who != $playerNum.id)
  433.     {    
  434.         order( $rebel.harabec, Attack, %who);
  435.         playSound(0, "HA1_1SQ06.wav", IDPRF_2D);                   
  436.     }
  437. }
  438.  
  439. function rebelKills()
  440. {
  441.     $rebel.kills++;
  442.     if($rebel.kills == 4 && !isGroupDestroyed($rebel.squadmate))
  443.         actorTalks($rebel.squadmate, IDSTR_HA1_1SQ05 , "HA1_1SQ05.wav" );
  444.         
  445.     if($rebel.kills == 9)
  446.         actorTalks($rebel.harabec, IDSTR_GEN_HAR16, "GEN_HAR16.wav");        
  447. }    
  448.     
  449.  
  450. function rebelReturns()
  451. {
  452.     if(isSafe(*IDSTR_TEAM_YELLOW,$rebel.harabec, 650))
  453.     {
  454.         actorTalks($rebel.harabec, IDSTR_HA1_HAR04, "HA1_HAR04.wav" );
  455.         order($rebel.harabec, Guard, $rebel.route2);
  456.         setNavMarker("MissionGroup/navMarkers/navAlpha", true, -1);
  457.         playerDistanceCheck(navAlpha);
  458.         $rebel.state = "return";
  459.     }
  460.     
  461.     else
  462.         schedule("rebelReturns();", 5.0);
  463. }
  464.  
  465. // CONVOY FUNCTIONS
  466. function initConvoy()
  467. {
  468.     db("initConvoy()");
  469.     
  470.     $convoy = getObjectId("MissionGroup/convoyGroup");
  471.     $convoy.leader = getObjectId("MissionGroup/convoyGroup/convoy1");
  472.     $convoy.attacked = false;
  473.     $convoy.count = 6;
  474.     $convoy.route = getObjectId("MissionGroup/convoyGroup/convoyRoute");
  475.     
  476.     order($convoy.leader, MakeLeader, true);
  477.     order($convoy, Formation, convoyFormation);
  478.     order($convoy.leader, Speed, medium);
  479.     schedule("order($convoy.leader, Guard, $convoy.route);", 1.0);
  480.     schedule("order($convoy.leader, HoldPosition, true);", 2.0);
  481. }
  482.  
  483. function convoy::vehicle::onAttacked(%this, %who)
  484. {
  485.     if(getTeam(%this) != getTeam(%who))
  486.         convoyAttacked();    
  487. }
  488.  
  489. function convoy::vehicle::onDestroyed(%this, %who)
  490. {
  491.     $convoy.count--;
  492.     
  493.     if(getTeam(%who) == *IDSTR_TEAM_YELLOW )
  494.         rebelKills();
  495.     if(%this == $convoy.leader)
  496.     {
  497.         order(getObjectId("MissionGroup/convoyGroup/convoy4"), guard, $convoy.route);
  498.         order(getObjectId("MissionGroup/convoyGroup/convoy4"), HoldPosition, true); 
  499.     }           
  500.         
  501.     if($convoy.count == 1)
  502.     {
  503.         schedule("order($patrolB.leader, Guard, $playerNum.id);", 14.0);  
  504.     }
  505.     if($convoy.count == 2)
  506.         schedule("startFlyer();",0.5);
  507.     
  508.     if($convoy.count == 0)
  509.     {        
  510.         missionObjective1.status = *IDSTR_OBJ_COMPLETED;
  511.         playSound(0, "GEN_OC01.wav", IDPRF_2D);
  512.                             
  513.         if($patrolA.count > 0)
  514.         {    
  515.             schedule("order($patrolA.leader, Guard, $playerNum.id);", 20.0);
  516.             order($patrolA.leader, Speed, Medium);
  517.         }
  518.          
  519.         checkImperialsDestroyed();
  520.         rebelReturns();     
  521.     }           
  522. }                         
  523.  
  524. function convoy::onNewLeader(%this)
  525. {
  526.     $convoy.leader = %this;
  527.     order(%this, MakeLeader, true);
  528.     order(%this, Guard, $convoy.route);    
  529. }
  530.  
  531. function convoyAttacked()
  532. {
  533.     if(!($convoy.attacked))
  534.     {
  535.         order($rebel.harabec, HoldPosition,false);
  536.         order($rebel.squadmate, HoldPosition,false);
  537.         
  538.         $convoy.attacked = true;
  539.         actorTalks($rebel.harabec, IDSTR_HA1_HAR03, "HA1_HAR03.wav" );
  540.         schedule("actorTalks(0, IDSTR_HA1_CON01, \"HA1_CON01.wav\" );", 3.0);
  541.         schedule("order($rebel.harabec, Holdfire,false);",1.0);
  542.         schedule("order($rebel.harabec, attack, $convoy);", 1.5);
  543.         
  544.         schedule("actorTalks($patrolA.leader, IDSTR_HA1_1IP01, \"HA1_1IP01.wav\" );", 8.0);
  545.         schedule("actorTalks($patrolB.leader, IDSTR_HA1_2IP01, \"HA1_2IP01.wav\" );", 13.0);    
  546.     }
  547.  
  548. //--PATROL FUNCTIONS
  549. function initPatrol()
  550. {
  551.     db("initPatrol()");
  552.     
  553.     $patrolA = getObjectId("MissionGroup/patrolAGroup");
  554.     $patrolB = getObjectId("MissionGroup/patrolBGroup");
  555.     
  556.     $patrolA.count = 2;
  557.     $patrolA.attacked = false;
  558.     $patrolB.count = 3;
  559.     $patrolA.attacked = false;
  560.     $patrolA.route = getObjectId("MissionGroup/patrolAGroup/route");
  561.     
  562.     $patrolA.leader = getObjectId("MissionGroup/patrolAGroup/patrolA1");
  563.     order($patrolA.leader, MakeLeader, true);
  564.     order($patrolA.leader, Speed, High);
  565.     order($patrolA, Formation, patrolAFormation);
  566.     schedule("order($patrolA.leader, guard, $patrolA.route);",30.0);
  567.     
  568.     $patrolB.leader = getObjectId("MissionGroup/patrolBGroup/patrolB1");
  569.     order($patrolB.leader, MakeLeader, true);
  570.     order($patrolB.leader, Speed, High);
  571.     order($patrolB, Formation, patrolBFormation);
  572.     schedule("patrolBSweep();", 10.0);    
  573.  
  574. function patrolA::vehicle::onDestroyed(%this, %who)
  575. {
  576.     $patrolA.count--;
  577.     vehicle::salvage(%this);
  578.     
  579.     if( getTeam(%this) != getTeam(%who) )
  580.         rebelKills();
  581.     checkImperialsDestroyed();
  582. }
  583.  
  584. function patrolB::vehicle::onDestroyed(%this, %who)
  585. {
  586.     $patrolB.count--;
  587.     
  588.     if(%this == $patrolB.leader)
  589.         order($patrolB, Attack, $rebel);
  590.     
  591.     if($patrolB.count == 0)
  592.     {
  593.         order($rebel.harabec, HoldPosition, true);
  594.         order($rebel.squadmate, HoldPosition, true);
  595.     }
  596.     
  597.     if( getTeam(%this) != getTeam(%who) )
  598.         rebelKills();       
  599.     checkImperialsDestroyed();
  600. }
  601.  
  602. function patrolA::vehicle:onAttacked(%this, %who)
  603. {
  604.     if(!($patrolA.attacked) && getTeam(%this) != getTeam(%who))
  605.         $patrolA.attacked = true;
  606. }
  607.  
  608. function patrolB::vehicle::onAttacked(%this, %who)
  609. {
  610.     if(!($patrolB.attacked) && getTeam(%this) != getTeam(%who))
  611.     {
  612.         $patrolB.attacked = true;
  613.     }
  614. }
  615.  
  616. function patrolASweep()
  617. {
  618.     if(getDistance($playerNum.id, $patrolA.leader) < 700)
  619.         order($patrolA.leader, Attack, $playerNum.id);
  620.     
  621.     else if(!($patrolA.attacked))
  622.         schedule("patrolASweep();", 10.0);
  623. }
  624.  
  625. function patrolBSweep()
  626. {
  627.     if(getDistance($playerNum.id, $patrolB.leader) < 700)
  628.         order($patrolB.leader, Attack, $playerNum.id);
  629.     
  630.     else if(!($patrolB.attacked))
  631.         schedule("patrolBSweep();", 10.0);    
  632. }
  633.  
  634. //--FLYER FUNCTION
  635. function initFlyer()
  636. {
  637.     db("initFlyer()");
  638.     
  639.     $flyer      = getObjectId("MissionGroup/flyerGroup");
  640.     $flyer.id1  = getObjectId("MissionGroup/flyerGroup/flyer1");
  641.     $flyer.route = getObjectId("MissionGroup/flyerGroup/flyerRoute");
  642.     order($flyer.id1, Speed, high);
  643.     schedule("setHercOwner( $rebel,  $flyer.id1);", 5.0);
  644.     setVehicleRadarVisible($flyer.id1,false);
  645. }
  646.  
  647. function flyer::vehicle::onArrived(%this, %where)
  648. {
  649.     if(%where == getObjectId("MissionGroup/flyerGroup/route/last"))
  650.         order(%this, Guard, %where);    
  651. }
  652.  
  653. function startFlyer()
  654. {
  655.      schedule("order($flyer.id1, Guard, $flyer.route);",10.0);
  656.      schedule("rebelDistanceCheck(flyer);", 10.0);     
  657.      setVehicleRadarVisible($flyer.id1,true); 
  658. }