#textdomain wesnoth-ei
[scenario]
    id=16_Weldyn_under_Attack
    name= _ "Weldyn under Attack"
    next_scenario=17a_The_Duel
    map_data="{campaigns/Eastern_Invasion/maps/16_Weldyn_under_Attack.map}"
    turns=18

    {DUSK}
    {DUSK}
    {DUSK}
    {FIRST_WATCH}
    {FIRST_WATCH}
    {FIRST_WATCH}
    {FIRST_WATCH}
    {FIRST_WATCH}
    {FIRST_WATCH}
    {SECOND_WATCH}
    {SECOND_WATCH}
    {SECOND_WATCH}
    {SECOND_WATCH}
    {SECOND_WATCH}
    {SECOND_WATCH}
    {DAWN}
    {DAWN}
    {DAWN}

    {INTRO_AND_SCENARIO_MUSIC the_city_falls.ogg loyalists.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}

    {campaigns/Eastern_Invasion/utils/deaths.cfg}

    {BIGMAP_16}

    [side]
        type=Lieutenant
        id=Gweddry
        name= _ "Gweddry"
        side=1
        canrecruit=yes
        controller=human
        team_name=good
        user_team_name=_"Wesnothians"
        {GOLD 250 200 200}
        {FLAG_VARIANT loyalist}
    [/side]

    {AI_CONTROLLER () 1 2,3,4 ()}

    [side]
        type=General
        id=Halrad
        name= _ "Halrad"
        side=2
        canrecruit=yes
        recruit=Heavy Infantryman,Swordsman,Mage
        controller=ai
        {GOLD 200 150 100}
        team_name=good
        user_team_name=_"Wesnothians"
        [ai]
            recruitment_pattern=fighter,fighter,mixed fighter
            villages_per_scout=0
        [/ai]
        {FLAG_VARIANT loyalist}
    [/side]
    [side]
        type=General
        id=Halric
        name= _ "Halric"
        side=3
        canrecruit=yes
        recruit=Heavy Infantryman,Swordsman,Red Mage
        controller=ai
        {GOLD 250 200 150}
        team_name=good
        user_team_name=_"Wesnothians"
        [ai]
            recruitment_pattern=fighter,fighter,mixed fighter
            villages_per_scout=0
        [/ai]
        {FLAG_VARIANT loyalist}
    [/side]
    [side]
        type=General
        id=Halrod
        name= _ "Halrod"
        side=4
        canrecruit=yes
        recruit=Shock Trooper,Swordsman,Mage
        controller=ai
        {GOLD 250 200 150}
        team_name=good
        user_team_name=_"Wesnothians"
        [ai]
            recruitment_pattern=fighter,fighter,mixed fighter
            villages_per_scout=0
        [/ai]
        {FLAG_VARIANT loyalist}
    [/side]

    [side]
        type=Lich
        id=Mal-Grekulak
        name= _ "Mal-Grekulak"
        side=5
        canrecruit=yes
        recruit=Spectre,Revenant,Banebow
        team_name=undead
        user_team_name=_"Undead"
        {GOLD 425 600 700}
        [ai]
            recruitment_pattern=scout,fighter,fighter,scout,fighter,archer,fighter
            {NO_SCOUTS}
        [/ai]
        {FLAG_VARIANT undead}
    [/side]

    [side]
        type=Lich
        id=Mal-Xakralan
        name= _ "Mal-Xakralan"
        side=6
        canrecruit=yes
        recruit=Necrophage,Revenant,Banebow,Blood Bat
        team_name=undead
        user_team_name=_"Undead"
        {GOLD 425 600 700}
        [ai]
            recruitment_pattern=scout,fighter,fighter,scout,fighter,archer,fighter
            {NO_SCOUTS}
        [/ai]
        {FLAG_VARIANT undead}
    [/side]

    [side]
        type=Lich
        id=Mal-Uknalu
        name= _ "Mal-Uknalu"
        side=7
        canrecruit=yes
        recruit=Nightgaunt,Revenant,Banebow
        team_name=undead
        user_team_name=_"Undead"
        {GOLD 425 600 700}
        [ai]
            recruitment_pattern=scout,fighter,fighter,scout,fighter,archer,fighter
            {NO_SCOUTS}
        [/ai]
        {FLAG_VARIANT undead}
    [/side]

    {STARTING_VILLAGES 1 5}
    {STARTING_VILLAGES 2 5}
    {STARTING_VILLAGES 3 5}
    {STARTING_VILLAGES 4 5}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Survive the long night"
                condition=win
                show_turn_counter=yes
            [/objective]
            [objective]
                description= _ "Death of Gweddry"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Dacyn"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Owaec"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Konrad II"
                condition=lose
            [/objective]

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]

            {AI_CONTROLLER_NOTE}
        [/objectives]
    [/event]

    #start event
    [event]
        name=start
        [recall]
            id=Dacyn
        [/recall]
        [recall]
            id=Owaec
        [/recall]
        [recall]
            id=Grug
        [/recall]
        [recall]
            id=Engineer
        [/recall]
        [recall]
            id=Terraent
        [/recall]
        [unit]
            id=Konrad
            name= _ "Konrad II"
            profile=portraits/konrad_II.png
            {IS_HERO}
            type=General
            side=1
            x=21
            y=20
        [/unit]
        [object]
            id=sceptre of fire
            silent=yes
            duration=forever

            [filter]
                id=Konrad
            [/filter]

            {SCEPTRE_OF_FIRE_EFFECT}
        [/object]
        [message]
            speaker=Gweddry
            message= _ "We will fight soon, my lord. Look, night approaches; and with it the undead hordes. I stand ready to defend the kingdom."
        [/message]
        [message]
            speaker=Konrad
            message= _ "Very well. But this... Mal-Ravanal, that you spoke of, is he here?"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "I sense his dark magic prolonging the night, but I do not feel his presence."
        [/message]
        [message]
            speaker=Owaec
            message= _ "In any case, the undead are attacking now. Let us show them the might of Wesnoth!"
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Konrad
        [/filter]
        [message]
            speaker=Konrad
            message= _ "I have died, and with me gone the kingdom is lost."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=time over

        [message]
            speaker=Dacyn
            message= _ "Look, the sun has finally risen, and the undead are retreating."
        [/message]

        [fire_event]
            name=choice
        [/fire_event]
    [/event]

    [event]
        name=enemies defeated

        [message]
            speaker=Owaec
            message= _ "Even this infernal darkness cannot dim the spirits of our men!"
        [/message]

        [fire_event]
            name=choice
        [/fire_event]
    [/event]

    # you can win either by waiting till the turns run out or by defeating the enemies
    [event]
        name=choice

        [message]
            speaker=Gweddry
            message= _ "This long night is over, and Wesnoth still stands. Yet I do not know how many more such nights we can endure."
        [/message]
        [message]
            speaker=Konrad
            message= _ "Gweddry, have you made a decision regarding our course of action?"
        [/message]

        [message]
            speaker=Gweddry
            message= _ "I have. I think we should..."
            [option]
                message= _ "challenge Mal-Ravanal to a duel."
                [command]
                    [message]
                        speaker=Dacyn
                        message= _ "I will send the message at once."
                    [/message]
                    [endlevel]
                        result=victory
                        next_scenario=17a_The_Duel
                        {NEW_GOLD_CARRYOVER 40}
                    [/endlevel]
                [/command]
            [/option]
            [option]
                message= _ "try to isolate Mal-Ravanal in battle."
                [command]
                    [message]
                        speaker=Owaec
                        message= _ "I will begin preparing our troops."
                    [/message]
                    [endlevel]
                        result=victory
                        next_scenario=17b_Weldyn_Besieged
                        {NEW_GOLD_CARRYOVER 40}
                    [/endlevel]
                [/command]
            [/option]
        [/message]
    [/event]
[/scenario]
