------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ -------------------------- C1M00 - THE EVENING -------------------------- ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ iCheck = 0 b_isInCutScene01a = false b_isInCutScene01b = false b_follow_denz = true b_follow_esteban = true i_playvoicedenz = 0 i_playvoiceesteban = 0 i_callcutscenedenz = 0 i_callcutsceneesteban = 0 i_scene03 = 0 b_state = true b_IsDenzAlive = false i_death_denz_win = 0 i_death_denz_fail = 0 b_IsEstebanAlive = false i_death_esteban_win = 0 i_death_esteban_fail = 0 t_respawn_denz = { true, true, true } t_respawn_esteban = { true, true, true } g_sEvent = { "A", "X", "Y", "B", "A" } function ManageLevel() if( Menu.IsPoped() ) then if( b_isInCutScene01a ) then ObjectFactory.GetComponent( "ExProd", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "RomVin", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "ProdMan", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "IsaPen", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "TechDir", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "BenJac", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "LeaArt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "AmBey", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "LeaGamProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "HarPou", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "CoGir", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "CharDes", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "RomSur", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Ato", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "MoCap", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "WriDir", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "YanTam", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_Center_1", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_Left_1", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_Right_1", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) end if( b_isInCutScene01b ) then ObjectFactory.GetComponent( "MusicComp", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_MusicComp", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "MusicComp_1", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "3DAnim", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_3DAnim", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "FXProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_FXProg", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "SoundDes", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_SoundDes", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "QATeam", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_QATeam", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) for i_cpt_3danim = 1, 2 do ObjectFactory.GetComponent( "3DAnim_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "FXProg_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "SoundDes_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "QATeam_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) end ObjectFactory.GetComponent( "GameProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_GameProg", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "MoCapStunt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_MoCapStunt", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) for i_cpt_gpro = 1, 3 do ObjectFactory.GetComponent( "GameProg_"..i_cpt_gpro, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "MoCapStunt_"..i_cpt_gpro, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) end ObjectFactory.GetComponent( "ConcArt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_ConcArt", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) for i_cpt_coart = 1, 4 do ObjectFactory.GetComponent( "ConcArt_"..i_cpt_coart, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) end ObjectFactory.GetComponent( "GDLD", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_GDLD", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "EngProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_EngProg", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) for i_cpt_gd = 1, 5 do ObjectFactory.GetComponent( "GDLD_"..i_cpt_gd, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "EngProg_"..i_cpt_gd, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) end ObjectFactory.GetComponent( "MoCapAnim", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_MocapAnim", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) for i_cpt_mocap = 1, 9 do ObjectFactory.GetComponent( "MoCapAnim_"..i_cpt_mocap, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) end ObjectFactory.GetComponent( "2D3DArt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) ObjectFactory.GetComponent( "Panel_2D_Artist", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", false ) for i_cpt_2dart = 1, 10 do ObjectFactory.GetComponent( "2D3DArt_"..i_cpt_2dart, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", false ) end end else if( b_isInCutScene01a ) then ObjectFactory.GetComponent( "ExProd", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "RomVin", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "ProdMan", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "IsaPen", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "TechDir", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "BenJac", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "LeaArt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "AmBey", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "LeaGamProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "HarPou", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "CoGir", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "CharDes", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "RomSur", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Ato", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "MoCap", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "WriDir", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "YanTam", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_Center_1", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_Left_1", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_Right_1", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) end if( b_isInCutScene01b ) then ObjectFactory.GetComponent( "MusicComp", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_MusicComp", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "MusicComp_1", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "3DAnim", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_3DAnim", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "FXProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_FXProg", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "SoundDes", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_SoundDes", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "QATeam", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_QATeam", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) for i_cpt_3danim = 1, 2 do ObjectFactory.GetComponent( "3DAnim_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "FXProg_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "SoundDes_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "QATeam_"..i_cpt_3danim, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) end ObjectFactory.GetComponent( "GameProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_GameProg", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "MoCapStunt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_MoCapStunt", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) for i_cpt_gpro = 1, 3 do ObjectFactory.GetComponent( "GameProg_"..i_cpt_gpro, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "MoCapStunt_"..i_cpt_gpro, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) end ObjectFactory.GetComponent( "ConcArt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_ConcArt", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) for i_cpt_coart = 1, 4 do ObjectFactory.GetComponent( "ConcArt_"..i_cpt_coart, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) end ObjectFactory.GetComponent( "GDLD", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_GDLD", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "EngProg", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_EngProg", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) for i_cpt_gd = 1, 5 do ObjectFactory.GetComponent( "GDLD_"..i_cpt_gd, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "EngProg_"..i_cpt_gd, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) end ObjectFactory.GetComponent( "MoCapAnim", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_MocapAnim", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) for i_cpt_mocap = 1, 9 do ObjectFactory.GetComponent( "MoCapAnim_"..i_cpt_mocap, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) end ObjectFactory.GetComponent( "2D3DArt", "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) ObjectFactory.GetComponent( "Panel_2D_Artist", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", true ) for i_cpt_2dart = 1, 10 do ObjectFactory.GetComponent( "2D3DArt_"..i_cpt_2dart, "PlayAll::GameServices::HudTextLabel" ):SetMemberValue( "IsVisible", true ) end end end --ManageLevel = function() end end function Unfreeze( sActorName, fDelay ) if( fDelay == 0 or fDelay == nil ) then Crusaders.Unfreeze( ObjectFactory.GetActor( sActorName ) ) else ScriptEventManager.AddTimedEvent( fDelay, [[ Crusaders.Unfreeze( ObjectFactory.GetActor( ]] .. sActorName .. [[ ) )]] ) end end function Teleport( sActorSrc, sActorDest ) ObjectFactory.GetComponent( sActorSrc, "CrCharacterController" ):Invoke( "TeleportTo", sActorDest ) end ----------------------------------------------------------------------------------------------------------------------- function OpenDoor() ObjectFactory.GetComponent( "CrAnimProp_8", "CrAnimProps" ):SetMemberValue( "PlayAnim", true ) end function Init() CrComboWorld.Disable(true) CrGameEngine.SetLastStand(false) -- Level.InitSound() CutSceneManager.PreLoadCutScene( "Data:/Levels/C1M00_BADDREAM/CutScene01a.lua", "C1M00Scene01a" ) Level.Intro() -- Level.ChooseGoToChurchCoop() -- Level.LaunchQTEDenz() -- Crusaders.SetObjective( "Player", "Anim_Death_Walk", 0 ) end function InitCheckPoint( iIndex ) if ( iIndex == 1 ) then iCheck = 1 CrComboWorld.Disable(true) CrGameEngine.SetLastStand(false) CutSceneManager.PreLoadCutScene( "Data:/Levels/C1M00_BADDREAM/CutScene02b.lua", "C1M00Scene02b" ) if ( CrGameEngine.GetSoloMode() ) then CutSceneManager.PlayCutScene() else Level.b_enemy_denz = false Level.b_enemy_esteban = false CutSceneManager.PlayCutScene() end end end function InitSound() SoundManager.PlaySound( "Sound_Camp_Fire_01", Vector3.New( -2929.000, 29.400, 2.400) ) SoundManager.PlaySound( "Sound_Torch_Fire_01", Vector3.New( -2890.000, -103.100, 28.520) ) SoundManager.PlaySound( "Sound_Torch_Fire_01", Vector3.New( -2793.0000, 18.820, 23.880) ) end function Intro() CutSceneManager.PlayCutScene() end function ChooseCoop() SoundManager.PlayMusic("CRU_10_battle_huge") if ( CrGameEngine.GetSoloMode() ) then Level.Embush() Level.LoadVoiceDenz() else Level.EmbushCoop() Level.LoadVoiceDenz() Level.LoadVoiceEsteban() end end function LoadVoiceDenz() SoundManager.LoadVoice( "C1M00_SCENE01_DENZ_03" ) SoundManager.LoadVoice( "C1M00_SCENE01_DENZ_04" ) SoundManager.LoadVoice( "C1M00_SCENE01_DENZ_05" ) end function LoadVoiceEsteban() SoundManager.LoadVoice( "C1M00_SCENE01_ESTEBAN_02" ) SoundManager.LoadVoice( "C1M00_SCENE01_ESTEBAN_03" ) SoundManager.LoadVoice( "C1M00_SCENE01_ESTEBAN_04" ) end function Embush() PostProcess.Activate( "ColorToScreen", 3, 0.5, 1, Vector3.New( { 0.0, 0.0, 0.0 } ) ) ObjectFactory.EnterStep("03a-Embush") KTUMission.Activate('Obj01_Eliminate_Thief_Denz') ScriptEventManager.AddTimedEvent( 5, [[KTUMission.Activate('Tips01_Attack')]] ) ScriptEventManager.AddTimedEvent( 10, [[KTUMission.Validate('Tips01_Attack')]] ) ScriptEventManager.AddTimedEvent( 10, [[KTUMission.Activate('Tips02_Defense')]] ) ScriptEventManager.AddTimedEvent( 15, [[KTUMission.Validate('Tips02_Defense')]] ) ObjectFactory.GetComponent( "Player", "CrArsenal" ):Invoke( "ForceWeaponChange", "4" ) ScriptEventManager.AddTimedEvent( 1, [[Level.Unfreeze( "Thief_Denz_3")]] ) Crusaders.SetObjective( "Thief_Denz_3", "ObjAttackPlayer", 1) ScriptEventManager.AddTimedEvent( 1.5, [[Level.Unfreeze( "Thief_Denz_4")]] ) Crusaders.SetObjective( "Thief_Denz_4", "ObjAttackPlayer", 1.5) ScriptEventManager.AddTimedEvent( 2, [[Level.Unfreeze( "Thief_Denz_5")]] ) Crusaders.SetObjective( "Thief_Denz_5", "ObjAttackPlayer", 2) -- ScriptEventManager.AddTimedEvent( 2.3, [[Level.Unfreeze( "Thief_Denz_6")]] ) -- Crusaders.SetObjective( "Thief_Denz_6", "ObjAttackPlayer", 2.3) for i_cpt = 1, 5 do ScriptEventManager.RegisterEvent( "Thief_Denz_"..i_cpt, "DIE", [[KTUMission.Validate('Obj01_Eliminate_Thief_Denz'); Level.PlayVoiceDenz()]] ) end end function PlayVoiceDenz() Level.i_playvoicedenz = Level.i_playvoicedenz + 1 if ( Level.i_playvoicedenz == 1 ) then SoundManager.PlayVoice( "C1M00_SCENE01_DENZ_03", "Player" ) elseif ( Level.i_playvoicedenz == 3 ) then SoundManager.PlayVoice( "C1M00_SCENE01_DENZ_04", "Player" ) elseif ( Level.i_playvoicedenz == 5 ) then SoundManager.PlayVoice( "C1M00_SCENE01_DENZ_05", "Player" ) end end function PlayVoiceEsteban() Level.i_playvoiceesteban = Level.i_playvoiceesteban + 1 if ( Level.i_playvoiceesteban == 1 ) then SoundManager.PlayVoice( "C1M00_SCENE01_ESTEBAN_02", "Mercs_01" ) elseif ( Level.i_playvoiceesteban == 3 ) then SoundManager.PlayVoice( "C1M00_SCENE01_ESTEBAN_03", "Mercs_01" ) elseif ( Level.i_playvoiceesteban == 5 ) then SoundManager.PlayVoice( "C1M00_SCENE01_ESTEBAN_04", "Mercs_01" ) end end function EmbushCoop() i_validateembushcoop = 0 b_enemy_denz = true b_enemy_esteban = true PostProcess.Activate( "ColorToScreen", 3, 0.5, 1, Vector3.New( { 0.0, 0.0, 0.0 } ) ) ObjectFactory.EnterStep("03b-EmbushCoop") KTUMission.Activate('Obj01_Eliminate_Thief_Denz_Coop') KTUMission.Activate('Obj01_Eliminate_Thief_Esteban_Coop') ScriptEventManager.AddTimedEvent( 5, [[KTUMission.Activate('Tips01_Attack')]] ) ScriptEventManager.AddTimedEvent( 10, [[KTUMission.Validate('Tips01_Attack')]] ) ScriptEventManager.AddTimedEvent( 10, [[KTUMission.Activate('Tips02_Defense')]] ) ScriptEventManager.AddTimedEvent( 15, [[KTUMission.Validate('Tips02_Defense')]] ) ObjectFactory.GetComponent( "Player", "CrArsenal" ):Invoke( "ForceWeaponChange", "4" ) ObjectFactory.GetComponent( "Mercs_01", "CrArsenal" ):Invoke( "ForceWeaponChange", "5" ) ScriptEventManager.AddTimedEvent( 1, [[Level.Unfreeze( "Thief_Denz_3")]] ) Crusaders.SetObjective( "Thief_Denz_3", "ObjAttackPlayer", 1) ScriptEventManager.AddTimedEvent( 1.5, [[Level.Unfreeze( "Thief_Denz_4")]] ) Crusaders.SetObjective( "Thief_Denz_4", "ObjAttackPlayer", 1.5) ScriptEventManager.AddTimedEvent( 2, [[Level.Unfreeze( "Thief_Denz_5")]] ) Crusaders.SetObjective( "Thief_Denz_5", "ObjAttackPlayer", 2) -- ScriptEventManager.AddTimedEvent( 2.3, [[Level.Unfreeze( "Thief_Denz_6")]] ) -- Crusaders.SetObjective( "Thief_Denz_6", "ObjAttackPlayer", 2.3) ScriptEventManager.AddTimedEvent( 1.5, [[Level.Unfreeze( "Thief_Esteban_4")]] ) Crusaders.SetObjective( "Thief_Esteban_4", "ObjAttackMercs", 1.5) ScriptEventManager.AddTimedEvent( 2, [[Level.Unfreeze( "Thief_Esteban_5")]] ) Crusaders.SetObjective( "Thief_Esteban_5", "ObjAttackMercs", 2) -- ScriptEventManager.AddTimedEvent( 2.3, [[Level.Unfreeze( "Thief_Esteban_6")]] ) -- Crusaders.SetObjective( "Thief_Esteban_6", "ObjAttackMercs", 2.3) for i_cpt = 1, 5 do ScriptEventManager.RegisterEvent( "Thief_Denz_"..i_cpt, "DIE", [[Level.ReviveEnemy_Denz("Thief_Denz_]] .. i_cpt .. [["); Level.PlayVoiceDenz(); Level.CallCutsceneDenz()]] ) end for i_cpt = 2, 5 do ScriptEventManager.RegisterEvent( "Thief_Esteban_"..i_cpt, "DIE", [[Level.ReviveEnemy_Esteban("Thief_Esteban_]] .. i_cpt .. [["); Level.PlayVoiceEsteban(); Level.CallCutsceneEsteban()]] ) end ScriptEventManager.RegisterEvent( "Thief_Esteban_1", "DIE", [[Level.PlayVoiceEsteban(); Level.CallCutsceneEsteban()]] ) end function ReviveEnemy_Denz(s_enemy_denz) if( not Level.b_enemy_denz ) then return false end local i_time = math.random(2, 4) ScriptEventManager.AddTimedEvent(i_time, [[ObjectFactory.GetComponent("]] .. s_enemy_denz .. [[", 'CrCharacterArmor' ):Invoke( "Revive" )]]) ScriptEventManager.AddTimedEvent(i_time, [[ObjectFactory.GetComponent("]] .. s_enemy_denz .. [[", 'CrCharacterArmor' ):Invoke( "RestoreArmor" )]]) ScriptEventManager.AddTimedEvent(i_time, [[Crusaders.Teleport("]] .. s_enemy_denz .. [[", "RespawnEnemy_Denz_]]..Level.Math_Denz()..[[")]]) ScriptEventManager.AddTimedEvent(i_time, [[Crusaders.SetObjective("]] .. s_enemy_denz .. [[", "ObjAttackPlayer")]]) ScriptEventManager.RegisterEvent( s_enemy_denz, "DIE", [[Level.ReviveEnemy_Denz("]] .. s_enemy_denz .. [["); Level.CallCutsceneDenz()]]) end function Math_Denz() if( Level.t_respawn_denz[1] == false and Level.t_respawn_denz[2] == false and Level.t_respawn_denz[3] == false ) then return math.random( 1, 3) end repeat i_math_denz = math.random( 1, 3) until ( Level.t_respawn_denz[i_math_denz] ) return i_math_denz end function ChangeRespawnDenz_1( oTriggerFlag, oActor ) if(oTriggerFlag == 2) then Level.t_respawn_denz[1] = false return true elseif( oTriggerFlag == 4 ) then Level.t_respawn_denz[1] = true return true end return false end function ChangeRespawnDenz_2( oTriggerFlag, oActor ) if(oTriggerFlag == 2) then Level.t_respawn_denz[2] = false return true elseif( oTriggerFlag == 4 ) then Level.t_respawn_denz[2] = true return true end return false end function ChangeRespawnDenz_3( oTriggerFlag, oActor ) if(oTriggerFlag == 2) then Level.t_respawn_denz[3] = false return true elseif( oTriggerFlag == 4 ) then Level.t_respawn_denz[3] = true return true end return false end -------------------------------------------------------------------------------------------------------------- function ReviveEnemy_Esteban(s_enemy_esteban) if( not Level.b_enemy_esteban ) then return false end local i_time = math.random(2, 4) ScriptEventManager.AddTimedEvent(i_time, [[ObjectFactory.GetComponent("]] .. s_enemy_esteban .. [[", 'CrCharacterArmor' ):Invoke( "Revive" )]]) ScriptEventManager.AddTimedEvent(i_time, [[ObjectFactory.GetComponent("]] .. s_enemy_esteban .. [[", 'CrCharacterArmor' ):Invoke( "RestoreArmor" )]]) ScriptEventManager.AddTimedEvent(i_time, [[Crusaders.Teleport("]] .. s_enemy_esteban .. [[", "RespawnEnemy_Esteban_]]..Level.Math_Esteban()..[[")]]) ScriptEventManager.AddTimedEvent(i_time, [[Crusaders.SetObjective("]] .. s_enemy_esteban .. [[", "ObjAttackMercs")]]) ScriptEventManager.RegisterEvent( s_enemy_esteban, "DIE", [[Level.ReviveEnemy_Esteban("]] .. s_enemy_esteban .. [["); Level.CallCutsceneEsteban()]]) end function Math_Esteban() if( Level.t_respawn_esteban[1] == false and Level.t_respawn_esteban[2] == false and Level.t_respawn_esteban[3] == false ) then return math.random( 1, 3) end repeat i_math_esteban = math.random( 1, 3) until ( Level.t_respawn_esteban[i_math_esteban] ) return i_math_esteban end function ChangeRespawnEsteban_1( oTriggerFlag, oActor ) if(oTriggerFlag == 2) then Level.t_respawn_esteban[1] = false return true elseif( oTriggerFlag == 4 ) then Level.t_respawn_esteban[1] = true return true end return false end function ChangeRespawnEsteban_2( oTriggerFlag, oActor ) if(oTriggerFlag == 2) then Level.t_respawn_esteban[2] = false return true elseif( oTriggerFlag == 4 ) then Level.t_respawn_esteban[2] = true return true end return false end function ChangeRespawnEsteban_3( oTriggerFlag, oActor ) if(oTriggerFlag == 2) then Level.t_respawn_esteban[3] = false return true elseif( oTriggerFlag == 4 ) then Level.t_respawn_esteban[3] = true return true end return false end ---------------------------------------------------------------------------------------------------------------- function CallCutsceneDenz() i_callcutscenedenz = i_callcutscenedenz + 1 if ( i_callcutscenedenz == 5 ) then Level.Scene02() end end function CallCutsceneEsteban() i_callcutsceneesteban = i_callcutsceneesteban + 1 if ( i_callcutsceneesteban == 5 ) then Level.Scene02() end end function Scene02() if ( CrGameEngine.GetSoloMode() ) then PostProcess.Activate( "SmoothColor", 3, 2, 2, Vector3.New( { 0.0, 0.0, 0.0 } ) ) ScriptEventManager.AddTimedEvent( 2, [[CutSceneManager.PlayCutScene()]] ) else i_validateembushcoop = i_validateembushcoop + 1 if ( i_validateembushcoop == 2 ) then Level.b_enemy_denz = false Level.b_enemy_esteban = false KTUMission.Validate('Obj01_Eliminate_Thief_Denz_Coop') KTUMission.Validate('Obj01_Eliminate_Thief_Esteban_Coop') PostProcess.Activate( "SmoothColor", 3, 2, 2, Vector3.New( { 0.0, 0.0, 0.0 } ) ) ScriptEventManager.AddTimedEvent( 2, [[CutSceneManager.PlayCutScene()]] ) end end end function ChooseGoToChurchCoop() if ( CrGameEngine.GetSoloMode() ) then if ( iCheck ~= 1 ) then CrGameEngine.SetCheckPoint( 1 ) if ( CrGameEngine.IsCheckPointAllowed() ) then ScriptEventManager.AddTimedEvent( 0 ,[[iTips = Tips.Show( "CHECKPOINT_REACH" )]] ) ScriptEventManager.AddTimedEvent( 3 ,[[Tips.Hide( iTips )]] ) end end ObjectFactory.GetComponent( "Player", "CrPlayerController" ):Invoke( "Force", true ) SoundManager.PlayMusic( "Alt_World_Ambiance" ) Level.GoToChurchSolo() else if ( iCheck ~= 1 ) then CrGameEngine.SetCheckPoint( 1 ) if ( CrGameEngine.IsCheckPointAllowed() ) then ScriptEventManager.AddTimedEvent( 0 ,[[iTips = Tips.Show( "CHECKPOINT_REACH" )]] ) ScriptEventManager.AddTimedEvent( 3 ,[[Tips.Hide( iTips )]] ) end end ObjectFactory.GetComponent( "Player", "CrPlayerController" ):Invoke( "Force", true ) ObjectFactory.GetComponent( "Mercs_01", "CrPlayerController" ):Invoke( "Force", true ) SoundManager.PlayMusic( "Alt_World_Ambiance" ) Level.GoToChurchCoop() end end function GoToChurchSolo() ObjectFactory.EnterStep("07a-GoToChurch") if ( iCheck ~= 1 ) then ScriptEventManager.AddTimedEvent( 3 ,[[KTUMission.Activate("Obj02_GoToChurch_Denz")]] ) else KTUMission.Activate("Obj02_GoToChurch_Denz") end ObjectFactory.GetComponent( "Cam_Death_Follow_Denz", "KTUCamAnim" ):Invoke( "Play" ) ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEDenz( 1 )]] ) ScriptEventManager.AddTimedEvent( 1, [[Level.FollowPosDeath_Denz()]] ) end function GoToChurchCoop() GameContext.Log( "Je suis la" ) i_validategotochurch = 0 ObjectFactory.EnterStep("07b-GoToChurchCoop") if ( iCheck ~= 1 ) then ScriptEventManager.AddTimedEvent( 3 ,[[KTUMission.Activate("Obj02_GoToChurch_Denz")]] ) ScriptEventManager.AddTimedEvent( 3 ,[[KTUMission.Activate("Obj02_GoToChurch_Esteban")]] ) else KTUMission.Activate("Obj02_GoToChurch_Denz") KTUMission.Activate("Obj02_GoToChurch_Esteban") end -- ObjectFactory.GetComponent( "Cam_Death_Follow_Denz", "KTUCamAnim" ):Invoke( "Play", 0 ) -- ObjectFactory.GetComponent( "Cam_Death_Follow_Esteban", "KTUCamAnim" ):Invoke( "Play", 1 ) ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEDenz( 1 )]] ) ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEEsteban( 1 )]] ) ScriptEventManager.AddTimedEvent( 1, [[Level.FollowPosDeath_Denz()]] ) ScriptEventManager.AddTimedEvent( 1, [[Level.FollowPosDeath_Esteban()]] ) end ---------------------------------------------------------------------------------------------------------------- function FollowPosDeath_Denz() local v3_PosDeath_Denz = ObjectFactory.GetComponent( "The_Death_Denz", "PlayAll::GameServices::Placement" ):GetMemberValue( "Position" ) ObjectFactory.GetComponent("Box_FollowDeathDenz", "PlayAll::GameServices::Placement"):SetMemberValue("Position", v3_PosDeath_Denz) if(Level.b_follow_denz) then ScriptEventManager.AddTimedEvent(0.75, [[Level.FollowPosDeath_Denz()]]) end end function LaunchQTEDenz( iQTE ) GameContext.Log( "LaunchQTEDenz"..iQTE ) if( not b_IsDenzAlive ) then GameContext.Log( "In Zone 1" ) v3_Pos_Denz = ObjectFactory.GetComponent( "Player", "PlayAll::GameServices::Placement" ):GetMemberValue( "Position" ) ObjectFactory.GetComponent("FX_Death_Denz", "PlayAll::GameServices::Placement"):SetMemberValue("Position", v3_Pos_Denz) ObjectFactory.GetComponent("FX_Death_Denz", "CrParticleFX"):Invoke( "Play" ) SoundManager.PlaySound( "ALT_BURN" ) QTEManager.AddQTE( 1, 1.3, 2, g_sEvent[ iQTE ], 0, true, true, true, "Level.QTEDenz_Success("..(iQTE + 1)..")", "Level.QTEDenz_Failed("..(iQTE + 1)..")" ) end end function QTEDenz_Success( i_num_denz ) if( i_num_denz == 6 ) then i_num_denz = 1 end GameContext.Log( "QTEDenz_Success: "..i_num_denz.." !!" ) if( not b_IsDenzAlive ) then ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEDenz(]]..i_num_denz..[[)]] ) end end function QTEDenz_Failed(i_num_denz) if( i_num_denz == 6 ) then i_num_denz = 1 end GameContext.Log( "QTEDenz_Failed: "..i_num_denz.." !!" ) if( not b_IsDenzAlive ) then -- i_num_denz = i_num_denz - 1 Crusaders.SetObjective( "Player", "Anim_Impact_Burn", 0 ) ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEDenz(]]..i_num_denz..[[)]] ) end end function Die_Denz() GameContext.Log( "Die_Denz" ) b_state = false b_IsDenzAlive = true ObjectFactory.GetComponent( "Player", "CrCharacterArmor" ):Invoke( "Die" ) if ( CrGameEngine.GetSoloMode() ) then ObjectFactory.GetComponent( "Cam_Death_Follow_Denz", "KTUCamAnim" ):Invoke( "Stop" ) end Crusaders.Freeze( ObjectFactory.GetActor( "The_Death_Denz" ) ) QTEManager.Clear() end function Denz_Reach_Church() Level.Scene03() b_IsDenzAlive = true Level.b_follow_denz = false Crusaders.Freeze( ObjectFactory.GetActor( "The_Death_Denz") ) -- ObjectFactory.GetComponent( "Player", "CrPlayerController" ):Invoke( "Force", false ) QTEManager.Clear() end function BurnedGeyserDenz() ObjectFactory.GetComponent( "Player", "CrCharacterController" ):Invoke( "ForceBurn" ) end ---------------------------------------------------------------------------------------------------------------- function FollowPosDeath_Esteban() local v3_PosDeath_Esteban = ObjectFactory.GetComponent( "The_Death_Esteban", "PlayAll::GameServices::Placement" ):GetMemberValue( "Position" ) ObjectFactory.GetComponent("Box_FollowDeathEsteban", "PlayAll::GameServices::Placement"):SetMemberValue("Position", v3_PosDeath_Esteban) if(Level.b_follow_esteban) then ScriptEventManager.AddTimedEvent(0.75, [[Level.FollowPosDeath_Esteban()]]) end end function LaunchQTEEsteban( iQTE ) GameContext.Log( "LaunchQTEEsteban"..iQTE ) if( not b_IsEstebanAlive ) then v3_Esteban = ObjectFactory.GetComponent( "Mercs_01", "PlayAll::GameServices::Placement" ):GetMemberValue( "Position" ) ObjectFactory.GetComponent("FX_Death_Esteban", "PlayAll::GameServices::Placement"):SetMemberValue("Position", v3_Esteban) ObjectFactory.GetComponent("FX_Death_Esteban", "CrParticleFX"):Invoke( "Play" ) SoundManager.PlaySound( "ALT_BURN" ) QTEManager.AddQTE( 1, 1.3, 2, g_sEvent[ iQTE ], 1, true, true, true, "Level.QTEEsteban_Success( "..(iQTE + 1).." )", "Level.QTEEsteban_Failed("..(iQTE + 1)..")" ) end end function QTEEsteban_Success(i_num_esteban) if( i_num_esteban == 6 ) then i_num_esteban = 1 end GameContext.Log( "QTEEsteban_Success: "..i_num_esteban.." !!" ) if( not b_IsEstebanAlive ) then ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEEsteban(]]..i_num_esteban..[[)]] ) end end function QTEEsteban_Failed(i_num_esteban) if( i_num_esteban == 6 ) then i_num_esteban = 1 end GameContext.Log( "QTEEsteban_Failed: "..i_num_esteban.." !!" ) if( not b_IsEstebanAlive ) then -- i_num_esteban = i_num_esteban - 1 Crusaders.SetObjective( "Mercs_01", "Anim_Impact_Burn", 0 ) ScriptEventManager.AddTimedEvent( 2, [[Level.LaunchQTEEsteban(]]..i_num_esteban..[[)]] ) end end function Die_Esteban() GameContext.Log( "Die_Esteban" ) b_IsEstebanAlive = true b_state = false ObjectFactory.GetComponent( "Mercs_01", "CrCharacterArmor" ):Invoke( "Die" ) Crusaders.Freeze( ObjectFactory.GetActor( "The_Death_Esteban" ) ) QTEManager.Clear() end function Esteban_Reach_Church() Level.Scene03() b_IsEstebanAlive = true b_follow_esteban = false Crusaders.Freeze( ObjectFactory.GetActor( "The_Death_Esteban") ) QTEManager.Clear() end function BurnedGeyserEsteban() ObjectFactory.GetComponent( "Mercs_01", "CrCharacterController" ):Invoke( "ForceBurn" ) end -------------------------------------------------------------------------------------------------------------------- function Scene03() i_scene03 = i_scene03 + 1 if ( i_scene03 == 1 ) then if ( b_state ) then if ( CrGameEngine.GetSoloMode() ) then ObjectFactory.GetComponent( "Cam_Death_Follow_Denz", "KTUCamAnim" ):Invoke( "Stop" ) end CutSceneManager.PlayCutScene() end end end function EndLevel() CrComboWorld.Disable(false) Hud.ShowStatistics() Hud.SetTutoState( 1 ) -- Crusaders.Freeze( ObjectFactory.GetActor( "Player" ) ) -- Ambiant_Trebuchet = function() end -- Gui.Pause() -- ObjectFactory.GetComponent( "CrHUDScreen-ImageBackground", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "IsVisible", 1 ) -- ObjectFactory.GetComponent( "CrHUDScreen-ImageBackground", "PlayAll::GameServices::HudPanel" ):SetMemberValue( "Color", "0;0;0;1.0" ) -- Gui.HideHud() -- Gui.BlockInGameMenu( true ) -- CrGameEngine.ProgressCampaign() end