#textdomain wesnoth-ei
[scenario]
    id=Duel
    name= _ "The Duel"
    map_data="{campaigns/Eastern_Invasion/maps/The_Arena.map}"
    turns=-1
    next_scenario=Epilog

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC underground.ogg the_deep_path.ogg}
    {EXTRA_SCENARIO_MUSIC the_dangerous_symphony.ogg}
    {EXTRA_SCENARIO_MUSIC legends_of_the_north.ogg}

    [side]
        type=Lieutenant
        id=Gweddry
        name= _ "Gweddry"
        side=1
        canrecruit=yes
        controller=human
        team_name=good
        user_team_name=_"Wesnothians"
        gold=200
    [/side]

    [side]
        type=Ancient Lich
        id=Mal-Ravanal
        name= _ "Mal-Ravanal"
        side=2
        canrecruit=yes
        recruit=
        controller=ai
        gold=0
        team_name=bad
        user_team_name=_"Undead"
        profile=portraits/mal-ravanal.png
        {FLAG_VARIANT undead}
    [/side]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat Mal-Ravanal"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Gweddry"
                condition=lose
            [/objective]
        [/objectives]
    [/event]

    [event]
        name=start

        [message]
            speaker=Mal-Ravanal
            message= _ "I have waited a long time for this day to come. Prepare to die, Gweddry of Wesnoth!"
        [/message]
        [scroll_to_unit]
            id=Gweddry
        [/scroll_to_unit]
        [message]
            speaker=narrator
            #wmllint: display on
            message= _ "The rules of the duel are these:
You may recruit or recall up to 6 units.
At the end of your first turn, your keep will disappear, and you must battle with whatever troops you have at that time.
The first leader to fall loses the duel."
            #wmllint: display off
            image=wesnoth-icon.png
        [/message]
    [/event]

#define DUEL_UNIT TYPE X Y
    [unit]
        type={TYPE}
        side=2
        x={X}
        y={Y}
    [/unit]
#enddef
#define DK
    {DUEL_UNIT (Death Knight) 19 6}
#enddef
#define SS
    {DUEL_UNIT (Banebow) 19 6}
#enddef
#define NP
    {DUEL_UNIT (Necrophage) 19 6}
#enddef

#define REMOVE_KEEP X Y
    [terrain]
        x={X}
        y={Y}
        terrain=Cud	# wmllint: ignore
    [/terrain]
#enddef

    [event]
        name=turn 2
        {DUEL_UNIT (Necromancer) 28 2}
        {DUEL_UNIT (Lich) 28 2}
        {DUEL_UNIT (Necromancer) 28 2}
        {DUEL_UNIT (Lich) 28 2}
        {DUEL_UNIT (Necromancer) 28 2}
        {DUEL_UNIT (Lich) 28 2}
        {REMOVE_KEEP 3 19}
        {REMOVE_KEEP 28 2}
    [/event]

    [event]
        name=turn 5
        {DK}
        {SS}
        {NP}
        [message]
            speaker=Gweddry
            message= _ "Wait - What just happened? He called more warriors out of the ground! That's not allowed!"
        [/message]
        [message]
            speaker=Mal-Ravanal
            message= _ "Stop talking and fight! The rules do not stop me from bringing up warriors that were already here."
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Mal-Ravanal
        [/filter]
        [message]
            speaker=Mal-Ravanal
            message= _ "I... lose?..."
        [/message]
        [endlevel]
            result=continue_no_save
        [/endlevel]
    [/event]

#define TURNX5 TURN
    [event]
        name=turn {TURN}
        [message]
            speaker=Mal-Ravanal
            message= _ "And more!"
        [/message]
        {DK}
        {SS}
        {NP}
    [/event]
#enddef

    {TURNX5 11}
    {TURNX5 17}
    {TURNX5 23}
    {TURNX5 30}
    {TURNX5 38}
    {TURNX5 47}
    {TURNX5 57}
    {TURNX5 68}
    {TURNX5 80}
[/scenario]
