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

            [Art] => ReplaceableTextures\CommandButtons\BTNDevourMagic.blp
            [turnRate] => 3
            [dmgplus1] => 64
            [bldtm] => 1
            [goldcost] => 100
            [unitSound] => ObsidianDestroyer
            [sides1] => 1
            [Missilearc] => 0.1
            [manaN] => 100
            [acquire] => 950
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Starving Manafiend
            [red] => 55
            [weapTp1] => missile
            [impactZ] => 60
            [file] => units\creeps\VoidWalker\VoidWalker.mdl
            [MissileHoming] => 1
            [uberSplat] => YTDG
            [Missilespeed] => 1200
            [Missileart] => Abilities\Weapons\VoidWalkerMissile\VoidWalkerMissile.mdl
            [dice1] => 1
            [RngBuff1] => 250
            [green] => 155
            [modelScale] => 0.55
            [rangeN1] => 950
            [propWin] => 10
            [atkType1] => normal
            [cool1] => 1
            [Ubertip] => It has an insatiable hunger for magic.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [moveHeight] => 8
            [customTeamColor] => 1
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

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

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+12.5% |rdmg to magical (|cffFFFF00+0.5%|r/lvl)
            [abil_factor] => 0.7
            [author] => Ashbringer
            [alpha] => 205
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.324057
                    [y] => 23.429
                    [z] => 83.2
                    [scale] => 2.35
                    [rot] => 4.71239
                    [file] => Abilities\Spells\NightElf\SpiritOfVengeance\SpiritOfVengeanceOrbs1.mdl
                    [red] => 255
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -2.5
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 0.438804
                    [y] => 13.6797
                    [z] => -19.2
                    [scale] => 0.1
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 155
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.446623
                    [y] => -13.0724
                    [z] => -19.2
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 155
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -0.0479101
                    [y] => 0.496255
                    [z] => 0
                    [scale] => 0.7
                    [rot] => 4.32042
                    [file] => buildings\other\CircleOfPower\CircleOfPower.mdl
                    [red] => 155
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -0.0676702
                    [y] => 0.289265
                    [z] => 19.2
                    [scale] => 1
                    [rot] => 4.71239
                    [file] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    [red] => 155
                    [green] => 35
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -0.0772741
                    [y] => -27.1868
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 14.9567
                    [y] => -14.9195
                    [z] => 25.6
                    [scale] => 0.2
                    [rot] => 5.49779
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -2.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 16.7621
                    [y] => 16.7862
                    [z] => 25.6
                    [scale] => 0.2
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -2.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -16.2906
                    [y] => 15.7316
                    [z] => 25.6
                    [scale] => 0.2
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -2.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => -15.3304
                    [y] => -17.2217
                    [z] => 25.6
                    [scale] => 0.2
                    [rot] => 3.92699
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -2.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => 28.4083
                    [y] => 0.0399968
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 0.133644
                    [y] => 28.4557
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -27.727
                    [y] => 0.0374235
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 55
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_DMG_TO_MAGIC
                    [base] => 0.125
                    [add] => 0.005
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
    endglobals
    
    //@export
    function ashbringer_devour_magic takes Tower tower, integer max, real mana_base, real mana_per_level returns nothing
        local Iterate towers = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TYPE_TOWERS, 300)
        local Unit next_tower = towers.nextRandom()
        local integer count = 0
        local real mana
        local real max_mana = GetUnitState(tower.getUnit(), UNIT_STATE_MAX_MANA)
        local real mana_per = (mana_base + (tower.getLevel() * mana_per_level))
        
        loop
            set next_tower = towers.nextRandom()
            exitwhen GetUnitState(tower.getUnit(), UNIT_STATE_MANA) >= max_mana or count == max or next_tower==0
            if next_tower != 0 and next_tower != tower then
                if next_tower.purgeBuff(true) then
                    set count = count + 1
                    call Effect.createSimpleAtUnit("Abilities\\Spells\\Undead\\DeathPact\\DeathPactCaster.mdl", next_tower).setLifetime(3.0)
                    call tower.addMana(mana_per * (1 + tower.getProp_ManaRegPercBonus()))
                endif
            endif
            
            exitwhen count==max
        endloop
        
        if next_tower != 0 then
            call towers.destroy()
        endif
        
        if count > 0 then
            call Effect.createSimpleOnUnit("war3mapImported\\Drain.mdx", tower, "origin").setLifetime(3.0)
        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
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Damage
                    [code] => local real mana = GetUnitState(tower.getUnit(), UNIT_STATE_MANA)
    
    if mana > 0 then
        set Event.damage = Event.damage * (1 + (mana * (0.01 + (tower.getLevel() * 0.0004))))
        call tower.subtractMana(mana * 0.1, true)
    endif
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNUnsummonBuilding.blp
                            [name] => Primordial Feast
                            [short_explain] => Attacks drain mana to deal additional damage.
                            [ONDAMAGE_chanceLevelAdd] => 0
                            [long_explain] => Attacks deal |cffFFFF80[current mana x 1%]|r more damage but each attack removes |cffFFFF8010%|r of current mana.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.04%|r damage per mana
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => call ashbringer_devour_magic(tower, 1, 10, 0.2)
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 3
                            [AUTOCAST_autoRange] => 950
                            [AUTOCAST_manacost] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNDevourMagic.blp
                            [AUTOCAST_range] => 950
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
                            [long_explain] => Consumes |cffFFFF801|r buff on a random nearby tower within |cffFFFF80300|r range and gains |cffFFFF8010|r mana if successful. Mana gained is increased by mana regeneration stat.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.2|r mana per buff
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Devour Magic
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Consumes a buff on a nearby tower to gain mana.
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Creation
                    [code] => call SetUnitColor(tower.getUnit(), ConvertPlayerColor(7))
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)