#textdomain wesnoth-sotbe

#define OLD_ORCISH_SHAMAN X Y ID_STRING NAME_STRING
    [unit]
        id={ID_STRING}
        name={NAME_STRING}
        type=Old Orcish Shaman
        profile=portraits/old_orcish_shaman.png
        side=1
        x={X}
        y={Y}
        random_traits=no
        {IS_HERO}
        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
    [/unit]
#enddef

#define NOVICE_ORCISH_SHAMAN X Y ID_STRING NAME_STRING
    [unit]
        id={ID_STRING}
        name={NAME_STRING}
        type=Novice Orcish Shaman
        profile=portraits/young_orcish_shaman.png
        side=1
        x={X}
        y={Y}
        random_traits=no
        {IS_HERO}
        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
    [/unit]
#enddef

#define ORCISH_SHAMAN X Y ID_STRING NAME_STRING
    [unit]
        id={ID_STRING}
        name={NAME_STRING}
        type=Orcish Shaman
        profile=portraits/orcish_shaman.png
        side=1
        x={X}
        y={Y}
        random_traits=no
        {IS_HERO}
        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
    [/unit]
#enddef

#define BLACK_FLAG
    flag=flags/black-flag-1.png:100,flags/black-flag-2.png:300,flags/black-flag-1.png:100,flags/black-flag-3.png:300
    flag_icon=flags/black-flag-icon.png
#enddef

#define RENAME_IF_DEAD VAR NAME STRING
    [if]
        [variable]
            name={VAR}
            equals=yes
        [/variable]
        [then]
            {MODIFY_UNIT id={NAME} name {STRING}}
        [/then]
    [/if]
#enddef

#define ALBROCK_SIDE
    type=Orcish Warlord
    id="Al'Brock"
    name= _ "Al’Brock"
    side=2
    canrecruit=yes
    profile=portraits/albrock.png
    recruit=Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer, Orcish Crossbowman, Orcish Warrior
    team_name=Kapoue
    user_team_name=_ "Kapou’e"
    {IS_HERO}
    persistent=yes
#enddef

#define FLARTAR_SIDE
    type=Orcish Warlord
    id="Flar'Tar"
    name= _ "Flar’Tar"
    side=3
    canrecruit=yes
    profile=portraits/flartar.png
    recruit=Wolf Rider, Orcish Grunt, Troll Whelp, Orcish Archer, Orcish Crossbowman, Orcish Warrior
    team_name=Kapoue
    user_team_name=_ "Kapou’e"
    {IS_HERO}
    persistent=yes
#enddef

#define GREAT_HORDE_NOTE
    [note]
        description= _ "The Great Horde: upkeep cost of every unit decreased by one."
    [/note]
#enddef

#define GOT_THE_GREAT_HORDE SIDES
    [event]
        name=prerecruit
        first_time_only=no

        [filter]
            side={SIDES}
        [/filter]

        {VARIABLE unit.upkeep $unit.level}
        {VARIABLE_OP unit.upkeep sub 1}
        {VARIABLE unit.variables.great_horde_upkeep_mod_applied yes}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]
    [/event]

    [event]
        name=prerecall
        first_time_only=no

        [filter]
            side={SIDES}

            [not]
                [filter_wml]
                    [modifications]
                        [trait]
                            id=loyal
                        [/trait]
                    [/modifications]
                [/filter_wml]
            [/not]

            [not]
                [filter_wml]
                    [variables]
                        great_horde_upkeep_mod_applied=yes
                    [/variables]
                [/filter_wml]
            [/not]
        [/filter]

        {VARIABLE unit.upkeep $unit.level}
        {VARIABLE_OP unit.upkeep sub 1}
        {VARIABLE unit.variables.great_horde_upkeep_mod_applied yes}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]
    [/event]

    [event]
        name=post_advance
        first_time_only=no

        [filter]
            side={SIDES}

            [not]
                [filter_wml]
                    [modifications]
                        [trait]
                            id=loyal
                        [/trait]
                    [/modifications]
                [/filter_wml]
            [/not]
        [/filter]

        {VARIABLE unit.upkeep $unit.level}
        {VARIABLE_OP unit.upkeep sub 1}
        {VARIABLE unit.variables.great_horde_upkeep_mod_applied yes}

        [unstore_unit]
            variable=unit
            find_vacant=no
        [/unstore_unit]
    [/event]
#enddef
