//========================================================================================== // // uje_mall.gm // // Who When What //------------------------------------------------------------------------------------------ // ^1[UJE]^3Niek 10 January 2015 Initial Script // MickyP 14 January 2015 Added game logic // ^1[UJE]^3Captain 4 August 2015 Added Attack,Defense ,Improved Gameplay // //========================================================================================== // global Map = { Debug = 0, // please set to zero before distributing your script Ammo_Cabinet_south_ammocabinet = "AMMOCAB_south_ammocabinet", Ammo_Cabinet_uje1_ammocabinet = "AMMOCAB_uje1_ammocabinet", Ammo_Cabinet_uje5_ammocabinet = "AMMOCAB_uje5_ammocabinet", Ammo_Cabinet_uje7_ammocabinet = "AMMOCAB_uje7_ammocabinet", Health_Cabinet_south_healthcabinet = "HEALTHCAB_south_healthcabinet", Health_Cabinet_uje1_healthcabinet = "HEALTHCAB_uje1_healthcabinet", Health_Cabinet_uje5_healthcabinet = "HEALTHCAB_uje5_healthcabinet", Health_Cabinet_uje7_healthcabinet = "HEALTHCAB_uje7_healthcabinet", Checkpoint_bunker_flag = "CHECKPOINT_bunker_flag", Flag_Secret_Documents = "FLAG_Secret_Documents", Build_Axis_Generator = "BUILD_Axis_Generator", Build_Command_Post = "BUILD_Command_Post", Build_Field_Radio_1 = "BUILD_Field_Radio_1", Build_Tank = "BUILD_Tank", Build_Tank_Barrier_1 = "BUILD_Tank_Barrier_1", Build_Tank_Barrier_2 = "BUILD_Tank_Barrier_2", Plant_Axis_Generator = "PLANT_Axis_Generator", Plant_Command_Post = "PLANT_Command_Post", Plant_Field_Radio_1 = "PLANT_Field_Radio_1", Plant_Safe = "PLANT_Safe", Plant_Tank_Barrier_1 = "PLANT_Tank_Barrier_1", Plant_Tank_Barrier_2 = "PLANT_Tank_Barrier_2", Mover_tank = "MOVER_tank", Escort_tank = "ESCORT_tank", Mount_tank = "MOUNT_tank", TankBarrier_1_1_Dyno = 0, TankBarrier_1_2_Dyno = 0, TankBarrier_2_1_Dyno = 0, TankBarrier_2_2_Dyno = 0, AxisGenerator_Dyno = 0, TankAtB1 = 0, B1Built = 0, TankAtB2 = 0, B2Built = 0, Allied_Command_Post_Built = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" ); SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" ); SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" ); Util.MapDebugPrint( "Allied_Command_Post_Built" ); }, Axis_Command_Post_Built = function( trigger ) { Util.ChangeSpawn( TEAM.AXIS, 3, 4 ); SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" ); SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" ); SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" ); SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" ); Util.MapDebugPrint( "Axis_Command_Post_Built" ); }, Axis_Command_Post_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" ); SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" ); SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" ); Util.MapDebugPrint( "Axis_Command_Post_Destroyed" ); }, Allied_Command_Post_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" ); SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" ); SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" ); Util.MapDebugPrint( "Allied_Command_Post_Destroyed" ); }, Tank_Built = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" ); SetAvailableMapGoals( TEAM.AXIS, true, "MOUNT_Tank" ); Util.MapDebugPrint( "Tank_Built" ); }, Tank_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_tank" ); SetAvailableMapGoals( TEAM.AXIS, false, "MOUNT_Tank" ); Util.MapDebugPrint( "Tank_Destroyed" ); }, TankBarrier_1_Built = function( trigger ) { if ( TestMap ) { return; } Map.B1Built = 1; if ( Map.TankAtB1 == 1 ) { SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Tank" ); } Util.MapDebugPrint( "TankBarrier_1_Built" ); }, TankBarrier_1_Planted = function( trigger ) { Map.TankBarrier_1_Dyno += 1; Util.MapDebugPrint( "TankBarrier_1_Planted" ); }, TankBarrier_1_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.TankBarrier_1_Dyno = 0; Map.B1Built = 0; if ( Map.TankAtB1 == 1 ) { SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Tank" ); SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" ); } Util.MapDebugPrint( "TankBarrier_1_Destroyed" ); }, Tank_At_Barrier_1 = function( trigger ) { if ( TestMap ) { return; } Map.TankAtB1 = 1; if ( Map.B1Built == 1 ) { //SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Tank_Barrier_1" ); SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Tank_Barrier_1_.*" ); SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Axis_Generator" ); SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Tank" ); SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_tank" ); } Util.MapDebugPrint( "Tank_At_Barrier_1" ); }, Tank_Past_Barrier_1 = function( trigger ) { if ( TestMap ) { return; } Map.TankAtB1 = 0; SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Market_.*" ); SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Tank_Barrier_1_.*" ); SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Second_.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Market_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Second_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Tank_Barrier_1" ); SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_bunker_flag" ); Util.MapDebugPrint( "Tank_Past_Barrier_1" ); }, AxisGenerator_Build = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Axis_Generator" ); SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Generator" ); Util.MapDebugPrint( "AxisGenerator_Build" ); }, AxisGenerator_Planted = function( trigger ) { Map.AxisGenerator_Dyno += 1; Util.MapDebugPrint( "AxisGenerator_Planted" ); }, AxisGenerator_Destroyed = function( trigger ) { Map.AxisGenerator_Dyno = 0; SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Axis_Generator" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Axis_Generator" ); Util.MapDebugPrint( "AxisGenerator_Destroyed" ); }, Tankbarrier_2_Built = function( trigger ) { if ( TestMap ) { return; } Map.B2Built = 1; if ( Map.TankAtB2 == 1 ) { SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Tank" ); } Util.MapDebugPrint( "Tankbarrier_2_Built" ); }, TankBarrier_2_Planted = function( trigger ) { if ( TestMap ) { return; } Map.TankBarrier_2_Dyno += 1; Util.MapDebugPrint( "TankBarrier_2_Planted" ); }, Tank_At_Barrier_2 = function( trigger ) { if ( TestMap ) { return; } Map.TankAtB2 = 1; if ( Map.B2Built == 1 ) { SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Tank_Barrier_2_.*" ); SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Axis_Generator" ); SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Tank" ); SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_tank" ); } Util.MapDebugPrint( "Tank_At_Barrier_2" ); }, Tankbarrier_2_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.TankBarrier_2_Dyno = 0; Map.B2Built = 0; if ( Map.TankAtB2 == 1 ) { SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Tank" ); SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" ); } Util.MapDebugPrint( "Tankbarrier_2_Destroyed" ); }, Tank_Past_Barrier_2 = function( trigger ) { if ( TestMap ) { return; } Map.TankAtB2 = 0; SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Bunker_.*" ); SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Market.*" ); SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Tank_Barrier_2_.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Bunker_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Market_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Axis_Generator" ); SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Tank_Barrier_2" ); // Shift defence to bunker Util.MapDebugPrint( "Tank_Past_Barrier_2" ); }, Bunker_Door_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Safe" ); SetAvailableMapGoals( TEAM.AXIS, false, ".*Tank.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Library_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "MOUNT_Allies_Tank" ); // Shift defence to safe Util.MapDebugPrint( "Safe_Destroyed" ); }, Safe_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Safe" ); SetAvailableMapGoals( TEAM.AXIS, true, "FLAG_Secret_Documents" ); SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Field_Radio_1" ); Util.MapDebugPrint( "Safe_Destroyed" ); }, Field_Radio_Built = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_Radio" ); SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Field_Radio_1" ); Util.MapDebugPrint( "Field_Radio_Built" ); }, Field_Radio_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Radio" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Field_Radio_1" ); Util.MapDebugPrint( "Field_Radio_Destroyed" ); }, Secret_Documents_Taken = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_Radio" ); SetAvailableMapGoals( TEAM.AXIS, false, "FLAG_Secret_Documents" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Radio_.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Market_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Bunker_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Library_.*" ); Util.MapDebugPrint( "Secret_Documents_Taken" ); }, Secret_Documents_Returned = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Bunker_.*" ); SetAvailableMapGoals( TEAM.AXIS, true, "FLAG_Secret_Documents" ); SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Radio" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Bunker_.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Library_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Radio_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Market_.*" ); Util.MapDebugPrint( "Secret_Documents_Returned" ); }, Secret_Documents_Secured = function( trigger ) { Util.MapDebugPrint( "Secret_Documents_Secured" ); }, vehicle_at_location = function( trigger ) { switch(Map.VehicleLocation) { case 1: { // 1st corner } case 2: { // 2nd corner // Shift 2nd defend SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_First_.*" ); SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Second_.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_First_.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Second_.*" ); } case 3: { // 3rd corner } case 4: { Map.Tank_At_Barrier_1(); // Shift defence to 2nd barrier } case 5: { Map.Tank_At_Barrier_2(); } } }, }; global OnMapLoad = function() { // Register callback functions //OnTrigger( "^3Allied MG nest constructed!", Map.Allied_MG_Built ); //OnTrigger( "^3Axis team has destroyed the Allied MG nest!", Map.Allied_MG_Destroyed ); OnTrigger( "Allied Command Post constructed. Charge speed increased!^3 CP Spawn act", Map.Allied_Command_Post_Built ); OnTrigger( "Axis Command Post constructed. Charge speed increased!^3 CP Spawn activ", Map.Axis_Command_Post_Built ); OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_Command_Post_Destroyed ); OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed ); OnTrigger( "^3The Tank has been repaired!", Map.Tank_Built ); OnTrigger( "^3The Tank has been damaged!", Map.Tank_Destroyed ); OnTrigger( "^3Tank Barrier #1 has been constructed.", Map.TankBarrier_1_Built ); OnTrigger( "Planted at Tank Barrier #1.", Map.TankBarrier_1_Planted ); OnTrigger( "^3Tank Barrier #1 has been destroyed.", Map.TankBarrier_1_Destroyed ); OnTrigger( "^3The Tank is past the first Barrier!", Map.Tank_Past_Barrier_1 ); OnTrigger( "Axis have build the Generator!", Map.AxisGenerator_Build ); OnTrigger( "Planted at Axis Generator.", Map.AxisGenerator_Planted ); OnTrigger( "Allied team has destroyed the Generator!", Map.AxisGenerator_Destroyed ); OnTrigger( "^3Tank Barrier #2 has been constructed.", Map.Tankbarrier_2_Built ); OnTrigger( "^3Tank Barrier #2 has been destroyed.", Map.Tankbarrier_2_Destroyed ); OnTrigger( "Planted at Tank Barrier #2.", Map.TankBarrier_2_Planted ); OnTrigger( "^3The Tank is past the second Barrier!", Map.Tank_Past_Barrier_2 ); OnTrigger( "^3 Axis have Destroyed the Library Door !", Map.Bunker_Door_Destroyed ); OnTrigger( "Axis have destroyed the ^3Safe Door^1 !", Map.Safe_Destroyed ); OnTrigger( "^3The Axis Field Radio has been constructed.", Map.Field_Radio_Built ); OnTrigger( "^3Allies have destroyed the Axis Field Radio.", Map.Field_Radio_Destroyed ); OnTrigger( "Axis have stolen The Secret Documents!", Map.Secret_Documents_Taken ); OnTrigger( "Flag returned Secret Documents!", Map.Secret_Documents_Returned ); OnTrigger( "Axis captured allied_obj1", Map.Secret_Documents_Secured ); OnTrigger( "tank at location", Map.vehicle_at_location ); OnTriggerRegion(AABB(-858.665,-161.806,-222.875,-383.126,-104.596,-148.875), RegionTrigger.VehicleTrigger); OnTriggerRegion(AABB(-2245.162,-1105.775,-222.875,-2197.625,-668.368,-148.875), RegionTrigger.VehicleTrigger); OnTriggerRegion(AABB(-2779.358,-2574.593,-222.875,-2448.661,-2512.479,-148.875), RegionTrigger.VehicleTrigger); OnTriggerRegion(AABB(-1149.518,-3584.128,-222.875,-1078.824,-3136.052,-148.875), RegionTrigger.VehicleTrigger); OnTriggerRegion(AABB(1498.899,-1909.271,-214.875,1773.127,-1854.929,-140.875), RegionTrigger.VehicleTrigger); //Util.DisableGoal( ".*", true ); // all but routes SetAvailableMapGoals( TEAM.AXIS, true, { "BUILD_Tank", "ESCORT_tank", "MOUNT_tank", "CHECKPOINT_bunker_flag", "AMMOCAB.*", "HEALTHCAB.*", "ATTACK_First_.*", }); SetAvailableMapGoals( TEAM.AXIS, false, { "FLAG_.*", "PLANT_.*", "DEFEND_.*", "BUILD_Field_.*", "ATTACK_Second_.*", "ATTACK_Market_.*", "ATTACK_Bunker_.*", "BUILD_Axis_Generator", "BUILD_Command_Post", }); SetAvailableMapGoals( TEAM.ALLIES, true, { "BUILD_Command_Post", "BUILD_Tank_Barrier.*", "CHECKPOINT_bunker_flag", "AMMOCAB.*", "HEALTHCAB.*", "DEFEND_First_.*", }); SetAvailableMapGoals( TEAM.ALLIES, false, { "DEFEND_Second_.*", "DEFEND_Market_.*", "DEFEND_Bunker_.*", "DEFEND_Library_.*", "DEFEND_Radio_.*", "ATTACK_.*", "CAPPOINT_.*", "PLANT_.*", }); // Max users per goal Util.SetMaxUsers( 1, "DEFEND_.*" ); Util.SetMaxUsers( 1, "ATTACK_.*" ); //Util.SetMaxUsers( 1, "GRENADE_.*" ); Util.SetMaxUsers( 1, "MOUNTMG42_.*" ); Util.SetMaxUsers( 1, "CHECKPOINT_bunker_flag" ); Util.SetMaxUsers( 1, "BUILD_Command_Post" ); Util.SetMaxUsers( 1, "ESCORT_tank" ); Util.SetMaxUsers( 1, "MOUNT_tank" ); Util.SetMaxUsers( 2, "FLAG_Secret_Documents" ); Util.SetMaxUsers( 2, "CAPPOINT_Radio" ); // Camp times SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=30, MaxCampTime=90} ); SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=60, MaxCampTime=180} ); SetMapGoalProperties( "ATTACK_.*", {MinCampTime=45, MaxCampTime=90} ); SetMapGoalProperties( "DEFEND_.*", {MinCampTime=45, MaxCampTime=90} ); SetGoalPriority( "PLANT_Tank_Barrier_1", 0.83, TEAM.AXIS, CLASS.ENGINEER ); SetGoalPriority( "PLANT_Tank_Barrier_2", 0.82, TEAM.AXIS, CLASS.ENGINEER ); SetGoalPriority( "BUILD_Tank_Barrier_1", 0.83, TEAM.ALLIES, CLASS.ENGINEER ); SetGoalPriority( "BUILD_Tank_Barrier_2", 0.82, TEAM.ALLIES, CLASS.ENGINEER ); SetGoalPriority( "BUILD_Field_Radio", 0.83, TEAM.ALLIES, CLASS.ENGINEER ); SetGoalPriority( "BUILD_Command_Post", 0.8, TEAM.AXIS, CLASS.ENGINEER ); SetGoalPriority( "BUILD_Command_Post", 0.8, TEAM.ALLIES, CLASS.ENGINEER ); SetGoalPriority( "PLANT_Command_Post", 0.8, TEAM.AXIS ); SetGoalPriority( "PLANT_Command_Post", 0.8, TEAM.ALLIES ); Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." ); }; global OnBotJoin = function( bot ) { // Uncomment for shootable breakables bot.TargetBreakableDist = 250.0; foreach ( weap in { WEAPON.THOMPSON,WEAPON.MP40,WEAPON.SHOTGUN } ) { w = bot.GetWeapon(weap); if(w){ w.PrimaryFire.SetTargetBias(CLASS.BREAKABLE, 1.2); } } // Only set MaxViewDistance on maps with limited sight (e.g. fog) //~bot.MaxViewDistance = 2400; }; global InitializeRoutes = function() { MapRoutes = { BUILD_Tank_Barrier_1 = { }, PLANT_Tank_Barrier_1 = { }, BUILD_Tank_Barrier_2 = { }, PLANT_Tank_Barrier_2 = { }, BUILD_Tank = { }, FLAG_Secret_Documents = { }, BUILD_Field_Radio = { }, PLANT_Field_Radio = { }, BUILD_Command_Post = { }, PLANT_Command_Post = { }, PLANT_Safe = { }, }; Util.Routes(MapRoutes); };