//==========================================================================================
//
//  ETL Warbell - etl_warbell.gm
//
//  Who         When                What
//------------------------------------------------------------------------------------------
//  Original Warbell Waypoints and Script by Red Dwarf
//  Updated and edited for Omni-Bot 0.71 and 0.8 by :)BOK(: Naerling
//  cs: formatting and bugfixes
//  Mateos: ETL port
//
//  Mateos      17th August 2014    Added use points & cover spots for the destructible objectives
//                                  Moved routing scripting to its own table, and moved few nodes
//                                  Fixed bot stuckage at Monastery with crates
//                                  Script clearing
//    ^4Tardis 23/08/14 - fixes - stuck bots, disable bell plant after ring toll bell, cover spots added
//==========================================================================================
//

/****************************************************
Path mapping and script both updated by Mateos
Correspondant WAY file size: -
Last update: 18th December 2022
****************************************************/

/*
 * TODO:
 * - Manage Allied spawning (spawn at the CP if possible when the Forward Spawn gets captured by Axis, ...)
 */

global Map =
{
    Debug = false,
    Quiet = true,
    Talk = true, // Set Talk to false if you don't want the bots talking ingame

    BellTolled = false,
    Book = false,
    BookTaken = false,
    BookDelivered = false,
    Mechanism = false,

    // *************************************************************************

    LowerGeneratorDoorStatus = 0, // Door is closed initially
    UpperGeneratorDoorStatus = 0, // Door is closed initially
    Switches =
    {
        // Allow Allies to get back to the first part of the map if the Forward Spawn is lost
        // /bot waypoint_setproperty paththrough UseSwitch_PT:lower_generator_door
        lower_generator_door =
        {
            Enabled = true,
            Priority = 0, // Always set to 0 when using path through
            WaypointName = "lower_generator_door_switch",
            Timeout = 3000,
            AimPosition = Vec3(-2277, -521, 292), // Use /bot aim_pos to get aim vector. Replaces the unreliable waypoint facing
            Wait = function() // Optional. Used to have the bot wait a bit for slow moving doors / elevators
            {
                return Map.LowerGeneratorDoorStatus == 2; // Return true to finish the path through and go through the door
            },
        },

        // Allow Allies to build the CP and plant landmines beyond the Guard House Gate on map load
        // /bot waypoint_setproperty paththrough UseSwitch_PT:upper_generator_door
        upper_generator_door =
        {
            Enabled = true,
            Priority = 0, // Always set to 0 when using path through
            WaypointName = "upper_generator_door_switch",
            Timeout = 3000,
            AimPosition = Vec3(-2408, -414, 485), // Use /bot aim_pos to get aim vector. Replaces the unreliable waypoint facing
            Wait = function() // Optional. Used to have the bot wait a bit for slow moving doors / elevators
            {
                return Map.UpperGeneratorDoorStatus == 2; // Return true to finish the path through and go through the door
            },
        },
    },

    LowerGeneratorDoor_Moving = function( trigger )
    {
        if ( trigger.Action == "opening" )
        {
            // We also go through here when the Generator gets destroyed,
            // so no need to disable it upon Generator_Destroyed
            Map.LowerGeneratorDoorStatus = 1; // Opening
            sleep( 2.5 );  // Wait 2.5 seconds while the door is opening
            Map.LowerGeneratorDoorStatus = 2; // Opened
            Map.Switches.lower_generator_door.Enabled = false;
        }
        else
        {
            Map.LowerGeneratorDoorStatus = 0; // Closed
            Map.Switches.lower_generator_door.Enabled = true;
        }
    },

    UpperGeneratorDoor_Moving = function( trigger )
    {
        if ( trigger.Action == "opening" )
        {
            // We also go through here when the Generator gets destroyed,
            // so no need to disable it upon Generator_Destroyed
            Map.UpperGeneratorDoorStatus = 1; // Opening
            sleep( 2.5 );  // Wait 2.5 seconds while the door is opening
            Map.UpperGeneratorDoorStatus = 2; // Opened
            Map.Switches.upper_generator_door.Enabled = false;
        }
        else
        {
            Map.UpperGeneratorDoorStatus = 0; // Closed
            Map.Switches.upper_generator_door.Enabled = true;
        }
    },

    // ========================================================================
    // First stage
    // ========================================================================
    forward_spawn_flag_Axis_Captured = function( trigger )
    {
        SetAvailableMapGoals( TEAM.ALLIES, false, {
        	"ATTACK_First_stage.*",
        	"PLANTMINE_First_FX.*",
        	"MOBILEMG42_First.*",
        	"SNIPE_First.*",
        });
        SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_forward_spawn_flag" );

        SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_forward_spawn_flag" );
        SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_First_stage.*" );

        Util.MapDebugPrint( "forward_spawn_flag_Axis_Captured" );
    },

    forward_spawn_flag_Allies_Captured = function( trigger )
    {
        SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_forward_spawn_flag" );
        SetAvailableMapGoals( TEAM.ALLIES, true, {
        	"ATTACK_First_stage.*",
        	"PLANTMINE_First_FX.*",
        	"MOBILEMG42_First.*",
        	"SNIPE_First.*",
        });

        SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_First_stage.*" );
        SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_forward_spawn_flag" );

        if ( Map.BookTaken )
        {
            SetAvailableMapGoals( TEAM.ALLIES, true, {
            	"ATTACK_BookAttack",
            	"DEFEND_Abbey_6",
            });
        }

        Util.MapDebugPrint( "forward_spawn_flag_Allies_Captured" );
    },

    Generator_Destroyed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, true, "GRENADE_bookcase" );

        Util.MapDebugPrint( "Generator_Destroyed" );
    },

    Bookcase_Exploded = function()
    {
        SetAvailableMapGoals( TEAM.AXIS, true, {
        	"FLAG_book",
        	"CAPPOINT_BOOKOFDEATHPLACE",
        });

        Util.MapDebugPrint( "Bookcase_Exploded" );
    },

    book_Taken = function( trigger )
    {
        Map.BookTaken = true;
        SetAvailableMapGoals( TEAM.ALLIES, true, {
        	"ATTACK_BookAttack",
        	"DEFEND_Abbey_6",
        });

        SetAvailableMapGoals( TEAM.AXIS, true, {
        	"ATTACK_BookAttack",
        	"DEFEND_Abbey_6",
        });

        Util.MapDebugPrint( "book_Taken" );
    },

    book_Returned = function( trigger )
    {
        BookTaken = false;
        SetAvailableMapGoals( TEAM.ALLIES, false, {
        	"ATTACK_BookAttack",
        	"DEFEND_Abbey_6",
        });

        SetAvailableMapGoals( TEAM.AXIS, false, {
        	"ATTACK_BookAttack",
        	"DEFEND_Abbey_6",
        });

        Util.MapDebugPrint( "book_Returned" );
    },

    Guard_House_Gate_Destroyed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.ALLIES, false, {
        	"CHECKPOINT_forward_spawn_flag",
        	"ATTACK_First_stage.*",
        	"PLANTMINE_First_FX.*",
        	"MOBILEMG42_First.*",
        	"SNIPE_First.*",
        });
        SetAvailableMapGoals( TEAM.ALLIES, true, {
        	"PLANT_Bell_Mechanism",
        	"PLANT_Command_Post",
        	"ATTACK_secondStage.*",
        	"DEFEND_BellMechanism_5",
        	"SNIPE_secondStage.*",
        	"SNIPE_Second_.*",
        	"CALLARTILLERY_Second.*",
        	"ARTILLERY_S_Second_.*",
        	"PLANTMINE_Second_.*",
        });

        SetAvailableMapGoals( TEAM.AXIS, false, {
        	"ATTACK_First_stage.*",
        	"CHECKPOINT_forward_spawn_flag",
        });
        SetAvailableMapGoals( TEAM.AXIS, true, {
        	"ATTACK_a_Abbey_Main_Gate_.*",
        	"BUILD_Command_Post",
        	"PLANT_Command_Post",
        	"PLANT_Abbey_Main_Gate",
        });

        if ( Map.Talk && MAP_TALK )
        {
            foreach ( id and bot in BotTable )
            {
                if ( !axisAnnounce && bot.GetTeam() == TEAM.AXIS )
                {
                    r = RandRange(0,10);
                    if( r < 2 )
                    {
                        axisAnnounce = true;
                        bot.ExecCommand("vsay_team FTFollowMe");
                    }
                    else if( r > 8 )
                    {
                        axisAnnounce = true;
                        bot.SayVoice(VOICE.REINFORCE_OFF);
                    }
                }
                if ( !alliesAnnounce && bot.GetTeam() == TEAM.ALLIES )
                {
                    r = RandRange(0,10);
                    if( r < 2 )
                    {
                        alliesAnnounce = true;
                        bot.SayVoice(VOICE.DEFEND_OBJECTIVE);
                    }
                    else if( r > 8 )
                    {
                        alliesAnnounce = true;
                        bot.ExecCommand("vsay_team FTFallBack");
                    }
                }
            }
        }

        Util.MapDebugPrint( "Guard_House_Gate_Destroyed" );
    },


    // ========================================================================
    // Second stage
    // ========================================================================
    Abbey_Main_Gate_Destroyed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, true, "ROUTE_abbeygate_destroyed" );

        SetAvailableMapGoals( TEAM.ALLIES, false, {
        	"ATTACK_secondStage_9",
        	"ATTACK_secondStage_10",
        });
        SetAvailableMapGoals( TEAM.ALLIES, true, {
        	"DEFEND_BellMechanism.*",
        	"DEFEND_Abbey_.*",
        	"DEFEND_d_ab_.*",
        });

        SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_a_Abbey_Main_Gate_.*" );
        SetAvailableMapGoals( TEAM.AXIS, true, {
        	"BUILD_Bell_Mechanism",
        	"PLANT_Garden_Gate",
        	"PLANT_Crypt_Gate",
        	"DEFEND_d_ab_.*",
        	"DEFEND_BellMechanism_5",
        });

        if ( Map.Talk && MAP_TALK )
        {
            foreach ( id and bot in BotTable )
            {
                if ( !axisAnnounce && bot.GetTeam() == TEAM.AXIS )
                {
                    r = RandRange(0,10);
                    if( r < 2 )
                    {
                        axisAnnounce = true;
                        bot.ExecCommand("vsay_team FTFollowMe");
                    }
                    else if( r > 8 )
                    {
                        axisAnnounce = true;
                        bot.SayVoice(VOICE.REINFORCE_OFF);
                    }
                }

                if ( !alliesAnnounce && bot.GetTeam() == TEAM.ALLIES )
                {
                    r = RandRange(0,10);
                    if( r < 2 )
                    {
                        alliesAnnounce = true;
                        bot.SayVoice(VOICE.DEFEND_OBJECTIVE);
                    }
                    else if( r > 8 )
                    {
                        alliesAnnounce = true;
                        bot.ExecCommand("vsay_team FTFallBack");
                    }
                }
            }
        }

        Util.MapDebugPrint( "Abbey_Main_Gate_Destroyed" );
    },

    Bell_Mechanism_Built = function( trigger )
    {
        Map.Mechanism = true;

        SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_BellMechanism.*" );
        SetAvailableMapGoals( TEAM.ALLIES, true, {
        	"PLANT_Bell_Mechanism",
        	"DEFEND_BellMechanism_5",
        });

        SetAvailableMapGoals( TEAM.ALLIES, !Map.BookDelivered, {
            "ATTACK_GardenGate",
            "ATTACK_AbbeyGate",
            "ATTACK_Cryptgate",
        });

        Map.Manage_Bell_Tolling();

        Util.MapDebugPrint( "Bell_Mechanism_Built" );
    },

    Bell_Mechanism_Destroyed = function( trigger )
    {
        Map.Mechanism = false;
        Map.Manage_Bell_Tolling();
        SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_BellMechanism.*" );

        Util.MapDebugPrint( "Bell_Mechanism_Destroyed" );
    },

    First_Sacrifice = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Pentagramm_1" );

        Util.MapDebugPrint( "First_Sacrifice" );
    },

    First_Sacrifice_Performed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Pentagramm_1" );

        Util.MapDebugPrint( "First_Sacrifice_Performed" );
    },

    Second_Sacrifice = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Pentagramm_2" );

        Util.MapDebugPrint( "Second_Sacrifice" );
    },

    Second_Sacrifice_Performed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Pentagramm_2" );

        Util.MapDebugPrint( "Second_Sacrifice_Performed" );
    },

    Third_Sacrifice = function( trigger )
    {
        SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Bell_Mechanism" );

        SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Pentagramm_3" );

        Util.MapDebugPrint( "Third_Sacrifice" );
    },

    Crypt_Gate_Destroyed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, true, "ROUTE_crypt" );

        Util.MapDebugPrint( "Crypt_Gate_Destroyed" );
    },

    Garden_Gate_Destroyed = function( trigger )
    {
        SetAvailableMapGoals( TEAM.AXIS, true, "ROUTE_gardengate" );

        Util.MapDebugPrint( "Garden_Gate_Destroyed" );
    },

    BOOKOFDEATHPLACE_Captured = function( trigger )
    {
        Map.BookDelivered = true;

        SetAvailableMapGoals( TEAM.ALLIES, !Map.Mechanism, {
            "ATTACK_GardenGate",
            "ATTACK_AbbeyGate",
            "ATTACK_Cryptgate",
        });

        Map.Manage_Bell_Tolling();

        Util.MapDebugPrint( "BOOKOFDEATHPLACE_Captured" );
    },

    Axis_Win = function( trigger )
    {
        ETUtil.WinningChat( TEAM.AXIS );
        ETUtil.LosingChat( TEAM.ALLIES );

        Util.MapDebugPrint( "Axis_Win", true );
    },

    Axis_CP_Build = function( trigger )
    {
        Util.MapDebugPrint( "Axis_CP_Build", true );
    },

    Bell_Tolled = function( trigger )
    {
        if ( trigger.Action == "axis_complete" )
        {
            Map.BellTolled = true;
            Map.Manage_Bell_Tolling();

            Util.MapDebugPrint( "Bell_Tolled" );
        }
    },

    Manage_Bell_Tolling = function()
    {
        SetAvailableMapGoals( TEAM.AXIS, !Map.BellTolled && Map.BookDelivered && Map.Mechanism, "SWITCH_BellRope" );
    }
};

