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

            [Art] => ReplaceableTextures\CommandButtons\BTNNetherTempest.blp
            [dmgplus1] => 1760
            [bldtm] => 1
            [goldcost] => 4000
            [unitSound] => ArcaneSanctum
            [sides1] => 1
            [manaN] => 10000
            [launchZ] => 115
            [acquire] => 1200
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => The Nexus
            [red] => 50
            [weapTp1] => instant
            [MissileHoming] => 1
            [file] => .mdl
            [uberSplat] => YTDG
            [Missilespeed] => 4000
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 200
            [green] => 50
            [rangeN1] => 1200
            [atkType1] => magic
            [cool1] => 1.5
            [Ubertip] => A convergence of magical ley lines.
            [blue] => 50
            [scaleBull] => 0
            [abilList] => @@0@@
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+200 |rmana/lvl
            [abil_factor] => 0.3
            [author] => Ashbringer
            [alpha] => 0
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => unique
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.692888
                    [y] => -21.2352
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 0.0427838
                    [y] => 0.949725
                    [z] => 89.6
                    [scale] => 1
                    [rot] => 3.76991
                    [file] => Abilities\Spells\Undead\Possession\PossessionCaster.mdl
                    [red] => 255
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -3.14
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => 0.705489
                    [y] => 21.3716
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -21.2985
                    [y] => 0.424255
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 0.000000238419
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -0.865673
                    [y] => 2.30034
                    [z] => 96
                    [scale] => 1
                    [rot] => 4.71239
                    [file] => war3mapImported\ArcaneMissileComplete.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -0.281575
                    [y] => -13.261
                    [z] => 12.8
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 45
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => -0.316727
                    [y] => -0.525879
                    [z] => 76.8
                    [scale] => 0.15
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => -3.14
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => -0.0928222
                    [y] => 0.0245067
                    [z] => 6.40001
                    [scale] => 0.5
                    [rot] => 0.715585
                    [file] => Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
                    [red] => 255
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => 0.0374061
                    [y] => -0.179741
                    [z] => 0.00000858307
                    [scale] => 0.75
                    [rot] => 5.07368
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 45
                    [green] => 25
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => -0.0630508
                    [y] => 0.0206106
                    [z] => 64
                    [scale] => 1.65
                    [rot] => 0.191986
                    [file] => Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -0.210604
                    [y] => -0.0297037
                    [z] => 44.8
                    [scale] => 1.55
                    [rot] => 2.44346
                    [file] => Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 0.162759
                    [y] => -0.456543
                    [z] => 96
                    [scale] => 2
                    [rot] => 2.44346
                    [file] => Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

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

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

            [13] => Array
                (
                    [x] => -0.169648
                    [y] => -13.1613
                    [z] => -19.2
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 45
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => 0.223622
                    [y] => 13.6283
                    [z] => -19.2
                    [scale] => 0.1
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 45
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => 21.3084
                    [y] => -0.974129
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => -17.5311
                    [y] => 0.964936
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => 17.8179
                    [y] => 1.06834
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => 0.693425
                    [y] => -17.6859
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => 0.590026
                    [y] => 17.6631
                    [z] => 6.40001
                    [scale] => 0.12
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [20] => Array
                (
                    [x] => 0.0159849
                    [y] => 0.718483
                    [z] => 44.8
                    [scale] => 1.1
                    [rot] => 1.60267
                    [file] => Abilities\Spells\Undead\Possession\PossessionCaster.mdl
                    [red] => 255
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [21] => Array
                (
                    [x] => -0.327195
                    [y] => -0.233956
                    [z] => 76.8
                    [scale] => 0.15
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => -3.14
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [22] => Array
                (
                    [x] => -0.199776
                    [y] => -0.493481
                    [z] => 70.4
                    [scale] => 0.15
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [23] => Array
                (
                    [x] => -0.199776
                    [y] => -0.493481
                    [z] => 70.4
                    [scale] => 0.15
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Structures\Archway1\Archway1.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 45
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_MANA
                    [base] => 0
                    [add] => 200
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => call ashbringer_barrage_start(tower, Event.getTarget())
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNNetherTempest.blp
                            [name] => Nether Tempest
                            [short_explain] => Attacks consume mana to bombard random enemies with arcane missiles.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => Attacks have a chance equal to this tower's percentage of remaining mana to launch an arcane missile at the enemy, consuming |cffffff802%|r of remaining mana and dealing |cffffff80500%|r of mana consumed as spell damage. Every missile can trigger another missile towards a random nearby enemy. Cannot trigger while below |cffffff8030%|r mana.|n|n|cffFF8000Level Bonus:|r|n|cffffff80+10%|r spell damage
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType ashbringer_nexus_aura
        BuffType ashbringer_convergence_buff
        ProjectileType ashbringer_convergence_projectile
        ProjectileType ashbringer_barrage_projectile
    endglobals
    
    function ashbringer_nexus_update takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        local Tower caster = b.getCaster()
        local real tower_level = caster.getLevel()
        local real caster_level_factor = 0.5 + (tower_level * 0.02)
        
        call tower.modifyProperty(MOD_SPELL_DAMAGE_DEALT, -b.userReal)
        call tower.modifyProperty(MOD_SPELL_CRIT_CHANCE, -b.userReal2)
        call tower.modifyProperty(MOD_SPELL_CRIT_DAMAGE, -b.userReal3)
        call tower.modifyProperty(MOD_MANA_PERC, -(b.userInt/1000.0))
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, -(b.userInt2/1000.0))
        
        set b.userReal = (caster.getProp_SpellDmgDealt() - 1.0)*caster_level_factor
        set b.userReal2 = (caster.getProp_SpellCritChance() - (0.0125 + (tower_level * 0.0015)))*caster_level_factor
        set b.userReal3 = (caster.getProp_SpellCritDamage() - (1.25 + (tower_level * 0.02)))*caster_level_factor
        set b.userInt = R2I((caster.getProp_ManaPercBonus())*caster_level_factor*1000.0)
        set b.userInt2 = R2I((caster.getProp_ManaRegPercBonus())*caster_level_factor*1000.0)
        
        call tower.modifyProperty(MOD_SPELL_DAMAGE_DEALT, b.userReal)
        call tower.modifyProperty(MOD_SPELL_CRIT_CHANCE, b.userReal2)
        call tower.modifyProperty(MOD_SPELL_CRIT_DAMAGE, b.userReal3)
        call tower.modifyProperty(MOD_MANA_PERC, (b.userInt/1000.0))
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, (b.userInt2/1000.0))
    endfunction

    function ashbringer_nexus_create takes Buff b returns nothing
        set b.userReal = 0
        set b.userReal2 = 0
        set b.userReal3 = 0
        set b.userInt = 0
        set b.userInt2 = 0
        call ashbringer_nexus_update(b)
    endfunction

    function ashbringer_nexus_cleanup takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        call tower.modifyProperty(MOD_SPELL_DAMAGE_DEALT, -b.userReal)
        call tower.modifyProperty(MOD_SPELL_CRIT_CHANCE, -b.userReal2)
        call tower.modifyProperty(MOD_SPELL_CRIT_DAMAGE, -b.userReal3)
        call tower.modifyProperty(MOD_MANA_PERC, -b.userInt/1000.0)
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, -b.userInt2/1000.0)
    endfunction
    
    function ashbringer_convergence_mana takes Projectile p, Creep target returns nothing
        local Tower tower = p.getCaster()
        local real mana = p.userReal
        
        if p.userInt == tower.getUID() and mana > 0 then
            set mana = mana * 100 * 0.002
            call tower.addManaPerc(mana)
        endif
    endfunction
    
    function ashbringer_barrage_fire takes Tower tower, Creep target, real mana returns nothing
        local Projectile p
        local integer leftright = GetRandomInt(0, 1)
        local real arc = GetRandomReal(0.1, 0.6)
        
        if leftright == 0 then
            set leftright = -1
        endif
        
        call tower.subtractMana(mana, true)
        set p = Projectile.createBezierInterpolationFromPointToUnit(ashbringer_barrage_projectile, tower, 0.0, 0.0, tower.getX(), tower.getY(), 115.0, target, 0.1, arc*leftright, 0.17, true)
        call p.setScale(0.75)
        set p.userInt = target.getUID()
        set p.userInt2 = tower.getUID()
        set p.userReal = mana
    endfunction
    
    function ashbringer_barrage_random takes Tower tower, real mana returns nothing
        local Iterate i = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TYPE_CREEPS, 1250)
        local Unit next
        
        loop
            set next = i.nextRandom()
            exitwhen next == 0 or (next != 0 and not next.isImmune())
        endloop
        
        if next != 0 then
            call i.destroy()
            call ashbringer_barrage_fire(tower, next, mana)
        endif
    endfunction
    
    function ashbringer_barrage_start takes Tower tower, Creep target returns nothing
        local real mana = GetUnitState(tower.getUnit(), UNIT_STATE_MANA)
        local real chance = mana / GetUnitState(tower.getUnit(), UNIT_STATE_MAX_MANA)
        
        if chance >= 0.3 then
            if tower.calcChance(chance) then
                set mana = mana * 0.02
                if target != 0 and not target.isImmune() then
                    call ashbringer_barrage_fire(tower, target, mana)
                else
                    call ashbringer_barrage_random(tower, mana)
                endif
            endif
        endif
    endfunction
    
    function ashbringer_barrage_hit takes Projectile p, Creep target returns nothing
        local Tower tower = p.getCaster()
        
        if p.userInt == target.getUID() and p.userInt2 == tower.getUID() then
            call tower.doSpellDamage(target, p.userReal*(5+(tower.getLevel()*0.1)), tower.calcSpellCritNoBonus())
            call ashbringer_barrage_start(tower, 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
        local Modifier m = Modifier.create()
        
        set ashbringer_nexus_aura = BuffType.createAuraEffectType(true)
        call ashbringer_nexus_aura.setBuffIcon('@@1@@')
        call ashbringer_nexus_aura.addEventOnCreate(ashbringer_nexus_create)
        call ashbringer_nexus_aura.addEventOnCleanup(ashbringer_nexus_cleanup)
        call ashbringer_nexus_aura.addPeriodicEvent(ashbringer_nexus_update, 5)
        
        set ashbringer_convergence_buff = BuffType.create(6.0, 0.0, true)
        call ashbringer_convergence_buff.setBuffIcon('@@2@@')
        call m.addModification(MOD_SPELL_DAMAGE_DEALT, 0.0, 0.001)
        call m.addModification(MOD_MANA_REGEN_PERC, 0.0, 0.001)
        call ashbringer_convergence_buff.setBuffModifier(m)
        
        set ashbringer_convergence_projectile = ProjectileType.create("Abilities\\Spells\\Undead\\AbsorbMana\\AbsorbManaBirthMissile.mdl", 5.0, 700.0)
        call ashbringer_convergence_projectile.setEventOnInterpolationFinished(ProjectileTargetEvent.ashbringer_convergence_mana)
        set ashbringer_barrage_projectile = ProjectileType.create("war3mapImported\\ArcaneMissileComplete.mdx", 5.0, 1400.0)
        call ashbringer_barrage_projectile.setEventOnInterpolationFinished(ProjectileTargetEvent.ashbringer_barrage_hit)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

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

                    [values] => Array
                        (
                            [AURA_powerAdd] => 0
                            [visible] => true
                            [AURA_auraEffect] => ashbringer_nexus_aura
                            [AURA_levelAdd] => 0
                            [AURA_power] => 1
                            [icon] => ReplaceableTextures\CommandButtons\BTNArcaneBlast.blp
                            [AURA_targetType] => TARGET_TYPE_TOWERS + TARGET_TYPE_ELEMENT_ARCANE + TARGET_TYPE_RARITY_UNCOMMON + TARGET_TYPE_RARITY_COMMON
                            [long_explain] => Maximum mana, mana regeneration, spell damage, spell crit chance and spell crit damage bonuses on this tower are applied to |cffFFFFFFCommon|r and |cff0080FFUncommon|r |cFFFF77FFArcane|r towers in |cffffff80350|r range at a rate of |cffffff8050%|r.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+2%|r stats
                            [AURA_targetSelf] => false
                            [name] => Arcane Nexus
                            [AURA_level] => 1
                            [short_explain] => Certain bonuses on this tower affect nearby |cffFFFFFFCommon|r and |cff0080FFUncommon|r |cFFFF77FFArcane|r towers.
                            [AURA_auraRange] => 350
                        )

                )

            [3] => Array
                (
                    [name] => Autocast
                    [code] => local Iterate i = Iterate.overUnitsInRangeOfUnit(tower, TARGET_TOWERS + TARGET_TYPE_ELEMENT_ARCANE, tower, 350)
    local Tower next
    local real mana
    local real max_mana
    local real current_mana
    local real max_drain = 0.2 + (tower.getLevel() * 0.008)
    local Projectile p
    local real x = tower.getX()
    local real y = tower.getY()
    local real total = 0
    
    call Effect.createScaled("Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCasterOverhead.mdl", x, y, 115.0+25, 270, 2.5).setLifetime(2.0)
    loop
        set next = i.next()
        exitwhen next == 0
        //call BJDebugMsg("next: " + I2S(next) + " ; " + "tower: " + I2S(tower) + " ; " + "next fam: " + I2S(next.getFamily()) + " ; " + "tower fam: " + I2S(tower.getFamily()) + " ; ")
        if next != tower then // and next.getFamily() != tower.getFamily()
            set current_mana = GetUnitState(next.getUnit(), UNIT_STATE_MANA)
            if current_mana > 0 then
                set max_mana = GetUnitState(next.getUnit(), UNIT_STATE_MAX_MANA)
                set mana = current_mana * max_drain
                set mana = next.subtractMana(mana, true)
                if mana > 0 then
                    set p = Projectile.createLinearInterpolationFromUnitToPoint(ashbringer_convergence_projectile, tower, 0.0, 0.0, next, x, y, 115.0, 0.2)
                    set p.userInt = tower.getUID()
                    set p.userReal = mana / max_mana
                    set total = total + (mana / max_mana)
                    call ashbringer_convergence_buff.apply(tower, next, R2I((mana / max_mana)*4000))
                endif
            endif
        endif
    endloop
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 8
                            [AUTOCAST_autoRange] => 1000
                            [AUTOCAST_manacost] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNNeutralManaShield.blp
                            [AUTOCAST_range] => 1000
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Drains up to |cffffff8020%|r of current mana from every other |cFFFF77FFArcane|r tower in |cffffff80350|r range. The Nexus gains |cffffff800.2%|r of its own maximum mana for every |cffffff801%|r of each tower's maximum mana drained and each tower drained gains Ley Surge for |cffffff806|r seconds, increasing spell damage and mana regeneration by |cffffff804%|r for every |cffffff801%|r of mana drained.|n|n|cffFF8000Level Bonus:|r|n|cffffff80+0.8%|r maximum drain
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_ALWAYS_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Convergence
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Redirects mana from nearby |cFFFF77FFArcane|r towers to itself but increases their spell damage in exchange.
                        )

                )

        )

    [abilities] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Alit
                    [oeValues] => Array
                        (
                            [Targetattach] => origin
                            [Art] => Array
                                (
                                )

                            [TargetArt] => Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
                            [LightningEffect] => PBEAM
                            [Missileart] => Array
                                (
                                )

                            [Missilespeed] => 4000
                            [Unubertip] => -HIDE-
                            [Name] => Nexus Attack
                        )

                )

        )

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

                            [Buffubertip] => Stats increased by nearby Nexus.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Arcane Nexus
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNArcaneBlast.blp
                        )

                )

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

                            [Buffubertip] => Increased spell damage and mana regeneration.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Ley Surge
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNNeutralManaShield.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)