#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 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 add -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 add -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 add -1}
        {VARIABLE unit.variables.great_horde_upkeep_mod_applied yes}

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