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

            [Art] => ReplaceableTextures\CommandButtons\BTNSoul Rune.blp
            [dmgplus1] => 50
            [bldtm] => 1
            [goldcost] => 55
            [unitSound] => ShrineOfAzshara
            [sides1] => 1
            [Missilearc] => 0.1
            [manaN] => 60
            [acquire] => 900
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Faintly Glowing Rune
            [red] => 185
            [weapTp1] => missile
            [file] => war3mapImported\RuneOrc1.mdl
            [uberSplat] => YTDG
            [Missilespeed] => 800
            [Missileart] => Abilities\Spells\Undead\DevourMagic\DevourMagicBirthMissile.mdl
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 5
            [green] => 55
            [modelScale] => 0.7
            [rangeN1] => 800
            [atkType1] => normal
            [cool1] => 2
            [Ubertip] => Humming with energy.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [moveHeight] => 10
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+3% |rattackspeed/lvl|n|cffFFFF00+3% |rmana/lvl
            [abil_factor] => 0.4
            [author] => Ashbringer
            [alpha] => 135
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => common
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.479404
                    [y] => -0.519366
                    [z] => -12.8
                    [scale] => 0.4
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 35
                    [green] => 15
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 0.958779
                    [y] => -19.6979
                    [z] => -12.8
                    [scale] => 0.3
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 35
                    [green] => 15
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => 19.692
                    [y] => -0.119928
                    [z] => -12.8
                    [scale] => 0.3
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 35
                    [green] => 15
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 0.691889
                    [y] => 18.5649
                    [z] => -12.8
                    [scale] => 0.3
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 35
                    [green] => 15
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -19.1344
                    [y] => -1.06167
                    [z] => -12.8
                    [scale] => 0.3
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 35
                    [green] => 15
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_ATTACKSPEED
                    [base] => 0
                    [add] => 0.03
                )

            [1] => Array
                (
                    [id] => MOD_MANA_PERC
                    [base] => 0
                    [add] => 0.03
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => call ashbringer_fragment_attack(tower, Event.getTarget())
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNSoul Rune.blp
                            [name] => Rune Fragmentation
                            [short_explain] => Attacks can hit additional enemies at the cost of mana.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => Attacks hit additional enemies at the cost of |cffFFFF8010|r mana per extra projectile.
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType ashbringer_rune_projectile
    endglobals
    
    //@export
    function ashbringer_fragment_attack takes Tower tower, Creep target returns nothing
        local integer mana = R2I(GetUnitState(tower.getUnit(), UNIT_STATE_MANA))
        local integer num_proj = (mana- ModuloInteger(mana, 10)) / 10
        local integer count = 0
        local Iterate i = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TYPE_CREEPS, 800)
        local Creep next
        
        loop
            set next = i.nextRandom()
            if next == target then
                set next = i.nextRandom()
            endif
            exitwhen count == num_proj or next == 0
            set count = count + 1
            call Projectile.createFromUnitToUnit(ashbringer_rune_projectile, tower, 0.0, 0.0, tower, next, true, false, false)
        endloop
        
        if next != 0 then
            call i.destroy()
        endif
        
        call tower.subtractMana(I2R(count*10), true)
    endfunction
    
    function ashbringer_rune_hit takes Projectile p, Unit c returns nothing
        local Tower t = p.getCaster()
        call t.doAttackDamage(c, t.getCurrentAttackDamageWithBonus(), t.calcAttackMulticrit(0, 0, 0))
    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
        set ashbringer_rune_projectile = ProjectileType.create("Abilities\\Spells\\Undead\\DevourMagic\\DevourMagicBirthMissile.mdl", 5.0, 800)
        call ashbringer_rune_projectile.enableHoming(ashbringer_rune_hit, 0.0)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)