#textdomain wesnoth-ei
[unit_type]
    id=Twilight Mage
    name= _ "Twilight Mage"
    race=human
    gender=male
    image="units/dacyn/dacyn-L3.png"
    profile="portraits/dacyn.webp"
    hitpoints=47
    movement_type=smallfoot
    movement=5
    experience=200
    level=4 # means he ignores gweddry's leadership
    alignment=liminal
    advances_to=null
    {AMLA_DEFAULT}
    cost=70
    usage=healer
    description= _ "Even the most devout of white magi can have their light tainted by the power of darkness. Though not extinguished, their faltering inner light can become muted."
    die_sound={SOUND_LIST:HUMAN_OLD_DIE}
    {DEFENSE_ANIM "units/dacyn/dacyn-L3-defend1.png" "units/dacyn/dacyn-L3-defend2.png" {SOUND_LIST:HUMAN_OLD_HIT} }
    [resistance]
        arcane=90
        cold=80
    [/resistance]

    halo=halo/elven/nature-halo[7~1].png~O(0.5):250
    [standing_anim]
        {FRAME_DELAY 2000}
        {IDLE_LIGHTNING_FRAMES C[1~8]   "~O(0.7)~GS()~FL(vertical)"   } # LRG staff
        {IDLE_LIGHTNING_FRAMES  [1~4]   "~O(0.7)~GS()"                } # SML ground
        {FRAME_DELAY 3000}

        {IDLE_LIGHTNING_FRAMES A[2,1,5] "~O(0.7)~GS()~FL(vertical)"   } # SML staff
        {FRAME_DELAY 1500}
        {IDLE_LIGHTNING_FRAMES  [1~4]   "~O(0.7)~GS()"                } # SML ground
        {FRAME_DELAY 1000}
        {IDLE_LIGHTNING_FRAMES E[2,1,5] "~O(0.7)~GS()~FL(vertical)"   } # SML staff 2
        {FRAME_DELAY 2000}

        {IDLE_LIGHTNING_FRAMES A[1~5]   "~O(0.7)~GS()~FL(vertical)"   } # MED staff
        {FRAME_DELAY 1500}
        {IDLE_LIGHTNING_FRAMES A[2,1,5] "~O(0.7)~GS()~FL(vertical)"   } # SML staff
        {FRAME_DELAY 1000}
        {IDLE_LIGHTNING_FRAMES  [1~4]   "~O(0.7)~GS()"                } # SML ground
        {FRAME_DELAY 3000}

        {IDLE_LIGHTNING_FRAMES E[2,1,5] "~O(0.7)~GS()~FL(vertical)"   } # SML staff 2
        {FRAME_DELAY 1000}
        {IDLE_LIGHTNING_FRAMES E[1~5]   "~O(0.7)~GS()~FL(vertical)"   } # MED staff 2
    [/standing_anim]

    [abilities]
        {ABILITY_HEALS}
        #         {ABILITY_UNPOISON}
    [/abilities]
    [healing_anim]
        start_time=-525
        [frame]
            image="units/dacyn/dacyn-L3-magic-[1,2].png:75"
        [/frame]
        [frame]
            image="units/dacyn/dacyn-L3-magic-3.png"
            halo=halo/holy/halo[6,1~6].png:75
        [/frame]
        [frame]
            image="units/dacyn/dacyn-L3-magic-[2,1].png:75"
        [/frame]
    [/healing_anim]
    [attack]
        name=flail
        #textdomain wesnoth-units
        description=_"flail"
        type=impact
        [specials]
            {WEAPON_SPECIAL_DRAIN}
        [/specials]
        range=melee
        damage=7
        number=3
        icon=attacks/morning-star.png
    [/attack]
    [attack]
        name=shadow wave
        description= _ "shadow wave"
        #textdomain wesnoth-ei
        icon=attacks/dark-missile.png
        type=arcane
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        range=ranged
        damage=9
        number=5
    [/attack]
    [attack_anim]
        [filter_attack]
            name=shadow wave
        [/filter_attack]
        {MISSILE_FRAME_SHADOW_WAVE}
        start_time=-675
        {SOUND:HIT_AND_MISS magic-twilight.ogg magic-twilight-miss.ogg -500}
        [frame]
            image="units/dacyn/dacyn-L3-magic-[1,2].png:75"
        [/frame]
        [frame]
            image="units/dacyn/dacyn-L3-magic-3.png"
            halo=halo/holy/halo[6,1,3,5,6].png:[75*4,50]
        [/frame]
        [frame]
            image="units/dacyn/dacyn-L3-magic-[2,1].png:50"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=flail
        [/filter_attack]

        start_time=-250
        {SOUND:HIT_AND_MISS flail.ogg flail-miss.ogg -250}
        [frame]
            image="units/dacyn/dacyn-L3-magic-3.png:100"
        [/frame]
        [frame]
            image="units/dacyn/dacyn-L3-mace-[1~4].png:[100*4]"
        [/frame]
    [/attack_anim]

    {LIGHTNING_ANIMATION_DACYN 1}
    {LIGHTNING_ANIMATION_DACYN 2}
    {LIGHTNING_ANIMATION_DACYN 3}

    {LIGHTNING_ANIMATION_DACYN_SELF 1}
    {LIGHTNING_ANIMATION_DACYN_SELF 2}
    {LIGHTNING_ANIMATION_DACYN_SELF 3}
[/unit_type]
