home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
Script
/
Source
/
Chapter2
/
MS06-C2L2.sma
< prev
next >
Wrap
Text File
|
2005-03-11
|
25KB
|
840 lines
#include "Script.inc"
#include "visualeffects.inc"
#include "antiair.inc"
#define max_run_once 7
/*
Temp Speeches:
US Soldier: Buza Laszlo aka Buza
US Tank Commander: Ovari Tamas aka aTom
US Officer: Zalabai Peter aka Timber
*/
//GlobalParams
//============================================================================================================================
new iMS06_SP001[]="#iMS06_SP001#";
new iMS06_SP002[]="#iMS06_SP002#";
new iMS06_SP003[]="#iMS06_SP003#";
new iMS06_SP004[]="#iMS06_SP004#";
new iMS06_SP005[]="#iMS06_SP005#";
new iMS06_SP006[]="#iMS06_SP006#";
new iMS06_SP007[]="#iMS06_SP007#";
new gFueltanksum = 0;
new gWarehouse = 0;
new DestFueltank = 0;
new DestWarehouse = 0;
new Float:gOra;
// new Float:Fog = 0.0;
new bool:RunOnce[max_run_once];
//name constant
new gBunker1[] = "big_bunker1";
new gBunker2[] = "big_bunker2";
new gTarget1[] = "wp_target_1";
new gTarget2[] = "wp_target_2";
new gHouse1[] = "house1";
new gHouse2[] = "house2";
new gHouse3[] = "house3";
new gHouse4[] = "house4";
new gfueltank1[] = "fueltank1";
new gStartWP1[] = "wp_start1";
new gStartWP2[] = "wp_start2";
new gActor1[] = "actor1";
new gActor2[] = "actor2";
new gSmallbunker1[] = "bunker1";
new gSmallbunker2[] = "bunker2";
new gSmallbunker3[] = "bunker3";
new gHelphouse1[] = "helphouse1";
new gHelphouse2[] = "helphouse2";
new gHelphouse3[] = "helphouse3";
//group constant
new gPantherz[] = "grp_pantherz";
new gAirguns[] = "AirGuns";
new gPort[] = "grp_port";
new gHelperz[] = "grp_Helperz"
new gFueltankz[] = "grp_fueltankz";
new gPorthouses[] = "grp_porthouses";
new gMobilForce[] = "grp_MobilForce";
new gIntro1[] = "grp_intro1";
new gIntro2[] = "grp_intro2";
// new gOberStumFhurer[] = "oberstumfuhrer";
new gBunkerz[] = "grp_bunkerz";
new gBunkercrew1[] = "grp_Bunker1Crew";
new gBunkercrew2[] = "grp_Bunker2Crew";
new gBunkercrew3[] = "grp_Bunker3Crew";
//soundfiles
new gSoundFile1[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP001.mp3";
new gSoundFile2[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP002.mp3";
new gSoundFile3[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP003.mp3";
new gSoundFile4[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP004.mp3";
new gSoundFile5[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP005.mp3";
new gSoundFile6[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP006.mp3";
new gSoundFile7[] = "Sounds\\Game\\Speech\\Mission\\MS06_SP007.mp3";
//============================================================================================================================
public main()
CommonAKMain();
//============================================================================================================================
public PostGameStart()
{
CommonAKInit();
//Level Init
ScenarioMode();
Add2GermanGroup();
forbidden_grp_num = 2;
gForbiddenGroups[0] = "grp_pantherz";
gForbiddenGroups[1] = "grp_AirDefense";
HideEntity( GetEntity( "sys_palyahatar1" ) );
for(new counter = 0; counter <= max_run_once-1; counter++)
{
RunOnce[counter] = false;
}
//fadein
AddTimerEvent( "Fadeout", 0.001 );
AddTimerEvent("FogSet", 0.001);
//Megszamlaljuk hany tartaj es haz van
gFueltanksum = CountEntitiesInSelector( gFueltankz );
gWarehouse = CountEntitiesInSelector( gPorthouses );
//szamlalas vege
new PrevLevel = GetGlobalVariable("gvMS05_BonusTank");
if(PrevLevel != 1)
{
new Iterator:i = Iterate( "grp_bonuspz" );
while(ItNext( i ))
{
DeActivateEntity( ItEntity( i ) );
HideEntity( ItEntity( i ) );
}
ItStop( i );
}
else
AddAKEntityEvent( "PZIsSeleceted", ANY_ENTITY, ENTITY_SELECTED );
SetBehav("SelectorTeam1",MB_MOVE_IN_VICINITY,_,_,_,_,_);
SetBehav( gAirguns,_,_,UB_NEVER,DB_DISABLED,_,_ );
SetBehav(gPort,MB_MOVE_IN_VICINITY,FB_FIRE_AT_WILL,UB_EVAC,DB_DISABLED,_,_);
SetBehav(gMobilForce,MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC,DB_DISABLED,_,_);
SetBehav( "grp_flakguardz", MB_MOVE_IN_VICINITY,FB_FIRE_AT_WILL);
SetBehav( "grp_radiocarz", MB_MOVE_IN_VICINITY, FB_HOLD_FIRE, UB_EVAC);
SetBehav( gPantherz, MB_MOVE_IN_VICINITY,FB_FIRE_AT_WILL,UB_EVAC,DB_DISABLED,_,_);
SetBehav2Ent( GetEntity( "surprise_panzer" ), MB_MOVE_FREELY, FB_FIRE_AT_WILL, UB_EVAC );
SetNationality("SelectorTeam2", "American");
//Bunkerz opening fire!
CmdAttack( GetEntity( gBunker1 ), Q_OVERRIDE, GetEntity( gTarget1 ) );
CmdAttack( GetEntity( gBunker2 ), Q_OVERRIDE, GetEntity( gTarget2 ) );
//Timer Events
AddTimerEvent( "BunkerTargetPos", 30.0 );
AddTimerEvent( "RandomWaterImpact", 3.0, "GameLogic", true);
AddTimerEvent( "ParticleDestroyer", 10.0, "GameLogic", true);
//User Events
AddUserEvent( "GroupEliminated", UE_GROUPELIM_SUCC );
AddUserEvent( "TeamEliminated", UE_TEAMELIM_SUCC );
AddUserEvent( "ObjectiveChanged", UE_OBJECTIVE_CHANGED);
//Code Events
AddAKEntityEvent( "AreaEnterCheck", ANY_ENTITY, UNIT_AREA_ENTER );
AddAKEntityEvent( "CountDownDone", ANY_ENTITY, COUNTDOWN_DONE );
AddAKEntityEvent( "HQCaptured", ANY_ENTITY, HQ_TAKEOVER );
AddAKSelectorEvent( "Help", gPort, UNIT_HIT );
AddAKSelectorEvent( "HiddenObjective", gFueltankz, UNIT_DIED );
AddAKSelectorEvent( "SecondaryObjective", gPorthouses, UNIT_DIED );
AddAKEntityEvent( "FueltankDestroyCutscene", GetEntity(gfueltank1), UNIT_DIED );
AddAKSelectorEvent( "BunkerDamaged", gBunkerz, UNIT_DAMAGED );
// AddAKEntityEvent( "kiiras", ANY_ENTITY, TEST_EVENT );
AddAKSelectorEvent( "GlobalGroupRemover", "grp_German", UNIT_TEAM_CHANGED );
AddObjective( "PRI_Port", OT_PRIMARY, "#iMS06_PS01#", "#iMS06_PL01#", OS_SLEEPING );
AddObjective( "SEC_PortDestroyed", OT_SECONDARY, "#iMS06_SS01#", "#iMS06_SL01#", OS_SLEEPING );
AddObjective( "SEC_AirDefense", OT_SECONDARY, "#iMS06_SS02#", "#iMS06_SL02#", OS_SLEEPING );
AddObjective( "HID_OilTanks", OT_HIDDEN, "#iMS06_HS01#", "#iMS06_HL01#", OS_SLEEPING );
switch(GetDifficulty())
{
case 0://easy
{
GiveAirRecon(gPlayerTeam);
gOra = 270.0;
}
case 1,2://medium hard
{
gOra = 270.0;
}
case 3://extreme
{
gOra = 210.0;
}
}
Intro();
}
//============================================================================================================================
public ObjectiveChanged()
{
if(GetObjectiveState( "PRI_Port" ) == OS_COMPLETED)
{
if(GetObjectiveState( "HID_OilTanks" ) == OS_IN_PROGRESS)
{
SetObjectiveState( "HID_OilTanks", OS_COMPLETED );
SetGlobalVariable("gvMS06_OilTankz",1);
}
if(GetObjectiveState( "SEC_PortDestroyed" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_PortDestroyed", OS_COMPLETED );
if(GetObjectiveState( "SEC_AirDefense" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_AirDefense", OS_FAILED );
SetCutScene(true);
BulletTime( GetEntity( "hq" ), false, false, false, 35.0, 30.0);
AddUserEvent( "Victory", UE_BULLETTIME_END );
}
if(GetObjectiveState("PRI_Port") == OS_FAILED)
{
if(GetObjectiveState( "SEC_PortDestroyed" ) == OS_IN_PROGRESS)
SetObjectiveState( "SEC_PortDestroyed", OS_FAILED );
}
}
//============================================================================================================================
public FogReducer()
{
new DrID:WeatherManager = GetPropertyObject( GetWorld(), "Weather" );
new Float:MaxRange = GetPropertyFloat( WeatherManager, "FogMaxRange" );
if(MaxRange < 1000.0)
MaxRange = MaxRange + 1.0;
else
RemoveEvent( "FogReducer" );
SetPropertyFloat( WeatherManager, "FogMaxRange", MaxRange );
//debug
// Fog = MaxRange;
}
//============================================================================================================================
public FogSet()
{
new DrID:WeatherManager = GetPropertyObject( GetWorld(), "Weather" );
static Float:MaxRange;
//set fog
if(RunOnce[1] == false)
{
RunOnce[1] = true;
SetPropertyFloat( WeatherManager, "FogMaxRange", 0.0 );
SetPropertyFloat( WeatherManager, "FogMinRange", 0.0 );
MaxRange = 1000.0;
}
//end
if(MaxRange > 100.0)
{
MaxRange -= 0.35;
SetPropertyFloat( WeatherManager, "FogMaxRange", MaxRange );
}
else
{
RemoveEvent( "FogSet" );
AddTimerEvent( "FogReducer", 1.0 );
}
}
//============================================================================================================================
public GroupEliminated()
{
new ID = GetMsgParamInt();
if(ID == 20)
{
AddSoundMessage(iMS06_SP006, gSoundFile6);
GiveArtilleryAttack(gPlayerTeam);
RemoveEvent( "RandomWaterImpact" );
}
if(ID == 30)
{
AddSoundMessage(iMS06_SP007, gSoundFile7);
SetParatroopers(gPlayerTeam,1);
SetObjectiveState( "SEC_AirDefense", OS_COMPLETED );
}
if(ID == 100)
{
if(GetObjectiveState( "HID_OilTanks" ) == OS_IN_PROGRESS)
{
SetObjectiveState( "HID_OilTanks", OS_COMPLETED );
SetGlobalVariable("gvMS06_OilTankz",1);
new Iterator:i = Iterate( gFueltankz, "cDamageableEntity" );
while(ItNext( i ))
{
// MakeInvulnerable(ItEntity( i ));
SetPropertyBool( GetComponent( ItEntity( i ), "cDRSimple"), "Invulnerable", true );
}
ItStop( i );
}
if(RunOnce[6] == false)
CountDownDone();
}
}
//============================================================================================================================
public Fadeout()
{
static Float:light = 0.0;
if(light >= 0.55)
{
RemoveEvent( "Fadeout" );
SetPropertyFloat( GetWorld(), "AmbientIntensity", 0.55);
SetPropertyFloat( GetWorld(), "DirLightIntensity", 0.55);
AddTimerEvent( "DawnToDay", 0.1 );
}
else
{
light+= 0.0001;
SetPropertyFloat( GetWorld(), "AmbientIntensity", light);
SetPropertyFloat( GetWorld(), "DirLightIntensity", light);
}
}
//============================================================================================================================
public AreaEnterCheck(DrID:Unit, DrID:Area)
{
new DrID:area = GetEntity( "area_perimeter" );
if(RunOnce[0] == false && area == Area && GetPropertyInt( Unit, "Team" ) == gPlayerTeam )
{
RunOnce[0] = true;
DebugMessage( "A gamer elerte a varos hatarat! Itt jon a megsemmisetes cutscene", DL_MESSAGE );
Destroy(gPantherz, GetEntity( gHouse1 ) );
DestroyCutscene();
}
}
//============================================================================================================================
public CountDownDone()
{
RunOnce[6] = true;
RemoveEvent( "CountDownDone" );
RemoveEvent( "DestroyAgain" );
RemoveEvent( "PortHouseInfo" );
CmdGroupStop( gPantherz, Q_OVERRIDE );
SetBehav( gPantherz, MB_MOVE_FREELY);
if(DestWarehouse == gWarehouse)
{
SetObjectiveState( "SEC_PortDestroyed", OS_FAILED );
AddSoundMessage(iMS06_SP005, gSoundFile5);
}
else
{
SetObjectiveState( "SEC_PortDestroyed", OS_COMPLETED );
new Iterator:i = Iterate( gPorthouses );
while(ItNext( i ))
{
MakeInvulnerable(ItEntity( i ));
}
ItStop( i );
}
SetCountDown( -1 );
SetShortInfo("");
}
//============================================================================================================================
public BunkerTargetPos()
{
static bool:state = false;
new DrID:Target1 = GetEntity( gTarget1 );
new DrID:Target2 = GetEntity( gTarget2 );
new Float:TargetPos1[vec3];
new Float:TargetPos2[vec3];
GetPropertyVec3( Target1, "LogicalPos_", TargetPos1 );
GetPropertyVec3( Target2, "LogicalPos_", TargetPos2 );
if(state == false)
{
state = true;
TargetPos1[vec3:y] += 50.0;
TargetPos2[vec3:y] -= 50.0;
SetPropertyVec3( Target1, "Pos", TargetPos1 );
SetPropertyVec3( Target2, "Pos", TargetPos2 );
}
else
{
state = false;
TargetPos1[vec3:y] -= 50.0;
TargetPos2[vec3:y] += 50.0;
SetPropertyVec3( Target1, "Pos", TargetPos1 );
SetPropertyVec3( Target2, "Pos", TargetPos2 );
}
}
//============================================================================================================================
public Destroy(group[], DrID:target)
{
if(IsAlive(target))
{
new Iterator:i = Iterate(group);
while(ItNext( i ))
{
new DrID:Unit = ItEntity( i );
if(IsAlive(Unit))
{
CmdAttack( Unit, Q_ENQUEUE, target , AF_FORCE);
}
}
}
}
//============================================================================================================================
public DestroyAgain()
{
static counter = 0;
switch(counter)
{
case 0: Destroy(gPantherz, GetEntity(gHouse2));
case 1: Destroy(gPantherz, GetEntity(gfueltank1));
case 2: Destroy(gPantherz, GetEntity(gHouse3));
case 3: Destroy(gPantherz, GetEntity(gHouse4));
}
counter++;
}
//============================================================================================================================
public TeamEliminated()
{
new ID = GetMsgParamInt();
if(ID == 10)
{
SetCutScene(true, true, true);
SetObjectiveState( "PRI_Port", OS_FAILED );
CallUserEvent( UE_OBJECTIVE_CHANGED );
new DrID:LastPlayerUnit = GetLastKilledEntity();
BulletTime( LastPlayerUnit, false);
AddUserEvent( "GameOver", UE_BULLETTIME_END );
}
if(ID == 20 && RunOnce[5] == false)
{
RunOnce[5] = true;
if(GetDifficulty() == 0)
{
Reinforcement( "help_to_easy", GetEntity( "wp_reinforcement" ), GetEntity( "wp_incoming" ));
}
}
}
//============================================================================================================================
public HQCaptured(DrID:HQ)
{
if(GetPropertyInt( HQ, "Team" )== gPlayerTeam)
{
SetObjectiveState( "PRI_Port", OS_COMPLETED );
CallUserEvent( UE_OBJECTIVE_CHANGED );
}
}
//============================================================================================================================
public Help(DrID:Unit)
{
static counter = 0;
if(counter == 5)
RemoveEvent( "Help" );
else
{
new Iterator:i = Iterate( gHelperz );
while(ItNext( i ))
{
new DrID:Helper = ItEntity( i );
if(IsAlive(Helper))
{
CmdMoveToEnt( Helper, Unit, Q_ENQUEUE, MF_ATTACKMOVE );
}
}
}
counter++;
}
//============================================================================================================================
public HiddenObjective()
{
DestFueltank++;
}
//============================================================================================================================
public SecondaryObjective()
{
DestWarehouse++;
PortHouseInfo();
}
//============================================================================================================================
public Intro()
{
SetCutScene(true, true, true);
SetSpeedInSelector( gIntro2, 8.0 );
FormationMoveToEnt(gIntro2,GetEntity(gStartWP2),Q_OVERRIDE, MF_DIRECT);
AddAKEntityEvent( "IntroSpeech", GetEntity( gActor1 ), UNIT_ARRIVED );
TeleportCameraToEnt(GetEntity( gActor1 ));
CameraFollow( GetEntity( gActor1 ) );
SetCameraPitchSpeed(30.0);
SetCameraZoomSpeed(2.0);
SetCameraRotSpeed(2.0);
SetCameraActualPitch(85.0);
SetCameraActualDistance(35.0);
SetCameraActualRotate(90.0);
SetCameraTargetPitch(85.0);
SetCameraTargetDistance(35.0);
SetCameraTargetRotate(90.0);
SetCameraTargetRotate(-89.0);
SetCameraTargetDistance( 30.0 );
SetCameraTargetPitch( 55.0 );
}
public IntroSpeech()
{
static counter = 0;
switch(counter)
{
case 0:
{
RemoveEvent("IntroSpeech");
AddAKEntityEvent( "IntroSpeech", ANY_ENTITY, MESSAGE_END );
AddSoundMessage(iMS06_SP001, gSoundFile1);
CameraFollow( DrID:0 );
}
case 1:
{
RemoveEvent( "IntroSpeech" );
AddTimerEvent( "IntroSpeech", 2.0, "GameLogic", true );
SetSpeedInSelector( gIntro1, 8.0 );
FormationMoveToEnt(gIntro1,GetEntity(gStartWP1),Q_OVERRIDE, MF_DIRECT);
}
case 2:
{
RemoveEvent("IntroSpeech");
TeleportCameraToEnt(GetEntity( gActor2 ));
CameraFollow( GetEntity( gActor2 ) );
SetCameraRotSpeed(5.5);
SetCameraActualPitch(85.0);
SetCameraActualDistance(30.0);
SetCameraActualRotate(90.0);
SetCameraTargetPitch(85.0);
SetCameraTargetDistance(30.0);
SetCameraTargetRotate(90.0);
SetCameraTargetRotate(-1.0);
SetCameraTargetDistance( 40.0 );
SetCameraTargetPitch( 55.0 );
AddSoundMessage(iMS06_SP002, gSoundFile2);
AddAKEntityEvent( "IntroOver", GetEntity(gActor2), UNIT_ARRIVED );
}
}
counter++;
}
public IntroOver()
{
RemoveEvent( "IntroOver" );
SetCutScene(false);
CameraFollow( DrID:0 );
ResetCameraSpeed();
SetSpeedInSelector( gIntro1, 0.0 );
SetSpeedInSelector( gIntro2, 0.0 );
HackAntiAirInit();
//Ojjektivak
SetObjectiveState( "PRI_Port", OS_IN_PROGRESS );
SetObjectiveState( "SEC_AirDefense", OS_IN_PROGRESS );
SetObjectiveState( "HID_OilTanks", OS_IN_PROGRESS );
SetPropertyBool( GetEntity( "hq" ), "VisibleOnMiniMap", true );
}
//============================================================================================================================
public DestroyCutscene()
{
SetCutScene(true, false, true);
new Float:Pos[vec3];
GetPropertyVec3( GetEntity(gHouse1), "LogicalPos_", Pos );
new DrID:Fow = CreateEntity( "fowbacon_30", Pos );
SetPropertyString( Fow, "StringID", "HouseFOW" );
SetPropertyInt( Fow, "Team", gPlayerTeam );
SetPropertyBool( Fow, "GadgetsVisible", false );
RefreshFOW();
CamPosStore();
TeleportCameraToEnt(GetEntity( gHouse1 ));
SetCameraPitchSpeed(30.0);
SetCameraZoomSpeed(2.0);
SetCameraRotSpeed(2.0);
SetCameraActualDistance( 45.0 );
SetCameraActualPitch( 65.0 );
SetCameraActualRotate( 90.0 );
SetCameraTargetDistance( 45.0 );
SetCameraTargetPitch( 65.0 );
SetCameraTargetRotate( 90.0 );
SetCameraTargetDistance( 55.0 );
SetCameraTargetPitch( 45.0 );
SetCameraTargetRotate( 180.0 );
AddSoundMessage(iMS06_SP003, gSoundFile3);
AddSoundMessage(iMS06_SP004, gSoundFile4);
// AddAKEntityEvent( "DestroyCutsceneOver", ANY_ENTITY, MESSAGE_END );
AddTimerEvent( "DestroyCutsceneOver", 10.0, "GameLogic", true);
}
//============================================================================================================================
public DestroyCutsceneOver()
{
RemoveEvent( "DestroyCutsceneOver" );
CamPosRestore();
SetPropertyFloat( GetEntity( "HouseFOW" ), "FOWRangeRadius", 0.0 );
SetPropertyInt( GetEntity( "HouseFOW" ), "Team", 0 );
SetCutScene(false, false, true);
SetCountDown( floatround(gOra)*4 );
AddTimerEvent( "DestroyAgain", gOra-10.0, "GameLogic", true );
SetObjectiveState( "SEC_PortDestroyed", OS_IN_PROGRESS );
PortHouseInfo();
}
//============================================================================================================================
public FueltankDestroyCutscene()
{
RemoveEvent( "FueltankDestroyCutscene" );
BulletTime(GetEntity( gfueltank1 ), true, false, false, 30.0, 40.0 );
AddUserEvent( "HiddenIsFailed", UE_BULLETTIME_END );
}
//============================================================================================================================
public SetNationality(group[], nationality[])
{
new Iterator:i = Iterate( group );
while(ItNext(i))
{
new DrID:Unit = ItEntity(i);
SetPropertyString( Unit, "Nationality", nationality );
}
}
//============================================================================================================================
public DawnToDay()
{
static Float:light = 0.55;
if(light >= 1.0)
{
RemoveEvent( "DawnToDay" );
SetPropertyFloat( GetWorld(), "AmbientIntensity", 1.0);
SetPropertyFloat( GetWorld(), "DirLightIntensity", 1.0);
}
else
{
light+= 0.001;
SetPropertyFloat( GetWorld(), "AmbientIntensity", light);
SetPropertyFloat( GetWorld(), "DirLightIntensity", light);
//debug
/* new tmpstr1[255];
new tmpstr2[255];
Float2Str( light, tmpstr1, 254 );
Float2Str( Fog, tmpstr2, 254 );
ConcatString( tmpstr1, 255, tmpstr1, "#b#" );
ConcatString( tmpstr1, 255, tmpstr1, tmpstr2 );
SetShortInfo(tmpstr1);*/
}
}
//============================================================================================================================
public BunkerDamaged(DrID:Building)
{
new Float:MaxHP=GetPropertyFloat( GetPropertyObject(GetBaseComponentBase(GetBaseEntity(Building), "cDRBuildingBase"), "Body"), "HP" );
new Float:ActHP=GetPropertyFloat( GetPropertyObject(GetComponent( Building, "cDRBuilding"), "Body"), "HP" );
if(GetEntity(gSmallbunker1) == Building)
{
if(RunOnce[2] == false && ActHP <= MaxHP/4)
{
RunOnce[2] = true;
CmdGroupSetMS( gBunkercrew1, Q_OVERRIDE, MS_RUN );
CmdGroupUnmount( gBunkercrew1, Q_ENQUEUE );
CmdGroupMount( gBunkercrew1, Q_ENQUEUE, GetEntity( gHelphouse1 ) );
}
}
if(GetEntity(gSmallbunker2) == Building)
{
if(RunOnce[3] == false && ActHP <= MaxHP/4)
{
RunOnce[3] = true;
CmdGroupSetMS( gBunkercrew2, Q_OVERRIDE, MS_RUN );
CmdGroupUnmount( gBunkercrew2, Q_ENQUEUE );
CmdGroupMount( gBunkercrew2, Q_ENQUEUE, GetEntity( gHelphouse2 ) );
}
}
if(GetEntity(gSmallbunker3) == Building)
{
if(RunOnce[4] == false && ActHP <= MaxHP/4)
{
RunOnce[4] = true;
CmdGroupSetMS( gBunkercrew3, Q_OVERRIDE, MS_RUN );
CmdGroupUnmount( gBunkercrew3, Q_ENQUEUE );
CmdGroupMount( gBunkercrew3, Q_ENQUEUE, GetEntity( gHelphouse3 ) );
}
}
}
//============================================================================================================================
public Victory()
{
RemoveEvent( "Victory" );
AddDebriefing("#iMISSION06_DB_P#");
if(GetObjectiveState( "SEC_PortDestroyed" ) == OS_COMPLETED)
AddDebriefing("#iMISSION06_DB_S#");
EndMission(MS_ACCOMPLISHED);
}
public GameOver()
{
RemoveEvent( "GameOver" );
AddDebriefing("#iMISSION_DB_F#");
EndMission(MS_FAILED);
}
// public kiiras()
// {
// ShowShortMessageP1( "gFueltanksum %d", gFueltanksum );
// ShowShortMessageP1( "DestFueltank %d", DestFueltank );
// ShowShortMessageP1( "gWarehouse %d", gWarehouse );
// ShowShortMessageP1( "DestWarehouse %d", DestWarehouse );
// }
public PZIsSeleceted(DrID:Unit)
{
if(GetEntity( "panzer" ) == Unit)
{
RemoveEvent( "PZIsSeleceted" );
AddSoundMessage("#iMS06_SP008#", gSoundFile1);
}
}
public Add2GermanGroup()
{
new Iterator:i = Iterate( "SelectorTeam1" );
while(ItNext( i ))
{
if(IsInstanceOf( ItEntity( i ), GetClassID( "cVehicle" )))
AddToGroup( "grp_German", ItEntity( i ) );
}
ItStop( i );
}
public PortHouseInfo()
{
static HouseNum = 0;
HouseNum = CountLivingInSelector( gPorthouses );
if(HouseNum == 0)
{
SetShortInfo("");
CountDownDone();
return;
}
new HouseNumSTR[2];
Int2Str( HouseNum, HouseNumSTR, 2 );
new OriginalHouseNumSTR[2];
Int2Str( gWarehouse, OriginalHouseNumSTR, 2 );
new WareHouseSTR[] = "#d##iMS06_MSG001#";
new Separator[] = "#d#:";
new tmpstr1[20];
new tmpstr2[40];
new tmpstr3[60];
ConcatString( tmpstr1, 20, WareHouseSTR, HouseNumSTR );
ConcatString( tmpstr2, 40, tmpstr1, Separator );
ConcatString( tmpstr3, 55, tmpstr2, OriginalHouseNumSTR );
ConcatString( tmpstr3, 60, "#d#", tmpstr3 );
SetShortInfo(tmpstr3);
}
public HiddenIsFailed()
{
RemoveEvent( "HiddenIsFailed" );
SetObjectiveState( "HID_OilTanks", OS_FAILED );
SetGlobalVariable("gvMS06_OilTankz", 0);
}
public ScenarioMode()
{
new Iterator:i = Iterate( "StartingPlayerUnits" );
while(ItNext( i ))
{
AddToGroup( "grp_intro1", ItEntity( i ) );
}
ItStop( i );
}
public RandomWaterImpact()
{
new Float:AreaPos[vec3];
new Float:RndPos[vec3];
new DrID:area = GetEntity( "area_random_impact" );
GetPropertyVec3( area, "LogicalPos_", AreaPos )
RndPos[vec3:x] = FloatRnd( -(GetPropertyFloat( area, "SizeX" )/2), (GetPropertyFloat( area, "SizeX" )/2) )+AreaPos[vec3:x];
RndPos[vec3:y] = FloatRnd( -(GetPropertyFloat( area, "SizeY" )/2), (GetPropertyFloat( area, "SizeY" )/2) )+AreaPos[vec3:y];
RndPos[vec3:z] = 0.0;
new DrID:Effect = CreateEntity( "patricle_water_impact", RndPos );
if(Effect==DrID:0)
{
DebugMessage( "Effect name is not valid or do not exist!", DL_WARNING );
}
else
{
AddToGroup( "particle", Effect );
}
}
public ParticleDestroyer()
{
new Iterator:i = Iterate( "particle", "cAKEntity" );
while(ItNext(i))
DestructEntity( ItEntity(i) );
ItStop(i);
}
public GlobalGroupRemover(DrID:Unit)
{
GroupRemover(Unit);
}