#textdomain wesnoth-thot
[scenario]
    name=_"The Court of Karrag"
    id="11_The_Court_of_Karrag"
    next_scenario="12_The_Underlevels"
    victory_when_enemies_defeated=yes

    # This scenario will take place on a throneroom map which is, effectively,
    # all castle.  It should have two keep hexes on it, one near the front
    # for our heroes and one at the rear for Karrag. Features of the
    # map must include an indication of a doorway in the cave wall near the
    # rear dais.  The throneroom map should in general look like a distorted
    # mirror image of Hamel's, but with the braziers unlit.
    #
    # Aiglondur, Angarthing, and a few of their veteran followers face Karrag,
    # flanked by several of his followers.  Dulcatulos escorts our heroes.
    # Karrag's group should have black team disks and Dulcatulos a blue one.

    map_data="{@campaigns/The_Hammer_of_Thursagan/maps/the_court_of_karrag.map}"

    {DEFAULT_SCHEDULE}
    {DEFAULT_MUSIC_PLAYLIST}
    {VICTORY_AND_DEFEAT_MUSIC}

    turns=12	# BALANCE

    [side]
        type="Dwarvish Fighter"
        description="Aiglondur"
        user_description=_"Aiglondur"
        canrecruit="1"
        side="1"
        controller="human"
        team_name="good"
        fog="no"
        shroud="no"
        recruit="Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Guardsman,Mage"
        {GOLD 140 120 100}	# BALANCE
    [/side]

    [side]
        type="Dwarvish Rune Lord"
        description="Karrag"
        user_description=_"Karrag"
        canrecruit="1"
        side="2"
        colour=black
        facing=sw
        controller="ai"
        team_name="evil"
        fog="no"
        shroud="no"
        recruit="Dwarvish Masked Fighter,Dwarvish Masked Thunderer,Dwarvish Ulfserker"
        [ai]
            {NO_SCOUTS}
            passive_leader=yes
            grouping=defensive
            recruitment_pattern=fighter,fighter,mixed fighter
            {ATTACK_DEPTH 4 5 5}
        [/ai]
        {GOLD 280 240 200}	# BALANCE
    [/side]

    [side]
        # The uncorrupted Kal Karthans (which is to say Dulcatulos)
        side=3
        colour=blue
        no_leader=yes
        team_name=good
    [/side]

    {@campaigns/The_Hammer_of_Thursagan/utils/herodeaths.cfg}
    {@campaigns/The_Hammer_of_Thursagan/utils/macros.cfg}

    {SET_RIGHTEOUS_FLAME_EVENT}

    [event]
        name="start"

        {PLACE_IMAGE "scenery/rune1-glow.png" 14 8}
        {PLACE_IMAGE "scenery/rune2-glow.png" 9  9}
        {PLACE_IMAGE "scenery/rune3-glow.png" 17 9}
        {PLACE_IMAGE "scenery/rune4-glow.png" 9  14}
        {PLACE_IMAGE "scenery/rune5-glow.png" 14 13}
        {PLACE_IMAGE "scenery/rune6-glow.png" 17 14}
        {PLACE_IMAGE "scenery/dwarven-doors-closed.png" 18 11}

        [recall]
            description="Angarthing"
        [/recall]

        [recall]
            description="Ratheln"
        [/recall]

        [unit]
            type=Dwarvish Steelclad
            description=Dulcatulos
            user_description= _ "Dulcatulos"
            {IS_HERO}
            side=3
            x,y=10,9
        [/unit]

        {RECALL_VETERAN (Dwarvish Dragonguard) 11 11}
        {RECALL_VETERAN (Dwarvish Lord) 11 12}

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

        # Karrag's throne guards

        {MODIFY_UNIT description="Karrag" facing sw}

        [unit]
            type=Dwarvish Masked Steelclad
            description=Gog
            user_description=_ "Masked Dwarf"
            side=2
            x,y=16,10
            facing=sw
        [/unit]

        [unit]
            type=Dwarvish Masked Steelclad
            description=Magog
            user_description=_ "Masked Dwarf"
            side=2
            x,y=16,12
            facing=sw
        [/unit]

        [unit]
            type=Dwarvish Ulfserker
            description=Hekyll
            user_description=_ "Masked Dwarf"
            side=2
            x,y=15,10
            facing=sw
        [/unit]

        [unit]
            type=Dwarvish Ulfserker
            description=Jekyll
            user_description=_ "Masked Dwarf"
            side=2
            x,y=15,13
            facing=sw
        [/unit]

        {CONDITIONAL_MAGE_RECRUITING}

        [message]
            description="Aiglondur"
            message=_"(Psst, Angarthing...Karrag and those dwarves on the dais, they're all masked.)"
        [/message]

        [message]
            description="Angarthing"
            message=_"(I see it. There is something very wrong here.)"
        [/message]

        [message]
            description="Karrag"
            message=_"Hail, fellow dwarves. All Kal Kartha thanks you for your timely rescue."
        [/message]

        [message]
            description="Aiglondur"
            message=_"We are from Knalga; your clans are kin to ours of old. We but did our duty to kin."
        [/message]

        [message]
            description="Karrag"
            message=_"All dwarves are kin, and must prevail against orcs and humans and other dirtgrubbers. You can be part of the fist that smites them."
        [/message]

        [message]
            description="Angarthing"
            message=_"We did not come to smite anyone, but to re-open contact and trade."
        [/message]

        [message]
            description="Karrag"
            message=_"Trade?  Your destruction of the besieging orcs was a far nobler act than trade. There can be more such victories. And there will be by the power of our ancient heirloom, the Hammer of Thursagan. "
        [/message]

        [message]
            description="Angarthing"
            message=_"It is remembered in Knalga that Kal Kartha holds the Hammer."
        [/message]

        [message]
            description="Karrag"
            message=_"Yes!  And the Hammer holds the soul of the dwarves, the true people. Together, we can march to greater victories!  Will you of Knalga join me?"
        [/message]

        [message]
            description="Angarthing"
            message=_"On one condition. You must take off that mask and show your true face. I am a witness."
        [/message]

        [message]
            description="Karrag"
            message=_"You...do not wish to see what is beneath this mask. I was terribly wounded in an orcish attack. Disfigured."
        [/message]

        [message]
            description="Angarthing"
            message=_"But the Law must see. A dwarf must put his name and his face behind his deeds. I am a witness."
        [/message]

        [message]
            description="Karrag"
            message=_"Impertinent fool!  It is not for you to dictate to a lord in his own holding, much less one who holds the very soul of the dwarves in his hand."
        [/message]

        [message]
            description="Angarthing"
            message=_"The Law speaks. Against him with the eyes to see, no deception can hold. I AM A WITNESS!"
        [/message]

        [store_unit]
            [filter]
                description=Karrag
            [/filter]

            kill=yes
            variable=stored_Karrag
        [/store_unit]

        [unit]
            type=Lich
            description=Karrag
            user_description=_"Karrag"
            canrecruit=yes
            side=2
            facing=sw
            x,y=$stored_Karrag.x,$stored_Karrag.y
        [/unit]

        [sound]
            name=lich-hit-1.ogg
        [/sound]

        {CLEAR_VARIABLE stored_Karrag}

        [redraw]
        [/redraw]

        [message]
            description="Dulcatulos"
            message=_"No...no...it is horrible!  My lord, how did you come to this?"
        [/message]

        [message]
            description="Karrag"
            message=_"I lingered for weeks in agony. Only my hatred and the runelore of old sustained me, until I became as I am. I will have revenge; I will destroy the orcs, and the humans, and the elves, and all but the  true people!"
        [/message]

        [message]
            description="Karrag"
            message=_"And you have sealed your doom. Hundreds of dirtgrubbers have already died to weave a web of blood around the Hammer and the soul of the dwarves. You and your new friends will be the the last sacrifices I require to bind the entire dwarvish race to my purpose. TAKE THEM!"
        [/message]

        {MODIFY_UNIT description=Dulcatulos side 1}

        [objectives]
            side="1"
            silent="no"
            [objective]
                description=_"Defeat Karrag"
                condition="win"
            [/objective]
            [objective]
                description=_"Death of Aiglondur"
                condition="lose"
            [/objective]
            [objective]
                description=_"Death of Angarthing"
                condition="lose"
            [/objective]
            [objective]
                description=_"Time runs out"
                condition="lose"
            [/objective]
        [/objectives]
    [/event]

    [message]
        speaker=narrator
        message=_"Neither side can recruit or recall. You must win with the troops you have."
        image=wesnoth-icon.png
    [/message]

    [event]
        name="die"
        [filter]
            description=Karrag
        [/filter]

        [delay]
            time=500	# Dramatic pause
        [/delay]

        [message]
            speaker=Angarthing
            message=_"Wait...the lich's apparent death was another illusion. In truth he ran through that doorway behind the throne."
        [/message]

        [message]
            speaker=Dulcatulos
            message=_"Then Karrag has fled to the underlevels. None but his masked ones go there any more."
        [/message]

        [message]
            speaker=Angarthing
            message=_"We must follow. Quickly!  It may be his talk of perverting the Hammer was merely mad raving, but we cannot allow the risk that his foul spell might succeed."
        [/message]

        [endlevel]
            result=victory
        [/endlevel]
    [/event]

    [event]
        name="die"
        [filter]
            description="Dulcatulos"
        [/filter]

        [message]
            speaker=Aiglondur
            message=_"Without Dulcatulos to explain our actions to the Kal Karthans we'll have to fight them, too. Our mission has failed."
        [/message]

        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
[/scenario]
