home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
Script
/
Source
/
Chapter3
/
MS11-C3L3.sma
< prev
next >
Wrap
Text File
|
2005-03-11
|
33KB
|
1,010 lines
// TUNING PARAMETERS:
// Here comes the parameters, which need fine tuning.
// new iMS11_SP001A[]="US Tank Commander: Seems like the Germans are regrouping nearby ... they almost had us.";
// new iMS11_SP001B[]="US Officer: Don't worry. A plane is already sent out to scout the area.";
// new iMS11_SP001C[]="US Pilot: The town is quiet. Seems like the Krauts aren't attacking yet.";
// new iMS11_SP001D[]="US Pilot: What the hell's going on around here?";
// new iMS11_SP001E[]="US Pilot: I'm hit!";
// new iMS11_SP002A[]="US Pilot: Thank you, my friends! I owe you one!";
// new iMS11_SP002B[]="US Soldier: Let's get back to the HQ at the town. You'll be safe there, Private!";
// new iMS11_SP002C[]="US Pilot: *coughs* In fact I am actually a Wing Commander."
// new iMS11_SP002D[]="US Soldier: My apologies, Sir! But we still got to hurry up!";
// new iMS11_SP002E[]="US Pilot: No problem. Let's go to that HQ!";
// new iMS11_SP003A[]="US Pilot: I am heading back to my Headquarters. Thank you again, fellows. I really owe you that one.";
// new iMS11_SP004A[]="US Soldier: Our bridge ... They blew it up!";
// new iMS11_SP005A[]="US Soldier: Look! The Big Tank is retreating!";
//new gTempWav[]="Sounds\\Game\\Speech\\Mission\\TEMPORARY.wav";
// TODO: ===============================================================================================
// Write here tasks to be done.
// DECLARATIONS: =======================================================================================
#include "script.inc"
#include antiair.inc
// Write here global variable declarations and definitions. All globals should start with letter: 'g'!
new gPilotName[66];
new bool:gPilotResced=false;
new Float:gWessideReinf=350.0;
new Float:gEassideReinf=460.0;
new Float:gInduljPilotert=666.666;
new Float:gEngineerAttack=456.789;
new bool:gElozopalya=false;
new gReinfNo=0;
//======================================================================================================
public main() // A palya belepesi pontja, helyette a PostGameStart fuggvenyt hasznald
CommonAKMain();
//======================================================================================================
public PostGameStart()
{
// Some must have stuff:
CommonAKInit();
// Add objectives:
// Add objective related events:
SetLvBehSentProp(123, true);
switch(GetDifficulty())
{
case 0:SetReinfNo(15);
case 1:SetReinfNo(10);
case 2:SetReinfNo(5);
case 3:SetReinfNo(3);
}
AddUserEvent( "TeamElimSucceed", UE_TEAMELIM_SUCC );
// AddUserEvent( "GroupSurviveFailed", UE_GROUP_SURV_FAIL );
AddUserEvent( "ObjectiveChanged", UE_OBJECTIVE_CHANGED );
// Additional Mission Objective:
StartIntro();
// Start doing some things:
AddAKEntityEvent( "SomeEntered", ANY_ENTITY, UNIT_AREA_ENTER );
AddAKEntityEvent( "SomeExited", ANY_ENTITY, UNIT_AREA_EXIT );
AddAKEntityEvent( "SomeHQCaptured", ANY_ENTITY, "cHQ,00" );
AddAKEntityEvent( "SomeMounted", ANY_ENTITY, UNIT_MOUNTED );
AddAKEntityEvent( "SomeTeamChanged", ANY_ENTITY, UNIT_TEAM_CHANGED );
AddAKEntityEvent( "BridgeDied", GetEntity( "westbridge" ), UNIT_DIED );
AddAKEntityEvent( "BridgeDied", GetEntity( "eastbridge" ), UNIT_DIED );
AddAKEntityEvent( "ShowReinfNo", ANY_ENTITY, "cReinforcementSystem,00" );
HackAntiAirInit();
AddTimerEvent( "YouReDaRealNigger", 1.0 );
gElozopalya=(GetGlobalVariable("gvMS10_Elifrit")==1);
}
public ShowReinfNo()
{
new DaTeam=GetMsgParamInt();
// ShowShortMessageP1( "Reinf / DaTeam %d", DaTeam );
if(DaTeam==gPlayerTeam)
{
gReinfNo++;
ReinfKiir();
}
}
public ReinfKiir()
{
new DrID:ReinfSys=GetPropertyObject( GetWorld(), "ReinforcementSystem");
new ReinfMax=GetPropertyInt( ReinfSys, "MultiReinforcementCount" );
new Kiirando[166];
if((ReinfMax-gReinfNo)<1)
{
SetShortInfo("#cred##d##iMS11_MSG001A#");
SetLvBehSentProp(123, false);
return;
}
Int2Str( (ReinfMax-gReinfNo), Kiirando, 10, "" );
ConcatString( Kiirando, 166, "#iMS11_MSG001B#", Kiirando );
if((ReinfMax-gReinfNo)<2)
{
Kiirando="#cred##d##iMS11_MSG001C#";
}
SetShortInfo(Kiirando);
}
public SetReinfNo(Hanyra)
{
new DrID:ReinfSys=GetPropertyObject( GetWorld(), "ReinforcementSystem");
SetPropertyInt( ReinfSys, "MultiReinforcementCount",Hanyra );
ReinfKiir();
}
public ShowTheStatz()
{
ShowShortMessage( "TEST EVENTA!" );
ShowTheStats();
}
public SomeTeamChanged(DrID:UndWho)
{
if(GetPropertyInt( UndWho, "Team" )==0)
{
SetPropertyString( UndWho, "Group", "");
}
}
public SomeMounted(DrID:UndWho)
{
new DrID:UndWhere=GetMsgParamObject();
static bool:AutoSent=false;
if(UndWho==GetEntity( gPilotName )&&UndWhere==GetEntity( "headquarters" )&&!AutoSent)
{
AutoSent=true;
GoAuto();
}
}
public SomeHQCaptured(DrID:UndHQ)
{
new DebugInfo[166];
GetPropertyString( UndHQ, "StringID", 100, DebugInfo );
ConcatString( DebugInfo, 166, "HQ Captured: ", DebugInfo );
DebugMessage( DebugInfo, DL_MESSAGE );
if(IsPlayer( GetEntity( "cityhq" ))
&&IsPlayer( GetEntity( "easthq" ))
&&IsPlayer( GetEntity( "westhq" )))
{
SetCountDown( 300 );
DebugMessage( "Player holds all!", DL_MESSAGE )
AddAKEntityEvent( "GameDoneMan", ANY_ENTITY, COUNTDOWN_DONE );
}
else
{
RemoveEvent( "GameDoneMan" );
SetCountDown( -1 );
DebugMessage( "Player needs to capture something", DL_MESSAGE )
}
if(!IsPlayer( GetEntity( "cityhq" ))
&&!IsPlayer( GetEntity( "easthq" ))
&&!IsPlayer( GetEntity( "westhq" )))
{
SetObjectiveState( "SecureMortain", OS_FAILED );
GameOverMan();
}
}
public SomeEntered(DrID:UndWho)
{
new DrID:UndWhere=GetMsgParamObject();
if(UndWhere==GetEntity( "nigger1" )||UndWhere==GetEntity( "nigger2" ))
{
AddAKEntityEvent( "DogoljMeg", UndWho, UNIT_DIED, 5.0);
}
if(UndWhere==GetEntity( "introropziarea1" )&&UndWho==GetEntity( "introrepzi" ))
{
RepziMegerkezett1();
DeActivateEntity( GetEntity( "introropziarea1" ) );
}
if(UndWhere==GetEntity( "introropziarea2" )&&UndWho==GetEntity( "introrepzi" ))
{
RepziMegerkezett2();
DeActivateEntity( GetEntity( "introropziarea2" ) );
}
if(UndWhere==GetEntity( "introropziarea3" )&&UndWho==GetEntity( "introrepzi" ))
{
RepziMegerkezett3();
DeActivateEntity( GetEntity( "introropziarea3" ) );
}
if(UndWhere==GetEntity( "introendarea" )&&UndWho==GetEntity( "introrepzi" ))
{
RepziMegerkezett4();
DeActivateEntity( GetEntity( "introendarea" ) );
}
if(UndWhere==GetEntity( "menedekarea" )&&IsPlayer(UndWho))
{
CmdUnmount( GetEntity( gPilotName ), Q_OVERRIDE );
SetPropertyInt( GetEntity( gPilotName ), "Team", gPlayerTeam );
CmdMoveToEnt( GetEntity( gPilotName ), UndWhere, Q_ENQUEUE, MF_TELEPORT );
CmdMoveToEnt( UndWho, GetEntity( gPilotName ), Q_OVERRIDE, MF_NONE );
DeActivateEntity( UndWhere );
AddTimerEvent( "PilotMovie", 3.0, "GameLogic", true );
}
if(UndWhere==GetEntity( "menedekarea" )&& UndWho==GetEntity( "pilotgetta" ))
{
CmdUnmount( GetEntity( gPilotName ), Q_OVERRIDE );
CmdUnmount( UndWho, Q_OVERRIDE, UMTF_UNMOUNT_ALL );
SetPropertyInt( GetEntity( gPilotName ), "Team", gPlayerTeam );
DeActivateEntity( UndWhere );
}
}
public SomeExited(DrID:UndWho)
{
new DrID:UndWhere=GetMsgParamObject();
if(UndWhere==GetEntity( "nigger1" )||UndWhere==GetEntity( "nigger2" ))
{
RemoveEntityEvent( "DogoljMeg", UndWho);
}
}
public PilotMovie()
{
static PilotPart=0;
static Float:ActGameSpeed;
static Float:CameraProps[3];
static Float:CameraPos[vec3];
switch(PilotPart)
{
case 0:
{
gPilotResced=true;
CameraProps[0]=GetCameraActualDistance();
CameraProps[1]=GetCameraActualPitch();
CameraProps[2]=GetCameraActualRotate();
GetCameraActualPos( CameraPos );
ActGameSpeed=GetGameSpeed();
RemoveEvent( "PilotPart" );
SetCutScene(true);
CameraSet(30.0,55.0, 15.0)
CameraFollow( GetEntity( gPilotName ) );
AddSoundMessage("#iMS11_SP002A#", "Sounds\\Game\\Speech\\Mission\\MS11_SP002A.mp3");
AddAKEntityEvent( "PilotMovie", ANY_ENTITY, MESSAGE_END );
}
case 1:
{
SetGameSpeed( 0.01 );
CmdStop( GetEntity( gPilotName ),Q_OVERRIDE );
CameraFollow( DrID:0 );
AddSoundMessage("#iMS11_SP002B#", "Sounds\\Game\\Speech\\Mission\\MS11_SP002B.mp3");
}
case 2:
{
AddSoundMessage("#iMS11_SP002C#", "Sounds\\Game\\Speech\\Mission\\MS11_SP002C.mp3");
}
case 3:
{
AddSoundMessage("#iMS11_SP002D#", "Sounds\\Game\\Speech\\Mission\\MS11_SP002D.mp3");
}
case 4:
{
AddSoundMessage("#iMS11_SP002E#", "Sounds\\Game\\Speech\\Mission\\MS11_SP002E.mp3");
}
case 5:
{
SetCutScene(false);
CameraSet(CameraProps[2], CameraProps[1], CameraProps[0])
TeleportCamera(CameraPos );
SetGameSpeed( ActGameSpeed );
AddAKEntityEvent( "PilotDied", GetEntity( gPilotName ), UNIT_DIED );
}
}
PilotPart++;
}
public PilotDied()
{
RemoveEvent( "PilotDied" );
SetObjectiveState( "FreeWilly", OS_FAILED );
}
public RepziMegerkezett1()
{
CameraFollow( GetEntity( "introrepzi" ) );
AddTimerEvent( "RotateLikeRepzi", 0.1 );
//AddSoundMessage("#iMS11_SP001B#", "Sounds\\Game\\Speech\\Mission\\MS11_SP001B.mp3");
}
public RepziMegerkezett2()
{
//AddSoundMessage("#iMS11_SP001C#", "Sounds\\Game\\Speech\\Mission\\MS11_SP001C.mp3");
}
public RepziMegerkezett3()
{
MakeVulnerable(GetEntity( "megelni" ));
DamageEntity( GetEntity( "megelni" ), 200.0, 49 );
CmdMoveToEnt( GetEntity( "medikk" ), GetEntity( "serult" ), Q_OVERRIDE, MF_NONE);
MakeVulnerable(GetEntity( "introrepzi" ));
CmdAttack( GetEntity( "bofors1" ), Q_OVERRIDE, GetEntity( "introrepzi" ) );
CmdAttack( GetEntity( "bofors2" ), Q_OVERRIDE, GetEntity( "introrepzi" ) );
AddAKEntityEvent( "RepziSerult", GetEntity( "introrepzi" ), UNIT_DAMAGED );
Belassit();
//AddSoundMessage("#iMS11_SP001D#", "Sounds\\Game\\Speech\\Mission\\MS11_SP001D.mp3");
CmdMount( GetEntity( "mgnest1" ), Q_OVERRIDE, GetEntity( "vicknest1" ) );
CmdMount( GetEntity( "mgnest2" ), Q_OVERRIDE, GetEntity( "vicknest2" ) );
CmdMoveToEnt( GetEntity( "bmftiger" ), GetEntity( "konigide" ), Q_OVERRIDE, MF_ATTACKMOVE);
CmdTurnToEnt( GetEntity( "bmftiger" ), GetEntity( "westbridge" ), Q_ENQUEUE );
CmdDigin(GetEntity( "bmftiger" ), Q_ENQUEUE);
UnitCallEvent(GetEntity( "bmftiger" ), "OljUrest", Q_ENQUEUE);
CmdMoveToEnt( GetEntity( "panta1" ), GetEntity( "pantaide1" ), Q_OVERRIDE, MF_ATTACKMOVE);
CmdTurnToEnt( GetEntity( "panta1" ), GetEntity( "westbridge" ), Q_ENQUEUE );
CmdDigin(GetEntity( "panta1" ), Q_ENQUEUE);
CmdMoveToEnt( GetEntity( "panta2" ), GetEntity( "pantaide2" ), Q_OVERRIDE, MF_ATTACKMOVE);
CmdTurnToEnt( GetEntity( "panta2" ), GetEntity( "westbridge" ), Q_ENQUEUE );
CmdDigin(GetEntity( "panta2" ), Q_ENQUEUE);
AddAKEntityEvent( "PantaDied", GetEntity( "panta1" ), UNIT_TEAM_CHANGED, 2.0 );
AddAKEntityEvent( "PantaDied", GetEntity( "panta2" ), UNIT_TEAM_CHANGED, 2.0 );
AddAKEntityEvent( "TigaDamag", GetEntity( "bmftiger"), UNIT_DAMAGED );
}
public TigaDamag(DrID:BMFTIG)
{
if(GetActualHealth( BMFTIG )<=300)
{
AddTimerEvent( "RetreatBazdmeg", 1.0, "GameLogic", true );
AddTimerEvent( "WessideTikTak", 10.0, "GameLogic", true );
}
}
public PantaDied()
{
if(GetPropertyInt( GetEntity( "panta1" ), "Team" )==0&&GetPropertyInt( GetEntity( "panta2" ), "Team" )==0)
{
AddTimerEvent( "RetreatBazdmeg", 5.0, "GameLogic", true );
AddTimerEvent( "WessideTikTak", 10.0, "GameLogic", true );
}
}
public RetreatBazdmeg()
{
RemoveEvent( "RetreatBazdmeg" );
RemoveEvent( "TigaDamag" );
RemoveEvent( "PantaDied" );
AddSoundMessage("#iMS11_SP005A#", "Sounds\\Game\\Speech\\Mission\\MS11_SP005A.mp3");
CmdDigout(GetEntity( "bmftiger"), Q_OVERRIDE);
SetBehav2Ent( GetEntity( "bmftiger"), MB_HOLD_POSITION, FB_RETURN_FIRE);
CmdMoveToEnt( GetEntity( "bmftiger"), GetEntity( "west1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdMoveToEnt( GetEntity( "bmftiger"), GetEntity( "westoffa" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdMoveToEnt( GetEntity( "bmftiger"), GetEntity( "westoffd" ), Q_ENQUEUE, MF_DIRECT+MF_ATTACKMOVE );
RemoveEvent( "SendMeEngineerEast" );
AddTimerEvent( "SendMeEngineer", gEngineerAttack, "GameLogic", true );
SendMeEngineer();
}
public BridgeDied()
{
if(!IsAlive(GetEntity( "eastbridge" ))||!IsAlive(GetEntity( "westbridge" )))
{
if(GetObjectiveState( "BothBridges" )!=OS_FAILED)
{
AddSoundMessage("#iMS11_SP004A#","Sounds\\Game\\Speech\\Mission\\MS11_SP004A.mp3");
SetObjectiveState( "BothBridges" , OS_FAILED);
}
}
if(!IsAlive(GetEntity( "eastbridge" ))&&!IsAlive(GetEntity( "westbridge" )))
{
SetObjectiveState( "KeepPassing" , OS_FAILED);
AddTimerEvent( "GameOverMan", 5.0, "GameLogic" , true );
}
}
public Dejaktivate(DrID:UndWho)
{
RemoveEntityEvent( "Dejaktivate" , UndWho);
DeActivateEntity( UndWho );
}
public GoAuto()
{
new DrID:DasAuto=GetEntity( "oto" );
ActivateEntity( DasAuto );
ShowEntity( DasAuto );
SetPropertyInt( DasAuto, "Team", 2 );
SetPropertyInt( DasAuto, "Team", 5 );
CmdWait(GetEntity( gPilotName), Q_OVERRIDE, 5.0);
CmdUnmount( GetEntity( gPilotName), Q_ENQUEUE );
UnitCallEvent(GetEntity( gPilotName), "ChangePilot");
AddAKEntityEvent( "ChangePilot", GetEntity( gPilotName), UNIT_UNMOUNTED );
CmdMoveToEnt( DasAuto, GetEntity( "auto1" ), Q_OVERRIDE, MF_OVERRUN );
CmdMoveToEnt( DasAuto, GetEntity( "auto2" ), Q_ENQUEUE, MF_OVERRUN );
CmdMoveToEnt( DasAuto, GetEntity( "auto3" ), Q_ENQUEUE, MF_NONE );
UnitCallEvent(DasAuto, "GoodByeWilly", Q_ENQUEUE);
}
public GoodByeWilly(DrID:DasAuto)
{
RemoveEvent( "GoodByeWilly" );
if(!IsAlive(GetEntity( gPilotName )))
{
LeaveAuto();
return;
}
SetPropertyInt( GetEntity( gPilotName ), "Team", 5 );
AddSoundMessage("#iMS11_SP003A#","Sounds\\Game\\Speech\\Mission\\MS11_SP003A.mp3");
CmdMount( GetEntity( gPilotName ), Q_OVERRIDE, DasAuto );
AddAKEntityEvent( "LeaveAuto", GetEntity( gPilotName ), UNIT_MOUNTED );
}
public LeaveAuto()
{
RemoveEvent( "LeaveAuto" );
new DrID:DasAuto=GetEntity( "oto" );
CmdMoveToEnt( DasAuto, GetEntity( "auto4" ), Q_OVERRIDE, MF_OVERRUN );
CmdMoveToEnt( DasAuto, GetEntity( "auto5" ), Q_ENQUEUE, MF_OVERRUN );
CmdMoveToEnt( DasAuto, GetEntity( "auto6" ), Q_ENQUEUE, MF_OVERRUN );
CmdMoveToEnt( DasAuto, GetEntity( "auto7" ), Q_ENQUEUE, MF_DIRECT );
UnitCallEvent(DasAuto, "KintVagyok");
}
public KintVagyok(DrID:DasAuto)
{
RemoveEvent( "KintVagyok" );
if( GetObjectiveState( "FreeWilly")!= OS_FAILED )
SetObjectiveState( "FreeWilly", OS_COMPLETED );
DeActivateEntity( DasAuto );
}
public ChangePilot(DrID:Pilot)
{
SetPropertyInt( Pilot, "Team", 5 );
ShowEntity( GetEntity( "oto" ) );
RemoveEvent( "ChangePilot" );
}
public RepziMegerkezett4()
{
MakeVulnerable(GetEntity( "introrepzi" ));
DropPara2Ent(6, "pilot", GetEntity( "introrepzi" ), ARF_DONT_CHECK_LIMIT);
new Iterator:iti=Iterate("pilota");
while(ItNext(iti))
{
GetPropertyString( ItEntity(iti), "StringID", 65, gPilotName );
}
ItStop(iti);
SetPropertyInt( GetEntity( gPilotName ), "Team", gPlayerTeam );
CameraFollow( GetEntity( gPilotName ));
DamageEntity( GetEntity( "introrepzi" ), 666.666, 49 );
AddTimerEvent( "LeertPilota", 7.5,"GameLogic",true );
}
public LeertPilota()
{
RemoveEvent( "LeertPilota" );
CameraFollow( DrID:0 );
CmdMoveToEnt( GetEntity( gPilotName ), GetEntity( "menedek" ), Q_OVERRIDE, MF_RUN );
CmdMount( GetEntity( gPilotName ), Q_ENQUEUE, GetEntity( "menedek" ));
AddTimerEvent( "StartTheMap", 2.5,"GameLogic",true );
}
public StartTheMap()
{
AddObjective( "SecureMortain", OT_PRIMARY, "#iMS11_PS01#", "#iMS11_PL01#", OS_IN_PROGRESS);
AddObjective( "KeepPassing", OT_PRIMARY, "#iMS11_PS02#", "#iMS11_PL02#", OS_IN_PROGRESS );
AddObjective( "BothBridges", OT_SECONDARY, "#iMS11_SS01#", "#iMS11_SL01#", OS_IN_PROGRESS );
AddObjective( "FreeWilly", OT_HIDDEN, "#iMS11_HS01#", "#iMS11_HL01#", OS_IN_PROGRESS );
AddMapTickToEnt( GetEntity( "cityhq" ), 15.0, MAPTICK_FLAG );
AddMapTickToEnt( GetEntity( "easthq" ), 15.0, MAPTICK_FLAG );
AddMapTickToEnt( GetEntity( "westhq" ), 15.0, MAPTICK_FLAG );
AddMapTickToEnt( GetEntity( "westbridge" ), 15.0, MAPTICK_CIRCLE );
AddMapTickToEnt( GetEntity( "eastbridge" ), 15.0, MAPTICK_CIRCLE );
AddTimerEvent( "SendMeEngineerEast", Float:(gEngineerAttack*1.5), "GameLogic", true );
RemoveEvent( "StartTheMap" );
SetCutScene(false);
SetPropertyInt( GetEntity( gPilotName ), "Team", 6);
TeleportCameraToEnt( GetEntity("introropziarea2") );
CameraSet(0.0, 55.0, 45.0)
GoWest("startoff", true);
MakeVulnerable(GetEntity( "bmftiger" ));
CmdWait( GetEntity( "eassidemassif" ), Q_OVERRIDE, gEassideReinf );
UnitCallEvent( GetEntity( "eassidemassif" ), "EassideTikTak", Q_ENQUEUE);
CmdWait( GetEntity( "wessidemassif" ), Q_OVERRIDE, gWessideReinf );
UnitCallEvent( GetEntity( "wessidemassif" ), "WessideTikTak", Q_ENQUEUE);
AddTimerEvent( "GetThaPilot", gInduljPilotert, "GameLogic", true );
if(gElozopalya)
{
AddTimerEvent( "GimmeBonusReinforce", 120.0, "GameLogic", true);
}
}
public GimmeBonusReinforce()
{
RemoveEvent( "GimmeBonusReinforce" );
Reinforcement( "bonusreinf", GetEntity( "reinf2d" ), GetEntity( "reinf2a" ));
AddSoundMessage("#iMS11_SP006A#", "Sounds\\Game\\Speech\\Mission\\MS11_SP006A.mp3" );
}
public SendMeEngineerEast()
{
new Float:Pozicio[vec3];
new DrID:Ingenier;
if(IsAlive(GetEntity( "eastbridge" )))
{
if(IsPlayer( GetEntity( "easthq" ) ))
{
new arriver[66];
new deployer[66];
if(Rnd(0,1))
{
arriver="eastoffa";
deployer="eastoffd";
}
else
{
arriver="eastbacka";
deployer="eastbackd";
}
GetPropertyVec3( GetEntity( deployer ), "LogicalPos_", Pozicio );
Ingenier=CreateEntity( "ax_engineer", Pozicio );
CmdMoveToEnt( Ingenier, GetEntity( arriver ), Q_OVERRIDE, MF_DIRECT );
CmdMoveToEnt( Ingenier, GetEntity( "east1" ), Q_ENQUEUE, MF_NONE);
CmdMoveToEnt( Ingenier, GetEntity( "east2" ), Q_ENQUEUE, MF_NONE);
CmdDetonate(Ingenier, Q_ENQUEUE,GetEntity( "eastbridge" ));
CmdMoveToEnt( Ingenier, GetEntity( "east1" ), Q_ENQUEUE, MF_NONE);
}
}
}
public SendMeEngineer()
{
new Float:Pozicio[vec3];
new DrID:Ingenier;
if(IsAlive(GetEntity( "eastbridge" )))
{
if(IsPlayer( GetEntity( "easthq" ) ))
{
new arriver[66];
new deployer[66];
if(Rnd(0,1))
{
arriver="eastoffa";
deployer="eastoffd";
}
else
{
arriver="eastbacka";
deployer="eastbackd";
}
GetPropertyVec3( GetEntity( deployer ), "LogicalPos_", Pozicio );
Ingenier=CreateEntity( "ax_engineer", Pozicio );
CmdMoveToEnt( Ingenier, GetEntity( arriver ), Q_OVERRIDE, MF_DIRECT );
CmdMoveToEnt( Ingenier, GetEntity( "east1" ), Q_ENQUEUE, MF_NONE);
CmdMoveToEnt( Ingenier, GetEntity( "east2" ), Q_ENQUEUE, MF_NONE);
CmdDetonate(Ingenier, Q_ENQUEUE, GetEntity( "eastbridge" ));
CmdMoveToEnt( Ingenier, GetEntity( "east1" ), Q_ENQUEUE, MF_NONE);
}
}
if(IsAlive(GetEntity( "westbridge" )))
{
GetPropertyVec3( GetEntity( "westoffd" ), "LogicalPos_", Pozicio );
Ingenier=CreateEntity( "ax_engineer", Pozicio );
CmdMoveToEnt( Ingenier, GetEntity( "westoffa" ), Q_OVERRIDE, MF_DIRECT );
CmdMoveToEnt( Ingenier, GetEntity( "west1" ), Q_ENQUEUE, MF_NONE);
CmdMoveToEnt( Ingenier, GetEntity( "west2" ), Q_ENQUEUE, MF_NONE);
CmdDetonate(Ingenier, Q_ENQUEUE , GetEntity( "westbridge"));
CmdMoveToEnt( Ingenier, GetEntity( "west1" ), Q_ENQUEUE, MF_NONE);
}
}
public GetThaPilot()
{
RemoveEvent( "GetThaPilot" );
ActivateEntity( GetEntity( "pilotgetta" ) );
ShowEntity( GetEntity( "pilotgetta" ) );
CmdMoveToEnt( GetEntity( "pilotgetta" ) , GetEntity( "west1" ), Q_OVERRIDE, MF_OVERRUN );
CmdMoveToEnt( GetEntity( "pilotgetta" ) , GetEntity( "introendarea" ), Q_ENQUEUE, MF_OVERRUN );
CmdMoveToEnt( GetEntity( "pilotgetta" ) , GetEntity( "menedekarea" ), Q_ENQUEUE, MF_OVERRUN );
UnitCallEvent(GetEntity( "pilotgetta" ) , "OttVagyunk", Q_ENQUEUE);
}
public OttVagyunk(DrID:UndWho)
{
if(!gPilotResced)
{
CmdUnmount( GetEntity( gPilotName ), Q_OVERRIDE );
}
CmdUnmount( GetEntity( "pilotgetta" ) , Q_OVERRIDE );
SetBehav( "pilotgettaz", MB_UNMODIFIED, FB_FIRE_AT_WILL);
if(!gPilotResced)
{
DeActivateEntity( GetEntity( "menedekarea" ) );
}
}
public WessideTikTak()
{
RemoveEvent( "WessideTikTak" );
new Randomma=Rnd(1,3);
new lTmpStr[66];
Int2Str( Randomma, lTmpStr, 66, "" );
ConcatString( lTmpStr, 66, "westside", lTmpStr );
Reinforcement( lTmpStr, GetEntity( "westoffd" ), GetEntity( "westoffa" ) );
CmdWait( GetEntity( "wessidemassif" ), Q_OVERRIDE, gWessideReinf );
UnitCallEvent( GetEntity( "wessidemassif" ), "WessideTikTak", Q_ENQUEUE);
SetBehav( "westside", MB_MOVE_IN_VICINITY, FB_FIRE_AT_WILL, _, DB_WRECKSONLY);
new Iterator:iti=Iterate("westside");
while(ItNext(iti))
{
GetPropertyString( ItEntity(iti), "EntityBaseName", 66, lTmpStr );
if(CompareString( lTmpStr, "ax_Sdkfz 11" )==0)
{
// ShowShortMessage( "Sdkfz 11 erkezett" );
CmdWait( ItEntity(iti), Q_OVERRIDE, 10.0 );
SetBehav2Ent( ItEntity(iti), _, FB_HOLD_FIRE, UB_EVAC);
}
}
GoWest("westside", true);
}
public EassideTikTak()
{
RemoveEvent( "EassideTikTak" );
new Randomma=Rnd(1,3);
new lTmpStr[66];
Int2Str( Randomma, lTmpStr, 66, "" );
new arriver[66];
new deployer[66];
if(Rnd(0,1))
{
arriver="eastoffa";
deployer="eastoffd";
}
else
{
arriver="eastbacka";
deployer="eastbackd";
}
ConcatString( lTmpStr, 66, "eastside", lTmpStr );
Reinforcement( lTmpStr, GetEntity( deployer ), GetEntity( arriver ) );
CmdWait( GetEntity( "eassidemassif" ), Q_OVERRIDE, gEassideReinf );
UnitCallEvent( GetEntity( "eassidemassif" ), "EassideTikTak", Q_ENQUEUE);
SetBehav( "eastside", MB_MOVE_IN_VICINITY, FB_FIRE_AT_WILL, _, DB_WRECKSONLY);
new Iterator:iti=Iterate("eastside");
while(ItNext(iti))
{
GetPropertyString( ItEntity(iti), "EntityBaseName", 66, lTmpStr );
if(CompareString( lTmpStr, "ax_Sdkfz 11" )==0)
{
// ShowShortMessage( "Sdkfz 11 erkezett" );
CmdWait( ItEntity(iti), Q_OVERRIDE, 10.0 );
SetBehav2Ent( ItEntity(iti), _, FB_HOLD_FIRE, UB_EVAC);
}
}
GoEast("eastside", true);
}
public StartIntro()
{
if(CheatDetector())
{
return;
}
SetCutScene(true);
TeleportCameraToEnt(GetEntity( "repair" ));
AddSoundMessage("#iMS11_SP001A#", "Sounds\\Game\\Speech\\Mission\\MS11_SP001A.mp3");
CameraSet(0.0, 55.0, 30.0)
CmdAttack( GetEntity( "megelni" ), Q_OVERRIDE, GetEntity( "bmftiger" ));
CmdAttack( GetEntity( "bmftiger" ), Q_OVERRIDE, GetEntity( "megelni" ));
new Iterator:iti=Iterate("meghalni");
while(ItNext(iti))
{
DamageEntity( ItEntity(iti), 666.666, 49 );
}
ItStop(iti);
new DrID:Repzi=GetEntity( "introrepzi");
MakeInvulnerable(Repzi);
CmdMoveToEnt( Repzi, GetEntity( "introropziarea1" ), Q_OVERRIDE, MF_NONE );
CmdMoveToEnt( Repzi, GetEntity( "introropziarea2" ), Q_ENQUEUE, MF_NONE );
CmdMoveToEnt( Repzi, GetEntity( "introropziarea3" ), Q_ENQUEUE, MF_NONE );
CmdMoveToEnt( Repzi, GetEntity( "introendarea" ), Q_ENQUEUE, MF_NONE );
CmdSetWM(GetEntity( "bofors1" ), Q_OVERRIDE, WM_AIR);
CmdSetWM(GetEntity( "bofors2" ), Q_OVERRIDE, WM_AIR);
CmdMoveToEnt( GetEntity( "serultke" ), GetEntity( "repair" ),Q_OVERRIDE, MF_DIRECT );
}
public RotateLikeRepzi()
{
SetCameraTargetRotate( GetEntityDir(GetEntity( "introrepzi" ) , DB_X_AXIS )-90.0);
}
public RepziSerult()
{
MakeInvulnerable(GetEntity( "introrepzi" ));
AddTimerEvent( "AjmHit", 1.5, "GameLogic", true );
RemoveEvent( "RepziSerult" );
}
public AjmHit()
{
RemoveEvent( "AjmHit" );
//AddSoundMessage("#iMS11_SP001E#", "Sounds\\Game\\Speech\\Mission\\MS11_SP001E.mp3");
new DrID:Repzi=GetEntity( "introrepzi");
MakeVulnerable(Repzi);
DamageEntity( Repzi, Float:(GetActualHealth(Repzi)-1.0), 49 );
MakeInvulnerable(Repzi);
RemoveEvent( "RotateLikeRepzi" );
}
//======================================================================================================
public TeamElimSucceed()
{
new Team=GetMsgParamInt();
if(Team==123)
{
SetCutScene(true);
GameOverMan();
SetObjectiveState( "SecureMortain", OS_FAILED );
}
if(Team==666&&GetDifficulty()==0)
{
Reinforcement( "easy_extra", GetEntity( "reinf2d" ), GetEntity( "reinf2a" ));
Reinforcement( "easy_extra", GetEntity( "eastd" ), GetEntity( "easta" ));
}
}
//======================================================================================================
// Add your functions here:
public Belassit()
{
RemoveEvent( "Belassit" );
AddTimerEvent( "RealLassit", 0.01, "AnimLogic", false );
AddTimerEvent( "Kilassit", 4.5, "AnimLogic", true );
}
public Kilassit()
{
RemoveEvent( "Kilassit" );
AddTimerEvent( "RealLassit", 0.01, "AnimLogic", false );
}
public RealLassit()
{
static Float:OrigGameSpeed;
static Float:TargetGameSpeed=0.1;
static Float:SpeedLeptek;
static bool:Init=true;
static bool:Lassit=true;
if(Init)
{
OrigGameSpeed=GetGameSpeed();
SpeedLeptek=(OrigGameSpeed-TargetGameSpeed)/66.0;
Init=false;
}
SetGameSpeed(GetGameSpeed()-SpeedLeptek);
if(GetGameSpeed()<=TargetGameSpeed && Lassit) //lelassult
{
SetGameSpeed( TargetGameSpeed );
TargetGameSpeed=OrigGameSpeed;
Init=true;
Lassit=false;
RemoveEvent( "RealLassit" );
}
if(GetGameSpeed()>=TargetGameSpeed && !Lassit) //felgyorsult
{
SetGameSpeed( TargetGameSpeed );
TargetGameSpeed=OrigGameSpeed;
Init=true;
Lassit=true;
RemoveEvent( "RealLassit" );
}
}
public OljUrest(DrID:UndWho)
{
RemoveEntityEvent("OljUrest", UndWho);
SetPropertyInt( UndWho, "DestroyEmptyBehavior", 3 );
}
//======================================================================================================
public ObjectiveChanged()
{
// Check objectives here
}
public GoEast(Group[],bool:Direction)
{
if(Direction)
{
CmdGroupMoveToEnt( Group, GetEntity( "east1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "east2" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(IsAlive(GetEntity( "eastbridge" )))
{
CmdGroupMoveToEnt( Group, GetEntity( "east3" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "east4" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(GetPropertyInt( GetEntity( "easthq" ), "Team" )==gPlayerTeam)
{
CmdGroupMoveToEnt( Group, GetEntity( "eastbase" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
}
if(GetPropertyInt( GetEntity( "cityhq" ), "Team" )==gPlayerTeam)
{
GoLow(Group, true);
}
}
else
{
CmdGroupMoveToEnt( Group, GetEntity( "east1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
GoUp(Group, true);
}
}
}
public GoWest(Group[],bool:Direction)
{
if(Direction)
{
CmdGroupMoveToEnt( Group, GetEntity( "west1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(GetPropertyInt( GetEntity( "westhq" ), "Team" )==gPlayerTeam)
{
CmdGroupMoveToEnt( Group, GetEntity( "westbase" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
}
CmdGroupMoveToEnt( Group, GetEntity( "west2" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(IsAlive(GetEntity( "westbridge" )))
{
CmdGroupMoveToEnt( Group, GetEntity( "west3" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "west4" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(GetPropertyInt( GetEntity( "cityhq" ), "Team" )==gPlayerTeam)
{
CmdGroupMoveToEnt( Group, GetEntity( "citybase" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
}
if(GetPropertyInt( GetEntity( "easthq" ), "Team" )==gPlayerTeam)
{
GoLow(Group, false);
}
}
else
{
GoUp(Group, false);
}
}
}
public GoUp(Group[],bool:Direction)
{
if(Direction)
{
CmdGroupMoveToEnt( Group, GetEntity( "up1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up2" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up3" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up4" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up5" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
GoWest(Group, true);
}
else
{
CmdGroupMoveToEnt( Group, GetEntity( "up5" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up4" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up3" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up2" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "up1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
GoEast(Group, true);
}
}
public GoLow(Group[],bool:Direction)
{
if(Direction)
{
CmdGroupMoveToEnt( Group, GetEntity( "low1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "low2" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "low3" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(GetPropertyInt( GetEntity( "cityhq" ), "Team" )==gPlayerTeam)
{
CmdGroupMoveToEnt( Group, GetEntity( "citybase" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
}
}
else
{
if(GetPropertyInt( GetEntity( "cityhq" ), "Team" )==gPlayerTeam)
{
CmdGroupMoveToEnt( Group, GetEntity( "citybase" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
}
CmdGroupMoveToEnt( Group, GetEntity( "low3" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "low2" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
CmdGroupMoveToEnt( Group, GetEntity( "low1" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
if(GetPropertyInt( GetEntity( "easthq" ), "Team" )==gPlayerTeam)
{
CmdGroupMoveToEnt( Group, GetEntity( "eastbase" ), Q_ENQUEUE, MF_ATTACKMOVE+MF_OVERRUN );
}
}
}
public GameDoneMan()
{
SetObjectiveState( "SecureMortain", OS_COMPLETED );
SetObjectiveState( "KeepPassing", OS_COMPLETED );
if(GetObjectiveState( "BothBridges" )!=OS_FAILED)
{
SetObjectiveState( "BothBridges", OS_COMPLETED );
}
if(GetObjectiveState( "FreeWilly" )==OS_IN_PROGRESS
&&IsAlive(GetEntity( gPilotName )))
{
SetObjectiveState( "FreeWilly", OS_COMPLETED );
}
else
{
if(GetObjectiveState( "FreeWilly" )!=OS_COMPLETED)
SetObjectiveState( "FreeWilly", OS_FAILED );
}
if(GetObjectiveState( "FreeWilly" )==OS_COMPLETED)
{
SetGlobalVariable("gvMS11_Pilot",1);
}
else
{
SetGlobalVariable("gvMS11_Pilot",0);
}
RemoveEvent( "GameDoneMan" );
AddDebriefing("#iMISSION11_DB_P#");
if(GetObjectiveState( "FreeWilly" )==OS_COMPLETED)
{
AddDebriefing("#iMISSION11_DB_H#");
}
SetCutScene(true);
EndMission( MS_ACCOMPLISHED );
}
public GameOverMan()
{
RemoveEvent( "GameOverMan" );
AddDebriefing("#iMISSION_DB_F#");
SetCutScene(true);
EndMission( MS_FAILED );
}
public YouReDaRealNigger()
{
static Float:Lofasz=1.0;
new Float:lTmpVec3[vec3];
GetPropertyVec3( GetEntity( "nigger1" ), "LogicalPos_", lTmpVec3 );
lTmpVec3[vec3:x]+=Lofasz;
SetPropertyVec3( GetEntity( "nigger1" ), "Pos", lTmpVec3 );
GetPropertyVec3( GetEntity( "nigger2" ), "LogicalPos_", lTmpVec3 );
lTmpVec3[vec3:x]+=Lofasz;
SetPropertyVec3( GetEntity( "nigger2" ), "Pos", lTmpVec3 );
if(Lofasz==1.0)
{
Lofasz=-1.0;
}
else
{
Lofasz=1.0;
}
new Iterator:iti=Iterate("nigger1");
new DrID:Ureske;
while(ItNext(iti))
{
Ureske=ItEntity(iti);
if(IsInstanceOf( Ureske, GetClassID( "cVehicle" ) )&&!IsWreck(Ureske)&&(GetPropertyInt( Ureske, "Team" )==0))
{
DamageEntity( Ureske, 5.0, 49 );
}
}
iti=Iterate("nigger2");
while(ItNext(iti))
{
Ureske=ItEntity(iti);
if(IsInstanceOf( Ureske, GetClassID( "cVehicle" ) )&&!IsWreck(Ureske)&&(GetPropertyInt( Ureske, "Team" )==0))
{
DamageEntity( Ureske, 10.0, 49 );
}
}
}
public DogoljMeg(DrID:Hullajelolt)
{
RemoveEntityEvent( "DogoljMeg" , Hullajelolt);
DamageEntity( Hullajelolt, 1000.0, 49 );
}