#textdomain wesnoth-ei
[scenario]
    id=Approaching_Weldyn
    name= _ "Approaching Weldyn"
    map_data="{campaigns/Eastern_Invasion/maps/Approaching_Weldyn.map}"
    turns=24
    next_scenario=Throne

    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC loyalists.ogg frantic.ogg}
    {EXTRA_SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}

    {campaigns/Eastern_Invasion/utils/deaths.cfg}

    [story]
        [part]
            show_title=yes
            {TO_APPROACHING_WELDYN}
        [/part]
    [/story]

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

#define INVADER_AI_STUFF
    [ai]
        [target]
            side=1
            value=100
        [/target]
        [target]
            side=5
            value=.01
        [/target]
    [/ai]
#enddef

    [side]
        type=Necromancer
        id=Mal-un-Darak
        name= _ "Mal-un-Darak"
        side=2
        canrecruit=yes
        facing=sw
        controller=ai
        recruit=Skeleton,Skeleton Archer,Ghost
        {GOLD 250 300 350}
        [ai]
            recruitment_pattern=fighter,archer,scout
        [/ai]
        team_name=undead
        user_team_name=_"Undead"
        {INVADER_AI_STUFF}
        {FLAG_VARIANT undead}
    [/side]

    [side]
        type=Necromancer
        id=Mal-un-Zanrad
        name= _ "Mal-un-Zanrad"
        side=3
        canrecruit=yes
        controller=ai
        recruit=Walking Corpse,Vampire Bat,Skeleton
        {GOLD 250 300 350}
        [ai]
            recruitment_pattern=fighter,fighter,scout
        [/ai]
        team_name=undead
        user_team_name=_"Undead"
        {INVADER_AI_STUFF}
        {FLAG_VARIANT undead}
    [/side]

    [side]
        type=Necromancer
        id=Mal-un-Xadrux
        name= _ "Mal-un-Xadrux"
        side=4
        canrecruit=yes
        controller=ai
        recruit=Revenant,Bone Shooter,Wraith
        {GOLD 325 375 425}
        [ai]
            recruitment_pattern=fighter,archer,scout
        [/ai]
        team_name=undead
        user_team_name=_"Undead"
        {INVADER_AI_STUFF}
        {FLAG_VARIANT undead}
    [/side]

    [side]
        type=General
        id=Konrad II
        name= _ "Konrad II"
        profile=portraits/konrad_II.png
        side=5
        canrecruit=yes
        facing=sw
        controller=ai
        recruit=Swordsman,Pikeman,Longbowman
        {GOLD 200 150 100}
        team_name=good
        user_team_name=_"Wesnothians"
        [ai]
            passive_leader=yes
        [/ai]
    [/side]

    {STARTING_VILLAGES 5 8}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Get Gweddry to Weldyn"
                condition=win
            [/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]

            note={EARLY_FINISH_BONUS_NOTE}+{NEW_GOLD_CARRYOVER_NOTE_40}
        [/objectives]
        [unit]
            side=5
            type=Swordsman
            x,y=16,31
            ai_special=guardian
        [/unit]
        [unit]
            side=5
            type=Swordsman
            x,y=15,28
            ai_special=guardian
        [/unit]
        [unit]
            side=5
            type=Swordsman
            x,y=16,24
            ai_special=guardian
        [/unit]
        [unit]
            side=5
            type=Swordsman
            x,y=21,22
            ai_special=guardian
        [/unit]
        [unit]
            side=5
            type=Swordsman
            x,y=25,23
            ai_special=guardian
        [/unit]
        [unit]
            side=5
            type=Swordsman
            x,y=28,26
            ai_special=guardian
        [/unit]
    [/event]

    [event]
        name=start
        [recall]
            id=Dacyn
        [/recall]
        [recall]
            id=Owaec
        [/recall]
        [recall]
            id=Grug
        [/recall]
        [recall]
            id=Engineer
        [/recall]
        [message]
            speaker=Gweddry
            message= _ "We have finally reached Weldyn, but it seems the undead have surrounded it. We must break through to reach the king!"
        [/message]
        [message]
            speaker=Dacyn
            message= _ "It would be best not to try to defeat these undead, there are too many of them. Go straight to the city."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            x=20-24
            y=26-29
            id=Gweddry
        [/filter]
        [message]
            speaker=Dacyn
            message= _ "We have reached Weldyn. Now we must have a council to decide what to do next."
        [/message]
        [message]
            speaker=Konrad II
            message= _ "Come, into the castle."
        [/message]
        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Konrad II
        [/filter]
        [message]
            speaker=Konrad II
            message= _ "Weldyn has been captured, and Wesnoth is no more..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LATE_DEFEAT}
[/scenario]
