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

            [Art] => ReplaceableTextures\CommandButtons\BTNChaosOrb.blp
            [dmgplus1] => 762
            [bldtm] => 1
            [goldcost] => 750
            [unitSound] => HauntedMine
            [sides1] => 1
            [Missilearc] => 0.1
            [manaN] => 1000
            [launchZ] => 153
            [acquire] => 1150
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Gauss Obelisk
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => .mdl
            [uberSplat] => YTDB
            [Missilespeed] => 4000
            [dice1] => 1
            [RngBuff1] => 250
            [modelScale] => 0.1
            [rangeN1] => 1150
            [atkType1] => chaos
            [cool1] => 1.75
            [Ubertip] => Created by an ancient race of evil androids.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

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

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

            [abil_factor] => 0.6
            [author] => Ashbringer
            [alpha] => 0
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => darkness
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.0336511
                    [y] => 0.125088
                    [z] => 6.4
                    [scale] => 2.85
                    [rot] => 2.49582
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -0.364971
                    [y] => -21.0751
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -54.1227
                    [y] => -52.1537
                    [z] => 96
                    [scale] => 0.9
                    [rot] => 0.575959
                    [file] => Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => -1.5
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 5.2417
                    [y] => 20.2024
                    [z] => 0
                    [scale] => 0.8
                    [rot] => 3.68265
                    [file] => Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => 0.548817
                    [y] => 21.3697
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -0.364971
                    [y] => -21.0751
                    [z] => 6.4
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 0.548817
                    [y] => 21.3697
                    [z] => 6.4
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => -0.0487222
                    [y] => -0.00516806
                    [z] => 153.6
                    [scale] => 0.9
                    [rot] => 0.605766
                    [file] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    [red] => 75
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -0.101254
                    [y] => 0.11232
                    [z] => 32
                    [scale] => 2.45
                    [rot] => 2.49582
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => -0.134309
                    [y] => 0.334918
                    [z] => 64
                    [scale] => 2.25
                    [rot] => 2.49582
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -0.109623
                    [y] => 0.0307522
                    [z] => 83.2
                    [scale] => 2.05
                    [rot] => 2.49582
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => -0.0748664
                    [y] => 0.00308857
                    [z] => 51.2
                    [scale] => 2.25
                    [rot] => 2.49582
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 125
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -0.0244668
                    [y] => -27.042
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => -0.0233571
                    [y] => 27.2344
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => -26.9327
                    [y] => 0.173852
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => 26.8047
                    [y] => -0.11572
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => -21.3013
                    [y] => -20.3762
                    [z] => 6.4
                    [scale] => 0.4
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => -0.08
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => 20.4968
                    [y] => 21.0548
                    [z] => 6.4
                    [scale] => 0.4
                    [rot] => 3.92699
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => -0.08
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => -20.1128
                    [y] => 20.5283
                    [z] => 6.4
                    [scale] => 0.4
                    [rot] => 5.49779
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => -0.08
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => 20.5142
                    [y] => -20.707
                    [z] => 6.4
                    [scale] => 0.4
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 10
                    [alpha] => 255
                    [pitch] => -0.08
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local integer level = tower.getLevel()
    local real arc_chance = 0.3 + (tower.getLevel() * 0.006)
    local real feedback_mana = 15 + (tower.getLevel() * 0.6)
    local real feedback_damage = 75 + (tower.getLevel() * 3)
    call ashbringer_necron_attack(tower, Event.getTarget(), arc_chance, 6, 600, feedback_mana, feedback_damage, 153)
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNCripple.blp
                            [name] => Gauss Arc
                            [short_explain] => Attacks have a chance to chain to additional enemies.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => Attacks have a |cffffff8030%|r chance to chain to an additional enemy within |cffffff80600|r range. This effect can repeatedly trigger up to a maximum of |cffffff806|r times but cannot chain directly to the previous target. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6%|r chance
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType ashbringer_necron_missile
    endglobals
    
    function ashbringer_necron_feedback takes Tower tower, Creep target, real mana, real damage returns nothing
        set mana = target.subtractMana(mana, true)
        if mana > 0 then
            call tower.doSpellDamage(target, damage*mana, tower.calcSpellCritNoBonus())
            call Effect.createSimpleOnUnit("war3mapImported\\ArcaneTowerAttackGreen.mdx", target, "chest").destroy()
            call tower.addMana(mana)
        endif
    endfunction
    
    function ashbringer_necron_chain takes Tower tower, Unit from, Unit previous, integer remaining, real arc_chance, real arc_range, real feedback_mana, real feedback_damage returns nothing
        local Iterate i
        local Unit next
        local Unit closest = 0
        local real distance
        local real closest_distance = 0
        
        call TriggerSleepAction(0.05)
        if tower.calcChance(arc_chance) then
            set i = Iterate.overUnitsInRangeOfUnit(tower, TARGET_TYPE_CREEPS, from, arc_range)
            loop
                set next = i.next()
                exitwhen next == 0
                if next != previous and next != from then
                    set distance = DistanceBetweenPoints(GetUnitLoc(from.getUnit()), GetUnitLoc(next.getUnit()))
                    if (closest_distance == 0 or distance < closest_distance) then
                        set closest_distance = distance
                        set closest = next
                    endif
                endif
            endloop
            if closest != 0 then
                call Lightning.createFromUnitToUnit("GZAP", from, closest).setLifetime(0.2)
                call Effect.createSimpleOnUnit("Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl", closest, "chest").destroy()
                call tower.doAttackDamage(closest, tower.getCurrentAttackDamageWithBonus(), tower.calcAttackMulticrit(0, 0, 0))
                call ashbringer_necron_feedback(tower, closest, feedback_mana, feedback_damage)
                set remaining = remaining - 1
                if remaining > 0 then
                    call ashbringer_necron_chain(tower, closest, from, remaining, arc_chance, arc_range, feedback_mana, feedback_damage)
                endif
            endif
        endif
    endfunction
    
    //@export
    function ashbringer_necron_attack takes Tower tower, Unit target, real arc_chance, integer arc_max, real arc_range, real feedback_mana, real feedback_damage, real z returns nothing
        local real x = tower.getX()
        local real y = tower.getY()
        local integer count = 1
        
        call Lightning.createFromPointToUnit("GZAP", x, y, z, target).setLifetime(0.2)
        call Effect.createSimpleOnUnit("Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl", target, "chest").destroy()
        call ashbringer_necron_feedback(tower, target, feedback_mana, feedback_damage)
        
        call ashbringer_necron_chain(tower, target, 0, arc_max, arc_chance, arc_range, feedback_mana, feedback_damage)
    endfunction
    
    //@export
    function ashbringer_necron_hit takes Projectile p, Creep c returns nothing
        local Tower t = p.getCaster()
        local Iterate i = Iterate.overUnitsInRangeOfUnit(t, TARGET_TYPE_CREEPS, c, p.userReal2)
        local Creep next

        loop
            set next = i.next()
            exitwhen next == 0
            call t.doSpellDamage(next, t.getCurrentAttackDamageWithBonus() * p.userReal, t.calcSpellCritNoBonus())
            call Effect.createColored("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", next.getX(), next.getY(), next.getZ(), 270.0, 1.5, 75, 255, 1, 255).setLifetime(3.0)
        endloop
    endfunction
    
    //@export
    function ashbringer_necron_cast takes Tower tower, Creep target, real range, real damage, real z returns nothing
        local integer level = tower.getLevel()
        local Iterate i
        local Unit next
        local Projectile p
        
        set p = Projectile.createFromPointToUnit(ashbringer_necron_missile, tower, 0.0, 0.0, tower.getX(), tower.getY(), 200, target, true, false, false)
        call p.color(75, 255, 1, 255)
        call p.setScale(2.2)
        set p.userReal = damage
        set p.userReal2 = range
    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_necron_missile = ProjectileType.create("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl", 5.0, 900)
        call ashbringer_necron_missile.enableHoming(ProjectileTargetEvent.ashbringer_necron_hit, 0.0)
    endfunction
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNAntiMagicShell.blp
                            [name] => Gauss Flay
                            [short_explain] => Attacks burn mana and mana burnt is given to the tower.
                            [long_explain] => Attacks burn up to |cffffff8015|r mana from each enemy hit, dealing |cffffff8075|r spell damage per point of mana burnt. The tower gains mana equal to the amount of mana burnt. Can remove mana from immune enemies.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6|r mana burnt|n|cffFFFF80+3|r spell damage per mana
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => call ashbringer_necron_cast(tower, Event.getTarget(), 225, 5 + (tower.getLevel() * 0.1), 153)
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 5
                            [AUTOCAST_autoRange] => 900
                            [AUTOCAST_manacost] => 750
                            [icon] => ReplaceableTextures\CommandButtons\BTNChaosOrb.blp
                            [AUTOCAST_range] => 1100
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Release a sphere of energy that explodes when it reaches the target, dealing |cffffff80500%|r of attack damage as spell damage to enemies within |cffffff80225|r range.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+10%|r damage
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_UNIT
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Death Sphere
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Deals attack damage as spell damage around the target.
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)