#textdomain wesnoth-dm
[scenario]
    id=20_prince_of_wesnoth
    name= _ "Prince of Wesnoth"
    next_scenario="21_clash_at_the_manor"
    {MEMOIRS_MAP prince.map}
    {TURNS 20 22 24}
    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC nunc_dimittis.ogg elvish-theme.ogg}
    {EXTRA_SCENARIO_MUSIC the_king_is_dead.ogg}
    {EXTRA_SCENARIO_MUSIC frantic.ogg}
    {EXTRA_SCENARIO_MUSIC the_city_falls.ogg}

    [story]
        [part]
            show_title=yes
        [/part]
        [part]
            # The "generation" is the 26 years between 470 YW and 496 YW.
            # Delfador is 54 at this time.
            story= _ "Following the alliance's victory and the peace treaty came a period of calm that lasted a generation. The new King had learned to trust Delfador at the battle of Abez Ford, and it was no surprise that Delfador became Garard II's most valued advisor."
            delay=4000
        [/part]
        [part]
            story= _ "The elves knew that with Delfador close to the King, Wesnoth would be a reliable ally. And it was for a while."
            delay=4000
        [/part]
        [part]
            # Asheviere marries Garard II in 478.
            story= _ "But Delfador was not alone in having the King's ear; there was one yet closer to him. The Queen's power was rising..."
            delay=8000
            background="story/httt_story3.jpg"
        [/part]
        [part]
            # Eldred's raid takes place in 496
            story= _ "One day reports came of Wesnothian forces seizing elvish land on the border. Kalenz gathered a small force and hurried to the disputed country."
            background="maps/wesnoth.png"
        [/part]
    [/story]

    #### Kalenz's code ####
    #wmllint: validate-off
    [side]
        {KALENZ}
        canrecruit=yes
        # wmllint: recognize Kalenz
        recruit={ELVES}
        fog=yes
        {GOLD 130 100 100}
    [/side]
    #wmllint: validate-on

    {STARTING_VILLAGES_ALL 1}

    [event]
        name=prestart

        {DELFADOR_JOINS_ELVES}
    [/event]
    #### /Kalenz's code

    [side]
        type=General
        id=Eldred
        name=_ "Eldred"
        profile="portraits/eldred.png"
        side=2
        canrecruit=yes
        controller=ai
        team_name=wesnoth
        recruit=Heavy Infantryman,Spearman,Bowman,Cavalryman,Horseman,Mage,Swordsman
        {GOLD 130 180 200}
        {INCOME 0 2 2}
        [ai]
            recruitment_pattern=fighter,archer,mixed fighter,scout
            aggression=1.0
            caution=0.0
            protect_leader=3.0
        [/ai]
    [/side]

    [side]
        type=General
        id=Lowel
        name=_ "Lowel"
        side=3
        canrecruit=yes
        controller=ai
        recruit=Heavy Infantryman,Spearman,Bowman,Cavalryman,Horseman,Mage,Thug,Footpad,Poacher,Rogue,Thief,Outlaw,Bandit,Assassin
        team_name=wesnoth
        {GOLD 150 230 290}
        [ai]
            recruitment_pattern=fighter,archer,mixed fighter,scout
            aggression=1.0
            caution=0.0
        [/ai]
    [/side]

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Defeat Eldred"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Chantal"
                condition=lose
            [/objective]
            [objective]
                description= _ "Turns run out"
                condition=lose
            [/objective]
            note={EARLY_FINISH_BONUS_NOTE}
        [/objectives]
    [/event]

    [event]
        name=start

        [recall]
            id=Chantal
        [/recall]

        [message]
            id=Kalenz
            message= _ "Generals of Wesnoth: you have attacked defenseless elvish land. You must leave immediately. I am Kalenz, High Lord of the Elves. Delfador the Great will confirm the treaty between us."
        [/message]
        [message]
            id=Eldred
            message= _ "This is elvish land no more. I, Eldred, prince of Wesnoth and heir to the throne, claim it for Wesnoth and Queen Asheviere. Delfador does not rule in Wesnoth!"
        [/message]
        [message]
            id=Kalenz
            message= _ "I did not want to spill human blood, but this arrogant prince leaves me no other choice."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Eldred
        [/filter]

        # Keep his unit on the board
        {FULL_HEAL id=Eldred}

        [move_unit_fake]
            type=$delfador_store.type
            x=25,24,24
            y=18,17,16
        [/move_unit_fake]
        # wmllint: recognize Delfador
        {DELFADOR_ARRIVES 24 16}

        [scroll_to_unit]
            id=Delfador
        [/scroll_to_unit]

        {DELFADOR_LIGHTNING}

        [message]
            id=Delfador
            message= _ "Peace, friends! I have been riding nonstop for days to prevent this madness! Eldred, I have direct orders from the King to take you back to the Palace, where you will be reprimanded for your inexcusable actions. Kalenz, the King offers his deepest apologies for these events and promises to do anything in his power to make amends."
        [/message]
        [message]
            id=Kalenz
            message= _ "Delfador! I am glad to see you. We have no demands on the King, but I believe he should be very careful, for he does not seem to be the only ruler in Wesnoth!"
        [/message]
        [message]
            id=Chantal
            message= _ "Kalenz, I am very worried. There is a cloud of evil swirling around the Royal Palace, and it has more centers than the prince alone. I see dark days ahead..."
        [/message]
        [message]
            id=Kalenz
            message= _ "I wonder if the Book of Crelanu is not behind this. The Book is not evil in itself, but the power it gives tends to magnify any evil in the reader's soul. Delfador, has anyone but you opened its covers since you got it from us?"
        [/message]
        [message]
            id=Delfador
            message= _ "I do not think so. But...Asheviere, Garard's queen and Eldred's mother, seemed to be hinting some months ago that I should teach her magery. She ceased all such talk when I did not respond, and I thought it merely the momentary whim of a proud and willful woman."
        [/message]
        [message]
            id=Chantal
            message= _ "I wonder if we have not dangerously misjudged her..."
        [/message]
        [message]
            id=Delfador
            message= _ "It may be so. Now that I think on it, I think I had best return to the Palace more swiftly than I came here, even if I have to kill three horses under me to do it."
        [/message]

        {DELFADOR_TAKES_CONTROL}
        [endlevel]
            result=victory
        [/endlevel]
    [/event]

    [event]
        name=time over
        [message]
            id=Kalenz
            message= _ "We are too late! All is lost!"
        [/message]
    [/event]
    {MEMOIRS_DEATHS}
[/scenario]
