#textdomain wesnoth-ei
[scenario]
    id=15_Return_to_Wesnoth
    name= _ "Return to Wesnoth"
    map_file=15_Return_to_Wesnoth.map
    theme=Cutscene_Minimal
    turns=unlimited
    next_scenario=16_Eleventh_Hour
    victory_when_enemies_defeated=no

    {DEFAULT_SCHEDULE_MORNING}

    {SCENARIO_MUSIC loyalists.ogg}

    [story]
        [part]
            story= _ "Leaving the rotting Horse Plains far behind, Gweddry, Owaec, and Dacyn marched hurriedly towards Weldyn, capital of Wesnoth. They dreaded what they might find there..."
            music=silence.ogg
            {EI_BIGMAP}
        [/part]
    [/story]
    {EI_TRACK {JOURNEY_15_NEW} }

    [side]
        side=1
        canrecruit=yes
        controller=human
        team_name=good
        user_team_name=_"Wesnothians"
        gold=0
        {FLAG_VARIANT loyalist}
        defeat_condition=never

        {CHARACTER_STATS_GWEDDRY}
    [/side]

    #--------------------
    # WELDYN DEFENDERS
    #--------------------
    [side]
        side=2
        type=General
        id=Halrad
        name= _ "Halrad"
        profile=portraits/humans/marshal-2.webp~FL(horiz)
        canrecruit=yes
        facing=sw
        [modifications]
            {TRAIT_LOYAL_DUMMY}
            {TRAIT_STRONG}
        [/modifications]
        controller=ai
        recruit=Heavy Infantryman,Mage,Swordsman,Bowman
        gold=0
        income={ON_DIFFICULTY -32 -27 -22} # since he has +32 income from all the villages (+2 base), and we don't want him to recruit very much
        team_name=good
        user_team_name=_"Wesnothians"
        [ai]
            {NO_SCOUTS}
            grouping=defensive
            leader_aggression=-9
            aggression=0.1
            caution=0.9
        [/ai]
        {FLAG_VARIANT loyalist}

        {GENERIC_UNIT 2 (Shock Trooper) 17 28}
        {GENERIC_UNIT 2 (Swordsman) 17 32}
        {GENERIC_UNIT 2 (Longbowman) 17 33}

        {GENERIC_UNIT 2 (Longbowman) 21 26}
        {GENERIC_UNIT 2 (Shock Trooper) 22 25}
        {GENERIC_UNIT 2 (Red Mage) 27 26}

        {GENERIC_UNIT 2 (Heavy Infantryman) 31 30}
        {GENERIC_UNIT 2 (Spearman) 31 32}
        {GENERIC_UNIT 2 (Mage) 21 37}

        {NAMED_UNIT 2 (Transport Galleon) 29 37 "" (_"Shield of Ana’sar") ()} {GUARDIAN}
        [+unit]
            max_moves=3
        [/unit]
        {FACING sw}
        [+unit]
            max_hitpoints=83
        [/unit]
        {NAMED_UNIT 2 (Galleon)           29 36 "" (_"Carcyn’s Pride") ()} {GUARDIAN}
        [+unit]
            max_moves=3
        [/unit]
        {FACING se}
        [+unit]
            max_hitpoints=62
        [/unit]
    [/side]
    {STARTING_VILLAGES 2 7}
    {SILENTLY_LIMIT_LEADER_MOVES 2 1}

    [event]
        name=side 1 turn end
        first_time_only=no
        {RESET_SIDE_AI 2 no -9 9}

        [if]
            [have_unit]
                side=3,4,5

                [filter_location]
                    x,y=20,33
                    radius=14
                [/filter_location]
                # retreat if too many enemies
                count={ON_DIFFICULTY 15-99 20-99 25-99}
            [/have_unit]

            [or]
                [not]
                    [have_unit]
                        side=2
                        count=11-99 # retreat if too few defenders
                    [/have_unit]
                [/not]
            [/or]

            [then]
                {MODIFY_SIDE_AI (2) (
                    # retreat inside the moat
                    {GOAL_LOCATION 55 (x,y=21,30-33)} # attacks will most likely come from west and (some) north
                    {GOAL_LOCATION 55 (x,y=22,29)}
                    {GOAL_LOCATION 55 (x,y=23,29)}
                    {GOAL_LOCATION 55 (x,y=25,29)}
                    {GOAL_LOCATION 54 (x,y=26,29)}
                    {GOAL_LOCATION 53 (x,y=22,33)}
                    {GOAL_LOCATION 52 (x,y=23,34)}
                    {GOAL_LOCATION 51 (x,y=25,34)}
                    {GOAL_LOCATION 50 (x,y=27,32)}
                )}
                {MODIFY_SIDE_AI (2) (
                    [avoid] # stay inside the moat
                        x=0-20, 21,  21,    22,  22,    23,  23,    24,  24,    25,  25,    26,  26,    27,  27,    28-99
                        y=0-99, 0-29,34-99, 0-28,34-99, 0-28,35-99, 0-27,35-99, 0-28,35-99, 0-28,34-99, 0-29,34-99, 0-99
                    [/avoid]
                )}
            [/then]
            [else]
                {MODIFY_SIDE_AI (2) (
                    {GOAL_LOCATION 5 (x,y,terrain=17-31,25-37,Ce)} # encampment (not castle) tiles around Weldyn
                    {GOAL_LOCATION 5 (x,y=17,28)} # and some overlapping specific west/north encampment tiles
                    {GOAL_LOCATION 5 (x,y=17,31)}
                    {GOAL_LOCATION 5 (x,y=17,33)}
                    {GOAL_LOCATION 5 (x,y=20,26)}
                    {GOAL_LOCATION 5 (x,y=22,25)}
                    {GOAL_LOCATION 3 (x,y=27,26)}
                    {GOAL_LOCATION 1 (x,y=31,30)}
                    {GOAL_LOCATION 1 (x,y=21,37)}
                )}
                {MODIFY_SIDE_AI (2) (
                    [avoid] # stay inside the earthworks
                        x=0-16,32-99,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,    17,   18,   19,   20
                        y=0-99, 0-99,  0-27,0-26,0-26,0-25,0-25,0-24,0-25,0-24,0-25,0-25,0-25,0-25,0-26,0-27,0-29,  34-99,35-99,36-99,36-99
                    [/avoid]
                )}
            [/else]
        [/if]
    [/event]

    #--------------------
    # WELDYN INVADERS
    #--------------------
    # the player should have an easy time getting 1 unit to Weldyn for a big early finish bonus
    # or, they can choose to farm XP off all the various enemies
    [side]
        side=3
        type=Necromancer
        id=Mal-un-Darak
        name= _ "Mal-un-Darak"
        canrecruit=yes
        facing=sw
        [modifications]
            {TRAIT_INTELLIGENT}
            {TRAIT_STRONG}
        [/modifications]
        controller=ai
        recruit=Skeleton,Revenant,Skeleton Archer,Bone Shooter,Dark Adept
        gold=0
        {INCOME 5 18 28}
        team_name=undead
        user_team_name=_"Undead"
        {FLAG_VARIANT undead}

        {LOYAL_UNIT 3 (Draug) 37 25} {GUARDIAN}
        {LOYAL_UNIT 3 (Banebow) 38 26} {GUARDIAN}

        {LOYAL_UNIT 3 (Draug) 24 18} {GUARDIAN}
        {LOYAL_UNIT 3 (Deathblade) 26 18} {GUARDIAN}

        {GENERIC_UNIT 3 (Dark Sorcerer) 33 14}
        {GENERIC_UNIT 3 (Banebow) 34 15}
        {GENERIC_UNIT 3 (Dark Adept) 29 13}
        {GENERIC_UNIT 3 (Banebow) 26 14}

        {GENERIC_UNIT 3 (Revenant) 29 18} # extra stuff added for cutscene
        {GENERIC_UNIT 3 (Skeleton) 30 18}
        {GENERIC_UNIT 3 (Skeleton Archer) 33 18}
        {GENERIC_UNIT 3 (Bone Shooter) 29 17}
        {GENERIC_UNIT 3 (Skeleton) 28 19}

        {GENERIC_UNIT 3 (Bone Shooter) 37 19}
        {GENERIC_UNIT 3 (Skeleton Archer) 37 19}
        {GENERIC_UNIT 3 (Dark Adept) 36 19}
        {GENERIC_UNIT 3 (Skeleton Archer) 39 20}
        {GENERIC_UNIT 3 (Skeleton) 37 19}
        {GENERIC_UNIT 3 (Skeleton) 37 19}
    [/side]
    {STARTING_VILLAGES 3 12}
    {SILENTLY_LIMIT_LEADER_MOVES 3 1}

    [side]
        side=4
        type=Dark Sorcerer
        id=Mal-un-Zanrad
        name= _ "Mal-un-Zanrad"
        gender=female
        canrecruit=yes
        [modifications]
            {TRAIT_RESILIENT}
            {TRAIT_STRONG}
        [/modifications]
        controller=ai
        recruit=Walking Corpse,Soulless,Ghoul
        gold=0
        {INCOME 3 12 19}
        team_name=undead
        user_team_name=_"Undead"
        {FLAG_VARIANT undead}

        {LOYAL_UNIT 4 (Necrophage) 3 16} {GUARDIAN}

        {GENERIC_UNIT 4 (Ghast) 16 16}
        {GENERIC_UNIT 4 (Soulless) 16 19}
        {GENERIC_UNIT 4 (Dark Adept) 11 19}

        {GENERIC_UNIT 4 (Necrophage) 17 17} # extra stuff added for cutscene
        {GENERIC_UNIT 4 (Ghoul) 17 16}
        {GENERIC_UNIT 4 (Soulless) 16 15}
        {GENERIC_UNIT 4 (Soulless) 17 17}
        {GENERIC_UNIT 4 (Walking Corpse) 17 19}
        {GENERIC_UNIT 4 (Walking Corpse) 20 17}
        {GENERIC_UNIT 4 (Walking Corpse) 17 17}

        {GENERIC_UNIT 4 (Dark Adept) 11 23}
        {GENERIC_UNIT 4 (Dark Adept) 13 24}
        {GENERIC_UNIT 4 (Soulless) 12 23}
        {GENERIC_UNIT 4 (Soulless) 11 23}
        {GENERIC_UNIT 4 (Walking Corpse) 11 23}
        {GENERIC_UNIT 4 (Walking Corpse) 13 20}
        {GENERIC_UNIT 4 (Walking Corpse) 13 21}
    [/side]
    {STARTING_VILLAGES 4 8}
    {SILENTLY_LIMIT_LEADER_MOVES 4 2}

    [side]
        side=5
        type=Necromancer
        id=Mal-un-Xadrux
        name= _ "Mal-un-Xadrux"
        canrecruit=yes
        [modifications]
            {TRAIT_QUICK}
            {TRAIT_INTELLIGENT}
        [/modifications]
        controller=ai
        recruit=Skeleton Rider,Bone Knight,Chocobone,Dark Adept
        gold=120 # this guy doesn't attack the player directly (unless you go after him to farm XP), so don't vary money, so he remains a credible threat to Weldyn
        income=28
        team_name=undead
        user_team_name=_"Undead"
        {FLAG_VARIANT undead}

        {LOYAL_UNIT 5 (Skeleton Rider) 5 31} {GUARDIAN}
        {LOYAL_UNIT 5 (Chocobone) 40 37} {GUARDIAN}
        [+unit]
            max_moves=7 # so it can't attack Weldyn
        [/unit]

        {GENERIC_UNIT 5 (Chocobone) 2 33} # extra stuff added for cutscene
        {GENERIC_UNIT 5 (Bone Knight) 2 35}
        {GENERIC_UNIT 5 (Bone Knight) 3 33}
        {GENERIC_UNIT 5 (Skeleton Rider) 2 33}
        {GENERIC_UNIT 5 (Chocobone) 2 33}
        {GENERIC_UNIT 5 (Skeleton Rider) 1 32}

        {GENERIC_UNIT 5 (Bone Knight) 7 34}
        {GENERIC_UNIT 5 (Skeleton Rider) 7 34}
        {GENERIC_UNIT 5 (Skeleton Rider) 7 34}

        {GENERIC_UNIT 5 (Bone Knight) 1 26}
        {GENERIC_UNIT 5 (Chocobone) 1 28}
        {GENERIC_UNIT 5 (Skeleton Rider) 2 28}
        {GENERIC_UNIT 5 (Skeleton Rider) 1 29}
    [/side]
    {STARTING_VILLAGES 5 12}
    {SILENTLY_LIMIT_LEADER_MOVES 5 2}

    # dummy side, for corpses that attack the player (otherwise these will try and group up with the main armies)
    [side]
        side=6
        team_name=undead
        hidden=yes

        {GENERIC_UNIT 6 (Soulless)       22 9} {VARIATION mounted}
        {GENERIC_UNIT 6 (Soulless)       20 7}
        {GENERIC_UNIT 6 (Walking Corpse) 19 11}

        {GENERIC_UNIT 6 (Soulless)       33 5}
        {GENERIC_UNIT 6 (Soulless)       39 11}
        {GENERIC_UNIT 6 (Walking Corpse) 40 5} {VARIATION mounted}

        {GENERIC_UNIT 6 (Walking Corpse) 6 11}
        {GENERIC_UNIT 6 (Soulless)       3 12}
        {GENERIC_UNIT 6 (Soulless)       3 8} {VARIATION mounted}

        {GENERIC_UNIT 6 (Soulless)       41 22}
        {GENERIC_UNIT 6 (Walking Corpse) 40 20}
        {GENERIC_UNIT 6 (Soulless)       37 22} {VARIATION mounted}
        {GENERIC_UNIT 6 (Soulless)       38 22}
    [/side]
    [event]
        name=side 6 turn
        first_time_only=no
        {RESET_SIDE_AI 6 defensive 0.9 0.1}
        {MODIFY_SIDE_AI (6) ({GOAL_SEEK_SIDE 99 1 0})}
    [/event]

    #---------------------------
    # PREPARE WELDYN TERRAIN
    #---------------------------
    [event]
        name=prestart

        # river walls
        [event]
            name=new turn,draw_walls
            first_time_only=no
            [store_time_of_day]
            [/store_time_of_day]
            [if]
                [variable]
                    name=time_of_day.id
                    equals=morning
                [/variable]

                [then]
                    {REMOVE_IMAGE 24 31}
                    [item]
                        x,y=24,31
                        halo=weldyn/walls_S15.png
                    [/item]
                [/then]
            [/if]

            [store_time_of_day]
            [/store_time_of_day]
            [if]
                [variable]
                    name=time_of_day.id
                    equals=dusk
                [/variable]

                [then]
                    {REMOVE_IMAGE 24 31}
                    [item]
                        x,y,halo=24,31,weldyn/walls_S15.png~CS(10,-20,-35)
                    [/item]
                [/then]
            [/if]

            [store_time_of_day]
            [/store_time_of_day]
            [if]
                [variable]
                    name=time_of_day.id
                    equals=first_watch
                [/variable]

                [then]
                    {REMOVE_IMAGE 24 31}
                    [item]
                        x,y,halo=24,31,weldyn/walls_S15.png~CS(-75,-45,-13)
                    [/item]
                [/then]
            [/if]

            [store_time_of_day]
            [/store_time_of_day]
            [if]
                [variable]
                    name=time_of_day.id
                    equals=dawn
                [/variable]

                [then]
                    {REMOVE_IMAGE 24 31}
                    [item]
                        x,y,halo=24,31,weldyn/walls_S15.png~CS(-25,-15,0)
                    [/item]
                [/then]
            [/if]
        [/event]
        [fire_event]
            name=draw_walls
        [/fire_event]

        {PLACE_IMAGE scenery/village-human-burned1.png 8 12}
        {PLACE_IMAGE scenery/village-human-burned2.png 39 7}
        {PLACE_IMAGE scenery/village-human-burned3.png 37 9}
        {PLACE_IMAGE scenery/village-human-burned4.png 8 21}
        {PLACE_IMAGE scenery/village-human-burned3.png 13 10}

        {PLACE_IMAGE scenery/gore-1.png 38 3}
        {PLACE_IMAGE scenery/village-human-burned1.png 38 3}
        {PLACE_IMAGE "scenery/blood-trail-1.png~FL(horiz)" 37 4}

        {PLACE_IMAGE scenery/gore-1.png 26 11}
        {PLACE_IMAGE scenery/village-human-burned2.png 26 11}
        {PLACE_IMAGE scenery/gore-2.png 26 12}
        {PLACE_IMAGE "scenery/blood-trail-2.png~FL(horiz)" 27 13}

        {PLACE_IMAGE scenery/gore-1.png 4 19}
        {PLACE_IMAGE scenery/village-human-burned3.png 4 19}

        {PLACE_IMAGE scenery/blood-2.png 37 26}
        {PLACE_IMAGE scenery/gore-3.png 38 26}

        {PLACE_IMAGE scenery/blood-3.png 27 19}
        {PLACE_IMAGE scenery/blood-1.png 26 18}

        {PLACE_IMAGE scenery/blood-1.png 7 33}
        {PLACE_IMAGE scenery/gore-3.png 11 37}
        {PLACE_IMAGE scenery/gore-2.png 7 12}
        {PLACE_IMAGE scenery/blood-1.png 4 20}

        {BRAZIER_ILLUMINATION_MORNING 22 30}
        {BRAZIER_ILLUMINATION_MORNING 22 32}
        {BRAZIER_ILLUMINATION_MORNING 26 30}
        {BRAZIER_ILLUMINATION_MORNING 26 32}

        {BRAZIER_ILLUMINATION_MORNING 21 27}
        {BRAZIER_ILLUMINATION_MORNING 18 33}
        {BRAZIER_ILLUMINATION_MORNING 25 37}
        {BRAZIER_ILLUMINATION_MORNING 29 28}
        {BRAZIER_ILLUMINATION_MORNING 30 33}
    [/event]

    #---------------------------
    # PLAY WELDYN CUTSCENE
    #---------------------------
    [event]
        name=start

        {RECALL_XY Dacyn 20 1}
        {RECALL_XY Owaec 18 1}

        {SCROLL_TO 24 31}
        [delay]
            time=250
        [/delay]

        [message]
            speaker=Owaec
            message= _ "Lo and behold, the great city of Weldyn! Its walls still stand, thank the Light."
            scroll=no
        [/message]
        [delay]
            time=250
        [/delay]

        {SCROLL_TO 5 35}
        [animate_unit]
            [filter]
                side=5
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=4,34
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 5 (Chocobone)      4 34} {ANIMATE}
        [animate_unit]
            [filter]
                side=5
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=5,36
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 5 (Skeleton Rider) 5 36} {ANIMATE}
        [animate_unit]
            [filter]
                side=5
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=6,35
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 5 (Bone Knight)    6 35} {ANIMATE}
        [message]
            speaker=Gweddry
            message= _ "But look, the undead are laying siege and have built fortifications completely surrounding the city! The defenders must be grievously outnumbered."
            scroll=no
        [/message]
        {SCROLL_TO 22 16}
        [animate_unit]
            [filter]
                side=3
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=30,15
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 3 (Revenant)   30 15} {ANIMATE}
        [animate_unit]
            [filter]
                side=3
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=31,16
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 3 (Banebow)    31 16} {ANIMATE}
        [animate_unit]
            [filter]
                side=3
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=32,15
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 3 (Deathblade) 32 15} {ANIMATE}
        [message]
            speaker=Dacyn
            message= _ "Even this undead force appears to be (cough) but a small fraction of Mal-Ravanal’s greater host. (cough)(cough) I must meet with the king. Weldyn will fall if we do not act."
            scroll=no
        [/message]
        [animate_unit]
            [filter]
                side=4
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=11,17
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 4 (Necrophage) 11 17} {ANIMATE}
        [animate_unit]
            [filter]
                side=4
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=13,17
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 4 (Soulless)   13 17} {ANIMATE}
        [animate_unit]
            [filter]
                side=4
                canrecruit=yes
            [/filter]
            flag=attack
            hits=no
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                x,y=13,17
            [/facing]
        [/animate_unit]
        {GENERIC_UNIT 4 (Ghoul)      13 18} {ANIMATE}
        {SCROLL_TO 19 1}
        [message]
            speaker=Gweddry
            message= _ "Then we must break through to the city at once! Come on men, follow me!"
        [/message]

        {MOVE_UNIT id=Gweddry 20 6}
        [animate_unit]
            [filter]
                id=Gweddry
            [/filter]
            flag=attack
            hits=yes
            [primary_attack]
                range=melee
            [/primary_attack]
            [facing]
                [filter]
                    x,y=20,7
                [/filter]
            [/facing]
        [/animate_unit]

        {KILL x,y=20,7 ANIMATE=yes}

        {MOVE_UNIT id=Owaec 21 9}
        [animate_unit]
            [filter]
                id=Owaec
            [/filter]
            flag=attack
            hits=yes
            [primary_attack]
                range=melee
                type=impact
            [/primary_attack]
            [facing]
                [filter]
                    x,y=22,9
                [/filter]
            [/facing]
        [/animate_unit]

        {KILL x,y=22,9 ANIMATE=yes}

        {MOVE_UNIT id=Dacyn 19 10}
        [animate_unit]
            [filter]
                id=Dacyn
            [/filter]
            flag=attack
            hits=yes
            [primary_attack]
                range=ranged
            [/primary_attack]
            [facing]
                [filter]
                    x,y=19,11
                [/filter]
            [/facing]
        [/animate_unit]

        {KILL x,y=19,11 ANIMATE=yes}

        {PUT_TO_RECALL_LIST id=Owaec}
        {PUT_TO_RECALL_LIST id=Gweddry}
        {PUT_TO_RECALL_LIST id=Dacyn}

        [fire_event]
            name=council_prestart
        [/fire_event]
    [/event]

    #---------------------------
    # PREPARE COUNCIL TERRAIN
    #---------------------------
    [event]
        name=council_prestart
        [screen_fade]
            red=0
            green=0
            blue=0
            alpha=255
            duration=500
        [/screen_fade]

        {KILL side=2,3,4,5,6,7,8,9} # kill everything, so it doesn't get sent to recall lists when we change the map
        [remove_item]
        [/remove_item]
        [remove_time_area]
            id=
        [/remove_time_area]
        [time_area]
            x,y=0-99,0-99
            [time]
                id=indoors
                name= _ "Indoors"
                image=misc/time-schedules/schedule-indoors.png
                lawful_bonus=25
            [/time]
        [/time_area]
        [replace_map]
            map_file=Throne_Room.map
            expand=yes
            shrink=yes
        [/replace_map]

        {PLACE_IMAGE scenery/throne.png 10 5} # if I change these, also change 19_Epilogue
        {PLACE_IMAGE items/sceptre-of-fire.png 7 6}
        {PLACE_IMAGE items/ornate2.png 13 6}
        {PLACE_IMAGE items/ornate1.png 14 6}

        {GENERIC_UNIT 2 (Pikeman)    8 20} {FACING se}
        {GENERIC_UNIT 2 (Swordsman) 12 20} {FACING sw}
        {GENERIC_UNIT 2 (Iron Mauler)    6 15} {FACING ne}
        {GENERIC_UNIT 2 (Iron Mauler)   14 15} {FACING nw}
        {GENERIC_UNIT 2 (Royal Guard)    6 11} {FACING se}
        {GENERIC_UNIT 2 (Royal Guard)   14 11} {FACING sw}

        [unit]
            side=2
            x,y=10,7
            facing=se
            {CHARACTER_STATS_KING}
            [modifications]
                {KONRAD_UNARMED_SCENARIO}
            [/modifications]
        [/unit]
        [unit]
            id=Aeraeka
            name= _ "Aeraeka"
            type=Arch Mage
            side=2
            x,y=12,8
            facing=sw
            gender=female
            [modifications]
                {TEAM_COLOR_OVERRIDE () brown}
            [/modifications]
        [/unit]
        [unit]
            id=Halric
            name=_ "Halric"
            type=General
            profile=portraits/humans/marshal.webp
            side=2
            x,y=8,8
            facing=se
            [modifications]
                {TEAM_COLOR_OVERRIDE () green}
            [/modifications]
        [/unit]
        {NAMED_UNIT 2 (Lancer) 9 10 "Denogyc" (_"Denogyc") ()} {FACING ne}

        [delay]
            time=1500
        [/delay]

        [scroll_to]
            x,y=10,10
            immediate=yes
        [/scroll_to]
        [delay]
            time=1500
        [/delay]

        [screen_fade]
            red=0
            green=0
            blue=0
            alpha=0
            duration=500
        [/screen_fade]

        [fire_event]
            name=council_start
        [/fire_event]
    [/event]

    #---------------------------
    # PLAY COUNCIL CUTSCENE
    #---------------------------
    [event]
        name=council_start
        [lock_view]
        [/lock_view]

        [message]
            speaker=Aeraeka
            #po: the council discusses the northern alliance
            message= _ "Well try again! It is absolutely imperative that we get a response from the Northerners."
        [/message]
        [message]
            speaker=Halric
            message= _ "If help was coming, we would have heard about it by now. They’re either unwilling or unable to march. What we need to consider is-"
        [/message]

        # the council discusses the south guard
        {NAMED_UNIT 2 (Silver Mage) 10 12 "Mefel" (_"Mefel") ()}
        [animate_unit]
            [filter]
                id=Mefel
            [/filter]
            flag=post_teleport
        [/animate_unit]
        [message]
            speaker=Mefel
            #po: the speaker, a male Silver Mage, has just teleported in
            message= _ "Urgent report from the south, Sire! I’m afraid it can’t wait."
        [/message]
        [message]
            speaker=Konrad
            image=portraits/konrad_II.webp
            #po: Denogyc is a male Lancer.
            message= _ "Denogyc, you’re excused. Get some rest. Minister Mefel, what news of Kerlath?"
        [/message]
        [move_unit] # silently
            id=Denogyc
            to_x,to_y=10,20
            force_scroll=no
        [/move_unit]
        {KILL id=Denogyc}
        {MOVE_UNIT id=Mefel 10 9}
        [message]
            speaker=Mefel
            #po: Kerlath Province is the area around Westin
            message= _ "The siege around Westin has been broken, but Kerlath’s forces are badly depleted. I’m afraid we won’t be able to mount a counter-offensive in time to support you, especially with Mal-Xlana still holding Fort Tahn."
        [/message]

        # dacyn and co. appear
        {SCROLL_TO 10 20}
        [unit]
            type=General
            id=Halrad
            name= _ "Halrad"
            profile=portraits/humans/marshal-2.webp~FL(horiz)
            side=2
            x,y=10,19
            [modifications]
                {TEAM_COLOR_OVERRIDE () blue}
            [/modifications]
        [/unit]
        {RECALL_XY Dacyn 9 20}
        {RECALL_XY Gweddry 11 20}
        {RECALL_XY Owaec 10 20}
        [message]
            speaker=Aeraeka
            message= _ "Oh, what now..."
            scroll=no
        [/message]
        [message]
            speaker=Halrad
            message= _ "My Liege, your former High Advisor Dacyn is here, and he says he has vital information on how to defeat the undead."
        [/message]

        [move_unit] # silently
            id=Mefel
            to_x,to_y=13,10
            force_scroll=no
        [/move_unit]
        {MODIFY_UNIT id=Mefel facing nw}
        {MOVE_UNIT id=Dacyn 10 9}
        {MOVE_UNIT id=Gweddry 9 10}
        {MODIFY_UNIT id=Gweddry facing ne}
        {MOVE_UNIT id=Owaec 11 10}
        {MODIFY_UNIT id=Owaec facing nw}
        {SCROLL_TO 10 10}
        {KILL id=Halrad}

        # the council discusses dacyn's and owaec's plans
        [message]
            speaker=Konrad
            image=portraits/konrad_II.webp
            message= _ "Dacyn?! At last some good news! I thought you were long dead."
        [/message]
        [message]
            speaker=Halric
            message= _ "He certainly looks half-dead. Dacyn, there is an unholy pall over your skin. Where have you been all this time? We’ve sorely needed your help."
        [/message]
        [message]
            speaker=Dacyn
            message= _ "My story and appearance are irrelevant. What matters is that I know how to defeat these invaders. The only path to victory is cutting off the head of the snake. Mal-Ravanal, who you once knew as the mage Ravan, must be destroyed."
        [/message]
        [message]
            speaker=Aeraeka
            message= _ "You think we haven’t tried?! Our best mages struck down that infernal lich at great cost to their number, but within seconds, Mal-Ravanal had already taken a new body and returned the favor on our ranks. I myself barely made it out alive!"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "And that is why my companions and I have spent the past year traveling far to the northeast, seeking (cough) a potent magical amulet that I now possess. If we can destroy the skeletal body, I wield the power to banish the lich’s long-tortured soul. This destruction will be permanent."
        [/message]
        [message]
            speaker=Gweddry
            message= _ "Your Majesty, I have seen this amulet used before. While I cannot attest to its reliability, it is certainly powerful enough to do what Dacyn claims."
        [/message]
        [message]
            speaker=Halric
            message= _ "Even assuming this magical voodoo works, how do you mean to destroy Mal-Ravanal’s body? The one chance we had was out of the lich’s own arrogance, and even that cost us four of our elite magi under better conditions. Now we’ve been cut off from Dan’Tonk and barely have enough men to hold the walls, much less sortie against the undead."
        [/message]
        [message]
            speaker=Aeraeka
            message= _ "Truly, have you three not seen the might of the armies encircling Weldyn? It is as if all of the dead warriors from all ages past have come back to attack us. There is no end to the columns of marching skeletons, the wailing ghosts, the infernal bats, the necromancers who raised them..."
        [/message]
        [message]
            speaker=Owaec
            message= _ "I pay no heed to the odds! I say we strike at Mal-Ravanal with all the might of Wesnoth. If we assault in force, we can punch through the enemy lines, isolate Mal-Ravanal in the chaos of battle, and blast the lich to oblivion!

