#textdomain wesnoth-low
[scenario]
    id=11_Battle_of_the_Book
    next_scenario=12_Revelations

    random_start_time=no
    allow_new_game=no
    force_lock_settings=yes

    experience_modifier=100
    name= _ "Battle of the Book"
    {LOW_MAP 11_Battle_of_the_Book.map}
    {TURNS 30 34 38}
    {DEFAULT_SCHEDULE}

    {INTRO_AND_SCENARIO_MUSIC frantic.ogg the_dangerous_symphony.ogg}
    {EXTRA_SCENARIO_MUSIC battle.ogg}
    {EXTRA_SCENARIO_MUSIC nunc_dimittis.ogg}
    {EXTRA_SCENARIO_MUSIC suspense.ogg}
    {EXTRA_SCENARIO_MUSIC into_the_shadows.ogg}

    #        {LOW_PRESTART}

    [story]
        [part]
            show_title=yes
            delay=4000
            {TO_BATTLE_OF_THE_BOOK}
        [/part]
        [part]
            story= _ "Quickening their pace, the elves and dwarves raced towards the smoke..."
            {TO_BATTLE_OF_THE_BOOK_BATTLE}
        [/part]
    [/story]

#define PLAYER_GOLD
    {GOLD 300 200 100}
#enddef
#define MULTIPLAYER_GOLD
    {GOLD 45 45 45}
#enddef

    [side]
        side=1
        fog=yes
        no_leader=yes
        {PLAYABLE}
        save_id=Kalenz
        share_view=yes

        [unit]
            {KALENZ}
            x=20
            y=27
            extra_recruit=Elvish Fighter, Elvish Archer, Elvish Scout
        [/unit]

#ifndef MULTIPLAYER
        {PLAYER_GOLD}
        [unit]
            {LANDAR}
            extra_recruit=Elvish Fighter, Elvish Archer, Elvish Scout
            x=25
            y=27
        [/unit]
        [unit]
            {OLURF}
            extra_recruit=Dwarvish Fighter, Dwarvish Scout, Dwarvish Thunderer, Dwarvish Guardsman
            x=29
            y=28
        [/unit]
        [unit]
            {CLEODIL}
            extra_recruit=Elvish Shaman, Elvish Scout, Wose
            x=15
            y=27
        [/unit]
#else
        {MULTIPLAYER_GOLD}
#endif
    [/side]
    [event]
        name=prestart
        {RECALL_LOYALS}
    [/event]

    [side]
        side=2
        allow_player=no
        type=Arch Mage
        id=Aquagar
        name= _ "Aquagar"
        canrecruit=yes
        controller=ai
        {GOLD 230 290 320}
        recruit=Drake Warrior, Drake Burner, Drake Clasher, Drake Fighter, Drake Blademaster, Drake Enforcer, Fire Drake, Drake Flameheart, Drake Flare, Drake Thrasher, Sky Drake, Drake Arbiter, Drake Warden, Drake Glider, Hurricane Drake, Inferno Drake
        team_name=drakes
        user_team_name= _ "Enemies"
    [/side]

    [side]
        side=3
        allow_player=no
        type=Elder Mage
        id=Crelanu
        name= _ "Crelanu"
        profile="portraits/crelanu.png"
        canrecruit=yes
        controller=ai
        {GOLD 100 90 80}
        [ai]
            passive_leader=yes
        [/ai]
        recruit=Mage, Gryphon
        team_name=player
        user_team_name= _ "Player"
        fog=yes
        share_view=no
    [/side]
    {STARTING_VILLAGES_ALL 3}

    [side]
        side=4
        allow_player=no
        type=Troll Warrior
        id=Trigrul
        name=_ "Trigrul"
        canrecruit=yes
        controller=ai
#ifdef EASY
        recruit=Troll Rocklobber, Troll Whelp
#else
        recruit=Troll, Troll Rocklobber, Troll Warrior
