#textdomain wesnoth-thot

[scenario]
    id=11_The_Court_of_Karrag
    name= _ "The Court of Karrag"
    map_data="{campaigns/The_Hammer_of_Thursagan/maps/11_The_Court_of_Karrag.map}"
    turns=12
    next_scenario=12_The_Underlevels
    victory_when_enemies_defeated=yes

    {UNDERGROUND}

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

    {SCENARIO_MUSIC       the_king_is_dead.ogg}
    {EXTRA_SCENARIO_MUSIC revelation.ogg}
    {EXTRA_SCENARIO_MUSIC transience.ogg}

    {THOT_TRACK {JOURNEY_STAGE11}}

    # wmllint: validate-off
    [side]
        side=1
        controller=human
        # No gold or recruits this scenario
        team_name=good
        user_team_name= _ "Alliance"
        {FLAG_VARIANT knalgan}

        # wmllint: recognize Aiglondur
        {CHARACTER_STATS_AIGLONDUR}

        facing=se
    [/side]

    [side]
        side=2
        controller=ai
        # No gold or recruits this scenario
        team_name=evil
        user_team_name= _ "Kal Karthans"
        {FLAG_VARIANT knalgan}

        # wmllint: recognize Karrag
        {CHARACTER_STATS_KARRAG_PREREV}

        color=black
        facing=sw

        # Karrag's throne guards
        [unit]
            type=Dwarvish Masked Steelclad
            id=Gog
            name= _ "Masked Dwarf"
            x,y=16,10
            facing=sw
        [/unit]

        [unit]
            type=Dwarvish Masked Steelclad
            id=Magog
            name= _ "Masked Dwarf"
            x,y=16,12
            facing=sw
        [/unit]

        [unit]
            type=Dwarvish Ulfserker
            id=Hekyll
            name= _ "Masked Dwarf"
            x,y=15,10
            facing=sw
        [/unit]

        [unit]
            type=Dwarvish Ulfserker
            id=Jekyll
            name= _ "Masked Dwarf"
            x,y=15,13
            facing=sw
        [/unit]

        [ai]
            {NO_SCOUTS}
            passive_leader=yes
            grouping=defensive
            recruitment_pattern=fighter,fighter,mixed fighter
            {ATTACK_DEPTH 4 5 5}
        [/ai]
    [/side]
    # wmllint: validate-on

    [side]
        # The uncorrupted Kal Karthans (which is to say Dulcatulos)
        side=3
        no_leader=yes
        hidden=yes
        team_name=good
        user_team_name= _ "Kal Karthans"
        {FLAG_VARIANT knalgan}
        color=blue

        [unit]
            facing=se
            x,y=10,9

            # wmllint: recognize Dulcatulos
            {CHARACTER_STATS_DULCATULOS}
        [/unit]
    [/side]

    {PLACE_IMAGE "scenery/rune1-glow.png" 14  6}
    {PLACE_IMAGE "scenery/rune2-glow.png" 9   9}
    {PLACE_IMAGE "scenery/rune3-glow.png" 18  9}
    {PLACE_IMAGE "scenery/rune4-glow.png" 9  14}
    {PLACE_IMAGE "scenery/rune5-glow.png" 18 13}
    {PLACE_IMAGE "scenery/rune6-glow.png" 14 16}

    {PLACE_IMAGE "scenery/dwarven-doors-closed.png" 18 11}

    {PLACE_IMAGE "scenery/monolith3.png" 12 10}
    {PLACE_IMAGE "scenery/monolith3.png" 12 12}

    [event]
        name=prestart

        [objectives]
            side=1
            [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= _ "Death of Dulcatulos"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=40
            [/gold_carryover]
        [/objectives]

        {RECALL_VETERAN (Dwarvish Dragonguard) 8 10}
        {RECALL_VETERAN (Dwarvish Lord)        8 12}

        [recall]
            id=Angarthing
        [/recall]

        [recall]
            id=Ratheln
        [/recall]

        {MODIFY_UNIT (side=1) facing se}
    [/event]

    {CONDITIONAL_MAGE_RECRUITING}

    [event]
        name=start

        [message]
            speaker=Aiglondur
            message={WHISPER ( _ "Psst, Angarthing... Karrag and those dwarves on the dais, they’re all <i>masked</i>.")}
        [/message]

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

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

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

        [message]
            speaker=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]
            speaker=Angarthing
            message= _ "We did not come to smite anyone, but to re-open contact and trade."
        [/message]

        [message]
            speaker=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]
            speaker=Angarthing
            message= _ "It is remembered in Knalga that Kal Kartha holds the Hammer."
        [/message]

        [message]
            speaker=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]
            speaker=Angarthing
            message= _ "On one condition. You must take off that mask and show your true face. I am a witness."
        [/message]

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

        [message]
            speaker=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]
            speaker=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]
            speaker=Angarthing
            message= _ "The Law speaks. Against him with the eyes to see, no deception can hold. I AM A WITNESS!"
        [/message]

        [scroll_to_unit]
            id=Karrag
        [/scroll_to_unit]

        [transform_unit]
            id=Karrag
            transform_to=Undead Dwarvish Rune Lord
        [/transform_unit]

        {MODIFY_UNIT (id=Karrag) variation karrag-unmasked}

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

        [redraw][/redraw]

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

        [message]
            speaker=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]
            speaker=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 last sacrifices I require to bind the entire dwarvish race to my purpose. TAKE THEM!"
        [/message]

        {MODIFY_UNIT (id=Dulcatulos) side 1}

        # Put his mask back on so we don't have to deal with yet another unit type
        # for his maskless variation
        {MODIFY_UNIT (id=Karrag) variation none}

        [redraw][/redraw]

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

    [event]
        name=die
        [filter]
            id=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
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    {HERODEATH_AIGLONDUR}
    {HERODEATH_ANGARTHING}
    {HERODEATH_RATHELN}
    {HERODEATH_DULCATULOS}
[/scenario]
