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 >
Wrap
Text File
|
2005-03-11
|
71KB
|
2,257 lines
#include "script.inc"
#include "visualeffects.inc"
#include "antiair.inc"
#define max_run_once 12
#define purple_wpnum 2
#define red_wpnum 4
#define black_wpnum 4
#define brown_wpnum 3
#define turkiz_wpnum 3
#define green_wpnum 3
#define blue_wpnum 3
#define radio_wpnum 3
#define bridge_wpnum 6
#define maptime 2100
#define overtime 420
#define AAdelay 180
//Global params
new bool:RunOnce[max_run_once];
new gTeleporterName[20][60];
new gNewSpawnerNum = 0;
new gNewReinfNum = 0;
new gKonigTigerz = 0;
new gV1 = 0;
new gNewAreaReinf[4] = {0,0,0,0};
new gCounter = 0;
// new bool:gSecTimerRunning = false;
new gStaticReinfNum = 0;
new gSSpanzernum = 0;
new gStaticSSpanzernum = 0;
new bool:gSSpanzerzDestroyed = false;
new bool:gRadioTowerDestroyed = false;
new bool:gArtilleryStrikeMessage = true;
new bool:gGlobalVariable = false;
new gLinePurple[purple_wpnum][6] = {{"wpr1"},{"wpr2"}};
new gLineRed[red_wpnum][6] = {{"wpr6"},{"wpr7"},{"wpr21"},{"wpr8"}};
new gLineBlack[black_wpnum][20] = {{"wpr18"},{"wpr19"},{"wpr20"},{"area_teleport"}};
new gLineBrown[brown_wpnum][6] = {{"wpr3"},{"wpr4"},{"wpr5"}};
new gLineTurkiz[turkiz_wpnum][6] = {{"wpr15"},{"wpr16"},{"wpr17"}};
new gLineGreen[green_wpnum][6] = {{"wpr9"},{"wpr10"},{"wpr11"}};
new gLineBlue[blue_wpnum][6] = {{"wpr12"},{"wpr13"},{"wpr14"}};
new gLineRadio[radio_wpnum][6] = {{"wpr23"},{"wpr24"},{"wpr25"}};
new gLineBridge[bridge_wpnum][6] = {{"wpr26"},{"wpr27"},{"wpr28"},{"wpr29"},{"wpr30"},{"wpr31"}};
enum eWay
{
purple = 1,
red = 2,
black = 3,
brown = 4,
turkiz = 5,
green = 6,
blue = 7,
radio = 8,
bridge = 9
};
enum eSpawner
{
retreat = 1,
reinforce = 2,
SSpanzer = 10,
v1 = 100,
konigz = 1000,
konig_outro = 1001,
firefly_outro1 = 1002,
firefly_outro2 = 1003,
firefly_outro3 = 1004,
firefly_outro4 = 1005,
jeep_outro = 1006
};
//soundfiles
new gSoundFile1[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP001.mp3";
new gSoundFile2[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP002.mp3";
new gSoundFile3[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP003.mp3";
new gSoundFile4[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP004.mp3";
new gSoundFile5[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP005.mp3";
new gSoundFile6[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP006.mp3";
new gSoundFile7[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP007.mp3";
new gSoundFile8[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP008.mp3";
new gSoundFile9[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP009.mp3";
new gSoundFile10[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP010.mp3";
new gSoundFile11[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP011.mp3";
new gSoundFile12[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP012.mp3";
new gSoundFile13[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP013.mp3";
new gSoundFile14[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP014.mp3";
new gSoundFile15[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP015.mp3";
new gSoundFile16[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP016.mp3";
new gSoundFile17[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP017.mp3";
new gSoundFile18[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP018.mp3";
new gSoundFile19[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP019.mp3";
new gSoundFile20[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP020.mp3";
new gSoundFile21[] = "Sounds\\Game\\Speech\\Mission\\MS12_SP021.mp3";
//============================================================================================================================
public main()
CommonAKMain();
//============================================================================================================================
public PostGameStart()
{
CommonAKInit();
ScenarioMode();
HideEntity( GetEntity( "sys_palyahatar1" ) );
for(new counter = 0; counter <= max_run_once-1; counter++)
{
RunOnce[counter] = false;
}
Add2GermanGroup();
forbidden_grp_num = 3;
gForbiddenGroups[0] = "grp_v1";
gForbiddenGroups[1] = "grp_sspanzerz";
gForbiddenGroups[2] = "grp_konigz";
// user events
// AddUserEvent( "GroupEliminated", UE_GROUPELIM_SUCC );
AddUserEvent( "TeamEliminated", UE_TEAMELIM_SUCC );
// code events
AddAKEntityEvent( "WreckDestruct", ANY_ENTITY, UNIT_DIED, 0.1 );
AddAKEntityEvent( "UnitEntered", ANY_ENTITY, UNIT_AREA_ENTER );
AddAKEntityEvent( "UnitExited", ANY_ENTITY, UNIT_AREA_EXIT );
AddAKEntityEvent( "UnitThrowMsg", ANY_ENTITY, CMD_EVENT );
AddAKEntityEvent( "HQCaptured", ANY_ENTITY, HQ_TAKEOVER );
AddAKEntityEvent( "CountDownDone", ANY_ENTITY, COUNTDOWN_DONE );
AddAKEntityEvent( "TurretDestroyed", ANY_ENTITY, UNIT_TURRET_DESTROYED );
AddAKEntityEvent( "CaterpillarDestroyed", ANY_ENTITY, UNIT_CATERPILLAR_DESTROYED );
AddAKEntityEvent( "RadioTowerCaptured", GetEntity( "radiotower" ), UNIT_TEAM_CHANGED );
AddAKEntityEvent( "RadioTowerDestroyed", GetEntity( "radiotower" ), UNIT_DIED );
AddAKEntityEvent( "ArtilleryStrikeSoundMessage", GetEntity( "skot" ), UNIT_ENEMY_SEEN );
AddAKEntityEvent( "RemoveSoundMessage", GetEntity( "skot" ), UNIT_DIED );
// AddAKEntityEvent( "UnitTeamChanged", ANY_ENTITY, UNIT_TEAM_CHANGED );
// AddAKEntityEvent( "TurretDest", ANY_ENTITY, TEST_EVENT );
AddAKSelectorEvent( "RetreaterDied", "grp_retreaterz", UNIT_DIED );
AddAKSelectorEvent( "UnitDiedFromDef1", "grp_defender1", UNIT_DIED );
AddAKSelectorEvent( "UnitDiedFromDef2", "grp_defender2", UNIT_DIED );
AddAKSelectorEvent( "UnitDiedFromDef3", "grp_defender3", UNIT_DIED );
AddAKSelectorEvent( "UnitDiedFromDef4", "grp_defender4", UNIT_DIED );
AddAKSelectorEvent( "UnitDamagedFromDef1", "grp_defender1", UNIT_DAMAGED );
AddAKSelectorEvent( "UnitDamagedFromDef2", "grp_defender2", UNIT_DAMAGED );
AddAKSelectorEvent( "UnitDamagedFromDef3", "grp_defender3", UNIT_DAMAGED );
AddAKSelectorEvent( "UnitDamagedFromDef4", "grp_defender4", UNIT_DAMAGED );
AddAKSelectorEvent( "SSPanzerzDiedOrCaptured", "grp_sspanzerz", UNIT_TEAM_CHANGED );
AddAKSelectorEvent( "GlobalGroupRemover", "grp_German", UNIT_TEAM_CHANGED );
// timer events
AddTimerEvent( "SpawnControll", 5.0, "GameLogic", true);
// addobjeczves
AddObjective( "PRI_1", OT_PRIMARY, "#iMS12_PS01#", "#iMS12_PL01#", OS_SLEEPING );
AddObjective( "SEC_1", OT_SECONDARY, "#iMS12_SS01#", "#iMS12_SL01#", OS_SLEEPING );
AddObjective( "SEC_2", OT_SECONDARY, "#iMS12_SS02#", "#iMS12_SL02#", OS_SLEEPING );
AddObjective( "SEC_3", OT_SECONDARY, "#iMS12_SS03#", "#iMS12_SL03#", OS_SLEEPING );
AddObjective( "SEC_4", OT_SECONDARY, "#iMS12_SS04#", "#iMS12_SL04#", OS_SLEEPING );
AddObjective( "HID_1", OT_HIDDEN, "#iMS12_HS01#", "#iMS12_HL01#", OS_SLEEPING );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_retreaterz", lowestspd );
Move("tmp1", black, true, Q_ENQUEUE, MF_OVERRUN );
CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr21" ), Q_ENQUEUE, MF_OVERRUN );
CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr8" ), Q_ENQUEUE, MF_OVERRUN );
CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr18" ), Q_ENQUEUE, MF_OVERRUN );
CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr19" ), Q_ENQUEUE, MF_OVERRUN|MF_DIRECT );
CmdGroupMoveToEnt( "tmp2", GetEntity( "wpr20" ), Q_ENQUEUE, MF_OVERRUN|MF_DIRECT );
CmdGroupMoveToEnt( "tmp2", GetEntity( "area_teleport" ), Q_ENQUEUE, MF_OVERRUN|MF_DIRECT );
Move("tmp3", red, true, Q_ENQUEUE, MF_OVERRUN );
Move("tmp3", black, true, Q_ENQUEUE, MF_OVERRUN );
Intro();
}
//============================================================================================================================
public Intro()
{
static counter = 0;
RemoveEvent( "Intro" );
switch(counter)
{
case 0:
{
SetPropertyInt( GetSupportObj(gPlayerTeam), "NAirStrikes",GetNAirStrikes(gPlayerTeam)+2);
new PrevLevel = GetGlobalVariable("gvMS11_Pilot");
if(PrevLevel == 1)
{
SetPropertyInt( GetSupportObj(gPlayerTeam), "NRecons",GetNAirRecons(gPlayerTeam)+10);
gGlobalVariable = true;
}
else
SetPropertyInt( GetSupportObj(gPlayerTeam), "NRecons",GetNAirRecons(gPlayerTeam)+5);
HackAntiAirInit();
SetCutScene(true, true, true);
TeleportCameraToEnt(GetEntity( "camerapos1" ));
CameraSet(90.0, 45.0, 15.0, true);
new DrID:fow1 = CreateFOWBtoEntity(GetEntity( "camerapos1" ))
SetPropertyString( fow1, "StringID", "fow1" );
new DrID:fow2 = CreateFOWBtoEntity(GetEntity( "camerapos2" ))
SetPropertyString( fow2, "StringID", "fow2" );
AddTimerEvent( "Intro", 2.0, "GameLogic", true );
AddTimerEvent( "SetIntroCameraSpeed", 0.1, "GameLogic", true );
}
case 1:
{
CameraSpeed(3.0, 2.0, 5.0);
CameraSet(269.0, 55.0, 55.0, false);
MoveCameraToEnt( GetEntity("camerapos2") );
AddAKEntityEvent( "Intro", ANY_ENTITY, CAMERA_TARGET_REACHED );
}
case 2:
{
SetPropertyInt( GetEntity( "fow1" ), "Team", 0 );
SetPropertyInt( GetEntity( "fow2" ), "Team", 0 );
new DrID:fow3 = CreateFOWBtoEntity(GetEntity( "tiger" ));
SetPropertyString( fow3, "StringID", "fow3" );
FadeOut(0.5);
AddTimerEvent( "Intro", 0.5, "GameLogic", true );
CmdGroupMoveToEnt( "grp_polish", GetEntity( "wp_charge" ), Q_OVERRIDE, MF_KEEP_FORMATION );
}
case 3:
{
FadeIn(0.5);
TeleportCameraToEnt(GetEntity( "polish_officer" ));
CameraSet(GetEntityDir( GetEntity( "polish_officer" ), DB_NORTH ), 65.0, 25.0);
CameraFollow( GetEntity( "polish_officer" ) );
CameraSet(90.0, 45.0, 45.0, false);
AddTimerEvent( "Intro", 0.5, "GameLogic", true );
}
case 4:
{
AddSoundMessage("#iMS12_SP002#", gSoundFile2);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 5:
{
CameraFollow( DrID:0 );
CmdGroupStop( "grp_polish", Q_OVERRIDE );
TeleportCameraToEnt(GetEntity( "tiger" ));
CameraSet(GetEntityDir( GetEntity( "tiger" ), DB_NORTH ), 65.0, 25.0);
CameraSet(90.0, 45.0, 35.0);
CmdGroupAttack( "grp_defender3", Q_OVERRIDE, GetEntity( "wp_dir3" ), AF_FORCE);
AddSoundMessage("#iMS12_SP003#", gSoundFile3);
AddTimerEvent( "Intro", 5.0, "GameLogic", true );
}
case 6:
{
TeleportCameraToEnt(GetEntity( "polish_officer" ));
CameraSet(180.0, 65.0, 25.0);
CameraSet(180.0, 45.0, 40.0, false);
CmdMoveToEntity( GetEntity( "polish_officer" ), Q_OVERRIDE, GetEntity( "wp_retreat" ), MF_NONE );
CmdMoveToEntity( GetEntity( "pol1" ), Q_OVERRIDE, GetEntity( "wp_retreat1" ), MF_NONE );
CmdMoveToEntity( GetEntity( "pol2" ), Q_OVERRIDE, GetEntity( "wp_retreat2" ), MF_NONE );
CmdMoveToEntity( GetEntity( "pol3" ), Q_OVERRIDE, GetEntity( "wp_retreat4" ), MF_NONE );
CmdMoveToEntity( GetEntity( "pol4" ), Q_OVERRIDE, GetEntity( "wp_retreat5" ), MF_NONE );
CmdMoveToEntity( GetEntity( "polish_repair" ), Q_OVERRIDE, GetEntity( "wp_retreat3" ), MF_NONE );
CmdMoveToEntity( GetEntity( "polish_truck1" ), Q_OVERRIDE, GetEntity( "wp_retreat6" ), MF_NONE );
CmdMoveToEntity( GetEntity( "polish_truck2" ), Q_OVERRIDE, GetEntity( "wp_retreat7" ), MF_NONE );
CmdTurnToEnt( GetEntity( "polish_officer" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
CmdTurnToEnt( GetEntity( "pol1" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
CmdTurnToEnt( GetEntity( "pol2" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
CmdTurnToEnt( GetEntity( "pol3" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
CmdTurnToEnt( GetEntity( "pol4" ), GetEntity( "wp_charge" ), Q_ENQUEUE );
CmdDigin(GetEntity( "polish_officer" ), Q_ENQUEUE);
CmdDigin(GetEntity( "pol1" ), Q_ENQUEUE);
CmdDigin(GetEntity( "pol2" ), Q_ENQUEUE);
CmdDigin(GetEntity( "pol3" ), Q_ENQUEUE);
CmdDigin(GetEntity( "pol4" ), Q_ENQUEUE);
AddSoundMessage("#iMS12_SP004#", gSoundFile4);
CmdGroupStop( "grp_defender3", Q_OVERRIDE );
new Float:slowest = GetSlowestSpeedInGroup("grp_canadians");
SetSpeedInSelector( "grp_canadians", slowest );
CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb1" ), Q_OVERRIDE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb2" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb3" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb4" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
CmdGroupMoveToEnt( "grp_canadians", GetEntity( "wpb5" ), Q_ENQUEUE, MF_DIRECT|MF_OVERRUN|MF_KEEP_FORMATION );
CmdThrowEvent( GetEntity( "c_jeep" ), Q_ENQUEUE, 1000 );
}
case 7:
{
TeleportCameraToEnt(GetEntity( "c_tankcmdr" ));
CameraFollow( GetEntity( "c_tankcmdr" ) );
CameraSet(180.0, 45.0, 20.0);
CameraSet(90.0, 45.0, 20.0, false);
AddSoundMessage("#iMS12_SP005#", gSoundFile5);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 8:
{
CameraFollow( DrID:0 );
TeleportCameraToEnt(GetEntity( "polish_officer" ));
CameraSet(180.0, 45.0, 20.0);
AddSoundMessage("#iMS12_SP006#", gSoundFile6);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 9:
{
CameraFollow( GetEntity( "c_tankcmdr" ) );
TeleportCameraToEnt(GetEntity( "c_tankcmdr" ));
CameraSet(180.0, 45.0, 20.0);
AddSoundMessage("#iMS12_SP007#", gSoundFile7);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 10:
{
CameraFollow( DrID:0 );
TeleportCameraToEnt(GetEntity( "polish_officer" ));
CameraSet(180.0, 45.0, 20.0);
AddSoundMessage("#iMS12_SP008#", gSoundFile8);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 11:
{
CameraFollow( GetEntity( "c_tankcmdr" ) );
TeleportCameraToEnt(GetEntity( "c_tankcmdr" ));
CameraSet(180.0, 45.0, 20.0);
AddSoundMessage("#iMS12_SP009#", gSoundFile9);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 12:
{
CameraFollow( DrID:0 );
TeleportCameraToEnt(GetEntity( "camera_start" ));
CameraSet(GetEntityDir( GetEntity( "camera_start" ), DB_X_AXIS )-90.0, 45.0, 30.0, true);
AddSoundMessage("#iMS12_SP010#", gSoundFile10);
AddAKEntityEvent( "Intro", ANY_ENTITY, MESSAGE_END );
}
case 13:
{
new Iterator:i = Iterate( "grp_polish" );
while(ItNext( i ))
{
MakeVulnerable(ItEntity( i ));
}
ItStop( i );
SetBehav2Ent( GetEntity( "polish_repair" ), MB_MOVE_IN_VICINITY);
SetPropertyInt( GetEntity( "fow3" ), "Team", 0 );
SetCutScene(false);
CameraFollow( DrID:0 );
ResetCameraSpeed();
SetObjectiveState( "PRI_1", OS_IN_PROGRESS );
SetObjectiveState( "SEC_2", OS_IN_PROGRESS );
AddMapTickToEnt( GetEntity( "radiotower" ), 25.0, MAPTICK_CROSS );
if(gGlobalVariable == true)
AddTimerEvent( "PrevLevelHiddenCom", 5.0, "GameLogic", true);
switch(GetDifficulty())
{
case 0:
{
SetCountDown( maptime+600 );
}
case 3:
{
SetCountDown( maptime-300 );
}
default:
{
SetCountDown( maptime );
}
}
AddTimerEvent( "TickTack", 1.0, "GameLogic", true );
}
}
counter++;
}
//============================================================================================================================
public Outro()
{
static counter = 0;
RemoveEvent( "Outro" );
RemoveEvent( "SpawnControll" );
switch(counter)
{
case 0:
{
FadeOut(0.5);
CmdGroupStop( "grp_retreaterz", Q_OVERRIDE );
AddTimerEvent( "Outro", 1.0, "GameLogic", true);
}
case 1:
{
SetCutScene(true, true, true);
DeactivateEntityz();
CreateFOWBtoEntity(GetEntity( "hq" ));
new DrID:konig = Creator(konig_outro);
new DrID:firefly1 = Creator(firefly_outro1);
new DrID:firefly2 = Creator(firefly_outro2);
new DrID:firefly3 = Creator(firefly_outro3);
new DrID:firefly4 = Creator(firefly_outro4);
new DrID:jeep = Creator(jeep_outro);
SetPropertyString( konig, "StringID", "konig" );
SetPropertyString( firefly1, "StringID", "firefly1" );
SetPropertyString( firefly2, "StringID", "firefly2" );
SetPropertyString( firefly3, "StringID", "firefly3" );
SetPropertyString( firefly4, "StringID", "firefly4" );
SetPropertyString( jeep, "StringID", "jeep" );
SetPropertyString( firefly1, "Nationality", "Polish" );
SetPropertyString( firefly2, "Nationality", "Polish" );
SetPropertyString( firefly3, "Nationality", "Polish" );
SetPropertyString( firefly4, "Nationality", "Polish" );
MakeInvulnerable(konig);
MakeInvulnerable(firefly1);
MakeInvulnerable(firefly2);
MakeInvulnerable(firefly3);
MakeInvulnerable(firefly4);
CmdMoveToEnt( konig, GetEntity( "wp_dest" ), Q_ENQUEUE, MF_NONE );
CmdStop( konig, Q_ENQUEUE );
CmdThrowEvent( konig, Q_ENQUEUE, 555 );
CmdTurnToEnt( firefly2, GetEntity( "wp_dest" ), Q_ENQUEUE );
CmdTurnToEnt( firefly4, GetEntity( "wp_dest" ), Q_ENQUEUE );
CmdDigin(firefly2, Q_ENQUEUE);
CmdDigin(firefly4, Q_ENQUEUE);
CmdMoveToEnt( firefly1, GetEntity( "wp_outros1" ), Q_ENQUEUE, MF_NONE );
CmdMoveToEnt( firefly3, GetEntity( "wp_outros3" ), Q_ENQUEUE, MF_NONE );
CmdTurnToEnt( firefly1, GetEntity( "wp_dest" ), Q_ENQUEUE );
CmdTurnToEnt( firefly3, GetEntity( "wp_dest" ), Q_ENQUEUE );
CmdDigin(firefly1, Q_ENQUEUE);
CmdDigin(firefly3, Q_ENQUEUE);
AddTimerEvent( "Outro", 2.0, "GameLogic", true);
}
case 2:
{
FadeIn(0.5);
TeleportCameraToEnt(GetEntity( "konig" ));
CameraFollow( GetEntity( "konig" ) );
CameraSet(180.0, 45.0, 50.0);
CameraSpeed(-2.0, 5.0, 5.0, 10.0);
CameraSet(90.0, 45.0, 20.0, false);
// AddTimerEvent( "Outro", 5.0, "GameLogic", true);
AddAKEntityEvent( "SpeechEnd1", ANY_ENTITY, MESSAGE_END );
AddSoundMessage("#iMS12_SP014#", gSoundFile14);
AddSoundMessage("#iMS12_SP015#", gSoundFile15);
}
case 3:
{
SetCameraRotSpeed(2.0);
SetCameraPitchSpeed(1.0);
CameraSet(269.0, 45.0, 50.0);
CameraSet(180.0, 45.0, 20.0, false);
}
case 4:
{
//konig megall
FadeOut(0.5);
AddTimerEvent( "Outro", 1.0, "GameLogic", true);
}
case 5:
{
FadeIn(0.5);
new Float:pos[vec3];
GetPropertyVec3( GetEntity( "wp_hartmann" ), "LogicalPos_", pos );
new DrID:hartmann = CreateEntity( "ax_Officer", pos );
SetPropertyString( hartmann, "StringID", "Hartmann" );
SetPropertyInt( hartmann, "Team", gPlayerTeam );
ShowWeapon(hartmann, false);
TeleportCameraToEnt(GetEntity( "jeep" ));
CameraFollow( GetEntity( "jeep" ) );
CameraSet(180.0, 45.0, 25.0);
}
case 6:
{
FadeOut(0.5);
AddTimerEvent( "Outro", 0.5, "GameLogic", true);
}
case 7:
{
FadeIn(0.5);
TeleportCameraToEnt(GetEntity( "Hartmann" ));
CameraFollow( GetEntity( "Hartmann" ) );
CameraSet(180.0, 45.0, 5.0);
CameraSet(90.0, 45.0, 25.0, false);
AddAKEntityEvent( "SpeechEnd2", ANY_ENTITY, MESSAGE_END );
AddSoundMessage("#iMS12_SP016#", gSoundFile16);
AddSoundMessage("#iMS12_SP017#", gSoundFile17);
AddSoundMessage("#iMS12_SP018#", gSoundFile18);
}
case 8:
{
CameraFollow( GetEntity( "jeep" ) );
TeleportCameraToEnt(GetEntity( "jeep" ));
CameraSet(180.0, 45.0, 25.0);
AddSoundMessage("#iMS12_SP019#", gSoundFile19);
AddAKEntityEvent( "Outro", ANY_ENTITY, MESSAGE_END );
}
case 9:
{
CmdSetMS( GetEntity( "Hartmann" ), Q_OVERRIDE, MS_WALK );
CmdMount( GetEntity( "Hartmann" ), Q_ENQUEUE, GetEntity( "jeep" ));
CmdThrowEvent( GetEntity( "Hartmann" ), Q_ENQUEUE, 333 );
}
case 10:
{
RemoveEvent( "Defeat" );
FadeOut(0.5);
AddTimerEvent( "Victory", 0.5, "GameLogic", true);
}
}
counter++;
}
//============================================================================================================================
public SpeechEnd1()
{
static counter = 0;
counter++;
if(counter == 2)
{
RemoveEvent( "SpeechEnd" );
Outro();
}
}
//============================================================================================================================
public SpeechEnd2()
{
static counter = 0;
counter++;
if(counter == 3)
{
RemoveEvent( "SpeechEnd" );
Outro();
}
}
//============================================================================================================================
public SetIntroCameraSpeed()
{
static Float:speed = 0.0;
if(speed <= 4.5)
{
speed+=0.02;
SetCameraSpeed(speed);
}
else
{
RemoveEvent( "SetIntroCameraSpeed" );
SetCameraDampValue(0.01);
}
}
//============================================================================================================================
public GroupEliminated()
{
new ID = GetMsgParamInt();
if(ID == 2)
{
SetObjectiveState( "SEC_1", OS_COMPLETED );
}
}
public TeamEliminated()
{
new ID = GetMsgParamInt();
if(ID == 1)
{
SetCutScene(true, true, true);
BulletTime(GetLastKilledEntity(), false);
AddUserEvent( "Defeat", UE_BULLETTIME_END );
}
if(ID == 2 && RunOnce[11] == false)
{
RunOnce[11] = true;
if(GetDifficulty() == 0)
Reinforcement( "help_to_easy", GetEntity( "deploy_usa" ), GetEntity( "start_usa" ) );
}
}
//============================================================================================================================
stock Move(group[], eWay:way, bool:elore, eQueuing:queue, eMoveFlag:moveflag, DrID:unit = DrID:0 )
{
switch(way)
{
case 1:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < purple_wpnum; i++)
if(i == 0)
CmdGroupMoveToEnt( group, GetEntity( gLinePurple[i] ), queue, moveflag|MF_DIRECT );
else
CmdGroupMoveToEnt( group, GetEntity( gLinePurple[i] ), queue, moveflag );
}
else
{
for(new i = purple_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLinePurple[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < purple_wpnum; i++)
{
if(i == 0)
CmdMoveToEnt( unit, GetEntity( gLinePurple[i] ), queue, moveflag|MF_DIRECT );
else
CmdMoveToEnt( unit, GetEntity( gLinePurple[i] ), queue, moveflag );
if(i == 1)
CmdThrowEvent( unit, Q_ENQUEUE, 3 );
}
}
else
{
for(new i = purple_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLinePurple[i] ), queue, moveflag );
}
}
}
case 2:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < red_wpnum; i++)
CmdGroupMoveToEnt( group, GetEntity( gLineRed[i] ), queue, moveflag );
}
else
{
for(new i = red_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineRed[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < red_wpnum; i++)
CmdMoveToEnt( unit, GetEntity( gLineRed[i] ), queue, moveflag );
}
else
{
for(new i = red_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineRed[i] ), queue, moveflag );
}
}
}
case 3:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < black_wpnum; i++)
{
if(i >= 1)
CmdGroupMoveToEnt( group, GetEntity( gLineBlack[i] ), queue, moveflag|MF_DIRECT );
else
CmdGroupMoveToEnt( group, GetEntity( gLineBlack[i] ), queue, moveflag );
}
}
else
{
for(new i = black_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineBlack[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < black_wpnum; i++)
{
if(i >= 1)
CmdMoveToEnt( unit, GetEntity( gLineBlack[i] ), queue, moveflag|MF_DIRECT );
else
CmdMoveToEnt( unit, GetEntity( gLineBlack[i] ), queue, moveflag );
if(i == 2)
{
CmdThrowEvent( unit, Q_ENQUEUE, 2 );
// new senderStrID[250];
// GetPropertyString( unit, "StringID", 200, senderStrID );
// ConcatString( senderStrID, 250, "EntityThrowInvulnerableEvent:", senderStrID );
// DebugMessage( senderStrID, DL_MESSAGE );
}
}
}
else
{
for(new i = black_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineBlack[i] ), queue, moveflag );
}
}
}
case 4:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < brown_wpnum; i++)
CmdGroupMoveToEnt( group, GetEntity( gLineBrown[i] ), queue, moveflag );
}
else
{
for(new i = brown_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineBrown[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < brown_wpnum; i++)
{
CmdMoveToEnt( unit, GetEntity( gLineBrown[i] ), queue, moveflag );
if(i == 0)
CmdThrowEvent( unit, Q_ENQUEUE, 9 );
if(i == 2)
CmdThrowEvent( unit, Q_ENQUEUE, 5 );
}
}
else
{
for(new i = brown_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineBrown[i] ), queue, moveflag );
}
}
}
case 5:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < turkiz_wpnum; i++)
CmdGroupMoveToEnt( group, GetEntity( gLineTurkiz[i] ), queue, moveflag );
}
else
{
for(new i = turkiz_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineTurkiz[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < turkiz_wpnum; i++)
{
CmdMoveToEnt( unit, GetEntity( gLineTurkiz[i] ), queue, moveflag );
if(i == 0)
CmdThrowEvent( unit, Q_ENQUEUE, 9 );
if(i == 2)
CmdThrowEvent( unit, Q_ENQUEUE, 6 );
}
}
else
{
for(new i = turkiz_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineTurkiz[i] ), queue, moveflag );
}
}
}
case 6:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < green_wpnum; i++)
CmdGroupMoveToEnt( group, GetEntity( gLineGreen[i] ), queue, moveflag );
}
else
{
for(new i = green_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineGreen[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < green_wpnum; i++)
{
CmdMoveToEnt( unit, GetEntity( gLineGreen[i] ), queue, moveflag );
if(i == 0)
CmdThrowEvent( unit, Q_ENQUEUE, 9 );
if(i == 2)
CmdThrowEvent( unit, Q_ENQUEUE, 7 );
}
}
else
{
for(new i = green_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineGreen[i] ), queue, moveflag );
}
}
}
case 7:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < blue_wpnum; i++)
CmdGroupMoveToEnt( group, GetEntity( gLineBlue[i] ), queue, moveflag );
}
else
{
for(new i = blue_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineBlue[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < blue_wpnum; i++)
{
CmdMoveToEnt( unit, GetEntity( gLineBlue[i] ), queue, moveflag );
if(i == 0)
CmdThrowEvent( unit, Q_ENQUEUE, 9 );
if(i == 2)
CmdThrowEvent( unit, Q_ENQUEUE, 8 );
}
}
else
{
for(new i = blue_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineBlue[i] ), queue, moveflag );
}
}
}
case 8:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < radio_wpnum; i++)
CmdGroupMoveToEnt( group, GetEntity( gLineRadio[i] ), queue, moveflag );
}
else
{
for(new i = radio_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineRadio[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < radio_wpnum; i++)
{
CmdMoveToEnt( unit, GetEntity( gLineRadio[i] ), queue, moveflag );
if(i == 2)
CmdThrowEvent( unit, Q_ENQUEUE, 10 );
}
}
else
{
for(new i = radio_wpnum-1; i >= 0; i--)
{
CmdMoveToEnt( unit, GetEntity( gLineRadio[i] ), queue, moveflag );
}
}
}
}
case 9:
{
if(unit == DrID:0)
{
if(elore)
{
for(new i = 0; i < bridge_wpnum; i++)
{
if(i == bridge_wpnum-1)
CmdGroupThrowEvent( group, Q_ENQUEUE, 11 );
if(i >= bridge_wpnum-2)
CmdGroupMoveToEnt( group, GetEntity( gLineBridge[i] ), queue, moveflag|MF_DIRECT );
else
CmdGroupMoveToEnt( group, GetEntity( gLineBridge[i] ), queue, moveflag );
}
}
else
{
for(new i = bridge_wpnum-1; i >= 0; i--)
CmdGroupMoveToEnt( group, GetEntity( gLineBridge[i] ), queue, moveflag );
}
}
else
{
if(elore)
{
for(new i = 0; i < bridge_wpnum; i++)
{
if(i == bridge_wpnum-1)
CmdThrowEvent( unit, Q_ENQUEUE, 11 );
if(i >= bridge_wpnum-2)
CmdMoveToEnt( unit, GetEntity( gLineBridge[i] ), queue, moveflag|MF_DIRECT );
else
CmdMoveToEnt( unit, GetEntity( gLineBridge[i] ), queue, moveflag );
}
}
else
{
for(new i = bridge_wpnum-1; i >= 0; i--)
CmdMoveToEnt( unit, GetEntity( gLineBridge[i] ), queue, moveflag );
}
}
}
}
}
//============================================================================================================================
public WreckDestruct(DrID:diedunit)
{
WreckDestructor(diedunit, "area_roads");
}
//============================================================================================================================
public UnitEntered(DrID:unit, DrID:area)
{
new areaname[200];
GetPropertyString( area, "StringID", 200, areaname );
if(CompareString( areaname, "area_teleport") == 0 && IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
GetPropertyString( unit, "StringID", 250, gTeleporterName[gCounter] );
gCounter++;
}
// if(RunOnce[2] == false && CompareString( areaname, "area_secndary") == 0 && GetPropertyInt( unit, "Team" ) == gPlayerTeam)
// {
// RunOnce[2] = true;
// AddTimerEvent( "delayedV1", AAdelay, "GameLogic", true );
// }
if(CompareString( areaname, "area_fritzartsup") == 0 && IsInSelector( unit, "SelectorTeam2" ) &&
(IsInstanceOf( unit, GetClassID( "cVehicle" )) || IsInstanceOf( unit, GetClassID( "cSoldier" ))))
CmdAttack( GetEntity( "artillerysupport" ), Q_OVERRIDE, unit );
if(RunOnce[8] == false && CompareString( areaname, "area_bridge") == 0 && unit == GetEntity( "c_tankcmdr" ))
{
RunOnce[8] = true;
Intro();
}
}
//============================================================================================================================
public RetreaterDied(DrID:unit)
{
gNewSpawnerNum++;
}
//============================================================================================================================
stock DrID:Creator(eSpawner:spawner)
{
new DrID:Unit;
switch(spawner)
{
case 1:
{
DebugMessage( "Creating: Retreater", DL_MESSAGE );
new rndreinforcement = Rnd( 3 , 9 );
new rndreinf[250];
Int2Str( rndreinforcement, rndreinf, 200 );
Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( rndreinf, Q_OVERRIDE );
new Iterator:i = Iterate(rndreinf);
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( rndreinf, unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
if(IsEntityComp(unit, "cTurretController"))
{
SetBehav2Ent( unit,
MB_HOLD_POSITION,
FB_FIRE_AT_WILL,
UB_EVAC);
}
else
{
SetBehav2Ent( unit,MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
}
Unit = unit;
AddToGroup( "grp_retreaterz", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_retreaterz", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
case 2:
{
gStaticReinfNum++;
if(gStaticReinfNum <= 3)
{
DebugMessage( "Creating: Tiger Defender", DL_MESSAGE );
new rndreinf[250];
Int2Str( 2, rndreinf, 200 );
Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( rndreinf, Q_OVERRIDE );
new Iterator:i = Iterate(rndreinf);
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( rndreinf, unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
Unit = unit;
AddToGroup( "grp_retreaterz", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_retreaterz", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
if(gStaticReinfNum > 3 && gStaticReinfNum <= 8)
{
DebugMessage( "Creating: Panther Defender", DL_MESSAGE );
new rndreinf[250];
Int2Str( 3, rndreinf, 200 );
Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( rndreinf, Q_OVERRIDE );
new Iterator:i = Iterate(rndreinf);
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( rndreinf, unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
Unit = unit;
AddToGroup( "grp_retreaterz", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_retreaterz", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
if(gStaticReinfNum > 8 && gStaticReinfNum <= 12)
{
if(gStaticReinfNum == 9)
{
DebugMessage( "V1 Carrierz arrived", DL_MESSAGE );
AddTimerEvent( "delayedV1", AAdelay, "GameLogic", true );
}
DebugMessage( "Creating: PZIV G Defender", DL_MESSAGE );
new rndreinf[250];
Int2Str( 4, rndreinf, 200 );
Reinforcement( rndreinf, GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( rndreinf, Q_OVERRIDE );
new Iterator:i = Iterate(rndreinf);
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( rndreinf, unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
Unit = unit;
AddToGroup( "grp_retreaterz", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_retreaterz", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
}
case 10:
{
DebugMessage( "Creating: SSPanzer", DL_MESSAGE );
Reinforcement( "11", GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( "11", Q_OVERRIDE );
new Iterator:i = Iterate("11");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( "11", unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
Unit = unit;
AddToGroup( "grp_sspanzerz", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_sspanzerz", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
case 100:
{
DebugMessage( "Creating: V1", DL_MESSAGE );
Reinforcement( "10", GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( "10", Q_OVERRIDE );
new Iterator:i = Iterate("10");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( "10", unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
Unit = unit;
AddToGroup( "grp_v1", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_v1", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_NEVER, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
case 1000:
{
DebugMessage( "Creating: Konig", DL_MESSAGE );
Reinforcement( "1", GetEntity( "deploy1" ), GetEntity( "deploy1" ) );
CmdGroupStop( "1", Q_OVERRIDE );
new Iterator:i = Iterate("1");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
RemoveFromGroup( "1", unit );
RemoveFromGroup( ",", unit );
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
Unit = unit;
AddToGroup( "grp_konigz", unit );
AddToGroup( "grp_German", unit );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_konigz", lowestspd );
}
else
SetBehav2Ent( unit, MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC, DB_UNMODIFIED, MOB_WHEN_ENEMY_SEEN, MTP_ATTACK);
}
ItStop( i );
}
case 1001:
{
Reinforcement( "101", GetEntity( "wp_konig" ), GetEntity( "wp_dest" ) );
new Iterator:i = Iterate("101");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
SetBehav2Ent( unit, MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
Unit = unit;
}
}
ItStop( i );
}
case 1002:
{
Reinforcement( "201", GetEntity( "wp_outrod1" ), GetEntity( "wp_outros1" ) );
new Iterator:i = Iterate("201");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
SetBehav2Ent( unit, MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
Unit = unit;
}
}
ItStop( i );
}
case 1003:
{
Reinforcement( "201", GetEntity( "wp_outrod2" ), GetEntity( "wp_outrod2" ) );
CmdGroupStop( "101", Q_OVERRIDE );
new Iterator:i = Iterate("201");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
SetBehav2Ent( unit, MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
Unit = unit;
}
}
ItStop( i );
}
case 1004:
{
Reinforcement( "201", GetEntity( "wp_outrod3" ), GetEntity( "wp_outros3" ) );
new Iterator:i = Iterate("201");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
SetBehav2Ent( unit, MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
Unit = unit;
}
}
ItStop( i );
}
case 1005:
{
Reinforcement( "201", GetEntity( "wp_outrod4" ), GetEntity( "wp_outrod4" ) );
CmdGroupStop( "101", Q_OVERRIDE );
new Iterator:i = Iterate("201");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
SetBehav2Ent( unit, MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
Unit = unit;
}
}
ItStop( i );
}
case 1006:
{
Reinforcement( "301", GetEntity( "wp_jeeps" ), GetEntity( "wp_jeeps" ) );
CmdGroupStop( "301", Q_OVERRIDE );
new Iterator:i = Iterate("301");
while(ItNext(i))
{
new DrID:unit = ItEntity(i);
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
SetBehav2Ent( unit, MB_HOLD_POSITION, FB_HOLD_FIRE, UB_NEVER);
Unit = unit;
}
}
ItStop( i );
}
}
return Unit;
}
//============================================================================================================================
public SpawnControll()
{
// DebugMessage( "SpawnControll", DL_MESSAGE );
// DebugMessageP1( "SpawnerNum:", gNewSpawnerNum, DL_MESSAGE );
// DebugMessageP1( "ReinfNum:", gNewReinfNum, DL_MESSAGE );
// DebugMessageP1( "KonigNum:", gKonigTigerz, DL_MESSAGE );
// DebugMessageP1( "SSpantherNum:", gSSpanzernum, DL_MESSAGE );
// DebugMessageP1( "Def4Num:", gNewAreaReinf[3], DL_MESSAGE );
// DebugMessageP1( "Def3Num:", gNewAreaReinf[2], DL_MESSAGE );
// DebugMessageP1( "Def2Num:", gNewAreaReinf[1], DL_MESSAGE );
// DebugMessageP1( "Def1Num:", gNewAreaReinf[0], DL_MESSAGE );
if((gCounter > 0) && gNewSpawnerNum == 0)
{
new DrID:unit = GetEntity( gTeleporterName[0] );
for(new i = 0; i < gCounter-1; i++)
{
gTeleporterName[i] = gTeleporterName[i+1];
}
gCounter--;
DebugMessage( "Teleporting..", DL_MESSAGE );
CmdMoveToEnt( unit, GetEntity( "deploy1" ), Q_OVERRIDE, MF_TELEPORT );
CmdThrowEvent( unit, Q_ENQUEUE, 1 );
// new senderStrID[250];
// GetPropertyString( unit, "StringID", 200, senderStrID );
// ConcatString( senderStrID, 250, "EntityThrowVulnerableEvent:", senderStrID );
// DebugMessage( senderStrID, DL_MESSAGE );
new Float:lowestspd = GetSlowestSpeedInGroup("grp_retreaterz");
SetSpeedInSelector( "grp_retreaterz", lowestspd );
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, unit );
Move("", red, true, Q_ENQUEUE, MF_OVERRUN, unit );
Move("", black, true, Q_ENQUEUE, MF_OVERRUN, unit );
}
else
{
// DebugMessage( "meg kene hivodnia valamelyik creatornak:", DL_MESSAGE );
// DebugMessageP1( "SpawnerNum:", gNewSpawnerNum, DL_MESSAGE );
// DebugMessageP1( "ReinfNum:", gNewReinfNum, DL_MESSAGE );
// DebugMessageP1( "KonigNum:", gKonigTigerz, DL_MESSAGE );
// DebugMessageP1( "SSpantherNum:", gSSpanzernum, DL_MESSAGE );
// DebugMessageP1( "Def4Num:", gNewAreaReinf[3], DL_MESSAGE );
// DebugMessageP1( "Def3Num:", gNewAreaReinf[2], DL_MESSAGE );
// DebugMessageP1( "Def2Num:", gNewAreaReinf[1], DL_MESSAGE );
// DebugMessageP1( "Def1Num:", gNewAreaReinf[0], DL_MESSAGE );
if(gNewSpawnerNum > 0)
{
gNewSpawnerNum--;
if(gNewReinfNum > 0)
{
gNewReinfNum--;
if(gKonigTigerz > 0)
{
gKonigTigerz--;
new DrID:konig = Creator(konigz);
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, konig );
Move("", red, true, Q_ENQUEUE, MF_OVERRUN, konig );
Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, konig );
}
else
{
if(gSSpanzernum > 0)
{
gSSpanzernum--;
new DrID:sspanzer = Creator(SSpanzer)
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, sspanzer );
Move("", brown, true, Q_ENQUEUE, MF_OVERRUN, sspanzer );
Move("", radio, true, Q_ENQUEUE, MF_OVERRUN, sspanzer );
}
else
{
if(gV1 > 0)
{
gV1--;
new DrID:V1 = Creator(v1);
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, V1 );
Move("", red, true, Q_ENQUEUE, MF_OVERRUN, V1 );
Move("", black, true, Q_ENQUEUE, MF_OVERRUN, V1 );
AddAKEntityEvent( "V1CapturedOrDied", V1, UNIT_TEAM_CHANGED );
}
else
{
if(gNewAreaReinf[3] > 0)
{
gNewAreaReinf[3]--;
new DrID:def4unit = Creator(reinforce);
AddToGroup( "grp_defender4", def4unit );
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def4unit );
Move("", red, true, Q_ENQUEUE, MF_OVERRUN, def4unit );
Move("", blue, true, Q_ENQUEUE, MF_OVERRUN, def4unit );
}
else
{
if(gNewAreaReinf[2] > 0)
{
gNewAreaReinf[2]--;
new DrID:def3unit = Creator(reinforce);
AddToGroup( "grp_defender3", def3unit );
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def3unit );
Move("", red, true, Q_ENQUEUE, MF_OVERRUN, def3unit );
Move("", green, true, Q_ENQUEUE, MF_OVERRUN, def3unit );
}
else
{
if(gNewAreaReinf[1] > 0)
{
gNewAreaReinf[1]--;
new DrID:def2unit = Creator(reinforce);
AddToGroup( "grp_defender2", def2unit );
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def2unit );
Move("", turkiz, true, Q_ENQUEUE, MF_OVERRUN, def2unit );
}
else
{
if(gNewAreaReinf[0] > 0)
{
gNewAreaReinf[0]--;
new DrID:def1unit = Creator(reinforce);
AddToGroup( "grp_defender1", def1unit );
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, def1unit );
Move("", brown, true, Q_ENQUEUE, MF_OVERRUN, def1unit );
}
}
}
}
}
}
}
}
else
{
new DrID:Unit = Creator(retreat);
Move("", purple, true, Q_ENQUEUE, MF_OVERRUN, Unit );
Move("", red, true, Q_ENQUEUE, MF_OVERRUN, Unit );
Move("", black, true, Q_ENQUEUE, MF_OVERRUN, Unit );
}
}
}
}
//============================================================================================================================
public UnitDiedFromDef1(DrID:unit)
{
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
if(gStaticReinfNum <= 12)
{
gNewSpawnerNum++;
gNewReinfNum++;
gNewAreaReinf[0]++;
}
else
RemoveEvent( "UnitDiedFromDef1" );
}
}
public UnitDiedFromDef2(DrID:unit)
{
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
if(gStaticReinfNum <= 12)
{
gNewSpawnerNum++;
gNewReinfNum++;
gNewAreaReinf[1]++;
}
else
RemoveEvent( "UnitDiedFromDef2" );
}
}
public UnitDiedFromDef3(DrID:unit)
{
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
if(gStaticReinfNum <= 12)
{
gNewSpawnerNum++;
gNewReinfNum++;
gNewAreaReinf[2]++;
}
else
RemoveEvent( "UnitDiedFromDef3" );
}
}
public UnitDiedFromDef4(DrID:unit)
{
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
if(gStaticReinfNum <= 12)
{
gNewSpawnerNum++;
gNewReinfNum++;
gNewAreaReinf[3]++;
}
else
RemoveEvent( "UnitDiedFromDef4" );
}
}
//============================================================================================================================
public UnitThrowMsg(DrID:sender, param)
{
switch(param)
{
case 1:
{
new group[100];
GetPropertyString( sender, "Group", 200, group );
if(CompareString( group, ",grp_v1") == 0)
{
if(RunOnce[4] == false)
{
RunOnce[4] = true;
SetObjectiveState( "SEC_1", OS_FAILED );
}
CmdMoveToEnt( sender, GetEntity( "wp_parking" ), Q_OVERRIDE, MF_TELEPORT );
}
else
{
// new senderStrID[250];
// GetPropertyString( sender, "StringID", 200, senderStrID );
// ConcatString( senderStrID, 250, "Entity Vulnerable:", senderStrID );
// DebugMessage( senderStrID, DL_MESSAGE );
MakeVulnerable(sender);
}
}
case 2:
{
// new senderStrID[250];
// GetPropertyString( sender, "StringID", 200, senderStrID );
// ConcatString( senderStrID, 250, "Entity Invulnerable:", senderStrID );
// DebugMessage( senderStrID, DL_MESSAGE );
MakeInvulnerable(sender);
}
case 3:
{
new group[100];
GetPropertyString( sender, "Group", 200, group );
if(RunOnce[1] == false &&CompareString( group, ",grp_konigz,grp_German") == 0)
{
RunOnce[1] = true;
SetCutScene(true, true, true);
BulletTime( sender, false, true, false, 10.0, 20.0 );
AddUserEvent( "BulletTimeEnded", UE_BULLETTIME_END );
}
if(RunOnce[3] == false && CompareString( group, ",grp_v1,grp_German") == 0)
{
RunOnce[3] = true;
SetCutScene(true, true, true);
BulletTime( sender, true, true, false, 10.0, 20.0);
AddUserEvent( "AddSecondaryObj", UE_BULLETTIME_END );
AddUserEvent( "BulletTimeEnded", UE_BULLETTIME_END );
}
}
case 5:
{
if(IsInSelector( sender, "grp_sspanzerz" ))
return;
else
{
CmdTurnToEnt( sender, GetEntity( "wp_dir1" ), Q_OVERRIDE );
CmdDigin(sender, Q_ENQUEUE);
}
}
case 6:
{
CmdTurnToEnt( sender, GetEntity( "wp_dir2" ), Q_OVERRIDE );
CmdDigin(sender, Q_ENQUEUE);
}
case 7:
{
CmdTurnToEnt( sender, GetEntity( "wp_dir3" ), Q_OVERRIDE );
CmdDigin(sender, Q_ENQUEUE);
}
case 8:
{
CmdTurnToEnt( sender, GetEntity( "wp_dir4" ), Q_OVERRIDE );
CmdDigin(sender, Q_ENQUEUE);
}
case 9:
{
new Float:MaxSpeed = GetPropertyFloat( GetBaseComponentBase(GetBaseEntity(sender), "cUnitControllerBase"), "MaxSpeedRun");
SetPropertyFloat( GetComponent( sender, "cUnitController" ), "SpeedOverride", MaxSpeed );
new strid[200];
new maxspd[200];
Float2Str( MaxSpeed, maxspd, 200 );
GetPropertyString( sender, "StringID", 200, strid );
}
case 10:
{
if(gRadioTowerDestroyed == false && (GetPropertyInt( GetEntity( "radiotower" ), "Team" ) != gPlayerTeam || GetPropertyInt( GetEntity( "radiotower" ), "Team" ) != 1))
{
new mountedsoldierz = MountedPlaceNr(sender)
if(mountedsoldierz > 1)
{
new DrID:SoldierAddress = GetArrayElement ( GetComponent( sender, "cMountPoint"), "Mounted", 0);
new DrID:ActualSoldier = GetPropertyObject ( SoldierAddress, "Soldier");
CmdUnmount( ActualSoldier, Q_OVERRIDE );
CmdMount( ActualSoldier, Q_ENQUEUE, GetEntity( "radiotower" ) );
}
}
if(gRadioTowerDestroyed == false && GetPropertyInt( GetEntity( "radiotower" ), "Team" ) == gPlayerTeam)
CmdAttack( sender, Q_OVERRIDE, GetEntity( "radiotower" ) );
}
case 11:
{
if(RunOnce[6] == false)
{
RunOnce[6] = true;
SetObjectiveState( "SEC_4", OS_FAILED );
}
}
case 333:
{
CmdMoveToEnt( GetEntity( "jeep" ), GetEntity( "wp_jeep_seged" ), Q_OVERRIDE, MF_RUN|MF_OVERRUN );
CmdMoveToEnt( GetEntity( "jeep" ), GetEntity( "area_teleport" ), Q_ENQUEUE, MF_DIRECT );
AddTimerEvent( "Outro", 10.0, "GameLogic", true);
}
case 555:
{
CmdStop( GetEntity( "firefly1" ), Q_OVERRIDE );
CmdStop( GetEntity( "firefly2" ), Q_OVERRIDE );
CmdStop( GetEntity( "firefly3" ), Q_OVERRIDE );
CmdStop( GetEntity( "firefly4" ), Q_OVERRIDE );
SetAlliance( gPlayerTeam, 1, AL_NEUTRAL );
SetAlliance( 1, gPlayerTeam, AL_NEUTRAL );
CmdMoveToEnt( GetEntity( "jeep" ), GetEntity( "wp_jeepd" ), Q_ENQUEUE, MF_NONE );
CmdThrowEvent( GetEntity( "jeep" ), Q_ENQUEUE, 777 );
AddTimerEvent( "Outro", 1.0, "GameLogic", true);
}
case 777:
{
CmdStop( sender, Q_OVERRIDE );
Outro();
}
case 1000:
{
CmdGroupStop( "grp_canadians", Q_OVERRIDE );
}
}
}
//============================================================================================================================
public HQCaptured(DrID:hq)
{
if(RunOnce[0] == false && GetPropertyInt( hq, "Team" ) == gPlayerTeam)
{
RunOnce[0] = true;
RemoveEvent( "RetreaterDied" );
RemoveEvent( "UnitDiedFromDef1" );
RemoveEvent( "UnitDiedFromDef2" );
RemoveEvent( "UnitDiedFromDef3" );
RemoveEvent( "UnitDiedFromDef4" );
SetObjectiveState( "HID_1", OS_IN_PROGRESS );
AddTimerEvent( "delayedKonigz", 10.0, "GameLogic", true );
// if(gSecTimerRunning == false)
// AddTimerEvent( "SecondaryTimerRunner", 1.0, "GameLogic", true );
SetCountDown( -1 );
AddTimerEvent( "_NewTimer", 3.0, "GameLogic", true);
new counter = 0;
new Iterator:i = Iterate( "grp_defender3" );
while(ItNext( i ))
{
new DrID:unit = ItEntity( i );
new DrID:closest = GetNearestEntity(unit,"grp_defender3");
RemoveFromGroup( "grp_defender3", closest );
new state = GetPropertyInt( GetComponent( closest, "cDiginController"), "DiginState" );
if(state == 1)
{
CmdDigout(closest, Q_OVERRIDE);
SetBehav2Ent( closest, MB_MOVE_FREELY);
CmdWait( closest, Q_ENQUEUE, counter*20 );
Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
counter++;
}
else
Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
}
ItStop( i );
counter = 0;
new Iterator:k = Iterate( "grp_defender4" );
while(ItNext( k ))
{
new DrID:unit = ItEntity( k );
new DrID:closest = GetNearestEntity(unit,"grp_defender4");
RemoveFromGroup( "grp_defender3", closest );
new state = GetPropertyInt( GetComponent( closest, "cDiginController"), "DiginState" );
if(state == 1)
{
CmdDigout(closest, Q_OVERRIDE);
SetBehav2Ent( closest, MB_MOVE_FREELY);
CmdWait( closest, Q_ENQUEUE, counter*20 );
Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
counter++;
}
else
Move("", black, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE, closest );
}
ItStop( k );
}
if(GetPropertyInt( GetEntity( "hq" ), "Team" ) != gPlayerTeam)
{
SetObjectiveState( "PRI_1", OS_FAILED );
if(GetObjectiveState( "SEC_1" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_1", OS_FAILED );
SetCutScene(true, false, false);
BulletTime( GetEntity( "hq" ), false);
AddUserEvent( "Defeat", UE_BULLETTIME_END );
}
}
//============================================================================================================================
public AddSecondaryObj()
{
RemoveEvent( "AddSecondaryObj" );
SetObjectiveState( "SEC_1", OS_IN_PROGRESS );
}
//============================================================================================================================
public CountDownDone()
{
// if(gSecTimerRunning == false)
// {
RemoveEvent( "CountDownDone" );
if(GetPropertyInt( GetEntity( "hq" ), "Team" ) == gPlayerTeam)
{
SetCountDown( -1 );
SetObjectiveState( "PRI_1", OS_COMPLETED );
if(GetObjectiveState( "SEC_1" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_1", OS_FAILED );
Outro();
}
else
{
SetCountDown( -1 );
SetCutScene(true, true, true);
BulletTime( GetEntity( "hq" ), false, false, true, 15.0, 30.0 );
AddUserEvent( "Defeat", UE_BULLETTIME_END );
SetObjectiveState( "PRI_1", OS_FAILED );
if(GetObjectiveState( "SEC_1" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_1", OS_FAILED );
}
// ShowShortMessage( "#iMS12_MSG001#" );
}
//============================================================================================================================
// public SecondaryTimerRunner()
// {
// if(RunOnce[5] == false)
// {
// RunOnce[5] = true;
// gSecTimerRunning = true;
// }
// static counter = overtime;
// new Min;
// new Sec;
// Min = counter/60;
// Sec = counter-(Min*60);
// new sMin[50];
// new sSec[50];
// new Red[] = "#d##cred#";
// new White[] = "#d##cwhite#";
// new nullMin[] = "0";
// new nullSec[] = "0";
//
// Int2Str( Min, sMin, 10 );
// Int2Str( Sec, sSec, 10 );
// ConcatString( sMin, 40, nullMin, sMin );
// if(Sec < 10)
// ConcatString( sSec, 40, nullSec, sSec );
//
// if(counter <=60)
// {
// static bool:szinvalto = true;
// if(szinvalto == true)
// {
// szinvalto = false;
// ConcatString( sMin, 40, Red, sMin );
// ConcatString( sSec, 40, Red, sSec );
// }
// else
// {
// szinvalto = true;
// ConcatString( sMin, 40, White, sMin );
// ConcatString( sSec, 40, White, sSec );
// }
// }
// else
// {
// ConcatString( sMin, 40, White, sMin );
// ConcatString( sSec, 40, White, sSec );
// }
//
// ConcatString( sMin, 40, sMin, "#d##cwhite#:" );
// ConcatString( sMin, 40, sMin, sSec );
// if(counter == 0)
// {
// if(GetPropertyInt( GetEntity( "hq" ), "Team" ) == gPlayerTeam)
// {
// SetObjectiveState( "PRI_1", OS_COMPLETED );
// Outro();
// }
// }
// SetShortInfo(sMin);
// counter--;
// }
//============================================================================================================================
public V1CapturedOrDied(DrID:unit)
{
static counter = 0;
if(GetPropertyInt( unit, "Team" )== gPlayerTeam || GetPropertyInt( unit, "Team" ) == 0)
{
counter++;
if(GetDifficulty() == 0 && counter == 2)
{
SetObjectiveState( "SEC_1", OS_COMPLETED );
RemoveEvent( "V1CapturedOrDied" );
}
if(GetDifficulty() == 3 && counter == 5)
{
SetObjectiveState( "SEC_1", OS_COMPLETED );
RemoveEvent( "V1CapturedOrDied" );
}
if(GetDifficulty() != 0 && GetDifficulty() != 3 && counter == 3)
{
SetObjectiveState( "SEC_1", OS_COMPLETED );
RemoveEvent( "V1CapturedOrDied" );
}
}
}
//============================================================================================================================
public UnitDamagedFromDef1(DrID:unit)
{
if(GetPropertyInt( unit, "Team" ) == 1)
{
new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
if(ActHP <= MaxHP/1.5)
{
new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
if(state == 1)
{
CmdDigout(unit, Q_OVERRIDE);
SetBehav2Ent( unit, MB_MOVE_FREELY);
}
}
}
}
//============================================================================================================================
public UnitDamagedFromDef2(DrID:unit)
{
if(GetPropertyInt( unit, "Team" ) == 1)
{
new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
if(ActHP <= MaxHP/1.5)
{
new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
if(state == 1)
{
CmdDigout(unit, Q_OVERRIDE);
SetBehav2Ent( unit, MB_MOVE_FREELY);
}
}
}
}
//============================================================================================================================
public UnitDamagedFromDef3(DrID:unit)
{
if(GetPropertyInt( unit, "Team" ) == 1)
{
new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
if(ActHP <= MaxHP/1.5)
{
new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
if(state == 1)
{
CmdDigout(unit, Q_OVERRIDE);
SetBehav2Ent( unit, MB_MOVE_FREELY);
}
}
}
}
//============================================================================================================================
public UnitDamagedFromDef4(DrID:unit)
{
if(GetPropertyInt( unit, "Team" ) == 1)
{
new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(unit), "cDRVehicleBase"), "Body"), "HP" );
new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( unit, "cDRVehicle"), "Body"), "HP" );
if(ActHP <= MaxHP/1.5)
{
new state = GetPropertyInt( GetComponent( unit, "cDiginController"), "DiginState" );
if(state == 1)
{
CmdDigout(unit, Q_OVERRIDE);
SetBehav2Ent( unit, MB_MOVE_FREELY);
}
}
}
}
//============================================================================================================================
public TurretDestroyed(DrID:Unit)
{
new stringID[200];
new tmpstr[250];
GetPropertyString( Unit, "StringID", 200, stringID );
ConcatString( tmpstr, 200, "Turret destroyed:", stringID );
// ShowShortMessage( tmpstr );
}
public CaterpillarDestroyed(DrID:Unit)
{
// new stringID[200];
// new tmpstr[250];
// GetPropertyString( Unit, "StringID", 200, stringID );
// ConcatString( tmpstr, 200, "Caterpillar destroyed:", stringID );
// DebugMessage( stringID, DL_MESSAGE );
CmdStop( Unit, Q_OVERRIDE );
MakeVulnerable(Unit);
}
//============================================================================================================================
public TickTack()
{
static counter = 0;
counter++;
if(counter == 600)
{
Reinforcement( "polish", GetEntity( "deploy_polish" ), GetEntity( "deploy_polish" ) );
SetNationality("polish_reinf", "Polish");
ReinforceDelayer("polish_reinf");
Groupremover("polish_reinf");
}
if(counter == 900)
Reinforcement( "usa", GetEntity( "deploy_usa" ), GetEntity( "start_usa" ) );
if(counter == 1200)
{
RemoveEvent( "TickTack" );
Reinforcement( "polish", GetEntity( "deploy_polish" ), GetEntity( "deploy_polish" ) );
CmdGroupMoveToEnt( "polish_reinf", GetEntity( "wpb1" ), Q_OVERRIDE, MF_NONE, 1.0 );
CmdGroupMoveToEnt( "polish_reinf", GetEntity( "start_polish" ), Q_ENQUEUE, MF_NONE );
SetNationality("polish_reinf", "Polish");
ReinforceDelayer("polish_reinf");
Groupremover("polish_reinf");
}
}
//============================================================================================================================
public RadioTowerCaptured(DrID:tower)
{
if(RunOnce[9] == false && GetPropertyInt( tower, "Team" ) == gPlayerTeam)
{
RunOnce[9] = true;
SetObjectiveState( "SEC_2", OS_COMPLETED );
SetObjectiveState( "SEC_3", OS_IN_PROGRESS );
GiveParaTroopers(gPlayerTeam);
switch(GetDifficulty())
{
case 0:
{
gNewSpawnerNum+=1;
gNewReinfNum+=1;
gSSpanzernum = 1;
gStaticSSpanzernum = 1;
}
case 3:
{
gNewSpawnerNum+=5;
gNewReinfNum+=5;
gSSpanzernum = 5;
gStaticSSpanzernum = 5;
}
default:
{
gNewSpawnerNum+=3;
gNewReinfNum+=3;
gSSpanzernum = 3;
gStaticSSpanzernum = 3;
}
}
AddSoundMessage("#iMS12_SP011#", gSoundFile11);
AddSoundMessage("#iMS12_SP012#", gSoundFile12);
AddSoundMessage("#iMS12_SP013#", gSoundFile13);
}
if(RunOnce[10] == false && GetPropertyInt( tower, "Team" ) == 1)
{
RemoveEvent( "RadioTowerDestroyed" );
RunOnce[10] = true;
Move("grp_sspanzerz", bridge, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE );
if(GetObjectiveState( "SEC_3" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_3", OS_FAILED );
SetObjectiveState( "SEC_4", OS_IN_PROGRESS );
}
}
//============================================================================================================================
public RadioTowerDestroyed()
{
RemoveEvent( "RadioTowerDestroyed" );
gRadioTowerDestroyed = true;
if(GetObjectiveState( "SEC_2" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_2", OS_COMPLETED );
else
{
if(GetObjectiveState( "SEC_3" ) == OS_IN_PROGRESS)
{
SetObjectiveState( "SEC_3", OS_FAILED );
if(gSSpanzerzDestroyed == false)
Move("grp_sspanzerz", bridge, true, Q_ENQUEUE, MF_OVERRUN|MF_ATTACKMOVE );
SetObjectiveState( "SEC_4", OS_IN_PROGRESS );
}
}
}
//============================================================================================================================
public delayedV1()
{
RemoveEvent( "delayedV1" );
switch(GetDifficulty())
{
case 0:
{
gNewSpawnerNum+=2;
gNewReinfNum+=2;
gV1 = 2;
}
case 3:
{
gNewSpawnerNum+=5;
gNewReinfNum+=5;
gV1 = 5;
}
default:
{
gNewSpawnerNum+=3;
gNewReinfNum+=3;
gV1 = 3;
}
}
}
//============================================================================================================================
public delayedKonigz()
{
RemoveEvent( "delayedKonigz" );
switch(GetDifficulty())
{
case 3:
{
gNewSpawnerNum+=2;
gNewReinfNum+=2;
gKonigTigerz = 2;
}
default:
{
gNewSpawnerNum+=1;
gNewReinfNum+=1;
gKonigTigerz = 1;
}
}
}
//============================================================================================================================
public SSPanzerzDiedOrCaptured()
{
gStaticSSpanzernum--;
if(gStaticSSpanzernum == 0)
{
gSSpanzerzDestroyed = true;
if(GetObjectiveState( "SEC_3" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_3", OS_COMPLETED );
if(GetObjectiveState( "SEC_4" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_4", OS_COMPLETED );
Reinforcement( "polish", GetEntity( "deploy_polish" ), GetEntity( "deploy_polish" ) );
SetNationality("polish_reinf", "Polish");
ReinforceDelayer("polish_reinf");
Groupremover("polish_reinf");
AddSoundMessage("#iMS12_SP021#", gSoundFile21);
GiveAirStrike(gPlayerTeam);
}
}
//============================================================================================================================
public ArtilleryStrikeSoundMessage()
{
if(gArtilleryStrikeMessage == true)
AddSoundMessage("#iMS12_SP001#", gSoundFile1);
if(RunOnce[7] == false)
{
RunOnce[7] = true;
AddTimerEvent( "SoundMessageEnabled", 10.0, "GameLogic", true );
}
}
//============================================================================================================================
public RemoveSoundMessage()
{
RemoveEvent( "RemoveSoundMessage" );
RemoveEvent( "ArtilleryStrikeSoundMessage" );
}
//============================================================================================================================
public SoundMessageEnabled()
{
gArtilleryStrikeMessage = false;
}
//============================================================================================================================
public DeactivateEntityz()
{
new Iterator:i = Iterate( "area_outro" );
while(ItNext( i ))
{
new DrID:unit = ItEntity( i );
if((GetPropertyInt( unit, "Team" ) == gPlayerTeam ||
GetPropertyInt( unit, "Team" ) == 1 ||
GetPropertyInt( unit, "Team" ) == 0)
&& (IsInstanceOf( unit, GetClassID( "cVehicle" ))
|| IsInstanceOf( unit, GetClassID( "cSoldier" ))))
{
SetPropertyBool( unit, "Survivor", true );
HideEntity( unit );
DeActivateEntity( unit );
}
}
ItStop( i );
}
//============================================================================================================================
public UnitTeamChanged(DrID:unit, LastTeam)
{
if(IsInstanceOf( unit, GetClassID( "cVehicle" )))
{
if(GetPropertyInt( unit, "Team" ) == gPlayerTeam && LastTeam == 1)
SetPropertyString( unit, "Group", "" );
}
}
//============================================================================================================================
public Victory()
{
new bool:tigerismycat = false;
new Iterator:i = Iterate("grp_konigz");
while(ItNext( i ))
{
if(GetPropertyInt( ItEntity( i ), "Team" ) == gPlayerTeam)
tigerismycat = true
}
ItStop( i );
if(tigerismycat == true)
SetObjectiveState( "HID_1", OS_COMPLETED );
else
SetObjectiveState( "HID_1", OS_FAILED );
SetAlliance( gPlayerTeam, 1, AL_ENEMY );
SetAlliance( 1, gPlayerTeam, AL_ENEMY );
AddDebriefing("#iMISSION12_DB_P#");
EndMission( MS_ACCOMPLISHED );
}
public Defeat()
{
new bool:tigerismycat = false;
new Iterator:i = Iterate("grp_konigz");
while(ItNext( i ))
{
if(GetPropertyInt( ItEntity( i ), "Team" ) == gPlayerTeam)
tigerismycat = true
}
ItStop( i );
if(tigerismycat == true)
SetObjectiveState( "HID_1", OS_COMPLETED );
else
SetObjectiveState( "HID_1", OS_FAILED );
SetAlliance( gPlayerTeam, 1, AL_ENEMY );
SetAlliance( 1, gPlayerTeam, AL_ENEMY );
AddDebriefing("#iMISSION_DB_F#");
EndMission( MS_FAILED );
}
// public CaterpillarDest()
// {
// new Iterator:i = Iterate( "Selection" );
// while(ItNext( i ))
// {
// new DrID:DRComp = GetComponent( ItEntity( i ), "cDRVehicle");
// SetPropertyFloat( DRComp, "CaterpillarPercent", 0.0 );
// }
// ItStop( i );
// }
//
// public TurretDest()
// {
// new Iterator:i = Iterate( "Selection" );
// while(ItNext( i ))
// {
// new DrID:DRComp = GetComponent( ItEntity( i ), "cDRVehicle");
// SetPropertyFloat( DRComp, "TurretPercent", 0.0 );
// }
// ItStop( i );
// }
public PrevLevelHiddenCom()
{
RemoveEvent( "PrevLevelHiddenCom" );
AddSoundMessage("#iMS12_SP020#", gSoundFile20);
}
public Add2GermanGroup()
{
new Iterator:i = Iterate( "SelectorTeam1" );
while(ItNext( i ))
{
if(IsInstanceOf( ItEntity( i ), GetClassID( "cVehicle" )))
AddToGroup( "grp_German", ItEntity( i ) );
}
ItStop( i );
}
public ScenarioMode()
{
new Iterator:i = Iterate( "StartingPlayerUnits" );
while(ItNext( i ))
{
AddToGroup( "grp_intro1", ItEntity( i ) );
}
ItStop( i );
}
//============================================================================================================================
public SetNationality(group[], nationality[])
{
new Iterator:i = Iterate( group );
while(ItNext(i))
{
new DrID:Unit = ItEntity(i);
SetPropertyString( Unit, "Nationality", nationality );
}
}
//============================================================================================================================
public Groupremover(group[])
{
new Iterator:i = Iterate(group)
while(ItNext(i))
{
RemoveFromGroup( group, ItEntity(i));
}
ItStop(i);
}
//============================================================================================================================
public GlobalGroupRemover(DrID:Unit)
{
GroupRemover(Unit);
}
//============================================================================================================================
public ReinforceDelayer(group[])
{
new Iterator:i = Iterate( group );
while(ItNext( i ))
{
new DrID:entity = ItEntity( i );
if(IsInstanceOf( entity, GetClassID( "cVehicle" )))
{
static index = 0;
CmdWait( entity, Q_OVERRIDE, index*10.0 );
CmdMoveToEnt( entity, GetEntity( "wpb1" ), Q_ENQUEUE, MF_NONE, 1.0 );
CmdMoveToEnt( entity, GetEntity( "start_polish" ), Q_ENQUEUE, MF_NONE );
index++;
}
}ItStop( i );
}
public _NewTimer()
{
RemoveEvent( "_NewTimer" );
SetCountDown( overtime );
ShowShortMessage( "#d##cyellow##iMS12_MSG002#" );
}
public BulletTimeEnded()
{
RemoveEvent( "BulletTimeEnded" );
SetCutScene(false, true, true);
}