global OnMapLoad = function()
{
    // Triggers
    OnTrigger( "^1The Axis repaired the Bell Mechanism!", Map.Bell_Mechanism_Built );
    OnTrigger( "^1The Axis have destroyed the Abbey Main Gate!", Map.Abbey_Main_Gate_Destroyed );
    OnTrigger( "^1Allies have destroyed the Bell Mechanism!", Map.Bell_Mechanism_Destroyed );
    OnTrigger( "^1Heinrich awaits his first Sacrifice!", Map.First_Sacrifice );
    OnTrigger( "^1First Sacrifice performed!", Map.First_Sacrifice_Performed );
    OnTrigger( "^1Heinrich awaits his second Sacrifice!", Map.Second_Sacrifice );
    OnTrigger( "^1Second Sacrifice performed!", Map.Second_Sacrifice_Performed );
    OnTrigger( "^1Heinrich awaits his third Sacrifice!", Map.Third_Sacrifice );
    OnTrigger( "^1The Axis have destroyed the Crypt Gate!", Map.Crypt_Gate_Destroyed );
    OnTrigger( "^1The Axis have destroyed the Garden Gate!", Map.Garden_Gate_Destroyed );
    OnTrigger( "^1The Axis have destroyed the Guardhouse Gate!", Map.Guard_House_Gate_Destroyed );
    OnTrigger( "^1The Axis have destroyed the Generator!", Map.Generator_Destroyed );
    OnTrigger( "Axis have stolen the Book of Death!!", Map.book_Taken );
    OnTrigger( "Flag returned book!", Map.book_Returned );
    OnTrigger( "^1Axis have delivered the Book of Death!", Map.BOOKOFDEATHPLACE_Captured );
    OnTrigger( "^1The Axis have captured the Guardhouse Flag!", Map.forward_spawn_flag_Axis_Captured );
    OnTrigger( "^1Allies have captured the Guardhouse Flag!", Map.forward_spawn_flag_Allies_Captured );
    OnTrigger( "^1Third Sacrifice performed!", Map.Axis_Win );
    OnTrigger( "^1Axis Command Post constructed. Charge speed increased!", Map.Axis_CP_Build );
    OnTrigger( "GRENADE_bookcase Exploded.", Map.Bookcase_Exploded);
    OnTrigger( "bell_rope", Map.Bell_Tolled);

    OnTrigger( "lower_generator_door1_Moving", Map.LowerGeneratorDoor_Moving );
    OnTrigger( "upper_generator_door1_Moving", Map.UpperGeneratorDoor_Moving );

    // Disable goals
    Util.DisableGoal( ".*", true ); // All but routes

    // Disable some routes
    SetAvailableMapGoals( TEAM.AXIS, false, {
    	"ROUTE_abbeygate_destroyed",
    	"ROUTE_gardengate",
    	"ROUTE_crypt",
    });

    // Fix as some mod's breaking
    Util.AddUseWp("PLANT_Generator", "hidden");

    // Some goal use points & offsets
    Util.AddUsePoint("PLANT_Abbey_Main_Gate", Vec3(585, -2255, -125) );
    Util.AddUsePoint("PLANT_Garden_Gate", Vec3(2315, -2885, -135) );
    Util.AddUsePoint("PLANT_Generator", Vec3(-2900, -300, 475) );
    Util.AddUsePoint("PLANT_Guard_House_Gate", Vec3(-2550, -430, 25) );

    Util.SetGoalOffset( -20, 0, 0, "PLANT_Bell_Mechanism" );
    Util.SetGoalOffset( -29, 33, 0, "PLANT_Crypt_Gate" );

    // Some goal properties
    SetMapGoalProperties( "ATTACK_.*",      {MinCampTime=15, MaxCampTime=30} );
    SetMapGoalProperties( "DEFEND_.*",      {MinCampTime=15, MaxCampTime=30} );
    SetMapGoalProperties( "MOBILEMG42_.*",  {MinCampTime=60, MaxCampTime=120} );
    SetMapGoalProperties( "SNIPE_.*",       {MinCampTime=30, MaxCampTime=60} );

    Util.SetMaxUsersInProgress( 1, "BUILD_Command_Post" );
    Util.SetMaxUsersInProgress( 2, "PLANT.*" );
    Util.SetMaxUsersInProgress( 3, "FLAG.*" );
    Util.SetMaxUsersInProgress( 1, "DEFEND_.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_a_.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_second.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_Ga.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_F.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_C.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_Book.*" );
    Util.SetMaxUsersInProgress( 1, "ATTACK_Bell" );
    Util.SetMaxUsers( 8, "SWITCH_BellRope" );
    Util.SetMaxUsers( 8, "ATTACK_Pentagramm_.*" );

    SetGoalPriority( "BUILD_Command_Post", 0.75 );
    SetGoalPriority( "BUILD_Bell_Mechanism", 0.8 );
    SetGoalPriority( "PLANT_Guard_House_Gate", 0.95 );
    SetGoalPriority( "PLANT_Generator", 0.9 );
    SetGoalPriority( "PLANT_Abbey_Main_Gate", 0.85 );
    SetGoalPriority( "PLANT_Garden_Gate", 0.9, TEAM.AXIS, CLASS.COVERTOPS );
    SetGoalPriority( "PLANT_Garden_Gate", 0.75, TEAM.AXIS, CLASS.ENGINEER );

    SetGoalPriority( "ATTACK_secondStage_4", 0.52 );
    SetGoalPriority( "ATTACK_secondStage_6", 0.52 );
    SetGoalPriority( "ATTACK_secondStage_9", 0.52 );
    SetGoalPriority( "ATTACK_a_Abbey_.*", 0.52 );
    SetGoalPriority( "ATTACK_Pentagramm_.*", 0.7 );
    SetGoalPriority( "ATTACK_BookAttack", 0.52 );
    SetGoalPriority( "SWITCH_BellRope", 0.6 );
    SetGoalPriority( "DEFEND_Abbey_6", 0.52 );
    SetGoalPriority( "DEFEND_BellMechanism_5", 0.52 );

    SetGoalPriority( "DEFUSE_Bell_Mechanism_.*", 1.10, TEAM.AXIS, CLASS.ENGINEER, true );

    SetGoalPriority( "DEFUSE_Guard_House_Gate_.*", 1.10, TEAM.ALLIES, CLASS.ENGINEER, true );
    SetGoalPriority( "DEFUSE_Generator_.*", 1.15, TEAM.ALLIES, CLASS.ENGINEER, true );
    SetGoalPriority( "DEFUSE_Garden_Gate_.*", 1.20, TEAM.ALLIES, CLASS.ENGINEER, true );
    SetGoalPriority( "DEFUSE_Crypt_Gate_.*", 1.20, TEAM.ALLIES, CLASS.ENGINEER, true );
    SetGoalPriority( "DEFUSE_Abbey_Main_Gate_.*", 1.25, TEAM.ALLIES, CLASS.ENGINEER, true );

    // Available map goals at start
    SetAvailableMapGoals( TEAM.AXIS, true, {
    	"PLANT_Guard_House_Gate",
    	"PLANT_Generator",
    	"CHECKPOINT_forward_spawn_flag",
    });

    SetAvailableMapGoals( TEAM.ALLIES, true, {
    	"ATTACK_First_stage.*",
    	"PLANTMINE_First_FX.*",
    	"MOBILEMG42_First.*",
    	"SNIPE_First.*",
    	"BUILD_Command_Post",
    });

    Util.MapDebugPrint( "Omni-bot 0.8x map script for ETL Warbell V2 executed." );
};

