#textdomain wesnoth-httt
[scenario]
    id=05a_Muff_Malals_Peninsula
    name= _ "Muff Malal’s Peninsula"
    map_data="{campaigns/Heir_To_The_Throne/maps/05a_Muff_Malal_Peninsula.map}"
    {TURNS 27 24 21}

    {DEFAULT_SCHEDULE}

    next_scenario=06_The_Siege_of_Elensefar

    {SCENARIO_MUSIC "wanderer.ogg"}
    {EXTRA_SCENARIO_MUSIC "suspense.ogg"}
    {EXTRA_SCENARIO_MUSIC "heroes_rite.ogg"}
    {EXTRA_SCENARIO_MUSIC "weight_of_revenge.ogg"}

    # wmllint: local spelling Malal
    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Escape down the road to Elensefar"
                condition=win
            [/objective]
            {ALTERNATIVE_OBJECTIVE_BONUS ( _ "Defeat Muff Malal")}
            [objective]
                description= _ "Death of Konrad"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]
    [/event]

    {HTTT_TRACK {JOURNEY_05A_NEW} }

    [side]
        type=Commander
        id=Konrad
        name= _ "Konrad"
        unrenamable=yes
        profile=portraits/konrad-elvish.png
        side=1
        canrecruit=yes
        team_name=elves
        user_team_name=_"Rebels"
        controller=human
        gold=140
        {FLAG_VARIANT long}
    [/side]

    [side]
        type=Dark Sorcerer
        id=Muff Malal
        name= _ "Muff Malal"
        side=2
        canrecruit=yes
#ifdef HARD
        recruit=Blood Bat,Walking Corpse,Dark Adept
#else
        recruit=Vampire Bat,Walking Corpse,Dark Adept
#endif
        [ai]
            recruitment_pattern=scout,fighter,fighter,fighter,fighter,fighter,fighter,fighter,archer
            grouping=no
            aggression=1.0
            caution=-1.0
            simple_targeting=yes
            {ATTACK_DEPTH 1 4 5}
        [/ai]
        {GOLD 20 50 100}
        {INCOME 20 25 40}
        team_name=undead
        user_team_name=_"Undead"
        {FLAG_VARIANT undead}
    [/side]

    {RECRUIT_UNIT_VARIATIONS 2 "Walking Corpse" none,none,none,none,swimmer,swimmer,mounted,bat}

    {STARTING_VILLAGES 2 30}

    [event]
        name=prestart
        {VARIABLE via_isle_of_the_damned no}
        {CLEAR_VARIABLE moremirmu}

        {PLACE_IMAGE scenery/signpost.png 8 2}
        {PLACE_IMAGE scenery/rock2.png 17 20}

        {STORE_DELFADOR}
        [role]
            role=Advisor
            [auto_recall][/auto_recall]

            type="Elvish Sylph,Great Mage," +
                "Elvish Marshal,Elvish Champion,Elvish Avenger,Elvish Sharpshooter,Elvish Shyde,Elvish Enchantress,Elvish Outrider,Paladin,Grand Knight,Mage of Light,Arch Mage,Silver Mage," +
                "Merman Triton,Merman Hoplite,Merman Javelineer,Merman Entangler,Mermaid Diviner,Mermaid Siren," +
                "Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,Elvish Rider,Knight,Lancer,White Mage,Red Mage," +
                "Merman Warrior,Merman Spearman,Merman Netcaster,Mermaid Priestess,Mermaid Enchantress," +
                "Elvish Fighter,Elvish Archer,Elvish Shaman,Elvish Scout,Horseman,Mage," +
                "Merman Fighter,Merman Hunter,Mermaid Initiate"
            [else]
                [unit]
                    side=1
                    type=Elvish Fighter
                    role=Advisor
                    placement=leader
                [/unit]
            [/else]
        [/role]
    [/event]

    [event]
        name=start
        [message]
            speaker=narrator
            image="wesnoth-icon.png"
            message= _ "But the road to Elensefar was a treacherous one. Konrad and his men were set upon by a strong band of undead."
        [/message]
        [message]
            speaker=Muff Malal
            message= _ "Ahh, a party of elves approaches. Soon we shall have elven zombies serving us!"
        [/message]
        [message]
            role=Advisor
            message= _ "My lord! On yonder peninsula there seems to be some movement!"
        [/message]
        [message]
            speaker=Konrad
            message= _ "It looks like an undead outpost! If we could defeat them, the locals would probably be grateful. But I do not know if we have the strength to defeat such a foe, or the time to spare."
        [/message]
        [message]
            role=Advisor
            message= _ "Cleansing this land of undead does not appear overly difficult. It could be good training for those yet untested in battle."
        [/message]
        [message]
            speaker=Konrad
            message= _ "I see. If we are to break the siege of Elensefar, we will need every veteran soldier we can get."
        [/message]
        [message]
            role=Advisor
            message= _ "The decision is yours, sir. If we are to leave, I advise we hurry past before they are upon us. If we are to fight, then... to arms!"
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            side=1
            x=8
            y=2
        [/filter]

        [redraw]
        [/redraw]

        [message]
            speaker=narrator
            image="scenery/signpost.png"
            message= _ "To Elensefar"
        [/message]

        [allow_undo]
        [/allow_undo]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=1
            x=5
            y=1
        [/filter]
        [if]
            [have_unit]
                id=Konrad
                x=5
                y=1
            [/have_unit]
            [then]
                [message]
                    speaker=Konrad
                    message= _ "We do not have time to tarry here! On to Elensefar!"
                [/message]

                [endlevel]
                    bonus=no
                    result=victory
                    {NEW_GOLD_CARRYOVER 40}
                [/endlevel]
            [/then]
            [else]
                [message]
                    speaker=Konrad
                    message= _ "Shirk not your duty! I will decide when it is time to leave for Elensefar."
                [/message]

                [allow_undo]
                [/allow_undo]
            [/else]
        [/if]
    [/event]

    [event]
        name=enemies defeated
        [message]
            speaker=Konrad
            message= _ "Victory is ours! Let us hope that this delay will not hamper our quest to save Elensefar, but at least we have freed these good people. We must move onward with haste!"
        [/message]

        [endlevel]
            bonus=yes
            result=victory
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    {campaigns/Heir_To_The_Throne/utils/deaths.cfg}

    [event]
        name=victory

        {RESTORE_DELFADOR}
    [/event]
[/scenario]
