home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 April / Gamestar_83_2006-04_dvd.iso / Dema / demowot_english.exe / Script / Source / Chapter3 / MS12-C3L4.sma < prev    next >
Text File  |  2005-03-11  |  71KB  |  2,257 lines

  1. #include "script.inc"
  2. #include "visualeffects.inc"
  3. #include "antiair.inc"
  4.  
  5. #define max_run_once         12
  6.  
  7. #define purple_wpnum        2
  8. #define red_wpnum            4
  9. #define black_wpnum            4
  10. #define brown_wpnum            3
  11. #define turkiz_wpnum        3
  12. #define green_wpnum            3
  13. #define blue_wpnum            3
  14. #define radio_wpnum            3
  15. #define bridge_wpnum        6
  16.  
  17.  
  18. #define    maptime                2100
  19. #define overtime            420
  20. #define AAdelay                180
  21.  
  22. //Global params
  23. new bool:RunOnce[max_run_once];
  24. new gTeleporterName[20][60];
  25. new gNewSpawnerNum = 0;
  26. new gNewReinfNum = 0;
  27. new gKonigTigerz = 0;
  28. new gV1 = 0;
  29. new gNewAreaReinf[4] = {0,0,0,0};
  30. new gCounter = 0;
  31. // new bool:gSecTimerRunning = false;
  32. new gStaticReinfNum = 0;
  33. new gSSpanzernum = 0;
  34. new gStaticSSpanzernum = 0;
  35. new bool:gSSpanzerzDestroyed = false;
  36. new bool:gRadioTowerDestroyed = false;
  37. new bool:gArtilleryStrikeMessage = true;
  38. new bool:gGlobalVariable = false;
  39.  
  40. new gLinePurple[purple_wpnum][6]         = {{"wpr1"},{"wpr2"}};
  41. new gLineRed[red_wpnum][6]                 = {{"wpr6"},{"wpr7"},{"wpr21"},{"wpr8"}};
  42. new gLineBlack[black_wpnum][20]             = {{"wpr18"},{"wpr19"},{"wpr20"},{"area_teleport"}};
  43. new gLineBrown[brown_wpnum][6]             = {{"wpr3"},{"wpr4"},{"wpr5"}};
  44. new gLineTurkiz[turkiz_wpnum][6]        = {{"wpr15"},{"wpr16"},{"wpr17"}};
  45. new gLineGreen[green_wpnum][6]             = {{"wpr9"},{"wpr10"},{"wpr11"}};
  46. new gLineBlue[blue_wpnum][6]             = {{"wpr12"},{"wpr13"},{"wpr14"}};
  47. new gLineRadio[radio_wpnum][6]            = {{"wpr23"},{"wpr24"},{"wpr25"}};
  48. new gLineBridge[bridge_wpnum][6]        = {{"wpr26"},{"wpr27"},{"wpr28"},{"wpr29"},{"wpr30"},{"wpr31"}};
  49.  
  50. enum eWay
  51. {
  52.     purple     = 1,
  53.     red     = 2,
  54.     black     = 3,
  55.     brown     = 4,
  56.     turkiz     = 5,
  57.     green     = 6,
  58.     blue     = 7,
  59.     radio    = 8,
  60.     bridge    = 9
  61. };
  62.  
  63. enum eSpawner
  64. {
  65.     retreat            = 1,
  66.     reinforce        = 2,
  67.     SSpanzer        = 10,
  68.     v1                = 100,
  69.     konigz            = 1000,
  70.     konig_outro        = 1001,
  71.     firefly_outro1    = 1002,
  72.     firefly_outro2    = 1003,
  73.     firefly_outro3    = 1004,
  74.     firefly_outro4    = 1005,
  75.     jeep_outro        = 1006
  76. };
  77.  
  78. //soundfiles
  79. new gSoundFile1[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP001.mp3";
  80. new gSoundFile2[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP002.mp3";
  81. new gSoundFile3[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP003.mp3";
  82. new gSoundFile4[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP004.mp3";
  83. new gSoundFile5[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP005.mp3";
  84. new gSoundFile6[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP006.mp3";
  85. new gSoundFile7[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP007.mp3";
  86. new gSoundFile8[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP008.mp3";
  87. new gSoundFile9[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP009.mp3";
  88. new gSoundFile10[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP010.mp3";
  89. new gSoundFile11[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP011.mp3";
  90. new gSoundFile12[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP012.mp3";
  91. new gSoundFile13[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP013.mp3";
  92. new gSoundFile14[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP014.mp3";
  93. new gSoundFile15[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP015.mp3";
  94. new gSoundFile16[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP016.mp3";
  95. new gSoundFile17[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP017.mp3";
  96. new gSoundFile18[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP018.mp3";
  97. new gSoundFile19[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP019.mp3";
  98. new gSoundFile20[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP020.mp3";
  99. new gSoundFile21[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP021.mp3";
  100. //============================================================================================================================
  101. public main()
  102.     CommonAKMain();
  103. //============================================================================================================================
  104. public PostGameStart()
  105. {
  106.     CommonAKInit();
  107.     ScenarioMode();
  108.     HideEntity( GetEntity( "sys_palyahatar1" ) );
  109.  
  110.     for(new counter = 0; counter <= max_run_once-1; counter++)
  111.     {
  112.         RunOnce[counter] = false;
  113.     }
  114.  
  115.     Add2GermanGroup();
  116.     forbidden_grp_num = 3;
  117.     gForbiddenGroups[0] = "grp_v1";
  118.     gForbiddenGroups[1] = "grp_sspanzerz";
  119.     gForbiddenGroups[2] = "grp_konigz";
  120.  
  121.  
  122. // user events
  123. //     AddUserEvent( "GroupEliminated", UE_GROUPELIM_SUCC );
  124.     AddUserEvent( "TeamEliminated", UE_TEAMELIM_SUCC );
  125. // code events
  126.     AddAKEntityEvent( "WreckDestruct", ANY_ENTITY, UNIT_DIED, 0.1 );
  127.     AddAKEntityEvent( "UnitEntered", ANY_ENTITY, UNIT_AREA_ENTER );
  128.     AddAKEntityEvent( "UnitExited", ANY_ENTITY, UNIT_AREA_EXIT );
  129.     AddAKEntityEvent( "UnitThrowMsg", ANY_ENTITY, CMD_EVENT );
  130.     AddAKEntityEvent( "HQCaptured", ANY_ENTITY, HQ_TAKEOVER );
  131.     AddAKEntityEvent( "CountDownDone", ANY_ENTITY, COUNTDOWN_DONE );
  132.     AddAKEntityEvent( "TurretDestroyed", ANY_ENTITY, UNIT_TURRET_DESTROYED );
  133.     AddAKEntityEvent( "CaterpillarDestroyed", ANY_ENTITY, UNIT_CATERPILLAR_DESTROYED );
  134.     AddAKEntityEvent( "RadioTowerCaptured", GetEntity( "radiotower" ), UNIT_TEAM_CHANGED );
  135.     AddAKEntityEvent( "RadioTowerDestroyed", GetEntity( "radiotower" ), UNIT_DIED );
  136.     AddAKEntityEvent( "ArtilleryStrikeSoundMessage", GetEntity( "skot" ), UNIT_ENEMY_SEEN );
  137.     AddAKEntityEvent( "RemoveSoundMessage", GetEntity( "skot" ), UNIT_DIED );
  138. //     AddAKEntityEvent( "UnitTeamChanged", ANY_ENTITY, UNIT_TEAM_CHANGED );
  139. //     AddAKEntityEvent( "TurretDest", ANY_ENTITY, TEST_EVENT );
  140.  
  141.     AddAKSelectorEvent( "RetreaterDied", "grp_retreaterz", UNIT_DIED );
  142.     AddAKSelectorEvent( "UnitDiedFromDef1", "grp_defender1", UNIT_DIED );
  143.     AddAKSelectorEvent( "UnitDiedFromDef2", "grp_defender2", UNIT_DIED );
  144.     AddAKSelectorEvent( "UnitDiedFromDef3", "grp_defender3", UNIT_DIED );
  145.     AddAKSelectorEvent( "UnitDiedFromDef4", "grp_defender4", UNIT_DIED );
  146.     AddAKSelectorEvent( "UnitDamagedFromDef1", "grp_defender1", UNIT_DAMAGED );
  147.     AddAKSelectorEvent( "UnitDamagedFromDef2", "grp_defender2", UNIT_DAMAGED );
  148.     AddAKSelectorEvent( "UnitDamagedFromDef3", "grp_defender3", UNIT_DAMAGED );
  149.     AddAKSelectorEvent( "UnitDamagedFromDef4", "grp_defender4", UNIT_DAMAGED );
  150.     AddAKSelectorEvent( "SSPanzerzDiedOrCaptured", "grp_sspanzerz", UNIT_TEAM_CHANGED );
  151.     AddAKSelectorEvent( "GlobalGroupRemover", "grp_German", UNIT_TEAM_CHANGED );
  152.  
  153. // timer events
  154.     AddTimerEvent( "SpawnControll", 5.0, "GameLogic", true);
  155.  
  156. //    addobjeczves
  157.     AddObjective( "PRI_1", OT_PRIMARY, "#iMS12_PS01#", "#iMS12_PL01#", OS_SLEEPING );
  158.     AddObjective( "SEC_1", OT_SECONDARY, "#iMS12_SS01#", "#iMS12_SL01#", OS_SLEEPING );
  159.     AddObjective( "SEC_2", OT_SECONDARY, "#iMS12_SS02#", "#iMS12_SL02#", OS_SLEEPING );
  160.     AddObjective( "SEC_3", OT_SECONDARY, "#iMS12_SS03#", "#iMS12_SL03#", OS_SLEEPING );
  161.     AddObjective( "SEC_4", OT_SECONDARY, "#iMS12_SS04#", "#iMS12_SL04#", OS_SLEEPING );
  162.     AddObjective( "HID_1", OT_HIDDEN, "#iMS12_HS01#", "#iMS12_HL01#", OS_SLEEPING );
  163.  
  164.  
  165.     new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  166.      SetSpeedInSelector( "grp_retreaterz", lowestspd );
  167.     Move("tmp1", black, true, Q_ENQUEUE, MF_OVERRUN );
  168.     CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr21" ), Q_ENQUEUE, MF_OVERRUN );
  169.     CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr8" ), Q_ENQUEUE, MF_OVERRUN );
  170.     CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr18" ), Q_ENQUEUE, MF_OVERRUN );
  171.     CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr19" ), Q_ENQUEUE, MF_OVERRUN|MF_DIRECT );
  172.     CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr20" ), Q_ENQUEUE, MF_OVERRUN|MF_DIRECT );
  173.     CmdGroupMoveToEnt( "tmp2", GetEntity( "area_teleport" ), Q_ENQUEUE, MF_OVERRUN|MF_DIRECT );
  174.      Move("tmp3", red, true, Q_ENQUEUE, MF_OVERRUN );
  175.      Move("tmp3", black, true, Q_ENQUEUE, MF_OVERRUN );
  176.  
  177.     Intro();
  178. }
  179. //============================================================================================================================
  180. public Intro()
  181. {
  182.     static counter = 0;
  183.     RemoveEvent( "Intro" );
  184.     switch(counter)
  185.     {
  186.         case 0:
  187.         {
  188.             SetPropertyInt( GetSupportObj(gPlayerTeam), "NAirStrikes",GetNAirStrikes(gPlayerTeam)+2);
  189.             
  190.             new PrevLevel = GetGlobalVariable("gvMS11_Pilot");
  191.             if(PrevLevel == 1)
  192.             {
  193.                 SetPropertyInt( GetSupportObj(gPlayerTeam), "NRecons",GetNAirRecons(gPlayerTeam)+10);
  194.                 gGlobalVariable = true;
  195.             }
  196.             else
  197.                 SetPropertyInt( GetSupportObj(gPlayerTeam), "NRecons",GetNAirRecons(gPlayerTeam)+5);
  198.             HackAntiAirInit();
  199.  
  200.              SetCutScene(true, true, true);
  201.             TeleportCameraToEnt(GetEntity( "camerapos1" ));
  202.             CameraSet(90.0, 45.0, 15.0, true);
  203.             new DrID:fow1 = CreateFOWBtoEntity(GetEntity( "camerapos1" ))
  204.             SetPropertyString( fow1, "StringID", "fow1" );
  205.             new DrID:fow2 = CreateFOWBtoEntity(GetEntity( "camerapos2" ))
  206.             SetPropertyString( fow2, "StringID", "fow2" );
  207.             AddTimerEvent( "Intro", 2.0, "GameLogic", true );
  208.             AddTimerEvent( "SetIntroCameraSpeed", 0.1, "GameLogic", true );
  209.         }
  210.         case 1:
  211.         {
  212.             CameraSpeed(3.0, 2.0, 5.0);    
  213.             CameraSet(269.0, 55.0, 55.0, false);
  214.             MoveCameraToEnt( GetEntity("camerapos2") );
  215.             AddAKEntityEvent( "Intro", ANY_ENTITY, CAMERA_TARGET_REACHED );
  216.         }
  217.         case 2:
  218.         {    
  219.             SetPropertyInt( GetEntity( "fow1" ), "Team", 0 );
  220.             SetPropertyInt( GetEntity( "fow2" ), "Team", 0 );
  221.             new DrID:fow3 = CreateFOWBtoEntity(GetEntity( "tiger" ));
  222.             SetPropertyString( fow3, "StringID", "fow3" );
  223.             FadeOut(0.5);
  224.             AddTimerEvent( "Intro", 0.5, "GameLogic", true );
  225.             CmdGroupMoveToEnt( "grp_polish", GetEntity( "wp_charge" ), Q_OVERRIDE, MF_KEEP_FORMATION );
  226.         }
  227.         case 3:
  228.         {
  229.             FadeIn(0.5);
  230.             TeleportCameraToEnt(GetEntity( "polish_officer" ));
  231.             CameraSet(GetEntityDir( GetEntity( "polish_officer" ), DB_NORTH ), 65.0, 25.0);
  232.             CameraFollow( GetEntity( "polish_officer" ) );
  233.             CameraSet(90.0, 45.0, 45.0, false);
  234.             AddTimerEvent( "Intro", 0.5, "GameLogic", true );
  235.         }
  236.         case 4:
  237.         {
  238.             AddSoundMessage("#iMS12_SP002#", gSoundFile2);
  239.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  240.         }
  241.         case 5:
  242.         {
  243.             CameraFollow( DrID:0 );
  244.             CmdGroupStop( "grp_polish", Q_OVERRIDE );
  245.             TeleportCameraToEnt(GetEntity( "tiger" ));
  246.             CameraSet(GetEntityDir( GetEntity( "tiger" ), DB_NORTH ), 65.0, 25.0);
  247.             CameraSet(90.0, 45.0, 35.0);
  248.             CmdGroupAttack( "grp_defender3", Q_OVERRIDE, GetEntity( "wp_dir3" ), AF_FORCE);
  249.              AddSoundMessage("#iMS12_SP003#", gSoundFile3);
  250.             AddTimerEvent( "Intro", 5.0, "GameLogic", true );
  251.         }
  252.         case 6:
  253.         {
  254.             TeleportCameraToEnt(GetEntity( "polish_officer" ));
  255.             CameraSet(180.0, 65.0, 25.0);
  256.             CameraSet(180.0, 45.0, 40.0, false);
  257.             CmdMoveToEntity( GetEntity( "polish_officer" ), Q_OVERRIDE, GetEntity( "wp_retreat" ), MF_NONE );
  258.             CmdMoveToEntity( GetEntity( "pol1" ), Q_OVERRIDE, GetEntity( "wp_retreat1" ), MF_NONE );
  259.             CmdMoveToEntity( GetEntity( "pol2" ), Q_OVERRIDE, GetEntity( "wp_retreat2" ), MF_NONE );
  260.             CmdMoveToEntity( GetEntity( "pol3" ), Q_OVERRIDE, GetEntity( "wp_retreat4" ), MF_NONE );
  261.             CmdMoveToEntity( GetEntity( "pol4" ), Q_OVERRIDE, GetEntity( "wp_retreat5" ), MF_NONE );
  262.             CmdMoveToEntity( GetEntity( "polish_repair" ), Q_OVERRIDE, GetEntity( "wp_retreat3" ), MF_NONE );
  263.             CmdMoveToEntity( GetEntity( "polish_truck1" ), Q_OVERRIDE, GetEntity( "wp_retreat6" ), MF_NONE );
  264.             CmdMoveToEntity( GetEntity( "polish_truck2" ), Q_OVERRIDE, GetEntity( "wp_retreat7" ), MF_NONE );
  265.  
  266.             CmdTurnToEnt( GetEntity( "polish_officer" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
  267.             CmdTurnToEnt( GetEntity( "pol1" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
  268.             CmdTurnToEnt( GetEntity( "pol2" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
  269.             CmdTurnToEnt( GetEntity( "pol3" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
  270.             CmdTurnToEnt( GetEntity( "pol4" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
  271.             CmdDigin(GetEntity( "polish_officer" ), Q_ENQUEUE);
  272.             CmdDigin(GetEntity( "pol1" ), Q_ENQUEUE);
  273.             CmdDigin(GetEntity( "pol2" ), Q_ENQUEUE);
  274.             CmdDigin(GetEntity( "pol3" ), Q_ENQUEUE);
  275.             CmdDigin(GetEntity( "pol4" ), Q_ENQUEUE);
  276.  
  277.             AddSoundMessage("#iMS12_SP004#", gSoundFile4);
  278.             CmdGroupStop( "grp_defender3", Q_OVERRIDE );
  279.  
  280.             new Float:slowest = GetSlowestSpeedInGroup("grp_canadians");
  281.             SetSpeedInSelector( "grp_canadians", slowest );
  282.             CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb1" ), Q_OVERRIDE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
  283.             CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb2" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
  284.             CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb3" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
  285.             CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb4" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
  286.             CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb5" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
  287.             CmdThrowEvent( GetEntity( "c_jeep" ), Q_ENQUEUE, 1000 );
  288.         }
  289.         case 7:
  290.         {
  291.             TeleportCameraToEnt(GetEntity( "c_tankcmdr" ));
  292.             CameraFollow( GetEntity( "c_tankcmdr" ) );
  293.             CameraSet(180.0, 45.0, 20.0);
  294.              CameraSet(90.0, 45.0, 20.0, false);
  295.              AddSoundMessage("#iMS12_SP005#", gSoundFile5);
  296.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  297.         }
  298.         case 8:
  299.         {
  300.             CameraFollow( DrID:0 );
  301.             TeleportCameraToEnt(GetEntity( "polish_officer" ));
  302.             CameraSet(180.0, 45.0, 20.0);
  303.             AddSoundMessage("#iMS12_SP006#", gSoundFile6);    
  304.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  305.         }
  306.         case 9:
  307.         {
  308.             CameraFollow( GetEntity( "c_tankcmdr" ) );
  309.             TeleportCameraToEnt(GetEntity( "c_tankcmdr" ));
  310.             CameraSet(180.0, 45.0, 20.0);
  311.             AddSoundMessage("#iMS12_SP007#", gSoundFile7);    
  312.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  313.         }
  314.         case 10:
  315.         {
  316.             CameraFollow( DrID:0 );
  317.             TeleportCameraToEnt(GetEntity( "polish_officer" ));
  318.             CameraSet(180.0, 45.0, 20.0);
  319.             AddSoundMessage("#iMS12_SP008#", gSoundFile8);    
  320.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  321.         }
  322.         case 11:
  323.         {
  324.             CameraFollow( GetEntity( "c_tankcmdr" ) );
  325.             TeleportCameraToEnt(GetEntity( "c_tankcmdr" ));
  326.             CameraSet(180.0, 45.0, 20.0);
  327.             AddSoundMessage("#iMS12_SP009#", gSoundFile9);    
  328.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  329.         }
  330.         case 12:
  331.         {
  332.             CameraFollow( DrID:0 );
  333.             TeleportCameraToEnt(GetEntity( "camera_start" ));
  334.              CameraSet(GetEntityDir( GetEntity( "camera_start" ), DB_X_AXIS )-90.0, 45.0, 30.0, true);
  335.             AddSoundMessage("#iMS12_SP010#", gSoundFile10);    
  336.             AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
  337.         
  338.         }
  339.         case 13:
  340.         {
  341.             new Iterator:i = Iterate( "grp_polish" );
  342.             while(ItNext( i ))
  343.             {
  344.                 MakeVulnerable(ItEntity( i ));
  345.             }
  346.             ItStop( i );            
  347.             SetBehav2Ent( GetEntity( "polish_repair" ),    MB_MOVE_IN_VICINITY);
  348.             SetPropertyInt( GetEntity( "fow3" ), "Team", 0 );
  349.             SetCutScene(false);
  350.             CameraFollow( DrID:0 );
  351.             ResetCameraSpeed();
  352.  
  353.             SetObjectiveState( "PRI_1", OS_IN_PROGRESS );
  354.             SetObjectiveState( "SEC_2", OS_IN_PROGRESS );
  355.             AddMapTickToEnt( GetEntity( "radiotower" ), 25.0, MAPTICK_CROSS );
  356.                         
  357.             if(gGlobalVariable == true)
  358.                 AddTimerEvent( "PrevLevelHiddenCom", 5.0, "GameLogic", true);
  359.             switch(GetDifficulty())
  360.             {
  361.                 case 0:
  362.                 {
  363.                     SetCountDown( maptime+600 );
  364.                 }
  365.                 case 3:
  366.                 {
  367.                     SetCountDown( maptime-300 );
  368.                 }
  369.                 default:
  370.                 {
  371.                     SetCountDown( maptime );
  372.                 }
  373.             
  374.             }
  375.             AddTimerEvent( "TickTack", 1.0, "GameLogic", true );
  376.         }
  377.     }
  378.     counter++;
  379. }
  380. //============================================================================================================================
  381. public Outro()
  382. {
  383.     static counter = 0;
  384.     
  385.     RemoveEvent( "Outro" );
  386.     RemoveEvent( "SpawnControll" );
  387.     switch(counter)
  388.     {
  389.         case 0:
  390.         {
  391.             FadeOut(0.5);
  392.             CmdGroupStop( "grp_retreaterz", Q_OVERRIDE );
  393.             AddTimerEvent( "Outro", 1.0, "GameLogic", true);    
  394.         }
  395.         case 1:
  396.         {
  397.             SetCutScene(true, true, true);
  398.             DeactivateEntityz();
  399.             CreateFOWBtoEntity(GetEntity( "hq" ));
  400.             new DrID:konig = Creator(konig_outro);
  401.             new DrID:firefly1 = Creator(firefly_outro1);
  402.             new DrID:firefly2 = Creator(firefly_outro2);
  403.             new DrID:firefly3 = Creator(firefly_outro3);
  404.             new DrID:firefly4 = Creator(firefly_outro4);
  405.             new DrID:jeep = Creator(jeep_outro);
  406.  
  407.             SetPropertyString( konig, "StringID", "konig" );
  408.             SetPropertyString( firefly1, "StringID", "firefly1" );
  409.             SetPropertyString( firefly2, "StringID", "firefly2" );
  410.             SetPropertyString( firefly3, "StringID", "firefly3" );
  411.             SetPropertyString( firefly4, "StringID", "firefly4" );
  412.             SetPropertyString( jeep, "StringID", "jeep" );
  413.             
  414.             SetPropertyString( firefly1, "Nationality", "Polish" );
  415.             SetPropertyString( firefly2, "Nationality", "Polish" );
  416.             SetPropertyString( firefly3, "Nationality", "Polish" );
  417.             SetPropertyString( firefly4, "Nationality", "Polish" );
  418.             
  419.             MakeInvulnerable(konig);
  420.             MakeInvulnerable(firefly1);
  421.             MakeInvulnerable(firefly2);
  422.             MakeInvulnerable(firefly3);
  423.             MakeInvulnerable(firefly4);
  424.             
  425.             CmdMoveToEnt( konig, GetEntity( "wp_dest" ), Q_ENQUEUE, MF_NONE );
  426.             CmdStop( konig, Q_ENQUEUE );            
  427.             CmdThrowEvent( konig, Q_ENQUEUE, 555 );
  428.  
  429.             CmdTurnToEnt( firefly2, GetEntity( "wp_dest" ), Q_ENQUEUE );
  430.             CmdTurnToEnt( firefly4, GetEntity( "wp_dest" ), Q_ENQUEUE );
  431.             CmdDigin(firefly2, Q_ENQUEUE);
  432.             CmdDigin(firefly4, Q_ENQUEUE);
  433.  
  434.             CmdMoveToEnt( firefly1, GetEntity( "wp_outros1" ), Q_ENQUEUE, MF_NONE );
  435.             CmdMoveToEnt( firefly3, GetEntity( "wp_outros3" ), Q_ENQUEUE, MF_NONE );
  436.             CmdTurnToEnt( firefly1, GetEntity( "wp_dest" ), Q_ENQUEUE );
  437.             CmdTurnToEnt( firefly3, GetEntity( "wp_dest" ), Q_ENQUEUE );
  438.             CmdDigin(firefly1, Q_ENQUEUE);
  439.             CmdDigin(firefly3, Q_ENQUEUE);
  440.             AddTimerEvent( "Outro", 2.0, "GameLogic", true);    
  441.         }
  442.         case 2:
  443.         {
  444.             FadeIn(0.5);
  445.             TeleportCameraToEnt(GetEntity( "konig" ));
  446.             CameraFollow( GetEntity( "konig" ) );
  447.             CameraSet(180.0, 45.0, 50.0);
  448.             CameraSpeed(-2.0, 5.0, 5.0, 10.0);
  449.             CameraSet(90.0, 45.0, 20.0, false);
  450. //             AddTimerEvent( "Outro", 5.0, "GameLogic", true);
  451.             AddAKEntityEvent( "SpeechEnd1", ANY_ENTITY, MESSAGE_END );
  452.             AddSoundMessage("#iMS12_SP014#", gSoundFile14);
  453.             AddSoundMessage("#iMS12_SP015#", gSoundFile15);
  454.         }
  455.         case 3:
  456.         {
  457.             SetCameraRotSpeed(2.0);
  458.             SetCameraPitchSpeed(1.0);
  459.             CameraSet(269.0, 45.0, 50.0);
  460.             CameraSet(180.0, 45.0, 20.0, false);
  461.         }
  462.         case 4:
  463.         {
  464.             //konig megall
  465.             FadeOut(0.5);
  466.             AddTimerEvent( "Outro", 1.0, "GameLogic", true);
  467.         }
  468.         case 5:
  469.         {
  470.             FadeIn(0.5);
  471.             new Float:pos[vec3];
  472.             GetPropertyVec3( GetEntity( "wp_hartmann" ), "LogicalPos_", pos );
  473.             new DrID:hartmann = CreateEntity( "ax_Officer", pos );
  474.             SetPropertyString( hartmann, "StringID", "Hartmann" );
  475.             SetPropertyInt( hartmann, "Team", gPlayerTeam );
  476.             ShowWeapon(hartmann, false);
  477.                                     
  478.             TeleportCameraToEnt(GetEntity( "jeep" ));
  479.             CameraFollow( GetEntity( "jeep" ) );
  480.             CameraSet(180.0, 45.0, 25.0);
  481.         }
  482.         case 6:
  483.         {
  484.             FadeOut(0.5);
  485.             AddTimerEvent( "Outro", 0.5, "GameLogic", true);
  486.         }
  487.         case 7:
  488.         {
  489.             FadeIn(0.5);
  490.             TeleportCameraToEnt(GetEntity( "Hartmann" ));
  491.             CameraFollow( GetEntity( "Hartmann" ) );
  492.             CameraSet(180.0, 45.0, 5.0);
  493.             CameraSet(90.0, 45.0, 25.0, false);
  494.             AddAKEntityEvent( "SpeechEnd2", ANY_ENTITY, MESSAGE_END );
  495.             AddSoundMessage("#iMS12_SP016#", gSoundFile16);
  496.             AddSoundMessage("#iMS12_SP017#", gSoundFile17);
  497.             AddSoundMessage("#iMS12_SP018#", gSoundFile18);
  498.         }
  499.         case 8:
  500.         {
  501.             CameraFollow( GetEntity( "jeep" ) );
  502.             TeleportCameraToEnt(GetEntity( "jeep" ));
  503.             CameraSet(180.0, 45.0, 25.0);
  504.             AddSoundMessage("#iMS12_SP019#", gSoundFile19);
  505.             AddAKEntityEvent( "Outro", ANY_ENTITY, MESSAGE_END );
  506.         }
  507.         case 9:
  508.         {
  509.             CmdSetMS( GetEntity( "Hartmann" ), Q_OVERRIDE, MS_WALK );
  510.             CmdMount( GetEntity( "Hartmann" ), Q_ENQUEUE, GetEntity( "jeep" ));
  511.             CmdThrowEvent( GetEntity( "Hartmann" ), Q_ENQUEUE, 333 );
  512.         }
  513.         case 10:
  514.         {
  515.             RemoveEvent( "Defeat" );
  516.             FadeOut(0.5);
  517.             AddTimerEvent( "Victory", 0.5, "GameLogic", true);
  518.         }
  519.     }
  520.     counter++;
  521. }
  522. //============================================================================================================================
  523. public SpeechEnd1()
  524. {
  525.     static counter = 0;
  526.     counter++;
  527.     if(counter == 2)
  528.     {
  529.         RemoveEvent( "SpeechEnd" );
  530.         Outro();
  531.     }
  532. }
  533. //============================================================================================================================
  534. public SpeechEnd2()
  535. {
  536.     static counter = 0;
  537.     counter++;
  538.     if(counter == 3)
  539.     {
  540.         RemoveEvent( "SpeechEnd" );
  541.         Outro();
  542.     }
  543. }
  544. //============================================================================================================================
  545. public SetIntroCameraSpeed()
  546. {
  547.     static Float:speed = 0.0;
  548.     if(speed <= 4.5)
  549.     {
  550.         speed+=0.02;
  551.         SetCameraSpeed(speed);
  552.     }
  553.     else
  554.     {
  555.         RemoveEvent( "SetIntroCameraSpeed" );
  556.         SetCameraDampValue(0.01);
  557.     }
  558. }
  559. //============================================================================================================================
  560. public GroupEliminated()
  561. {
  562.     new ID = GetMsgParamInt();
  563.     if(ID == 2)
  564.     {
  565.         SetObjectiveState( "SEC_1", OS_COMPLETED );
  566.     }
  567. }
  568. public TeamEliminated()
  569. {
  570.     new ID = GetMsgParamInt();
  571.     if(ID == 1)
  572.     {
  573.         SetCutScene(true, true, true);
  574.         BulletTime(GetLastKilledEntity(), false);
  575.         AddUserEvent( "Defeat", UE_BULLETTIME_END );
  576.     }
  577.     if(ID == 2 && RunOnce[11] == false)
  578.     {
  579.         RunOnce[11] = true;
  580.         if(GetDifficulty() == 0)
  581.             Reinforcement( "help_to_easy", GetEntity( "deploy_usa" ), GetEntity( "start_usa" ) );
  582.     }
  583. }
  584. //============================================================================================================================
  585. stock Move(group[], eWay:way, bool:elore, eQueuing:queue, eMoveFlag:moveflag, DrID:unit = DrID:0 )
  586. {
  587.     switch(way)
  588.     {
  589.         case 1:
  590.         {
  591.             if(unit == DrID:0)
  592.             {
  593.                 if(elore)
  594.                 {
  595.                     for(new i = 0; i < purple_wpnum; i++)
  596.                         if(i == 0)
  597.                             CmdGroupMoveToEnt( group, GetEntity( gLinePurple[i] ), queue, moveflag|MF_DIRECT );
  598.                         else
  599.                             CmdGroupMoveToEnt( group, GetEntity( gLinePurple[i] ), queue, moveflag );
  600.                 }
  601.                 else
  602.                 {
  603.                     for(new i = purple_wpnum-1; i >= 0; i--)
  604.                         CmdGroupMoveToEnt( group, GetEntity( gLinePurple[i] ), queue, moveflag );
  605.                 }
  606.             }
  607.             else
  608.             {
  609.                 if(elore)
  610.                 {
  611.                     for(new i = 0; i < purple_wpnum; i++)
  612.                     {
  613.                         if(i == 0)
  614.                             CmdMoveToEnt( unit, GetEntity( gLinePurple[i] ), queue, moveflag|MF_DIRECT );
  615.                         else
  616.                             CmdMoveToEnt( unit, GetEntity( gLinePurple[i] ), queue, moveflag );
  617.                         if(i == 1)
  618.                             CmdThrowEvent( unit, Q_ENQUEUE, 3 );
  619.                     }
  620.                 }
  621.                 else
  622.                 {
  623.                     for(new i = purple_wpnum-1; i >= 0; i--)
  624.                         CmdMoveToEnt( unit, GetEntity( gLinePurple[i] ), queue, moveflag );
  625.                 }
  626.             }
  627.         }
  628.         case 2:
  629.         {
  630.             if(unit == DrID:0)
  631.             {
  632.                 if(elore)
  633.                 {
  634.                     for(new i = 0; i < red_wpnum; i++)
  635.                         CmdGroupMoveToEnt( group, GetEntity( gLineRed[i] ), queue, moveflag );
  636.                 }
  637.                 else
  638.                 {
  639.                     for(new i = red_wpnum-1; i >= 0; i--)
  640.                         CmdGroupMoveToEnt( group, GetEntity( gLineRed[i] ), queue, moveflag );
  641.                 }
  642.             }
  643.             else
  644.             {
  645.                 if(elore)
  646.                 {
  647.                     for(new i = 0; i < red_wpnum; i++)
  648.                         CmdMoveToEnt( unit, GetEntity( gLineRed[i] ), queue, moveflag );
  649.                 }
  650.                 else
  651.                 {
  652.                     for(new i = red_wpnum-1; i >= 0; i--)
  653.                         CmdMoveToEnt( unit, GetEntity( gLineRed[i] ), queue, moveflag );
  654.                 }
  655.             }
  656.         }
  657.         case 3:
  658.         {
  659.             if(unit == DrID:0)
  660.             {
  661.                 if(elore)
  662.                 {
  663.                     for(new i = 0; i < black_wpnum; i++)
  664.                     {
  665.                         if(i >= 1)    
  666.                             CmdGroupMoveToEnt( group, GetEntity( gLineBlack[i] ), queue, moveflag|MF_DIRECT );
  667.                         else
  668.                             CmdGroupMoveToEnt( group, GetEntity( gLineBlack[i] ), queue, moveflag );
  669.                     }
  670.                 }
  671.                 else
  672.                 {
  673.                     for(new i = black_wpnum-1; i >= 0; i--)
  674.                         CmdGroupMoveToEnt( group, GetEntity( gLineBlack[i] ), queue, moveflag );
  675.                 }
  676.             }
  677.             else
  678.             {
  679.                 if(elore)
  680.                 {
  681.                     for(new i = 0; i < black_wpnum; i++)
  682.                     {
  683.                         if(i >= 1)    
  684.                             CmdMoveToEnt( unit, GetEntity( gLineBlack[i] ), queue, moveflag|MF_DIRECT );
  685.                         else
  686.                             CmdMoveToEnt( unit, GetEntity( gLineBlack[i] ), queue, moveflag );
  687.                         if(i == 2)
  688.                         {
  689.                             CmdThrowEvent( unit, Q_ENQUEUE, 2 );
  690. //                             new senderStrID[250];
  691. //                             GetPropertyString( unit, "StringID", 200, senderStrID );
  692. //                             ConcatString( senderStrID, 250, "EntityThrowInvulnerableEvent:", senderStrID );
  693. //                             DebugMessage( senderStrID, DL_MESSAGE );
  694.                         }
  695.                     }
  696.                 }
  697.                 else
  698.                 {
  699.                     for(new i = black_wpnum-1; i >= 0; i--)
  700.                         CmdMoveToEnt( unit, GetEntity( gLineBlack[i] ), queue, moveflag );
  701.                 }
  702.             }
  703.         }
  704.         case 4:
  705.         {
  706.             if(unit == DrID:0)
  707.             {
  708.                 if(elore)
  709.                 {
  710.                     for(new i = 0; i < brown_wpnum; i++)
  711.                         CmdGroupMoveToEnt( group, GetEntity( gLineBrown[i] ), queue, moveflag );
  712.                 }
  713.                 else
  714.                 {
  715.                     for(new i = brown_wpnum-1; i >= 0; i--)
  716.                         CmdGroupMoveToEnt( group, GetEntity( gLineBrown[i] ), queue, moveflag );
  717.                 }
  718.             }
  719.             else
  720.             {
  721.                 if(elore)
  722.                 {
  723.                     for(new i = 0; i < brown_wpnum; i++)
  724.                     {
  725.                         CmdMoveToEnt( unit, GetEntity( gLineBrown[i] ), queue, moveflag );
  726.                         if(i == 0)
  727.                             CmdThrowEvent( unit, Q_ENQUEUE, 9 );
  728.                         if(i == 2)
  729.                             CmdThrowEvent( unit, Q_ENQUEUE, 5 );
  730.                     
  731.                     }
  732.                 }
  733.                 else
  734.                 {
  735.                     for(new i = brown_wpnum-1; i >= 0; i--)
  736.                         CmdMoveToEnt( unit, GetEntity( gLineBrown[i] ), queue, moveflag );
  737.                 }
  738.             }
  739.         }
  740.         case 5:
  741.         {
  742.             if(unit == DrID:0)
  743.             {
  744.                 if(elore)
  745.                 {
  746.                     for(new i = 0; i < turkiz_wpnum; i++)
  747.                         CmdGroupMoveToEnt( group, GetEntity( gLineTurkiz[i] ), queue, moveflag );
  748.                 }
  749.                 else
  750.                 {
  751.                     for(new i = turkiz_wpnum-1; i >= 0; i--)
  752.                         CmdGroupMoveToEnt( group, GetEntity( gLineTurkiz[i] ), queue, moveflag );
  753.                 }
  754.             }
  755.             else
  756.             {
  757.                 if(elore)
  758.                 {
  759.                     for(new i = 0; i < turkiz_wpnum; i++)
  760.                     {
  761.                         CmdMoveToEnt( unit, GetEntity( gLineTurkiz[i] ), queue, moveflag );
  762.                         if(i == 0)
  763.                             CmdThrowEvent( unit, Q_ENQUEUE, 9 );
  764.                         if(i == 2)
  765.                             CmdThrowEvent( unit, Q_ENQUEUE, 6 );
  766.                     }
  767.                 }
  768.                 else
  769.                 {
  770.                     for(new i = turkiz_wpnum-1; i >= 0; i--)
  771.                         CmdMoveToEnt( unit, GetEntity( gLineTurkiz[i] ), queue, moveflag );
  772.                 }
  773.             }
  774.         }
  775.         case 6:
  776.         {
  777.             if(unit == DrID:0)
  778.             {
  779.                 if(elore)
  780.                 {
  781.                     for(new i = 0; i < green_wpnum; i++)
  782.                         CmdGroupMoveToEnt( group, GetEntity( gLineGreen[i] ), queue, moveflag );
  783.                 }
  784.                 else
  785.                 {
  786.                     for(new i = green_wpnum-1; i >= 0; i--)
  787.                         CmdGroupMoveToEnt( group, GetEntity( gLineGreen[i] ), queue, moveflag );
  788.                 }
  789.             }
  790.             else
  791.             {
  792.                 if(elore)
  793.                 {
  794.                     for(new i = 0; i < green_wpnum; i++)
  795.                     {
  796.                         CmdMoveToEnt( unit, GetEntity( gLineGreen[i] ), queue, moveflag );
  797.                         if(i == 0)
  798.                             CmdThrowEvent( unit, Q_ENQUEUE, 9 );
  799.                         if(i == 2)
  800.                             CmdThrowEvent( unit, Q_ENQUEUE, 7 );
  801.                     }
  802.                 }
  803.                 else
  804.                 {
  805.                     for(new i = green_wpnum-1; i >= 0; i--)
  806.                         CmdMoveToEnt( unit, GetEntity( gLineGreen[i] ), queue, moveflag );
  807.                 }
  808.             }
  809.         }
  810.         case 7:
  811.         {
  812.             if(unit == DrID:0)
  813.             {
  814.                 if(elore)
  815.                 {
  816.                     for(new i = 0; i < blue_wpnum; i++)
  817.                         CmdGroupMoveToEnt( group, GetEntity( gLineBlue[i] ), queue, moveflag );
  818.                 }
  819.                 else
  820.                 {
  821.                     for(new i = blue_wpnum-1; i >= 0; i--)
  822.                         CmdGroupMoveToEnt( group, GetEntity( gLineBlue[i] ), queue, moveflag );
  823.                 }
  824.             }
  825.             else
  826.             {
  827.                 if(elore)
  828.                 {
  829.                     for(new i = 0; i < blue_wpnum; i++)
  830.                     {
  831.                         CmdMoveToEnt( unit, GetEntity( gLineBlue[i] ), queue, moveflag );
  832.                         if(i == 0)
  833.                             CmdThrowEvent( unit, Q_ENQUEUE, 9 );
  834.                         if(i == 2)
  835.                             CmdThrowEvent( unit, Q_ENQUEUE, 8 );
  836.                     }
  837.                 }
  838.                 else
  839.                 {
  840.                     for(new i = blue_wpnum-1; i >= 0; i--)
  841.                         CmdMoveToEnt( unit, GetEntity( gLineBlue[i] ), queue, moveflag );
  842.                 }
  843.             }
  844.         }
  845.         case 8:
  846.         {
  847.             if(unit == DrID:0)
  848.             {
  849.                 if(elore)
  850.                 {
  851.                     for(new i = 0; i < radio_wpnum; i++)
  852.                         CmdGroupMoveToEnt( group, GetEntity( gLineRadio[i] ), queue, moveflag );
  853.                 }
  854.                 else
  855.                 {
  856.                     for(new i = radio_wpnum-1; i >= 0; i--)
  857.                         CmdGroupMoveToEnt( group, GetEntity( gLineRadio[i] ), queue, moveflag );
  858.                 }
  859.             }
  860.             else
  861.             {
  862.                 if(elore)
  863.                 {
  864.                     for(new i = 0; i < radio_wpnum; i++)
  865.                     {
  866.                         CmdMoveToEnt( unit, GetEntity( gLineRadio[i] ), queue, moveflag );
  867.                         if(i == 2)
  868.                             CmdThrowEvent( unit, Q_ENQUEUE, 10 );
  869.                     }
  870.                 }
  871.                 else
  872.                 {
  873.                     for(new i = radio_wpnum-1; i >= 0; i--)
  874.                     {
  875.                         CmdMoveToEnt( unit, GetEntity( gLineRadio[i] ), queue, moveflag );
  876.                     }    
  877.                 }
  878.             }
  879.         }
  880.         case 9:
  881.         {
  882.             if(unit == DrID:0)
  883.             {
  884.                 if(elore)
  885.                 {
  886.                     for(new i = 0; i < bridge_wpnum; i++)
  887.                     {
  888.                         if(i == bridge_wpnum-1)
  889.                             CmdGroupThrowEvent( group, Q_ENQUEUE, 11 );
  890.                         if(i >= bridge_wpnum-2)
  891.                             CmdGroupMoveToEnt( group, GetEntity( gLineBridge[i] ), queue, moveflag|MF_DIRECT );
  892.                         else
  893.                             CmdGroupMoveToEnt( group, GetEntity( gLineBridge[i] ), queue, moveflag );
  894.                     }
  895.                 }
  896.                 else
  897.                 {
  898.                     for(new i = bridge_wpnum-1; i >= 0; i--)
  899.                         CmdGroupMoveToEnt( group, GetEntity( gLineBridge[i] ), queue, moveflag );
  900.                 }
  901.             }
  902.             else
  903.             {
  904.                 if(elore)
  905.                 {
  906.                     for(new i = 0; i < bridge_wpnum; i++)
  907.                     {
  908.                         if(i == bridge_wpnum-1)
  909.                             CmdThrowEvent( unit, Q_ENQUEUE, 11 );
  910.                         if(i >= bridge_wpnum-2)
  911.                             CmdMoveToEnt( unit, GetEntity( gLineBridge[i] ), queue, moveflag|MF_DIRECT );
  912.                         else
  913.                             CmdMoveToEnt( unit, GetEntity( gLineBridge[i] ), queue, moveflag );
  914.                     }
  915.                 }
  916.                 else
  917.                 {
  918.                     for(new i = bridge_wpnum-1; i >= 0; i--)
  919.                         CmdMoveToEnt( unit, GetEntity( gLineBridge[i] ), queue, moveflag );
  920.                 }
  921.             }
  922.         }
  923.     }
  924. }
  925. //============================================================================================================================
  926. public WreckDestruct(DrID:diedunit)
  927. {
  928.     WreckDestructor(diedunit, "area_roads");
  929. }
  930. //============================================================================================================================
  931. public UnitEntered(DrID:unit, DrID:area)
  932. {
  933.     new areaname[200];
  934.     GetPropertyString( area, "StringID", 200, areaname );
  935.     if(CompareString( areaname, "area_teleport") == 0 && IsInstanceOf( unit, GetClassID( "cVehicle" )))
  936.     {
  937.         GetPropertyString( unit, "StringID", 250, gTeleporterName[gCounter] );
  938.         gCounter++;
  939.     }
  940.  
  941. //     if(RunOnce[2] == false && CompareString( areaname, "area_secndary") == 0 && GetPropertyInt( unit, "Team" ) == gPlayerTeam)
  942. //     {
  943. //         RunOnce[2] = true;
  944. //         AddTimerEvent( "delayedV1", AAdelay, "GameLogic", true );
  945. //     }
  946.     if(CompareString( areaname, "area_fritzartsup") == 0 && IsInSelector( unit, "SelectorTeam2" ) && 
  947.         (IsInstanceOf( unit, GetClassID( "cVehicle" )) || IsInstanceOf( unit, GetClassID( "cSoldier" ))))
  948.         CmdAttack( GetEntity( "artillerysupport" ), Q_OVERRIDE, unit );
  949.     if(RunOnce[8] == false && CompareString( areaname, "area_bridge") == 0 && unit == GetEntity( "c_tankcmdr" ))
  950.     {
  951.         RunOnce[8] = true;
  952.         Intro();
  953.     }
  954. }
  955. //============================================================================================================================
  956. public RetreaterDied(DrID:unit)
  957. {
  958.     gNewSpawnerNum++;
  959. }
  960. //============================================================================================================================
  961. stock DrID:Creator(eSpawner:spawner)
  962. {
  963.     new DrID:Unit;
  964.     
  965.     switch(spawner)
  966.     {
  967.         case 1:
  968.         {
  969.             DebugMessage( "Creating: Retreater", DL_MESSAGE );
  970.             new rndreinforcement = Rnd( 3 , 9 );
  971.             new rndreinf[250];
  972.             Int2Str( rndreinforcement, rndreinf, 200 );
  973.             Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  974.             CmdGroupStop( rndreinf, Q_OVERRIDE );
  975.                         
  976.             new Iterator:i = Iterate(rndreinf);
  977.             while(ItNext(i))
  978.             {
  979.                 new DrID:unit = ItEntity(i);
  980.                 RemoveFromGroup( rndreinf, unit );
  981.                 RemoveFromGroup( ",", unit );
  982.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  983.                 {
  984.                     if(IsEntityComp(unit, "cTurretController"))
  985.                     {
  986.                         SetBehav2Ent( unit,    
  987.                         MB_HOLD_POSITION,
  988.                         FB_FIRE_AT_WILL,
  989.                         UB_EVAC);
  990.                     }
  991.                     else
  992.                     {
  993.                         SetBehav2Ent( unit,MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  994.                     }
  995.                     Unit = unit;
  996.                     AddToGroup( "grp_retreaterz", unit );
  997.                     AddToGroup( "grp_German", unit );
  998.                     new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  999.                      SetSpeedInSelector( "grp_retreaterz", lowestspd );
  1000.                 }
  1001.                 else
  1002.                     SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1003.             }
  1004.             ItStop( i );
  1005.         }
  1006.         case 2:
  1007.         {
  1008.             gStaticReinfNum++;
  1009.             if(gStaticReinfNum <= 3)
  1010.             {
  1011.                 DebugMessage( "Creating: Tiger Defender", DL_MESSAGE );
  1012.                 new rndreinf[250];
  1013.                 Int2Str( 2, rndreinf, 200 );
  1014.                 Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  1015.                 CmdGroupStop( rndreinf, Q_OVERRIDE );
  1016.                 
  1017.                 new Iterator:i = Iterate(rndreinf);
  1018.                 while(ItNext(i))
  1019.                 {
  1020.                     new DrID:unit = ItEntity(i);
  1021.                     RemoveFromGroup( rndreinf, unit );
  1022.                     RemoveFromGroup( ",", unit );
  1023.                     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1024.                     {
  1025.                         Unit = unit;
  1026.                         AddToGroup( "grp_retreaterz", unit );
  1027.                         AddToGroup( "grp_German", unit );
  1028.                         new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1029.                          SetSpeedInSelector( "grp_retreaterz", lowestspd );
  1030.                     }
  1031.                     else
  1032.                         SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1033.                     }
  1034.                 ItStop( i );
  1035.             }
  1036.             if(gStaticReinfNum > 3 && gStaticReinfNum <= 8)
  1037.             {
  1038.                 DebugMessage( "Creating: Panther Defender", DL_MESSAGE );
  1039.                 new rndreinf[250];
  1040.                 Int2Str( 3, rndreinf, 200 );
  1041.                 Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  1042.                 CmdGroupStop( rndreinf, Q_OVERRIDE );
  1043.                 
  1044.                 new Iterator:i = Iterate(rndreinf);
  1045.                 while(ItNext(i))
  1046.                 {
  1047.                     new DrID:unit = ItEntity(i);
  1048.                     RemoveFromGroup( rndreinf, unit );
  1049.                     RemoveFromGroup( ",", unit );
  1050.                     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1051.                     {
  1052.                         Unit = unit;
  1053.                         AddToGroup( "grp_retreaterz", unit );
  1054.                         AddToGroup( "grp_German", unit );
  1055.                         new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1056.                          SetSpeedInSelector( "grp_retreaterz", lowestspd );
  1057.                     }
  1058.                     else
  1059.                         SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1060.                         }
  1061.                 ItStop( i );
  1062.             }
  1063.             if(gStaticReinfNum > 8 && gStaticReinfNum <= 12)
  1064.             {
  1065.                 if(gStaticReinfNum == 9)
  1066.                 {
  1067.                     DebugMessage( "V1 Carrierz arrived", DL_MESSAGE );
  1068.                     AddTimerEvent( "delayedV1", AAdelay, "GameLogic", true );
  1069.                 }
  1070.                 DebugMessage( "Creating: PZIV G Defender", DL_MESSAGE );
  1071.                 new rndreinf[250];
  1072.                 Int2Str( 4, rndreinf, 200 );
  1073.                 Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  1074.                 CmdGroupStop( rndreinf, Q_OVERRIDE );
  1075.                 
  1076.                 new Iterator:i = Iterate(rndreinf);
  1077.                 while(ItNext(i))
  1078.                 {
  1079.                     new DrID:unit = ItEntity(i);
  1080.                     RemoveFromGroup( rndreinf, unit );
  1081.                     RemoveFromGroup( ",", unit );
  1082.                     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1083.                     {
  1084.                         Unit = unit;
  1085.                         AddToGroup( "grp_retreaterz", unit );
  1086.                         AddToGroup( "grp_German", unit );
  1087.                         new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1088.                          SetSpeedInSelector( "grp_retreaterz", lowestspd );
  1089.                     }
  1090.                     else
  1091.                         SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1092.                 }
  1093.                 ItStop( i );
  1094.             }
  1095.         }
  1096.         case 10:
  1097.         {
  1098.             DebugMessage( "Creating: SSPanzer", DL_MESSAGE );
  1099.             Reinforcement( "11", GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  1100.             CmdGroupStop( "11", Q_OVERRIDE );
  1101.             new Iterator:i = Iterate("11");
  1102.             while(ItNext(i))
  1103.             {
  1104.                 new DrID:unit = ItEntity(i);
  1105.                 RemoveFromGroup( "11", unit );
  1106.                 RemoveFromGroup( ",", unit );
  1107.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1108.                 {
  1109.                     Unit = unit;
  1110.                     AddToGroup( "grp_sspanzerz", unit );
  1111.                     AddToGroup( "grp_German", unit );
  1112.                     new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1113.                      SetSpeedInSelector( "grp_sspanzerz", lowestspd );
  1114.                 }
  1115.                 else
  1116.                     SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1117.             }
  1118.             ItStop( i );
  1119.         }
  1120.         case 100:
  1121.         {
  1122.             DebugMessage( "Creating: V1", DL_MESSAGE );
  1123.             Reinforcement( "10", GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  1124.             CmdGroupStop( "10", Q_OVERRIDE );
  1125.             new Iterator:i = Iterate("10");
  1126.             while(ItNext(i))
  1127.             {
  1128.                 new DrID:unit = ItEntity(i);
  1129.                 RemoveFromGroup( "10", unit );
  1130.                 RemoveFromGroup( ",", unit );
  1131.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1132.                 {
  1133.                     Unit = unit;
  1134.                     AddToGroup( "grp_v1", unit );
  1135.                     AddToGroup( "grp_German", unit );
  1136.                     new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1137.                      SetSpeedInSelector( "grp_v1", lowestspd );
  1138.                 }
  1139.                 else
  1140.                     SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_NEVER, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1141.             }
  1142.             ItStop( i );
  1143.         }
  1144.         case 1000:
  1145.         {
  1146.             DebugMessage( "Creating: Konig", DL_MESSAGE );
  1147.             Reinforcement( "1", GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
  1148.             CmdGroupStop( "1", Q_OVERRIDE );
  1149.             new Iterator:i = Iterate("1");
  1150.             while(ItNext(i))
  1151.             {
  1152.                 new DrID:unit = ItEntity(i);
  1153.                 RemoveFromGroup( "1", unit );
  1154.                 RemoveFromGroup( ",", unit );
  1155.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1156.                 {
  1157.                     Unit = unit;
  1158.                     AddToGroup( "grp_konigz", unit );
  1159.                     AddToGroup( "grp_German", unit );
  1160.                     new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1161.                      SetSpeedInSelector( "grp_konigz", lowestspd );
  1162.                 }
  1163.                 else
  1164.                     SetBehav2Ent( unit,    MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
  1165.             }
  1166.             ItStop( i );
  1167.         }
  1168.         case 1001:
  1169.         {
  1170.             Reinforcement( "101", GetEntity( "wp_konig" ), GetEntity( "wp_dest" ) );
  1171.             new Iterator:i = Iterate("101");
  1172.             while(ItNext(i))
  1173.             {
  1174.                 new DrID:unit = ItEntity(i);
  1175.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1176.                 {
  1177.                     SetBehav2Ent( unit,    MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  1178.                     Unit = unit;
  1179.                 }
  1180.             }
  1181.             ItStop( i );
  1182.         }
  1183.         case 1002:
  1184.         {
  1185.             Reinforcement( "201", GetEntity( "wp_outrod1" ), GetEntity( "wp_outros1" ) );
  1186.             new Iterator:i = Iterate("201");
  1187.             while(ItNext(i))
  1188.             {
  1189.                 new DrID:unit = ItEntity(i);
  1190.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1191.                 {
  1192.                     SetBehav2Ent( unit,    MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  1193.                     Unit = unit;
  1194.                 }
  1195.             }
  1196.             ItStop( i );
  1197.         }
  1198.         case 1003:
  1199.         {
  1200.             Reinforcement( "201", GetEntity( "wp_outrod2" ), GetEntity( "wp_outrod2" ) );
  1201.             CmdGroupStop( "101", Q_OVERRIDE );
  1202.             new Iterator:i = Iterate("201");
  1203.             while(ItNext(i))
  1204.             {
  1205.                 new DrID:unit = ItEntity(i);
  1206.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1207.                 {
  1208.                     SetBehav2Ent( unit,    MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  1209.                     Unit = unit;
  1210.                 }
  1211.             }
  1212.             ItStop( i );
  1213.         }
  1214.         case 1004:
  1215.         {
  1216.             Reinforcement( "201", GetEntity( "wp_outrod3" ), GetEntity( "wp_outros3" ) );
  1217.             new Iterator:i = Iterate("201");
  1218.             while(ItNext(i))
  1219.             {
  1220.                 new DrID:unit = ItEntity(i);
  1221.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1222.                 {
  1223.                     SetBehav2Ent( unit,    MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  1224.                     Unit = unit;
  1225.                 }
  1226.             }
  1227.             ItStop( i );
  1228.         }
  1229.         case 1005:
  1230.         {
  1231.             Reinforcement( "201", GetEntity( "wp_outrod4" ), GetEntity( "wp_outrod4" ) );
  1232.             CmdGroupStop( "101", Q_OVERRIDE );
  1233.             new Iterator:i = Iterate("201");
  1234.             while(ItNext(i))
  1235.             {
  1236.                 new DrID:unit = ItEntity(i);
  1237.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1238.                 {
  1239.                     SetBehav2Ent( unit,    MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  1240.                     Unit = unit;
  1241.                 }
  1242.             }
  1243.             ItStop( i );
  1244.         }
  1245.         case 1006:
  1246.         {
  1247.             Reinforcement( "301", GetEntity( "wp_jeeps" ), GetEntity( "wp_jeeps" ) );
  1248.             CmdGroupStop( "301", Q_OVERRIDE );
  1249.             new Iterator:i = Iterate("301");
  1250.             while(ItNext(i))
  1251.             {
  1252.                 new DrID:unit = ItEntity(i);
  1253.                 if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1254.                 {
  1255.                     SetBehav2Ent( unit,    MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
  1256.                     Unit = unit;
  1257.                 }
  1258.             }
  1259.             ItStop( i );
  1260.         }
  1261.     }
  1262.     return Unit;
  1263. }
  1264. //============================================================================================================================
  1265. public SpawnControll()
  1266. {
  1267. //     DebugMessage( "SpawnControll", DL_MESSAGE );
  1268. //     DebugMessageP1( "SpawnerNum:", gNewSpawnerNum, DL_MESSAGE );
  1269. //     DebugMessageP1( "ReinfNum:", gNewReinfNum, DL_MESSAGE );
  1270. //     DebugMessageP1( "KonigNum:", gKonigTigerz, DL_MESSAGE );
  1271. //     DebugMessageP1( "SSpantherNum:", gSSpanzernum, DL_MESSAGE );
  1272. //     DebugMessageP1( "Def4Num:", gNewAreaReinf[3], DL_MESSAGE );
  1273. //     DebugMessageP1( "Def3Num:", gNewAreaReinf[2], DL_MESSAGE );
  1274. //     DebugMessageP1( "Def2Num:", gNewAreaReinf[1], DL_MESSAGE );
  1275. //     DebugMessageP1( "Def1Num:", gNewAreaReinf[0], DL_MESSAGE );
  1276.     if((gCounter > 0) && gNewSpawnerNum == 0)
  1277.     {
  1278.          new DrID:unit = GetEntity( gTeleporterName[0] );
  1279.  
  1280.         for(new i = 0; i < gCounter-1; i++)
  1281.         {
  1282.             gTeleporterName[i] = gTeleporterName[i+1];
  1283.         }
  1284.         gCounter--;
  1285.         DebugMessage( "Teleporting..", DL_MESSAGE );
  1286.          CmdMoveToEnt( unit, GetEntity( "deploy1" ), Q_OVERRIDE, MF_TELEPORT );
  1287.  
  1288.         CmdThrowEvent( unit, Q_ENQUEUE, 1 );
  1289. //         new senderStrID[250];
  1290. //         GetPropertyString( unit, "StringID", 200, senderStrID );
  1291. //         ConcatString( senderStrID, 250, "EntityThrowVulnerableEvent:", senderStrID );
  1292. //         DebugMessage( senderStrID, DL_MESSAGE );
  1293.  
  1294.         new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
  1295.          SetSpeedInSelector( "grp_retreaterz", lowestspd );
  1296.         Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, unit );
  1297.         Move("", red, true, Q_ENQUEUE, MF_OVERRUN, unit );
  1298.         Move("", black, true, Q_ENQUEUE, MF_OVERRUN, unit );
  1299.     }
  1300.     else
  1301.     {
  1302. //         DebugMessage( "meg kene hivodnia valamelyik creatornak:", DL_MESSAGE );
  1303. //         DebugMessageP1( "SpawnerNum:", gNewSpawnerNum, DL_MESSAGE );
  1304. //         DebugMessageP1( "ReinfNum:", gNewReinfNum, DL_MESSAGE );
  1305. //         DebugMessageP1( "KonigNum:", gKonigTigerz, DL_MESSAGE );
  1306. //         DebugMessageP1( "SSpantherNum:", gSSpanzernum, DL_MESSAGE );
  1307. //         DebugMessageP1( "Def4Num:", gNewAreaReinf[3], DL_MESSAGE );
  1308. //         DebugMessageP1( "Def3Num:", gNewAreaReinf[2], DL_MESSAGE );
  1309. //         DebugMessageP1( "Def2Num:", gNewAreaReinf[1], DL_MESSAGE );
  1310. //         DebugMessageP1( "Def1Num:", gNewAreaReinf[0], DL_MESSAGE );
  1311.         if(gNewSpawnerNum > 0)
  1312.             {
  1313.             gNewSpawnerNum--;
  1314.             
  1315.             if(gNewReinfNum > 0)
  1316.             {
  1317.                 gNewReinfNum--;
  1318.  
  1319.                 if(gKonigTigerz > 0)
  1320.                 {
  1321.                     gKonigTigerz--;
  1322.                     new DrID:konig = Creator(konigz);
  1323.                     Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, konig );
  1324.                     Move("", red, true, Q_ENQUEUE, MF_OVERRUN, konig );
  1325.                     Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, konig );
  1326.                 }
  1327.                 else
  1328.                 {
  1329.                     if(gSSpanzernum > 0)
  1330.                     {
  1331.                         gSSpanzernum--;
  1332.                         new DrID:sspanzer = Creator(SSpanzer)
  1333.                         Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, sspanzer );
  1334.                         Move("", brown, true, Q_ENQUEUE, MF_OVERRUN, sspanzer );
  1335.                         Move("", radio, true, Q_ENQUEUE, MF_OVERRUN, sspanzer );
  1336.                     }
  1337.                     else
  1338.                     {    
  1339.                         if(gV1 > 0)
  1340.                         {
  1341.                             gV1--;    
  1342.                             new DrID:V1 = Creator(v1);
  1343.                             Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, V1 );
  1344.                             Move("", red, true, Q_ENQUEUE, MF_OVERRUN, V1 );
  1345.                             Move("", black, true, Q_ENQUEUE, MF_OVERRUN, V1 );
  1346.                             AddAKEntityEvent( "V1CapturedOrDied", V1, UNIT_TEAM_CHANGED );
  1347.                         }
  1348.                         else
  1349.                         {
  1350.                             if(gNewAreaReinf[3] > 0)
  1351.                             {
  1352.                                 gNewAreaReinf[3]--;
  1353.                                 new DrID:def4unit = Creator(reinforce);
  1354.                                 AddToGroup( "grp_defender4", def4unit );
  1355.                                 Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def4unit );
  1356.                                 Move("", red, true, Q_ENQUEUE, MF_OVERRUN, def4unit );
  1357.                                 Move("", blue, true, Q_ENQUEUE, MF_OVERRUN, def4unit );
  1358.                             }
  1359.                             else
  1360.                             {
  1361.                                 if(gNewAreaReinf[2] > 0)
  1362.                                 {
  1363.                                     gNewAreaReinf[2]--;
  1364.                                     new DrID:def3unit = Creator(reinforce);
  1365.                                     AddToGroup( "grp_defender3", def3unit );
  1366.                                     Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def3unit );
  1367.                                     Move("", red, true, Q_ENQUEUE, MF_OVERRUN, def3unit );
  1368.                                     Move("", green, true, Q_ENQUEUE, MF_OVERRUN, def3unit );
  1369.                                 }                
  1370.                                 else
  1371.                                 {
  1372.                                     if(gNewAreaReinf[1] > 0)
  1373.                                     {
  1374.                                         gNewAreaReinf[1]--;
  1375.                                         new DrID:def2unit = Creator(reinforce);
  1376.                                         AddToGroup( "grp_defender2", def2unit );
  1377.                                         Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def2unit );
  1378.                                         Move("", turkiz, true, Q_ENQUEUE, MF_OVERRUN, def2unit );
  1379.                                     }
  1380.                                     else
  1381.                                     {
  1382.                                         if(gNewAreaReinf[0] > 0)
  1383.                                         {
  1384.                                             gNewAreaReinf[0]--;
  1385.                                             new DrID:def1unit = Creator(reinforce);
  1386.                                             AddToGroup( "grp_defender1", def1unit );
  1387.                                             Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def1unit );
  1388.                                             Move("", brown, true, Q_ENQUEUE, MF_OVERRUN, def1unit );
  1389.                                         }
  1390.                                     }
  1391.                                 }
  1392.                             }
  1393.                         }
  1394.                     }
  1395.                 }
  1396.             }
  1397.             else
  1398.             {
  1399.                 new DrID:Unit = Creator(retreat);
  1400.                 Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, Unit );
  1401.                 Move("", red, true, Q_ENQUEUE, MF_OVERRUN, Unit );
  1402.                 Move("", black, true, Q_ENQUEUE, MF_OVERRUN, Unit );
  1403.             }
  1404.         }
  1405.     }
  1406. }
  1407. //============================================================================================================================
  1408. public UnitDiedFromDef1(DrID:unit)
  1409. {
  1410.     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1411.     {
  1412.         if(gStaticReinfNum <= 12)
  1413.         {
  1414.             gNewSpawnerNum++;
  1415.             gNewReinfNum++;
  1416.             gNewAreaReinf[0]++;
  1417.         }
  1418.         else
  1419.             RemoveEvent( "UnitDiedFromDef1" );
  1420.     }
  1421. }
  1422. public UnitDiedFromDef2(DrID:unit)
  1423. {
  1424.     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1425.     {
  1426.         if(gStaticReinfNum <= 12)
  1427.         {
  1428.             gNewSpawnerNum++;
  1429.             gNewReinfNum++;
  1430.             gNewAreaReinf[1]++;
  1431.         }
  1432.         else
  1433.             RemoveEvent( "UnitDiedFromDef2" );
  1434.     }
  1435. }
  1436. public UnitDiedFromDef3(DrID:unit)
  1437. {
  1438.     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1439.     {
  1440.         if(gStaticReinfNum <= 12)
  1441.         {
  1442.             gNewSpawnerNum++;
  1443.             gNewReinfNum++;
  1444.             gNewAreaReinf[2]++;
  1445.         }
  1446.         else
  1447.             RemoveEvent( "UnitDiedFromDef3" );
  1448.     }
  1449. }
  1450. public UnitDiedFromDef4(DrID:unit)
  1451. {
  1452.     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  1453.     {
  1454.         if(gStaticReinfNum <= 12)
  1455.         {
  1456.             gNewSpawnerNum++;
  1457.             gNewReinfNum++;
  1458.             gNewAreaReinf[3]++;
  1459.         }
  1460.         else
  1461.             RemoveEvent( "UnitDiedFromDef4" );
  1462.     }
  1463. }
  1464. //============================================================================================================================
  1465. public UnitThrowMsg(DrID:sender, param)
  1466. {
  1467.     switch(param)
  1468.     {
  1469.         case 1: 
  1470.         {
  1471.             new group[100];
  1472.             GetPropertyString( sender, "Group", 200, group );
  1473.             if(CompareString( group, ",grp_v1") == 0)
  1474.             {
  1475.                 if(RunOnce[4] == false)
  1476.                 {
  1477.                     RunOnce[4] = true;
  1478.                     SetObjectiveState( "SEC_1", OS_FAILED );
  1479.                 }
  1480.                 CmdMoveToEnt( sender, GetEntity( "wp_parking" ), Q_OVERRIDE, MF_TELEPORT );
  1481.             }
  1482.             else
  1483.             {    
  1484. //                 new senderStrID[250];
  1485. //                 GetPropertyString( sender, "StringID", 200, senderStrID );
  1486. //                 ConcatString( senderStrID, 250, "Entity Vulnerable:", senderStrID );
  1487. //                 DebugMessage( senderStrID, DL_MESSAGE );
  1488.                 MakeVulnerable(sender);
  1489.             }
  1490.         }
  1491.         case 2: 
  1492.         {
  1493. //             new senderStrID[250];
  1494. //             GetPropertyString( sender, "StringID", 200, senderStrID );
  1495. //             ConcatString( senderStrID, 250, "Entity Invulnerable:", senderStrID );
  1496. //             DebugMessage( senderStrID, DL_MESSAGE );
  1497.             MakeInvulnerable(sender);
  1498.         }
  1499.         case 3:
  1500.         {
  1501.             new group[100];
  1502.             GetPropertyString( sender, "Group", 200, group );
  1503.             if(RunOnce[1] == false &&CompareString( group, ",grp_konigz,grp_German") == 0)
  1504.             {
  1505.                 RunOnce[1] = true;
  1506.                 SetCutScene(true, true, true);
  1507.                 BulletTime( sender, false, true, false, 10.0, 20.0 );
  1508.                 AddUserEvent( "BulletTimeEnded", UE_BULLETTIME_END );
  1509.             }
  1510.             if(RunOnce[3] == false && CompareString( group, ",grp_v1,grp_German") == 0)
  1511.             {
  1512.                 RunOnce[3] = true;
  1513.                 SetCutScene(true, true, true);
  1514.                 BulletTime( sender, true, true, false, 10.0, 20.0);
  1515.                 AddUserEvent( "AddSecondaryObj", UE_BULLETTIME_END );
  1516.                 AddUserEvent( "BulletTimeEnded", UE_BULLETTIME_END );
  1517.             }
  1518.         }
  1519.         case 5:
  1520.         {
  1521.             if(IsInSelector( sender, "grp_sspanzerz" ))
  1522.                 return;
  1523.             else
  1524.             {
  1525.                 CmdTurnToEnt( sender, GetEntity( "wp_dir1" ), Q_OVERRIDE );
  1526.                 CmdDigin(sender, Q_ENQUEUE);
  1527.             }
  1528.         }
  1529.         case 6:
  1530.         {
  1531.             CmdTurnToEnt( sender, GetEntity( "wp_dir2" ), Q_OVERRIDE );
  1532.             CmdDigin(sender, Q_ENQUEUE);
  1533.         }
  1534.         case 7:
  1535.         {
  1536.             CmdTurnToEnt( sender, GetEntity( "wp_dir3" ), Q_OVERRIDE );
  1537.             CmdDigin(sender, Q_ENQUEUE);
  1538.         }
  1539.         case 8:
  1540.         {
  1541.             CmdTurnToEnt( sender, GetEntity( "wp_dir4" ), Q_OVERRIDE );
  1542.             CmdDigin(sender, Q_ENQUEUE);
  1543.         }
  1544.         case 9:
  1545.         {
  1546.             new Float:MaxSpeed = GetPropertyFloat( GetBaseComponentBase(GetBaseEntity(sender), "cUnitControllerBase"), "MaxSpeedRun");
  1547.             SetPropertyFloat( GetComponent( sender, "cUnitController" ), "SpeedOverride", MaxSpeed );
  1548.  
  1549.             new strid[200];
  1550.             new maxspd[200];
  1551.             Float2Str( MaxSpeed, maxspd, 200 );
  1552.             GetPropertyString( sender, "StringID", 200, strid );
  1553.         }
  1554.         case 10:
  1555.         {
  1556.             if(gRadioTowerDestroyed == false && (GetPropertyInt( GetEntity( "radiotower" ), "Team" ) != gPlayerTeam || GetPropertyInt( GetEntity( "radiotower" ), "Team" ) != 1))
  1557.             {
  1558.                 new mountedsoldierz = MountedPlaceNr(sender)
  1559.                 if(mountedsoldierz > 1)
  1560.                 {
  1561.                     new DrID:SoldierAddress = GetArrayElement ( GetComponent( sender, "cMountPoint"), "Mounted", 0);
  1562.                     new DrID:ActualSoldier = GetPropertyObject ( SoldierAddress, "Soldier");
  1563.                     CmdUnmount( ActualSoldier, Q_OVERRIDE );
  1564.                     CmdMount( ActualSoldier, Q_ENQUEUE, GetEntity( "radiotower" ) );
  1565.                 }
  1566.             }
  1567.  
  1568.             if(gRadioTowerDestroyed == false && GetPropertyInt( GetEntity( "radiotower" ), "Team" ) == gPlayerTeam)
  1569.                 CmdAttack( sender, Q_OVERRIDE, GetEntity( "radiotower" ) );
  1570.                     
  1571.         }
  1572.         case 11:
  1573.         {
  1574.             if(RunOnce[6] == false)
  1575.             {
  1576.                 RunOnce[6] = true;
  1577.                 SetObjectiveState( "SEC_4", OS_FAILED );
  1578.             }
  1579.         }
  1580.         case 333:
  1581.         {
  1582.             CmdMoveToEnt( GetEntity( "jeep" ), GetEntity( "wp_jeep_seged" ), Q_OVERRIDE, MF_RUN|MF_OVERRUN );
  1583.             CmdMoveToEnt( GetEntity( "jeep" ), GetEntity( "area_teleport" ), Q_ENQUEUE, MF_DIRECT );
  1584.             AddTimerEvent( "Outro", 10.0, "GameLogic", true);
  1585.         }
  1586.         case 555:
  1587.         {
  1588.             CmdStop( GetEntity( "firefly1" ), Q_OVERRIDE );
  1589.             CmdStop( GetEntity( "firefly2" ), Q_OVERRIDE );
  1590.             CmdStop( GetEntity( "firefly3" ), Q_OVERRIDE );
  1591.             CmdStop( GetEntity( "firefly4" ), Q_OVERRIDE );
  1592.             SetAlliance( gPlayerTeam, 1, AL_NEUTRAL );
  1593.             SetAlliance( 1, gPlayerTeam, AL_NEUTRAL );
  1594.             CmdMoveToEnt( GetEntity( "jeep" ), GetEntity( "wp_jeepd" ), Q_ENQUEUE, MF_NONE );
  1595.             CmdThrowEvent( GetEntity( "jeep" ), Q_ENQUEUE, 777 );
  1596.             AddTimerEvent( "Outro", 1.0, "GameLogic", true);
  1597.         }
  1598.         case 777:
  1599.         {
  1600.             CmdStop( sender, Q_OVERRIDE );
  1601.             Outro();
  1602.         }
  1603.         case 1000:
  1604.         {
  1605.             CmdGroupStop( "grp_canadians", Q_OVERRIDE );
  1606.         }
  1607.     }
  1608. }
  1609. //============================================================================================================================
  1610. public HQCaptured(DrID:hq)
  1611. {
  1612.     if(RunOnce[0] == false && GetPropertyInt( hq, "Team" ) == gPlayerTeam)
  1613.     {
  1614.         RunOnce[0] = true;
  1615.         RemoveEvent( "RetreaterDied" );
  1616.         RemoveEvent( "UnitDiedFromDef1" );
  1617.         RemoveEvent( "UnitDiedFromDef2" );
  1618.         RemoveEvent( "UnitDiedFromDef3" );
  1619.         RemoveEvent( "UnitDiedFromDef4" );
  1620.         SetObjectiveState( "HID_1", OS_IN_PROGRESS );
  1621.         AddTimerEvent( "delayedKonigz", 10.0, "GameLogic", true );
  1622. //         if(gSecTimerRunning == false)
  1623. //             AddTimerEvent( "SecondaryTimerRunner", 1.0, "GameLogic", true );
  1624.  
  1625.         SetCountDown( -1 );
  1626.         AddTimerEvent( "_NewTimer", 3.0, "GameLogic", true);
  1627.         new counter = 0;
  1628.         new Iterator:i = Iterate( "grp_defender3" );
  1629.         while(ItNext( i ))
  1630.         {
  1631.             new DrID:unit = ItEntity( i );
  1632.             new DrID:closest = GetNearestEntity(unit,"grp_defender3");
  1633.             RemoveFromGroup( "grp_defender3", closest );
  1634.             
  1635.             new state = GetPropertyInt( GetComponent( closest, "cDiginController"), "DiginState" );
  1636.             if(state == 1)
  1637.             {
  1638.                 CmdDigout(closest, Q_OVERRIDE);
  1639.                 SetBehav2Ent( closest,    MB_MOVE_FREELY);
  1640.                 CmdWait( closest, Q_ENQUEUE, counter*20 );
  1641.                 Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
  1642.                 counter++;
  1643.             }
  1644.             else
  1645.                 Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
  1646.         }
  1647.         ItStop( i );
  1648.  
  1649.         
  1650.         counter = 0;
  1651.         new Iterator:k = Iterate( "grp_defender4" );
  1652.         while(ItNext( k ))
  1653.         {
  1654.             new DrID:unit = ItEntity( k );
  1655.             new DrID:closest = GetNearestEntity(unit,"grp_defender4");
  1656.             RemoveFromGroup( "grp_defender3", closest );
  1657.  
  1658.             new state = GetPropertyInt( GetComponent( closest, "cDiginController"), "DiginState" );
  1659.             if(state == 1)
  1660.             {
  1661.                 CmdDigout(closest, Q_OVERRIDE);
  1662.                 SetBehav2Ent( closest,    MB_MOVE_FREELY);
  1663.                 CmdWait( closest, Q_ENQUEUE, counter*20 );
  1664.                 Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
  1665.                 counter++;
  1666.             }
  1667.             else
  1668.                 Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
  1669.         }
  1670.         ItStop( k );
  1671.     }
  1672.     if(GetPropertyInt( GetEntity( "hq" ), "Team" ) != gPlayerTeam)
  1673.     {
  1674.         SetObjectiveState( "PRI_1", OS_FAILED );    
  1675.         if(GetObjectiveState( "SEC_1" ) == OS_IN_PROGRESS)
  1676.             SetObjectiveState( "SEC_1", OS_FAILED );
  1677.         SetCutScene(true, false, false);
  1678.         BulletTime( GetEntity( "hq" ), false);
  1679.         AddUserEvent( "Defeat", UE_BULLETTIME_END );
  1680.     }
  1681. }
  1682. //============================================================================================================================
  1683. public AddSecondaryObj()
  1684. {
  1685.     RemoveEvent( "AddSecondaryObj" );
  1686.     SetObjectiveState( "SEC_1", OS_IN_PROGRESS );
  1687. }
  1688. //============================================================================================================================
  1689. public CountDownDone()
  1690. {
  1691. //     if(gSecTimerRunning == false)
  1692. //     {
  1693.     RemoveEvent( "CountDownDone" );
  1694.     if(GetPropertyInt( GetEntity( "hq" ), "Team" ) == gPlayerTeam)
  1695.     {
  1696.         SetCountDown( -1 );
  1697.         SetObjectiveState( "PRI_1", OS_COMPLETED );
  1698.         if(GetObjectiveState( "SEC_1" ) == OS_IN_PROGRESS)
  1699.             SetObjectiveState( "SEC_1", OS_FAILED );
  1700.         Outro();
  1701.     }
  1702.     else
  1703.     {
  1704.         SetCountDown( -1 );
  1705.         SetCutScene(true, true, true);
  1706.         BulletTime( GetEntity( "hq" ), false, false, true, 15.0, 30.0 );
  1707.         AddUserEvent( "Defeat", UE_BULLETTIME_END );
  1708.         SetObjectiveState( "PRI_1", OS_FAILED );
  1709.         if(GetObjectiveState( "SEC_1" ) == OS_IN_PROGRESS)
  1710.             SetObjectiveState( "SEC_1", OS_FAILED );
  1711.      }
  1712. //     ShowShortMessage( "#iMS12_MSG001#" );
  1713. }
  1714. //============================================================================================================================
  1715. // public SecondaryTimerRunner()
  1716. // {
  1717. //     if(RunOnce[5] == false)
  1718. //     {
  1719. //         RunOnce[5] = true;
  1720. //         gSecTimerRunning = true;
  1721. //     }
  1722. //     static counter = overtime;
  1723. //     new Min;
  1724. //     new Sec;
  1725. //     Min = counter/60;
  1726. //     Sec = counter-(Min*60);
  1727. //     new sMin[50];
  1728. //     new sSec[50];
  1729. //     new Red[] = "#d##cred#";
  1730. //     new White[] = "#d##cwhite#";
  1731. //     new nullMin[] = "0";
  1732. //     new nullSec[] = "0";
  1733. //     
  1734. //     Int2Str( Min, sMin, 10 );
  1735. //     Int2Str( Sec, sSec, 10 );
  1736. //     ConcatString( sMin, 40, nullMin, sMin );    
  1737. //     if(Sec < 10)
  1738. //         ConcatString( sSec, 40, nullSec, sSec );    
  1739. //     
  1740. //     if(counter <=60)
  1741. //     {
  1742. //         static bool:szinvalto = true;
  1743. //         if(szinvalto == true)
  1744. //         {
  1745. //             szinvalto = false;
  1746. //             ConcatString( sMin, 40, Red, sMin );
  1747. //             ConcatString( sSec, 40, Red, sSec );
  1748. //         }    
  1749. //         else
  1750. //         {
  1751. //             szinvalto = true;
  1752. //             ConcatString( sMin, 40, White, sMin );
  1753. //             ConcatString( sSec, 40, White, sSec );
  1754. //         }
  1755. //     }
  1756. //     else
  1757. //     {
  1758. //         ConcatString( sMin, 40, White, sMin );
  1759. //         ConcatString( sSec, 40, White, sSec );
  1760. //     }
  1761. //         
  1762. //     ConcatString( sMin, 40, sMin, "#d##cwhite#:" );
  1763. //     ConcatString( sMin, 40, sMin, sSec );
  1764. //     if(counter == 0)
  1765. //     {
  1766. //         if(GetPropertyInt( GetEntity( "hq" ), "Team" ) == gPlayerTeam)
  1767. //         {
  1768. //             SetObjectiveState( "PRI_1", OS_COMPLETED );
  1769. //             Outro();
  1770. //         }
  1771. //     }
  1772. //     SetShortInfo(sMin);
  1773. //     counter--;
  1774. // }
  1775. //============================================================================================================================
  1776. public V1CapturedOrDied(DrID:unit)
  1777. {
  1778.     static counter = 0;
  1779.     if(GetPropertyInt( unit, "Team" )== gPlayerTeam || GetPropertyInt( unit, "Team" ) == 0)
  1780.     {
  1781.         counter++;
  1782.         if(GetDifficulty() == 0 && counter == 2)
  1783.         {
  1784.             SetObjectiveState( "SEC_1", OS_COMPLETED );
  1785.             RemoveEvent( "V1CapturedOrDied" );
  1786.         }    
  1787.  
  1788.         if(GetDifficulty() == 3 && counter == 5)
  1789.         {
  1790.             SetObjectiveState( "SEC_1", OS_COMPLETED );
  1791.             RemoveEvent( "V1CapturedOrDied" );
  1792.         }    
  1793.  
  1794.         if(GetDifficulty() != 0 && GetDifficulty() != 3 && counter == 3)
  1795.         {
  1796.             SetObjectiveState( "SEC_1", OS_COMPLETED );
  1797.             RemoveEvent( "V1CapturedOrDied" );
  1798.         }    
  1799.     }
  1800. }
  1801. //============================================================================================================================
  1802. public UnitDamagedFromDef1(DrID:unit)
  1803. {
  1804.     if(GetPropertyInt( unit, "Team" ) == 1)
  1805.     {
  1806.         new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
  1807.         new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
  1808.     
  1809.         if(ActHP <= MaxHP/1.5)
  1810.         {
  1811.             new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
  1812.             if(state == 1)
  1813.             {
  1814.                 CmdDigout(unit, Q_OVERRIDE);
  1815.                 SetBehav2Ent( unit,    MB_MOVE_FREELY);
  1816.             }
  1817.         }
  1818.     }
  1819. }
  1820. //============================================================================================================================
  1821. public UnitDamagedFromDef2(DrID:unit)
  1822. {
  1823.     if(GetPropertyInt( unit, "Team" ) == 1)
  1824.     {
  1825.         new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
  1826.         new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
  1827.     
  1828.         if(ActHP <= MaxHP/1.5)
  1829.         {
  1830.             new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
  1831.             if(state == 1)
  1832.             {
  1833.                 CmdDigout(unit, Q_OVERRIDE);
  1834.                 SetBehav2Ent( unit,    MB_MOVE_FREELY);
  1835.             }
  1836.         }
  1837.     }
  1838. }
  1839. //============================================================================================================================
  1840. public UnitDamagedFromDef3(DrID:unit)
  1841. {
  1842.     if(GetPropertyInt( unit, "Team" ) == 1)
  1843.     {
  1844.         new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
  1845.         new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
  1846.     
  1847.         if(ActHP <= MaxHP/1.5)
  1848.         {
  1849.             new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
  1850.             if(state == 1)
  1851.             {
  1852.                 CmdDigout(unit, Q_OVERRIDE);
  1853.                 SetBehav2Ent( unit,    MB_MOVE_FREELY);
  1854.             }
  1855.         }
  1856.     }
  1857. }
  1858. //============================================================================================================================
  1859. public UnitDamagedFromDef4(DrID:unit)
  1860. {
  1861.     if(GetPropertyInt( unit, "Team" ) == 1)
  1862.     {
  1863.         new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
  1864.         new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
  1865.     
  1866.         if(ActHP <= MaxHP/1.5)
  1867.         {
  1868.             new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
  1869.             if(state == 1)
  1870.             {
  1871.                 CmdDigout(unit, Q_OVERRIDE);
  1872.                 SetBehav2Ent( unit,    MB_MOVE_FREELY);
  1873.             }
  1874.         }
  1875.     }
  1876. }
  1877. //============================================================================================================================
  1878. public TurretDestroyed(DrID:Unit)
  1879. {
  1880.     new stringID[200];
  1881.     new tmpstr[250];
  1882.     GetPropertyString( Unit, "StringID", 200, stringID );
  1883.     ConcatString( tmpstr, 200, "Turret destroyed:", stringID );    
  1884. //     ShowShortMessage( tmpstr );
  1885. }
  1886. public CaterpillarDestroyed(DrID:Unit)
  1887. {
  1888. //     new stringID[200];
  1889. //     new tmpstr[250];
  1890. //     GetPropertyString( Unit, "StringID", 200, stringID );
  1891. //     ConcatString( tmpstr, 200, "Caterpillar destroyed:", stringID );    
  1892. //     DebugMessage( stringID, DL_MESSAGE );
  1893.     CmdStop( Unit, Q_OVERRIDE );
  1894.     MakeVulnerable(Unit);
  1895. }
  1896. //============================================================================================================================
  1897. public TickTack()
  1898. {
  1899.     static counter = 0;
  1900.     counter++;
  1901.     
  1902.     if(counter == 600)
  1903.     {
  1904.         Reinforcement( "polish", GetEntity( "deploy_polish" ), GetEntity( "deploy_polish" ) );
  1905.         SetNationality("polish_reinf", "Polish");
  1906.         ReinforceDelayer("polish_reinf");
  1907.         Groupremover("polish_reinf");
  1908.     }
  1909.     if(counter == 900)
  1910.         Reinforcement( "usa", GetEntity( "deploy_usa" ), GetEntity( "start_usa" ) );
  1911.     
  1912.     if(counter == 1200)
  1913.     {
  1914.         RemoveEvent( "TickTack" );
  1915.         Reinforcement( "polish", GetEntity( "deploy_polish" ), GetEntity( "deploy_polish" ) );
  1916.         CmdGroupMoveToEnt( "polish_reinf", GetEntity( "wpb1" ), Q_OVERRIDE, MF_NONE, 1.0 );
  1917.         CmdGroupMoveToEnt( "polish_reinf", GetEntity( "start_polish" ), Q_ENQUEUE, MF_NONE );
  1918.         SetNationality("polish_reinf", "Polish");
  1919.         ReinforceDelayer("polish_reinf");
  1920.         Groupremover("polish_reinf");
  1921.     }
  1922. }
  1923. //============================================================================================================================
  1924. public RadioTowerCaptured(DrID:tower)
  1925. {
  1926.     if(RunOnce[9] == false && GetPropertyInt( tower, "Team" ) == gPlayerTeam)
  1927.     {
  1928.         RunOnce[9] = true;
  1929.         SetObjectiveState( "SEC_2", OS_COMPLETED );
  1930.         SetObjectiveState( "SEC_3", OS_IN_PROGRESS );
  1931.         GiveParaTroopers(gPlayerTeam);            
  1932.         switch(GetDifficulty())
  1933.         {
  1934.             case 0:
  1935.             {
  1936.                 gNewSpawnerNum+=1;
  1937.                 gNewReinfNum+=1;
  1938.                 gSSpanzernum = 1;
  1939.                 gStaticSSpanzernum = 1;
  1940.             }
  1941.             case 3:
  1942.             {
  1943.                 gNewSpawnerNum+=5;
  1944.                 gNewReinfNum+=5;
  1945.                 gSSpanzernum = 5;
  1946.                 gStaticSSpanzernum = 5;
  1947.             }
  1948.             default:
  1949.             {
  1950.                 gNewSpawnerNum+=3;
  1951.                 gNewReinfNum+=3;
  1952.                 gSSpanzernum = 3;
  1953.                 gStaticSSpanzernum = 3;
  1954.             }
  1955.         }
  1956.         
  1957.         
  1958.         AddSoundMessage("#iMS12_SP011#", gSoundFile11);
  1959.         AddSoundMessage("#iMS12_SP012#", gSoundFile12);
  1960.         AddSoundMessage("#iMS12_SP013#", gSoundFile13);
  1961.     }            
  1962.     if(RunOnce[10] == false && GetPropertyInt( tower, "Team" ) == 1)
  1963.     {
  1964.         RemoveEvent( "RadioTowerDestroyed" );
  1965.         RunOnce[10] = true;
  1966.         Move("grp_sspanzerz", bridge, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE );
  1967.         if(GetObjectiveState( "SEC_3" ) == OS_IN_PROGRESS)
  1968.             SetObjectiveState( "SEC_3", OS_FAILED );
  1969.         SetObjectiveState( "SEC_4", OS_IN_PROGRESS );
  1970.     }
  1971. }
  1972. //============================================================================================================================
  1973. public RadioTowerDestroyed()
  1974. {
  1975.     RemoveEvent( "RadioTowerDestroyed" );
  1976.     gRadioTowerDestroyed = true;
  1977.     if(GetObjectiveState( "SEC_2" ) == OS_IN_PROGRESS)
  1978.         SetObjectiveState( "SEC_2", OS_COMPLETED );
  1979.     else
  1980.     {
  1981.         if(GetObjectiveState( "SEC_3" ) == OS_IN_PROGRESS)
  1982.         {
  1983.             SetObjectiveState( "SEC_3", OS_FAILED );
  1984.             if(gSSpanzerzDestroyed == false)
  1985.                 Move("grp_sspanzerz", bridge, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE );
  1986.             SetObjectiveState( "SEC_4", OS_IN_PROGRESS );
  1987.         }
  1988.     }
  1989. }
  1990. //============================================================================================================================
  1991. public delayedV1()
  1992. {
  1993.     RemoveEvent( "delayedV1" );
  1994.  
  1995.     switch(GetDifficulty())
  1996.     {
  1997.         case 0:
  1998.         {
  1999.             gNewSpawnerNum+=2;
  2000.             gNewReinfNum+=2;
  2001.             gV1 = 2;
  2002.         }
  2003.         case 3:
  2004.         {
  2005.             gNewSpawnerNum+=5;
  2006.             gNewReinfNum+=5;
  2007.             gV1 = 5;
  2008.         }
  2009.         default:
  2010.         {
  2011.             gNewSpawnerNum+=3;
  2012.             gNewReinfNum+=3;
  2013.             gV1 = 3;
  2014.         }
  2015.     }
  2016. }
  2017. //============================================================================================================================
  2018. public delayedKonigz()
  2019. {
  2020.     RemoveEvent( "delayedKonigz" );
  2021.     switch(GetDifficulty())
  2022.     {
  2023.         case 3:
  2024.         {
  2025.             gNewSpawnerNum+=2;
  2026.             gNewReinfNum+=2;
  2027.             gKonigTigerz = 2;
  2028.         }
  2029.         default:
  2030.         {
  2031.             gNewSpawnerNum+=1;
  2032.             gNewReinfNum+=1;
  2033.             gKonigTigerz = 1;
  2034.         }
  2035.     }
  2036. }
  2037. //============================================================================================================================
  2038. public SSPanzerzDiedOrCaptured()
  2039. {
  2040.     gStaticSSpanzernum--;
  2041.     if(gStaticSSpanzernum == 0)
  2042.     {
  2043.         gSSpanzerzDestroyed = true;
  2044.         if(GetObjectiveState( "SEC_3" ) == OS_IN_PROGRESS)
  2045.             SetObjectiveState( "SEC_3", OS_COMPLETED );
  2046.         if(GetObjectiveState( "SEC_4" ) == OS_IN_PROGRESS)
  2047.             SetObjectiveState( "SEC_4", OS_COMPLETED );
  2048.         Reinforcement( "polish", GetEntity( "deploy_polish" ), GetEntity( "deploy_polish" ) );
  2049.         SetNationality("polish_reinf", "Polish");
  2050.         ReinforceDelayer("polish_reinf");
  2051.         Groupremover("polish_reinf");
  2052.         AddSoundMessage("#iMS12_SP021#", gSoundFile21);
  2053.         GiveAirStrike(gPlayerTeam);
  2054.     }
  2055. }
  2056. //============================================================================================================================
  2057. public ArtilleryStrikeSoundMessage()
  2058. {
  2059.     if(gArtilleryStrikeMessage == true)
  2060.         AddSoundMessage("#iMS12_SP001#", gSoundFile1);
  2061.  
  2062.     if(RunOnce[7] == false)
  2063.     {
  2064.         RunOnce[7] = true;
  2065.         AddTimerEvent( "SoundMessageEnabled", 10.0, "GameLogic", true );
  2066.     }
  2067. }
  2068. //============================================================================================================================
  2069. public RemoveSoundMessage()
  2070. {
  2071.     RemoveEvent( "RemoveSoundMessage" );
  2072.     RemoveEvent( "ArtilleryStrikeSoundMessage" );
  2073. }
  2074. //============================================================================================================================
  2075. public SoundMessageEnabled()
  2076. {
  2077.     gArtilleryStrikeMessage = false;
  2078. }
  2079. //============================================================================================================================
  2080. public DeactivateEntityz()
  2081. {
  2082.     new Iterator:i = Iterate( "area_outro" );
  2083.     while(ItNext( i ))
  2084.     {
  2085.         new DrID:unit = ItEntity( i );
  2086.         if((GetPropertyInt( unit, "Team" ) == gPlayerTeam || 
  2087.             GetPropertyInt( unit, "Team" ) == 1 ||
  2088.             GetPropertyInt( unit, "Team" ) == 0)
  2089.             && (IsInstanceOf( unit, GetClassID( "cVehicle" ))
  2090.             || IsInstanceOf( unit, GetClassID( "cSoldier" ))))
  2091.         {    
  2092.             SetPropertyBool( unit, "Survivor", true );
  2093.             HideEntity( unit );
  2094.             DeActivateEntity( unit );
  2095.         }
  2096.     }
  2097.     ItStop( i );
  2098. }
  2099. //============================================================================================================================
  2100. public UnitTeamChanged(DrID:unit, LastTeam)
  2101. {
  2102.     if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
  2103.     {
  2104.         if(GetPropertyInt( unit, "Team" ) == gPlayerTeam && LastTeam == 1)
  2105.             SetPropertyString( unit, "Group", "" );
  2106.     }
  2107. }
  2108. //============================================================================================================================
  2109. public Victory()
  2110. {
  2111.     new bool:tigerismycat = false;
  2112.     new Iterator:i = Iterate("grp_konigz");
  2113.     while(ItNext( i ))
  2114.     {
  2115.         if(GetPropertyInt( ItEntity( i ), "Team" ) == gPlayerTeam)
  2116.             tigerismycat = true
  2117.     }
  2118.     ItStop( i );
  2119.     if(tigerismycat == true)
  2120.         SetObjectiveState( "HID_1", OS_COMPLETED );
  2121.     else
  2122.         SetObjectiveState( "HID_1", OS_FAILED );
  2123.  
  2124.     SetAlliance( gPlayerTeam, 1, AL_ENEMY );
  2125.     SetAlliance( 1, gPlayerTeam, AL_ENEMY );
  2126.     AddDebriefing("#iMISSION12_DB_P#");
  2127.     EndMission( MS_ACCOMPLISHED );
  2128. }
  2129. public Defeat()
  2130. {
  2131.     new bool:tigerismycat = false;
  2132.     new Iterator:i = Iterate("grp_konigz");
  2133.     while(ItNext( i ))
  2134.     {
  2135.         if(GetPropertyInt( ItEntity( i ), "Team" ) == gPlayerTeam)
  2136.             tigerismycat = true
  2137.     }
  2138.     ItStop( i );
  2139.     if(tigerismycat == true)
  2140.         SetObjectiveState( "HID_1", OS_COMPLETED );
  2141.     else
  2142.         SetObjectiveState( "HID_1", OS_FAILED );
  2143.  
  2144.     SetAlliance( gPlayerTeam, 1, AL_ENEMY );
  2145.     SetAlliance( 1, gPlayerTeam, AL_ENEMY );
  2146.     AddDebriefing("#iMISSION_DB_F#");
  2147.     EndMission( MS_FAILED );
  2148. }
  2149.  
  2150. // public CaterpillarDest()
  2151. // {
  2152. //     new Iterator:i = Iterate( "Selection" );
  2153. //     while(ItNext( i ))
  2154. //     {
  2155. //         new DrID:DRComp = GetComponent( ItEntity( i ), "cDRVehicle");
  2156. //         SetPropertyFloat( DRComp, "CaterpillarPercent", 0.0 );
  2157. //     }
  2158. //     ItStop( i );
  2159. // }
  2160. // 
  2161. // public TurretDest()
  2162. // {
  2163. //     new Iterator:i = Iterate( "Selection" );
  2164. //     while(ItNext( i ))
  2165. //     {
  2166. //         new DrID:DRComp = GetComponent( ItEntity( i ), "cDRVehicle");
  2167. //         SetPropertyFloat( DRComp, "TurretPercent", 0.0 );
  2168. //     }
  2169. //     ItStop( i );
  2170. // }
  2171.  
  2172.  
  2173. public PrevLevelHiddenCom()
  2174. {
  2175.     RemoveEvent( "PrevLevelHiddenCom" );
  2176.     AddSoundMessage("#iMS12_SP020#", gSoundFile20);
  2177. }
  2178.  
  2179. public Add2GermanGroup()
  2180. {
  2181.     new Iterator:i = Iterate( "SelectorTeam1" );
  2182.     while(ItNext( i ))
  2183.     {
  2184.         if(IsInstanceOf( ItEntity( i ), GetClassID( "cVehicle" )))
  2185.             AddToGroup( "grp_German", ItEntity( i ) );
  2186.     }
  2187.     ItStop( i );
  2188.  
  2189. }
  2190. public ScenarioMode()
  2191. {
  2192.     new Iterator:i = Iterate( "StartingPlayerUnits" );
  2193.     while(ItNext( i ))
  2194.     {
  2195.         AddToGroup( "grp_intro1", ItEntity( i ) );
  2196.     }
  2197.     ItStop( i );
  2198. }
  2199. //============================================================================================================================
  2200. public SetNationality(group[], nationality[])
  2201. {
  2202.     new Iterator:i = Iterate( group );
  2203.  
  2204.     while(ItNext(i))
  2205.     {
  2206.         new DrID:Unit = ItEntity(i);
  2207.         SetPropertyString( Unit, "Nationality", nationality );
  2208.     }
  2209. }
  2210. //============================================================================================================================
  2211. public Groupremover(group[])
  2212. {
  2213.     new Iterator:i = Iterate(group)
  2214.     while(ItNext(i))
  2215.     {
  2216.         RemoveFromGroup( group, ItEntity(i));
  2217.     }
  2218.     ItStop(i);
  2219. }
  2220. //============================================================================================================================
  2221. public GlobalGroupRemover(DrID:Unit)
  2222. {
  2223.     GroupRemover(Unit);
  2224. }
  2225. //============================================================================================================================
  2226. public ReinforceDelayer(group[])
  2227. {
  2228.     new Iterator:i = Iterate( group );
  2229.     while(ItNext( i ))
  2230.     {
  2231.         new DrID:entity = ItEntity( i );
  2232.         if(IsInstanceOf( entity, GetClassID( "cVehicle" )))
  2233.         {
  2234.             static index = 0;
  2235.             CmdWait( entity, Q_OVERRIDE, index*10.0 );
  2236.             CmdMoveToEnt( entity, GetEntity( "wpb1" ), Q_ENQUEUE, MF_NONE, 1.0 );
  2237.             CmdMoveToEnt( entity, GetEntity( "start_polish" ), Q_ENQUEUE, MF_NONE );
  2238.             index++;
  2239.         }
  2240.     }ItStop( i );
  2241. }
  2242.  
  2243. public _NewTimer()
  2244. {
  2245.     RemoveEvent( "_NewTimer" );
  2246.     SetCountDown( overtime );
  2247.     ShowShortMessage( "#d##cyellow##iMS12_MSG002#" );
  2248. }
  2249.  
  2250. public BulletTimeEnded()
  2251. {
  2252.     RemoveEvent( "BulletTimeEnded" );
  2253.     SetCutScene(false, true, true);
  2254. }
  2255.  
  2256.  
  2257.