#textdomain wesnoth-httt
[scenario]
    id=02_Blackwater_Port
    name= _ "scenario name^Blackwater Port"
    next_scenario=03_The_Isle_of_Alduin
    map_data="{campaigns/Heir_To_The_Throne/maps/02_Blackwater_Port.map}"
    {DEFAULT_SCHEDULE}
    {TURNS 12 12 9}

    {SCENARIO_MUSIC "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "knolls.ogg"}
    {EXTRA_SCENARIO_MUSIC "breaking_the_chains.ogg"}
    {EXTRA_SCENARIO_MUSIC "wanderer.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}

    [event]
        name=prestart
        [objectives]
            side=1
            [objective]
                description= _ "Resist until the end of the turns"
                condition=win
                show_turn_counter=yes
            [/objective]
#ifdef HARD
            [objective]
                {ALTERNATIVE_OBJECTIVE_CAPTION}
                description= _ "Defeat the enemy leader"+{EARLY_FINISH_BONUS_FOOTNOTE}+{OBJECTIVE_FOOTNOTE _"(special bonus)"}
                condition=win
            [/objective]
#else
            {ALTERNATIVE_OBJECTIVE_BONUS ( _ "Defeat the enemy leader")}
#endif
            [objective]
                description= _ "Death of Konrad"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Delfador"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Sir Kaylan"
                condition=lose
            [/objective]

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

    {HTTT_TRACK {JOURNEY_02_NEW} }

    [label]
        x,y=27,8
        text= _ "Blackwater Port"
    [/label]

    [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"
        gold=100
        controller=human
        {FLAG_VARIANT long}
    [/side]

    [side]
        type=Grand Knight
        id=Kaylan
        name= _ "Sir Kaylan"
        profile=portraits/humans/grand-knight-2.png

        side=2
        # Make Kaylan's TC teal, so it fits better with the portrait.
        color=teal
        canrecruit=yes
        team_name=elves
        user_team_name=_"Rebels"
        recruit=Horseman,Knight
        [ai]
            recruitment_pattern=fighter
            villages_per_scout=0
        [/ai]
        [ai]
            time_of_day=dusk,first_watch,second_watch
            aggression=0.45
            grouping=defensive
        [/ai]
        {GOLD 120 70 40}
    [/side]

    {STARTING_VILLAGES_AREA 2 17 15 25}

    [side]
        type=Orcish Warrior
        id=Mokolo Qimur
        name= _ "Mokolo Qimur"
        profile=portraits/orcs/grunt-2.png
        side=3
        color=purple
        canrecruit=yes
        team_name=orcs
        user_team_name=_"Orcs"
        recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll Whelp
        {GOLD 100 160 220}
        {INCOME 8 16 20}
        [ai]
            {ATTACK_DEPTH 1 3 5}
        [/ai]
        {FLAG_VARIANT6 ragged}
    [/side]

    {STARTING_VILLAGES_AREA 3 3 19 5}

    [event]
        name=prestart

        {PLACE_IMAGE scenery/rock1.png 23 17}

        [unit]
            type=Swordsman
            x=23
            y=10
            id=Veocyn
            name= _ "Veocyn"
            ai_special=guardian
            side=2
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Swordsman
            x=25
            y=11
            id=Yran
            name= _ "Yran"
            ai_special=guardian
            side=2
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]

        {NEED_DELFADOR placement=leader}
    [/event]

    [event]
        name=start
        [message]
            speaker=Delfador
            message= _ "We should be able to board a ship at Blackwater Port, but it seems the orcs are heading there too. Rebels who hate Asheviere and are loyal to the memory of the king desperately hold the port, as it is one of the only places where they can ship supplies and weapons."
        [/message]
        [message]
            speaker=Konrad
            message= _ "Delfador, some orcs are following us! We must make haste!"
        [/message]
        [message]
            speaker=Kaylan
            message= _ "Delfador, my old friend! We had heard of your coming, and of the attacks on the elves. It is good to see you again, although I would prefer it were not in such sad times."
        [/message]
        [message]
            speaker=Delfador
            message= _ "Konrad, this is Kaylan, one of the mightiest of the horse lords, and one of the few who is willing to oppose the Dark Crown. Rumor has it that his lance has slain fifty men and a hundred orcs."
        [/message]
        [message]
            speaker=Kaylan
            message= _ "It seems the orcs have come here too, to try to wrest this port from our hands. Our defenses are still weak, but reinforcements will arrive soon!"
        [/message]
        [message]
            speaker=Konrad
            message= _ "We will help you fight them off until the reinforcements arrive."
        [/message]
        [message]
            speaker=Kaylan
            message= _ "With your help, we have hope we can fend them off. But you must not tarry here long, for your survival is even more important to our cause than the strength of the port. A ship is due here in two days, surely it will be able to take you to safety."
        [/message]
        [message]
            speaker=Konrad
            message= _ "And the ship will take us to Alduin?"
        [/message]
        [message]
            speaker=Delfador
            message= _ "Yes, we will sail to the Isle of Alduin, my home, Konrad, and the home of many magi."
        [/message]
        [message]
            speaker=Kaylan
            message= _ "I will send one of my horsemen to serve under you. I offer you my support, Konrad, and the support of my men — from now on you will be able to recruit horsemen."
        [/message]
        #   [message]
        #   speaker=narrator
        #   image="wesnoth-icon.png"
        #   message= _ "You may now recruit horsemen!"
        #   [/message]
        [message]
            speaker=Konrad
            message= _ "Thank you, sir. But how shall I best use these horsemen? How do they differ from elves?"
        [/message]
#ifdef EASY
        [message]
            speaker=Kaylan
            message= _ "Elves are a powerful race, Konrad, more powerful than my own people usually acknowledge. But horsemen are powerful in a different way. They have no long range attack, but can charge into combat, inflicting double normal damage, though taking double damage in return. They are also lawful, meaning they fight better by day, and worse at night. Horsemen are unmatched on open land, though elves will serve you better in forests or rugged terrain."
        [/message]
#else
        [message]
            speaker=Kaylan
            message= _ "Elves may be the lords of the forest, but horsemen are powerful as well. On the plains under the midday sun they can fell the toughest foes with sharp spears and under heavy hoofs!"
        [/message]
#endif
        [message]
            speaker=Delfador
            {DELFADOR_MENTORING_ELF}
            message= _ "Recruit troops wisely, Konrad, and remember that you can recall experienced units from past battles to help you fight again."
        [/message]
        [move_unit_fake]
            side=1
            type=Horseman
            x=15,16,23
            y=27,27,24
        [/move_unit_fake]
        [unit]
            id=Haldiel
            name= _ "Haldiel"
            type=Horseman
            x=23
            y=24
            side=1
            facing=ne
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_STRONG}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [message]
            speaker=Haldiel
            message= _ "Greetings, young master. I pledge myself to your service."
        [/message]
        [message]
            speaker=Delfador
            {DELFADOR_MENTORING_ELF}
            message= _ "Konrad, note that Haldiel does not seek gold upkeep; as a loyal unit he fights for us solely out of loyalty to our cause. Such units are extremely valuable. Take care to use them cautiously in battle, lest they fall."
        [/message]
        [allow_recruit]
            side=1
            type=Horseman
        [/allow_recruit]
    [/event]

    [event]
        name=time over
        [scroll_to]
            x=35
            y=6
        [/scroll_to]
        [unit]
            type=Horseman
            id=Yredd
            name= _ "Yredd"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Horseman
            id=Tarcyn
            name= _ "Tarcyn"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Horseman
            id=Syryn
            name= _ "Syryn"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Knight
            id=Cicyn
            name= _ "Cicyn"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Knight
            id=Ginvan
            name= _ "Ginvan"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Knight
            id=Simyr
            name= _ "Simyr"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_INTELLIGENT}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [message]
            speaker=Kaylan
            message= _ "Reinforcements have arrived! Forward, men! I expect each of you to bring me back the head of an orc!"
        [/message]
        [message]
            speaker=Mokolo Qimur
            message= _ "So many foul humans riding on horses! There is no way we can defeat them. Quick, we must make our escape!"
        [/message]
        [fire_event]
            name=victory dance
        [/fire_event]
        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            id=Mokolo Qimur
        [/filter]

        #
        # A bonus for anyone who can beat the leader on the HARD level
        #