#endif
        {INCOME 5 10 20}
        {GOLD 140 160 210}
        team_name=drakes
        user_team_name= _ "Enemies"
    [/side]

#ifdef MULTIPLAYER
    [side]
        side=5
        fog=yes
        share_view=yes
        no_leader=yes
        {PLAYABLE}
        save_id=Landar
        [unit]
            {LANDAR}
            extra_recruit=Elvish Fighter, Elvish Archer, Elvish Scout
        [/unit]
    [/side]
    [side]
        side=6
        fog=yes
        share_view=yes
        no_leader=yes
        {PLAYABLE}
        save_id=Olurf
        [unit]
            {OLURF}
            extra_recruit=Dwarvish Scout, Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Guardsman
        [/unit]
    [/side]
    [side]
        side=7
        fog=yes
        share_view=yes
        no_leader=yes

        {PLAYABLE}
        save_id=Cleodil
        [unit]
            {CLEODIL}
            extra_recruit=Elvish Shaman, Wose, Elvish Scout
        [/unit]
    [/side]
#endif

    #TODO what if Crelanu moves into sight?
    [event]
        name=sighted
        [filter]
            id=Crelanu
        [/filter]
        [filter_second]
            side=1,5
        [/filter_second]
        [message]
            id=Crelanu
            message= _ "I sense a presence that is not one of Aquagar’s creatures. Who are you, and what is your purpose here?"
        [/message]
        [message]
            id=Cleodil
            message= _ "That, I think, must be the mage of which Olurf spoke. But he is not the one I sensed as we approached this place..."
        [/message]
        [message]
            id=Landar
            message= _ "I feel the shadow of destiny on my soul. There is something I am fated to do here, but I know not what."
        [/message]
        [message]
            id=Kalenz
            message= _ "If you are the mage Crelanu, we have come to seek your help."
        [/message]
        [message]
            id=Crelanu
            message= _ "I am Crelanu... but if you want my help you must begin by helping me, for I am besieged here and in no state to aid anyone else."
        [/message]
        [message]
            id=Landar
            message= _ "Ahhh. A fight! Perhaps this is my fate. Come, Kalenz, let us make a rescue."
        [/message]
        [modify_side]
            side=3
            share_view=yes
        [/modify_side]
    [/event]

    [event]
        name=prestart
        [objectives]
            side=0
            [objective]
                description= _ "Defeat Aquagar"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Kalenz"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Landar"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Olurf"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Cleodil"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Crelanu"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=80
            [/gold_carryover]
        [/objectives]
    [/event]

    [event]
        name=start

        [message]
            id=Landar
            message= _ "Looks like your mage friend is in trouble. There is a horde of drakes attacking him!"
        [/message]
        [message]
            id=Kalenz
            message= _ "Indeed. Before he can aid us, we will have to aid him."
        [/message]
        [message]
            id=Aquagar
            message= _ "Fools! The book will be mine!"
        [/message]
        [message]
            id=Cleodil
            message= _ "There... I sense magic emanating from that stone keep east of the lake. That is where we will find the mage."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Aquagar
        [/filter]
        [message]
            speaker=unit
            # wmllint: local spelling Morogoth
            message= _ "I die, but I will not go unavenged! Cursed will you be Kalenz! You will never find lasting peace in all your years. You will lose your dearest. And you, Crelanu, your book will bring woe on you and haunt all its future owners to their graves! This will be the price for slaying me, Aquagar, great drake wizard of Morogoth."
        [/message]

        [message]
            id=Olurf
            message= _ "Some scary fellow this Aquagar thinks he is! Come now, I think Crelanu owes us some drinks."
        [/message]

        [endlevel]
            result=victory
            save=no
            bonus=yes
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Crelanu
        [/filter]
        [message]
            id=Kalenz
            message= _ "There goes our last hope!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

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

#undef PLAYER_GOLD
#undef MULTIPLAYER_GOLD