global OnBotJoin = function( bot )
{
    bot.TargetBreakableDist = 100.0;
};

global InitializeRoutes = function()
{
    MapRoutes =
    {
        PLANT_Guard_House_Gate =
        {
            ROUTE_ax_spawn1 =
            {
                ROUTE_hill1 = {},
                ROUTE_cave1 = {},
                ROUTE_road1 =
                {
                    ROUTE_road2 = {},
                },
            },
        },

        CHECKPOINT_forward_spawn_flag =
        {
            ROUTE_ax_spawn1 =
            {
                ROUTE_hill1 =
                {
                    ROUTE_beds = {},
                    ROUTE_beds =
                    {
                        ROUTE_hall = {},
                    },
                },

                ROUTE_cave1 =
                {
                    ROUTE_beds = {},
                    ROUTE_beds =
                    {
                        ROUTE_hall = {},
                    },
                },

                ROUTE_road1 =
                {
                    ROUTE_road2 =
                    {
                        ROUTE_beds = {},
                        ROUTE_beds =
                        {
                            ROUTE_hall = {},
                        },
                    },
                },
            },
        },

        CAPPOINT_BOOKOFDEATHPLACE =
        {
            ROUTE_book =
            {
                ROUTE_abbeyroad =
                {
                    ROUTE_abbeygate_destroyed = {}
                },

                ROUTE_garden =
                {
                    ROUTE_gardengate = {},
                    ROUTE_gardengate =
                    {
                        ROUTE_abbey = {},
                    },
                },

                ROUTE_tower =
                {
                    ROUTE_cave2 =
                    {
                        ROUTE_crypt = {},
                        ROUTE_abbeygate = {},
                    },
                },
            },
        },
    };

    // Copy some routes
    MapRoutes.BUILD_Bell_Mechanism = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;
    MapRoutes.ATTACK_BookAttack = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;
    MapRoutes.SWITCH_BellRope = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;
    MapRoutes.ATTACK_Pentagramm_1 = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;
    MapRoutes.ATTACK_Pentagramm_2 = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;
    MapRoutes.ATTACK_Pentagramm_3 = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;
    MapRoutes.DEFEND_Abbey_6 = MapRoutes.CAPPOINT_BOOKOFDEATHPLACE;

    Util.Routes(MapRoutes);
};
