Array
(
    [scriptVersion] => 8
    [oeValues] => Array
        (
            [auto] => Array
                (
                )

            [Art] => ReplaceableTextures\CommandButtons\BTNKelThuzad.blp
            [turnRate] => 2
            [dmgplus1] => 1795
            [bldtm] => 1
            [goldcost] => 3600
            [unitSound] => KelThuzadLich
            [sides1] => 1
            [Missilearc] => 0.1
            [manaN] => 500
            [acquire] => 900
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Grand Necromancer
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => units\undead\Kelthuzad\Kelthuzad.mdl
            [uberSplat] => YTDB
            [Missileart] => Abilities\Weapons\NecromancerMissile\NecromancerMissile.mdl
            [Missilespeed] => 1400
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 5
            [modelScale] => 0.9
            [rangeN1] => 900
            [atkType1] => hero
            [cool1] => 2.5
            [Ubertip] => Grandmaster of death.
            [scaleBull] => 0
            [abilList] => @@0@@
            [moveHeight] => 33
            [customTeamColor] => 1
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
            [teamColor] => 10
        )

    [settings] => Array
        (
            [balanceTip] => Array
                (
                )

            [abil_factor] => 0.15
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => darkness
            [rarity] => unique
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.146169
                    [y] => 0.159106
                    [z] => 0
                    [scale] => 1.9
                    [rot] => 5.67232
                    [file] => Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [1] => Array
                (
                    [x] => 0.00953216
                    [y] => 0.00975675
                    [z] => 6.4
                    [scale] => 0.8
                    [rot] => 4.71239
                    [file] => Abilities\Spells\Undead\UnholyAura\UnholyAura.mdl
                    [red] => 55
                    [green] => 255
                    [blue] => 255
                    [alpha] => 205
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [2] => Array
                (
                    [x] => 0.0759074
                    [y] => -0.0386485
                    [z] => 19.2
                    [scale] => 1.55
                    [rot] => 0.244346
                    [file] => Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [3] => Array
                (
                    [x] => -27.5792
                    [y] => -40.5418
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 1.23639
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [4] => Array
                (
                    [x] => 45.6642
                    [y] => -28.4943
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 2.73292
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [5] => Array
                (
                    [x] => 23.8128
                    [y] => 40.1632
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 1.23639
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [6] => Array
                (
                    [x] => 39.6296
                    [y] => 32.1507
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 0.254704
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile2.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [7] => Array
                (
                    [x] => 16.7425
                    [y] => -55.2052
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 5.25749
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile2.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [8] => Array
                (
                    [x] => -44.4073
                    [y] => 8.72833
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 1.79117
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile2.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [9] => Array
                (
                    [x] => -7.84542
                    [y] => -50.4484
                    [z] => 0
                    [scale] => 0.45
                    [rot] => 6.2649
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile0.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [10] => Array
                (
                    [x] => -52.3493
                    [y] => -2.80004
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 3.48666
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [11] => Array
                (
                    [x] => 61.4808
                    [y] => -1.58061
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 3.48666
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [12] => Array
                (
                    [x] => -14.5789
                    [y] => 46.645
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 0.6921
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [13] => Array
                (
                    [x] => -39.4573
                    [y] => 43.9694
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 4.86947
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 195
                    [green] => 255
                    [blue] => 195
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [14] => Array
                (
                    [x] => -0.353325
                    [y] => -14.5155
                    [z] => -12.8
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 25
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [15] => Array
                (
                    [x] => 0.155632
                    [y] => 14.2318
                    [z] => -12.8
                    [scale] => 0.1
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 25
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [16] => Array
                (
                    [x] => 0.0218688
                    [y] => 0.570746
                    [z] => -6.4
                    [scale] => 1.4
                    [rot] => 4.6817
                    [file] => Doodads\Barrens\Rocks\Geyser\Geyser0.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Level Up
                    [code] => call ashbringer_damned_update(tower)
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Attack
                    [code] => if tower.userInt2 > 0 then
        set tower.userInt2 = tower.userInt2 - 1
        call ashbringer_skeleton_start(tower, Event.getTarget())
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType ashbringer_skeletal_missile
        ProjectileType ashbringer_damned_unit
        BuffType ashbringer_harvest_buff
        BuffType ashbringer_grim_aura
        MultiboardValues ashbringer_damned_mb
    endglobals
    
    struct damned
        Projectile array p[7]
        boolean array a[7]
        integer count = 0
        Effect e
    endstruct
    
    function ashbringer_damned_update takes Tower tower returns nothing
        local integer spirits = 2
        local damned ae = tower.userInt3
        local integer count = ae.count
        
        if tower.getLevel()>=25 then
            set spirits = spirits + 2
        elseif tower.getLevel()>=15 then
            set spirits = spirits + 1
        endif
        
        if tower.userInt >= 200 then
            set spirits = spirits + 2
        elseif tower.userInt >= 100 then
            set spirits = spirits + 1
        endif
        
        if spirits>count then
            loop
                if ae.a[count]==false then
                    set ae.p[count] = Projectile.createBezierInterpolationFromPointToPoint(ashbringer_damned_unit, tower, 0, 0, tower.getX(), tower.getY(), 100, tower.getX(), tower.getY()-200, 225, 0, 0, 0)
                    call ae.p[count].setScale(0.5)
                    set ae.p[count].userInt = 0
                    set ae.a[count] = true
                endif
                set count = count + 1
                exitwhen count==spirits
            endloop
        elseif spirits180.0 then
                    set angle_diff = angle_diff - 360.0
                endif
                if angle_diff>0.0 then
                    set angle_mult = 1
                elseif(angle_diff < 0.0) then
                    set angle_mult = -1
                else
                    set angle_mult = 1
                endif
                
                set p.speed = 600 * move_modifier
                call p.startBezierInterpolationToUnit(next, 0, GetRandomReal(0.2, 0.4)*angle_mult, GetRandomReal(0.2, 0.4), true)
                set p.userInt = 1
                call i.destroy()
            else
                set random_angle = GetRandomReal(0, 360)
                set random_distance = GetRandomReal(0, 750)
                set end_x = tower.getX() + random_distance * Cos(Deg2Rad(random_angle))
                set end_y = tower.getY() + random_distance * Sin(Deg2Rad(random_angle))
                
                set angle_diff = bj_RADTODEG * Atan2(end_y - p.y, end_x - p.x)
                set angle_diff = (angle_diff-180) - (p.direction-180)
                if angle_diff<-180.0 then
                    set angle_diff = angle_diff + 360.0
                endif
                if angle_diff>180.0 then
                    set angle_diff = angle_diff - 360.0
                endif
                if angle_diff>0.0 then
                    set angle_mult = -1
                elseif(angle_diff < 0.0) then
                    set angle_mult = 1
                else
                    set angle_mult = 0
                endif
                
                set p.speed = 350 * move_modifier
                call p.startBezierInterpolationToPoint(end_x, end_y, height, 0, GetRandomReal(0.2, 0.4)*angle_mult, 0.4)
            endif
        else
            set p.userInt = 0
            
            if target!=0 then
                set damage = (7500 + (tower.getLevel() * 300)) * (1 + (tower.userInt * 0.01))
                set b = target.getBuffOfType(ashbringer_harvest_buff)
                
                if b != 0 then
                    if target.getSize() == SIZE_BOSS then
                        set damage = damage * (1 + (0.5 + (tower.getLevel() * 0.02)) / 2)
                    else
                        set damage = damage * (1 + 0.5 + (tower.getLevel() * 0.02))
                    endif
                endif
                
                call tower.doSpellDamage(target, damage, tower.calcSpellCritNoBonus())
                call Effect.createSimpleOnUnit("Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl", target, "chest").destroy()
            endif
            
            set random_angle = GetRandomReal(0, 360)
            set random_distance = GetRandomReal(0, 900)
            set end_x = tower.getX() + random_distance * Cos(Deg2Rad(random_angle))
            set end_y = tower.getY() + random_distance * Sin(Deg2Rad(random_angle))
            
            set angle_diff = bj_RADTODEG * Atan2(end_y - p.y, end_x - p.x)
            set angle_diff = (angle_diff-180) - (p.direction-180)
            if angle_diff<-180.0 then
                set angle_diff = angle_diff + 360.0
            endif
            if angle_diff>180.0 then
                set angle_diff = angle_diff - 360.0
            endif
            if angle_diff>0.0 then
                set angle_mult = -1
            elseif(angle_diff < 0.0) then
                set angle_mult = 1
            else
                set angle_mult = 0
            endif
            
            set p.speed = 350 * move_modifier
            call p.startBezierInterpolationToPoint(end_x, end_y, height, 0, GetRandomReal(0.2, 0.4)*angle_mult, 0.4)
        endif
    endfunction
    
    function ashbringer_skeleton_tick takes nothing returns nothing
        local timer tm = GetExpiredTimer()
        local Effect e = Effect(GetTimerData(tm))
        local Tower tower = Tower(e.userInt2)
        local Iterate i
        local Creep next = 0
        local real period = e.userReal2
        local real angle
        local real distance
        
        if e.userReal3 >= 1 and tower.getUID()!=-1 then
            if e.userInt3 != 0 then
                set next = e.userInt3
                if next.getUID() > 0 then
                    set distance = DistanceBetweenPoints(Location(e.x, e.y), GetUnitLoc(next.getUnit()))
                    if distance > 600 then
                        set next = 0
                        set e.userInt3 = 0
                    endif
                else
                    set next = 0
                    set e.userInt3 = 0
                endif
            endif
            if next == 0 then
                set i = Iterate.overUnitsInRange(tower, TARGET_TYPE_CREEPS, e.x, e.y, 600)
                set next = i.nextRandom()
                if next !=0 then
                    call i.destroy()
                endif
            endif
            if next !=0 then
                set e.userReal3 = e.userReal3 - 1
                set e.userInt3 = next
                call e.setAnimationSpeed(1/period)
                call e.setAnimation("attack")
                call Projectile.createFromPointToUnit(ashbringer_skeletal_missile, tower, 0.0, 0.0, e.x, e.y, 30, next, true, false, false)
                set angle = bj_RADTODEG * Atan2(next.getY() - e.y, next.getX() - e.x)
                call e.setFacing(angle)
                set e.userInt = 1
            else
                if e.userInt == 1 then
                    call e.setAnimationSpeed(1.0)
                    call e.setAnimation("stand")
                endif
                set e.userInt = 0
            endif
        else
            if e.userReal3 >= 0 then
                call e.setAnimationSpeed(1/period)
                call e.setAnimation("death")
                set e.userReal3 = -1
            else
                call e.destroy()
                call PauseTimer(tm)
                call DestroyTimer(tm)
            endif
        endif
    endfunction
    
    function ashbringer_skeleton_start takes Tower tower, Unit target returns nothing
        local integer random = GetRandomInt(0, 1)
        local real x
        local real y
        local Effect e
        local timer tm = CreateTimer()
        local real period = 2 //RMaxBJ(2 / RMinBJ(RMaxBJ(1 + tower.getProp_Attackspeed(), 1), 5), 0.4)
        
        if random == 0 then
            set random = -1
        endif
        
        set x = target.getX() + (random * GetRandomReal(50, 100))
        set y = target.getY() + (random * GetRandomReal(50, 100))
        call Effect.createSimple("Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl", x, y).setLifetime(3.0)
        set e = Effect.createAnimated("units\\undead\\SkeletonMage\\SkeletonMage.mdx", x, y, 0.0, 270.0)
        call e.setTeamcolor(GetPlayerColor(tower.getOwner().getThePlayer()))
        set e.userReal = (6 + (tower.getLevel() * 0.12)) * tower.getProp_BuffDuration()
        set e.userReal2 = period
        set e.userReal3 = 3  * tower.getProp_BuffDuration()
        set e.userInt = 1
        set e.userInt2 = tower
        set e.userInt3 = 0
        call e.setAnimationSpeed(2.33/period)
        call e.setAnimation("birth")
        call SetTimerData(tm, e)
        call TimerStart(tm, period, true, function ashbringer_skeleton_tick)
    endfunction
    
    function ashbringer_skeletal_hit takes Projectile p, Unit target returns nothing
        local Tower tower = p.getCaster()
        local real damage = 5000 + (tower.getLevel() * 200)
        local Buff b = target.getBuffOfType(ashbringer_harvest_buff)
        
        if b != 0 then
            if target.getSize() == SIZE_BOSS then
                set damage = damage * (1 + (0.5 + (tower.getLevel() * 0.02)) / 2)
            else
                set damage = damage * (1 + 0.5 + (tower.getLevel() * 0.02))
            endif
        endif
        
        call tower.doSpellDamage(target, damage * (1 + (tower.userInt * 0.01)), tower.calcSpellCritNoBonus())
    endfunction
    
    function ashbringer_grim_death takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Unit target = b.getBuffedUnit()
        local Buff h = target.getBuffOfType(ashbringer_harvest_buff)
        
        if h == 0 then
            if tower.calcChance(0.05) or target.getSize() == SIZE_BOSS then
                set tower.userInt =  tower.userInt + 1
                call Effect.createSimpleAtUnit("Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl", target).setLifetime(3.0)
                if tower.userInt == 100 or tower.userInt == 200 then
                    call ashbringer_damned_update(tower)
                endif
            endif
        endif
    endfunction
    
    function ashbringer_harvest_periodic takes Buff b returns nothing
        local Creep target = b.getBuffedUnit()
        local unit u = target.getUnit()
        local real life = GetWidgetLife(u)
        local real damage = life * 0.05
        
        if target.getSize() == SIZE_BOSS then
            set damage = damage / 2
        endif
            
        if damage >= 1 then
            call SetWidgetLife(u, life - damage)
        endif
    endfunction
    
    function ashbringer_harvest_death takes Buff b returns nothing
        local Tower tower = b.getCaster()
        
        set tower.userInt =  tower.userInt + 1
        call tower.resetCooldowns()
        call Effect.createSimpleAtUnit("Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl", b.getBuffedUnit()).setLifetime(3.0)
        if tower.userInt == 100 or tower.userInt == 200 then
            call ashbringer_damned_update(tower)
        endif
    endfunction
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
        local Modifier mod = Modifier.create()
        
        set ashbringer_damned_unit = ProjectileType.createInterpolate("Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl", 350)
        call ashbringer_damned_unit.disableExplodeOnExpiration()
        call ashbringer_damned_unit.setEventOnInterpolationFinished(ashbringer_damned_order)
        
        set ashbringer_grim_aura = BuffType.createAuraEffectType(false)
        //call ashbringer_grim_aura.setBuffIcon('@@1@@')
        call ashbringer_grim_aura.addEventOnDeath(EventHandler.ashbringer_grim_death)
        
        set ashbringer_harvest_buff = BuffType.create(5, 0.1, false)
        call ashbringer_harvest_buff.setBuffIcon('@@2@@')
        call ashbringer_harvest_buff.addEventOnDeath(EventHandler.ashbringer_harvest_death)
        call ashbringer_harvest_buff.addPeriodicEvent(EventHandler.ashbringer_harvest_periodic, 1.0)
        
        set ashbringer_skeletal_missile = ProjectileType.create("Abilities\\Weapons\\SkeletalMageMissile\\SkeletalMageMissile.mdl", 3.0, 900)
        call ashbringer_skeletal_missile.enableHoming(ProjectileTargetEvent.ashbringer_skeletal_hit, 0.0)
        
        set ashbringer_damned_mb = MultiboardValues.create(2)
        call ashbringer_damned_mb.setKey(0, "Souls") 
        call ashbringer_damned_mb.setKey(1, "Spectres") 
    endfunction
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNSpell_Shadow_Haunting.blp
                            [name] => The Damned
                            [short_explain] => Damned souls roam near the necromancer, occasionally attacking enemies.
                            [long_explain] => |cffffff802|r spectres roam around the necromancer, occasionally attacking enemies within the tower's attack range, dealing |cffffff807500|r spell damage.|n|nMovement speed of the spectres is increased by |cffffff8020%|r of the Necromancer's bonus attack speed.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+300|r spell damage|n|cffFFFF80+1|r spectre at level |cffffff8015|r and |cffffff8025|r
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Details
                    [code] => local damned ae = tower.userInt3
    call ashbringer_damned_mb.setValue(0, I2S(tower.userInt))
    call ashbringer_damned_mb.setValue(1, I2S(ae.count))
    return ashbringer_damned_mb
                    [values] => Array
                        (
                            [0] => Array
                                (
                                    [_value] => 0
                                    [typ] => string
                                )

                        )

                )

            [4] => Array
                (
                    [name] => On Tower Destruction
                    [code] => local integer count = 0
    local damned ae = tower.userInt3
    local integer spirits = ae.count
    
    call ae.e.destroy()
    loop
        if ae.p[count]!=0 then
            call ae.p[count].destroy()
        endif
        set count = count + 1
        exitwhen count==spirits
    endloop
    call ae.destroy()
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [5] => Array
                (
                    [name] => Tower Aura
                    [code] => Array
                        (
                        )

                    [values] => Array
                        (
                            [AURA_powerAdd] => 1
                            [visible] => true
                            [AURA_auraEffect] => ashbringer_grim_aura
                            [AURA_levelAdd] => 1
                            [AURA_power] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNPossession.blp
                            [AURA_targetType] => TARGET_TYPE_CREEPS
                            [long_explain] => When an enemy dies within |cffffff801200|r range, there is a |cffffff805%|r (|cffffff80100%|r vs Boss) chance to collect its soul. Each soul collected increases the damage dealt by Skeletal Mages and Spectres by |cffffff801%|r.|n|nEvery |cffffff80100|r souls collected creates an additional spectre, up to a maximum of |cffffff802|r additional spectres.
                            [AURA_targetSelf] => false
                            [name] => Grim Shepherd
                            [AURA_level] => 0
                            [short_explain] => Harvest souls from the dead, increasing damage of minions.
                            [AURA_auraRange] => 1200
                        )

                )

            [6] => Array
                (
                    [name] => Periodic
                    [code] => local damned ae = tower.userInt3
    local integer count = 0
    local real current_time = Game.getGameTime()
    local boolean run_update = false
    
    call ae.e.queueAnimation("birth")
    //check for broken spirits and reboot them
    loop
        if ae.a[count]==true and (current_time-ae.p[count].userReal)/25>15 then
            set ae.a[count] = false
            call ae.p[count].destroy()
            set run_update = true
        endif
        set count = count + 1
        exitwhen count==7
    endloop
    
    if run_update==true then
        call ashbringer_damned_update(tower)
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [PERIODIC_period] => 60
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [7] => Array
                (
                    [name] => Periodic
                    [code] => local Iterate i
    local integer sel = 0
    local unit corpse
    
    if tower.userInt2 < 2 then
        set i = Iterate.overCorpsesInRange(tower, tower.getX(), tower.getY(), tower.getRange())
        loop
            set corpse = i.nextCorpse()
            exitwhen corpse == null
            if IsUnitType(corpse, UNIT_TYPE_FLYING) == false then
                set sel = 1
            endif
            exitwhen sel == 1
        endloop
        if corpse != null then
            call i.destroy()
            call Effect.createSimple("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl", GetUnitX(corpse), GetUnitY(corpse)).setLifetime(3.0)
            call ShowUnit(corpse, false)
            set tower.userInt2 = tower.userInt2 + 1
        endif
    endif
                    [values] => Array
                        (
                            [visible] => true
                            [PERIODIC_period] => 6
                            [icon] => ReplaceableTextures\CommandButtons\BTNSkeletonMage.blp
                            [name] => Raise Skeletal Mage
                            [short_explain] => Periodically raises skeletal mages from nearby corpses.
                            [long_explain] => Every |cffffff806|r seconds, collect a non-air corpse within attack range. On attack, consume a collected corpse to create a Skeletal Mage near the target. Skeletal Mages attack every |cffffff802|r seconds, dealing |cffffff805000|r spell damage and last for |cffffff803|r attacks. Buff duration increases the number of attacks.|n|nMaximum |cffffff802|r corpses stored.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+200|r spell damage
                        )

                )

            [8] => Array
                (
                    [name] => Autocast
                    [code] => Array
                        (
                        )

                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 15
                            [AUTOCAST_autoRange] => 900
                            [AUTOCAST_manacost] => 100
                            [icon] => ReplaceableTextures\CommandButtons\BTNLifeDrain.blp
                            [AUTOCAST_range] => 900
                            [AUTOCAST_targetType] => TARGET_TYPE_CREEPS
                            [AUTOCAST_numBuffsBeforeIdle] => 1
                            [caster_art] => 
                            [long_explain] => Inflict a powerful curse that increases damage taken from the Necromancer's minions by |cffffff8050%|r and causes the target to lose |cffffff805%|r of its current life per second. Lasts |cffffff805|r seconds. If the target dies while under this effect, the Necromancer collects a soul and the cooldown is reset.|n|nHas |cffffff8050%|r reduced effect against Bosses.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+2%|r damage taken from minions|n|cffFFFF80+0.1|r seconds duration
                            [target_art] => Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_BUFF
                            [AUTOCAST_buffType] => ashbringer_harvest_buff
                            [AUTOCAST_isExtended] => false
                            [name] => Soul Harvest
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Deals damage over time based on life and increases damage taken from minions.
                        )

                )

            [9] => Array
                (
                    [name] => On Tower Creation
                    [code] => local damned ae = damned.create()
    local integer count = 0
        
    loop
        set ae.p[count] = 0
        set ae.a[count] = false
        set count = count + 1
        exitwhen count==7
    endloop
    
    set ae.e = Effect.createAnimatedColored("SharedModels\\UBirth.mdl", tower.getX(), tower.getY(), 0.0, 129.9, 0.35, 155, 155, 255, 205)
        
    set tower.userInt = 0
    set tower.userInt2 = 0
    set tower.userReal = 0
    
    call SetUnitColor(tower.getUnit(), ConvertPlayerColor(10))
    set tower.userInt3 = ae
    call ashbringer_damned_update(tower)
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Asph
                    [oeValues] => Array
                        (
                            [Targetattach] => weapon
                            [Art] => Array
                                (
                                )

                            [Targetattach1] => Array
                                (
                                )

                            [Targetattach2] => Array
                                (
                                )

                            [TargetArt] => Abilities\Weapons\NecromancerMissile\NecromancerMissile.mdl
                            [Targetattachcount] => 1
                            [Missileart] => Abilities\Weapons\NecromancerMissile\NecromancerMissile.mdl
                            [Unubertip] => -HIDE-
                            [Cool1] => 0.01
                            [Name] => necrosphere
                        )

                )

        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => BHab
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Blorp.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Grim Shephard
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNPossession.blp
                        )

                )

            [1] => Array
                (
                    [id] => @@2@@
                    [derivedFrom] => BHab
                    [oeValues] => Array
                        (
                            [Targetattach] => chest
                            [Buffubertip] => Damage taken increased.
                            [TargetArt] => war3mapImported\SoulArmor.mdx
                            [Bufftip] => Soul Harvest
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNLifeDrain.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)