#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}

    {DEFAULT_MUSIC_PLAYLIST}

    [side]
        type=Lieutenant
        description=Gweddry
        user_description= _ "Gweddry"
        side=1
        canrecruit=yes
        controller=human
        team_name=good
    [/side]

    [side]
        type=Ancient Lich
        description=Mal-Ravanal
        user_description= _ "Mal-Ravanal"
        side=2
        canrecruit=yes
        recruit=
        controller=ai
        gold=0
        team_name=bad
        profile=portraits/mal-ravanal.png
    [/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]
            description=Mal-Ravanal
            profile=portraits/mal-ravanal.png
            message= _ "I have waited a long time for this day to come. Prepare to die, Gweddry of Wesnoth!"
        [/message]
        [scroll_to]
            description=Gweddry
        [/scroll_to]
        [message]
            speaker=narrator
            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."
            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]
            description=Gweddry
            message= _ "Wait - What just happened? He called more warriors out of the ground! That's not allowed!"
        [/message]
        [message]
            description=Mal-Ravanal
            profile=portraits/mal-ravanal.png
            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]
            description=Mal-Ravanal
        [/filter]
        [message]
            description=Mal-Ravanal
            profile=portraits/mal-ravanal.png
            message= _ "I... lose?..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]

#define TURNX5 TURN
    [event]
        name=turn {TURN}
        [message]
            description=Mal-Ravanal
            profile=portraits/mal-ravanal.png
            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]