#ifdef HARD
        [scroll_to]
            x=35
            y=6
        [/scroll_to]
        [unit]
            type=Horseman
            id=Yredd
            name= _ "Yredd"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Horseman
            id=Tarcyn
            name= _ "Tarcyn"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Horseman
            id=Syryn
            name= _ "Syryn"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Knight
            id=Cicyn
            name= _ "Cicyn"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Knight
            id=Ginvan
            name= _ "Ginvan"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [unit]
            type=Knight
            id=Simyr
            name= _ "Simyr"
            x=35
            y=6
            ai_special=guardian
            side=2
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_INTELLIGENT}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [redraw]
        [/redraw]
        [message]
            speaker=Kaylan
            message= _ "Reinforcements have arrived, but lo! Our allies have already destroyed the orcish army menacing our fair port. In honor, I must reward your valor."
        [/message]
        [message]
            speaker=Kaylan
            message= _ "You have risked your life to defend our city. In return, I place one of my city’s finest defenders in your service. Simyr, step forward. I place your lance in the service of young prince Konrad here. May you help him restore order to the country."
        [/message]
        [kill]
            id=Simyr
        [/kill]
        [move_unit_fake]
            side=2
            type=Knight
            x=33,29
            y=5,7
        [/move_unit_fake]
        [unit]
            type=Knight
            id=Simyr
            name= _ "Simyr"
            x=29
            y=7
            side=1
            facing=sw
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_INTELLIGENT}
            [/modifications]
            {IS_LOYAL}
        [/unit]
        [message]
            speaker=Simyr
            message= _ "It is my pleasure and honor to serve, my liege."
        [/message]
#endif

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

    [event]
        name=victory dance
        [message]
            speaker=Kaylan
            message= _ "Thank you for the help, friends. The ship should arrive soon, it will take you to Alduin."
        [/message]

        [sound]
            name=ambient/ship.ogg
        [/sound]

        [move_unit_fake]
            type=Galleon
            side=1
            x=1,2,3,4,5,6,7,8,9,9,9,10,11,12,13,14,15,16,17,18,19,20,21
            y=2,2,3,3,4,4,5,5,6,7,8, 8, 9, 9,10,10,10, 9, 9, 8, 8, 7, 7
        [/move_unit_fake]

        {PLACE_IMAGE "units/transport/galleon.png~RC(magenta>red)" 21 7}

        [message]
            speaker=Delfador
            message= _ "We should embark now."
        [/message]
        [message]
            speaker=Kaylan
            message= _ "Safe voyage to you, friends. Rest assured that we will never surrender to the forces of the Dark Queen."
        [/message]
    [/event]

    #
    # Death event for Sir Kaylan
    #
    [event]
        name=last breath
        [filter]
            id=Kaylan
        [/filter]
        [message]
            speaker=unit
            message= _ "I have failed in my duty to protect the Rightful Heir and the port."
        [/message]
        [message]
            speaker=Delfador
            message= _ "Without his help, we will be unable to use the ships. There is no hope..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {campaigns/Heir_To_The_Throne/utils/deaths.cfg}
[/scenario]