I will not let the devastation at the plains be the final legacy of the Clans. We must attack and win back our glory!"
        [/message]
        [delay]
            time=1000
        [/delay]

        [message]
            speaker=Dacyn
            message= _ "I have a (cough) superior suggestion. Mal-Ravanal’s armies are vast and unconquerable. Yet the lich alone is not. As a human, Ravan was overconfident to the point of arrogance. I still believe this to be true, if not more so after gaining lichdom. (cough)(cough) If I were to challenge Mal-Ravanal to a duel, I believe they would choose to face me. That would be our opportunity."
        [/message]
        [message]
            speaker=Owaec
            message= _ "You call Mal-Ravanal arrogant, yet you seek to face such an overwhelming power in single combat? Even if you could claim victory with that foul amulet of yours, we cannot trust that lich to honor the terms of such a challenge. You would likely find yourself facing their entire army!"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "We face their entire army regardless. (cough)(cough) The only difference is whether Mal-Ravanal is commanding in the back or gloating in the front."
        [/message]
        [delay]
            time=1000
        [/delay]
        [message]
            speaker=Konrad
            image=portraits/konrad_II.webp
            message= _ "Two risky plans. But the armies surrounding Weldyn grow each day, and we are hard-pressed for options."
        [/message]
        # While I would like to put the choice here, that would make players replay "Weldyn Under Attack"
        # if they wanted to change their selection. Playability trumps storyline, so the choice is deferred.

        [unit]
            id=Halrod
            name= _ "Halrod"
            type=General
            profile=portraits/humans/general.webp
            side=2
            x,y=10,20
            [modifications]
                {TEAM_COLOR_OVERRIDE () brightorange}
            [/modifications]
        [/unit]
        [unit]
            id=Escort
            name= _ "Escort"
            type=Swordsman
            side=2
            hitpoints=9
            x,y=9,20
            [modifications]
                {TEAM_COLOR_OVERRIDE () brightorange}
            [/modifications]
        [/unit]
        {MOVE_UNIT id=Halrod 10 15}
        {MODIFY_UNIT id=Escort facing nw}
        {MOVE_UNIT id=Escort  9 17}
        {MODIFY_UNIT id=Escort facing ne}

        [message]
            speaker=Halrod
            message= _ "Sire, we’re under attack! Undead have breached the perimeter earthworks and are massing around the outer villages. I think they mean to storm the moat at nightfall."
        [/message]
        [message]
            speaker=Halric
            message= _ "They attack again so soon?! The few men we have left are in no position to repel a concentrated assault!"
        [/message]
        [message]
            speaker=Konrad
            image=portraits/konrad_II.webp
            message= _ "This is ill news indeed. We will have to cut our council short; Generals, Lieutenant, ready your men!"
        [/message]

        {MODIFY_UNIT id=Konrad side 1}  # so that the king gets added to the player's recall list, and can help fight next scenario
        {PUT_TO_RECALL_LIST id=Konrad}
        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 100}
            carryover_report=no
            linger_mode=no
        [/endlevel]
    [/event]
[/scenario]
