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

            [Art] => ReplaceableTextures\CommandButtons\BTNHaloShadow.blp
            [bldtm] => 1
            [dmgplus1] => 0
            [goldcost] => 4000
            [unitSound] => ShrineOfAzshara
            [sides1] => 0
            [manaN] => 1000
            [acquire] => 950
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Enigma Cube
            [file] => units\nightelf\Wisp\Wisp.mdl
            [uberSplat] => YTDG
            [dice1] => 1
            [regenMana] => 10
            [modelScale] => 0.6
            [rangeN1] => 450
            [atkType1] => normal
            [cool1] => 2
            [Ubertip] => Its existence and inner workings remain a mystery.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [teamColor] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+10 |rmana/lvl|n|cffFFFF00+5% |rmana regen/lvl
            [abil_factor] => 0
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => unique
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.174889
                    [y] => -0.187694
                    [z] => 6.4
                    [scale] => 0.18
                    [rot] => 0.785398
                    [file] => Doodads\Ruins\Props\Ruins_NagaCircle\Ruins_NagaCircle.mdl
                    [red] => 5
                    [green] => 1
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 3.95986
                    [y] => -47.2965
                    [z] => 70.4
                    [scale] => 0.17
                    [rot] => 2.3562
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.154575
                    [y] => 0.559951
                    [z] => 44.8
                    [scale] => 2
                    [rot] => 4.71239
                    [file] => Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -11.8206
                    [y] => -10.9185
                    [z] => 76.8
                    [scale] => 0.11
                    [rot] => 0.785398
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => 11.4528
                    [y] => 11.1053
                    [z] => 76.8
                    [scale] => 0.11
                    [rot] => 3.92699
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -0.104478
                    [y] => 0.497171
                    [z] => 44.8
                    [scale] => 2
                    [rot] => 2.75762
                    [file] => Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 46.3103
                    [y] => 3.14883
                    [z] => 70.4
                    [scale] => 0.17
                    [rot] => 3.92699
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 0.0160404
                    [y] => -0.00104744
                    [z] => 38.4
                    [scale] => 2
                    [rot] => 1.60624
                    [file] => Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -4.13198
                    [y] => 46.1783
                    [z] => 70.4
                    [scale] => 0.17
                    [rot] => 5.49779
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => -47.2004
                    [y] => -3.63518
                    [z] => 70.4
                    [scale] => 0.17
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -3.97485
                    [y] => 47.4978
                    [z] => 6.4
                    [scale] => 0.17
                    [rot] => 5.49779
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 4.11698
                    [y] => -45.977
                    [z] => 6.4
                    [scale] => 0.17
                    [rot] => 2.3562
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => 46.4674
                    [y] => 4.46835
                    [z] => 6.4
                    [scale] => 0.17
                    [rot] => 3.92699
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => -47.0432
                    [y] => -2.31566
                    [z] => 6.4
                    [scale] => 0.17
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => 0.168637
                    [y] => 0.226883
                    [z] => 102.4
                    [scale] => 1
                    [rot] => 5.75959
                    [file] => Abilities\Spells\Undead\Possession\PossessionTarget.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -3.14
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => 0.0686507
                    [y] => -46.4491
                    [z] => 0
                    [scale] => 0.19
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => -0.0113717
                    [y] => 0.0252919
                    [z] => 32
                    [scale] => 4.3
                    [rot] => 0.977384
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 1
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => -43.2239
                    [y] => 40.5831
                    [z] => 38.4
                    [scale] => 1
                    [rot] => 5.49779
                    [file] => Abilities\Spells\Undead\Possession\PossessionTarget.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => 42.2912
                    [y] => -42.2557
                    [z] => 38.4
                    [scale] => 1
                    [rot] => 2.3562
                    [file] => Abilities\Spells\Undead\Possession\PossessionTarget.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => -43.1055
                    [y] => -44.7192
                    [z] => 44.8
                    [scale] => 1
                    [rot] => 0.785398
                    [file] => Abilities\Spells\Undead\Possession\PossessionTarget.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [20] => Array
                (
                    [x] => 39.9033
                    [y] => 42.2142
                    [z] => 38.4
                    [scale] => 1
                    [rot] => 3.92699
                    [file] => Abilities\Spells\Undead\Possession\PossessionTarget.mdl
                    [red] => 255
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [21] => Array
                (
                    [x] => -24.991
                    [y] => -25.4176
                    [z] => 57.6
                    [scale] => 0.11
                    [rot] => 3.92699
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [22] => Array
                (
                    [x] => -25.6059
                    [y] => -24.7415
                    [z] => 25.6
                    [scale] => 0.11
                    [rot] => 0.785398
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [23] => Array
                (
                    [x] => 24.5099
                    [y] => 25.272
                    [z] => 57.6
                    [scale] => 0.11
                    [rot] => 0.785399
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [24] => Array
                (
                    [x] => 25.1248
                    [y] => 24.5959
                    [z] => 25.6
                    [scale] => 0.11
                    [rot] => 3.92699
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [25] => Array
                (
                    [x] => -25.2317
                    [y] => 25.0514
                    [z] => 57.6
                    [scale] => 0.11
                    [rot] => 2.3562
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [26] => Array
                (
                    [x] => -24.5556
                    [y] => 25.6664
                    [z] => 25.6
                    [scale] => 0.11
                    [rot] => 5.49779
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [27] => Array
                (
                    [x] => 25.6962
                    [y] => -24.9154
                    [z] => 57.6
                    [scale] => 0.11
                    [rot] => 5.49779
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [28] => Array
                (
                    [x] => 25.0201
                    [y] => -25.5304
                    [z] => 25.6
                    [scale] => 0.11
                    [rot] => 2.35619
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [29] => Array
                (
                    [x] => -45.7366
                    [y] => 0.0163936
                    [z] => 0
                    [scale] => 0.19
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [30] => Array
                (
                    [x] => -0.0375362
                    [y] => 45.2808
                    [z] => 0
                    [scale] => 0.19
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [31] => Array
                (
                    [x] => 44.5637
                    [y] => -0.134218
                    [z] => 0
                    [scale] => 0.19
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 10
                    [green] => 10
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

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

            [1] => Array
                (
                    [id] => MOD_MANA_REGEN_PERC
                    [base] => 0
                    [add] => 0.05
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType ashbringer_enigma_buff
        //@export
        MultiboardValues ashbringer_cube_mb
    endglobals
    
    //@export
    function ashbringer_cube_mana takes Tower tower returns nothing
        local real mana_regen = tower.userInt * SquareRoot(tower.userInt2) * 10 / 100.0
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, tower.userReal - mana_regen)
        set tower.userReal = mana_regen
    endfunction
    
    //@export
    function ashbringer_cube_onCreate takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Tower target = b.getBuffedUnit()
        local integer power = b.getPower()
        
        if tower.getFamily() != target.getFamily() then
            set tower.userInt2 = tower.userInt2 + 1
            set b.userInt = tower.userInt
            call ashbringer_cube_mana(tower)
            if power == 1 then
                //arcane
                set b.userReal = 0.06 * tower.userInt
                call target.modifyProperty(MOD_SPELL_DAMAGE_DEALT, b.userReal)
                set b.userReal2 = 0.03 * tower.userInt
                call target.modifyProperty(MOD_MANA_PERC, b.userReal2)
            elseif power == 2 then
                //darkness
                set b.userReal = 0.06 * tower.userInt
                call target.modifyProperty(MOD_SPELL_CRIT_DAMAGE, b.userReal)
                set b.userReal2 = 0.03 * tower.userInt
                call target.modifyProperty(MOD_BUFF_DURATION, b.userReal2)
            elseif power == 3 then
                //fire
                set b.userReal = 0.006 * tower.userInt
                call target.modifyProperty(MOD_ATK_CRIT_CHANCE, b.userReal)
                set b.userReal2 = 0.03 * tower.userInt
                call target.modifyProperty(MOD_DAMAGE_ADD_PERC, b.userReal2)
            elseif power == 4 then
                //astral
                set b.userReal = 0.006 * tower.userInt
                call target.modifyProperty(MOD_SPELL_CRIT_CHANCE, b.userReal)
                set b.userReal2 = 0.03 * tower.userInt
                call target.modifyProperty(MOD_TRIGGER_CHANCES, b.userReal2)
            elseif power == 5 then
                //storm
                set b.userReal = 0.06 * tower.userInt
                call target.modifyProperty(MOD_ATTACKSPEED, b.userReal)
                set b.userReal2 = 0.03 * tower.userInt
                call target.modifyProperty(MOD_MANA_REGEN_PERC, b.userReal2)
            elseif power == 6 then
                //ice
                set b.userReal = 0.06 * tower.userInt
                call target.modifyProperty(MOD_ATK_CRIT_DAMAGE, b.userReal)
                set b.userReal2 = 0.03 * tower.userInt
                call target.modifyProperty(MOD_DEBUFF_RESISTANCE, b.userReal2)
            endif
        endif
    endfunction
    
    //@export
    function ashbringer_cube_onAttack takes Buff B returns nothing
        local Tower caster = B.getCaster()
        local Tower tower = B.getBuffedUnit()
        local integer lvl = caster.getLevel()
        if caster.calcChance(0.01 * tower.getBaseAttackspeed()) then
            call caster.addExp(1 + 0.04 * lvl)
            call Effect.createScaled("Abilities\\Spells\\Undead\\OrbOfDeath\\OrbOfDeathMissile.mdl", tower.getX(), tower.getY(), 70.0, 0.0, 3).destroy()
        endif
    endfunction
    
    //@export
    function ashbringer_cube_periodic takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Tower target = b.getBuffedUnit()
        local real buff_alter
        local integer power = b.getPower()
        
        if tower.getFamily() != target.getFamily() and tower.userInt != b.userInt then
            if power == 1 then
                //arcane
                set buff_alter = (0.06 * tower.userInt) - b.userReal
                call target.modifyProperty(MOD_SPELL_DAMAGE_DEALT, buff_alter)
                set b.userReal = b.userReal + buff_alter
                
                set buff_alter = (0.03 * tower.userInt) - b.userReal2
                call target.modifyProperty(MOD_MANA_PERC, buff_alter)
                set b.userReal2 = b.userReal2 + buff_alter
            elseif power == 2 then
                //darkness
                set buff_alter = (0.06 * tower.userInt) - b.userReal
                call target.modifyProperty(MOD_SPELL_CRIT_DAMAGE, buff_alter)
                set b.userReal = b.userReal + buff_alter
                
                set buff_alter = (0.03 * tower.userInt) - b.userReal2
                call target.modifyProperty(MOD_BUFF_DURATION, buff_alter)
                set b.userReal2 = b.userReal2 + buff_alter
            elseif power == 3 then
                //fire
                set buff_alter = (0.006 * tower.userInt) - b.userReal
                call target.modifyProperty(MOD_ATK_CRIT_CHANCE, buff_alter)
                set b.userReal = b.userReal + buff_alter
                
                set buff_alter = (0.03 * tower.userInt) - b.userReal2
                call target.modifyProperty(MOD_DAMAGE_ADD_PERC, buff_alter)
                set b.userReal2 = b.userReal2 + buff_alter
            elseif power == 4 then
                //astral
                set buff_alter = (0.006 * tower.userInt) - b.userReal
                call target.modifyProperty(MOD_SPELL_CRIT_CHANCE, buff_alter)
                set b.userReal = b.userReal + buff_alter
                
                set buff_alter = (0.03 * tower.userInt) - b.userReal2
                call target.modifyProperty(MOD_TRIGGER_CHANCES, buff_alter)
                set b.userReal2 = b.userReal2 + buff_alter
            elseif power == 5 then
                //storm
                set buff_alter = (0.06 * tower.userInt) - b.userReal
                call target.modifyProperty(MOD_ATTACKSPEED, buff_alter)
                set b.userReal = b.userReal + buff_alter
                
                set buff_alter = (0.03 * tower.userInt) - b.userReal2
                call target.modifyProperty(MOD_MANA_REGEN_PERC, buff_alter)
                set b.userReal2 = b.userReal2 + buff_alter
            elseif power == 6 then
                //ice
                set buff_alter = (0.06 * tower.userInt) - b.userReal
                call target.modifyProperty(MOD_ATK_CRIT_DAMAGE, buff_alter)
                set b.userReal = b.userReal + buff_alter
                
                set buff_alter = (0.03 * tower.userInt) - b.userReal2
                call target.modifyProperty(MOD_DEBUFF_RESISTANCE, buff_alter)
                set b.userReal2 = b.userReal2 + buff_alter
            endif
        endif
    endfunction
    
    //@export
    function ashbringer_cube_onCleanup takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Tower target = b.getBuffedUnit()
        if tower.getFamily() != target.getFamily() then
            set tower.userInt2 = tower.userInt2 - 1
            call ashbringer_cube_mana(tower)
            if b.getPower() == 1 then
                //arcane
                call target.modifyProperty(MOD_SPELL_DAMAGE_DEALT, -b.userReal)
                call target.modifyProperty(MOD_MANA_PERC, -b.userReal2)
            elseif b.getPower() == 2 then
                //darkness
                call target.modifyProperty(MOD_SPELL_CRIT_DAMAGE, -b.userReal)
                call target.modifyProperty(MOD_BUFF_DURATION, -b.userReal2)
            elseif b.getPower() == 3 then
                //fire
                call target.modifyProperty(MOD_ATK_CRIT_CHANCE, -b.userReal)
                call target.modifyProperty(MOD_DAMAGE_ADD_PERC, -b.userReal2)
            elseif b.getPower() == 4 then
                //astral
                call target.modifyProperty(MOD_SPELL_CRIT_CHANCE, -b.userReal)
                call target.modifyProperty(MOD_TRIGGER_CHANCES, -b.userReal2)
            elseif b.getPower() == 5 then
                //storm
                call target.modifyProperty(MOD_ATTACKSPEED, -b.userReal)
                call target.modifyProperty(MOD_MANA_REGEN_PERC, -b.userReal2)
            elseif b.getPower() == 6 then
                //ice
                call target.modifyProperty(MOD_ATK_CRIT_DAMAGE, -b.userReal)
                call target.modifyProperty(MOD_DEBUFF_RESISTANCE, -b.userReal2)
            endif
        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
        set ashbringer_enigma_buff = BuffType.createAuraEffectType(true)
        call ashbringer_enigma_buff.setBuffIcon('@@0@@')
        call ashbringer_enigma_buff.addEventOnCreate(ashbringer_cube_onCreate)
        call ashbringer_enigma_buff.addEventOnAttack(ashbringer_cube_onAttack, 1.0, 0.0)
        call ashbringer_enigma_buff.addPeriodicEvent(ashbringer_cube_periodic, 1.0)
        call ashbringer_enigma_buff.addEventOnCleanup(ashbringer_cube_onCleanup)
        
        set ashbringer_cube_mb = MultiboardValues.create(2)
        call ashbringer_cube_mb.setKey(0,"Power Level") 
        call ashbringer_cube_mb.setKey(1,"Towers Powered")
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Tower Details
                    [code] => call ashbringer_cube_mb.setValue(0,I2S(tower.userInt))
    call ashbringer_cube_mb.setValue(1,I2S(tower.userInt2))
    return ashbringer_cube_mb
                    [values] => Array
                        (
                            [0] => Array
                                (
                                    [_value] => 0
                                    [typ] => string
                                )

                        )

                )

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

                    [values] => Array
                        (
                            [AURA_powerAdd] => 0
                            [visible] => true
                            [AURA_auraEffect] => ashbringer_enigma_buff
                            [AURA_levelAdd] => 1
                            [AURA_power] => 1
                            [icon] => ReplaceableTextures\CommandButtons\BTNHaloShadow.blp
                            [AURA_targetType] => TARGET_TYPE_TOWERS
                            [long_explain] => Increases the spell damage of towers in |cffffff80450|r range by |cffffff80[6% x power level]|r and maximum mana by |cffffff80[3% x power level]|r but consumes mana based on power level and number of towers affected. Mana regeneration is reduced by |cffffff80[10 x power level x squareroot(towers powered)]%|r. If the cube's mana reaches zero mana it will deactivate itself for |cffffff80120|r seconds. Does not stack with or affect other Enigma Cubes.
                            [AURA_targetSelf] => false
                            [name] => Enigmatic Artifice
                            [AURA_level] => 0
                            [short_explain] => Increases the spell damage and maximum mana of nearby towers based on power level.
                            [AURA_auraRange] => 450
                        )

                )

            [3] => Array
                (
                    [name] => Periodic
                    [code] => local unit u = tower.getUnit()
    if tower.userInt != 0 and GetUnitState(u, UNIT_STATE_MANA) <= 1.0 then
        set tower.userInt = 0
        call ashbringer_cube_mana(tower)
        call tower.getOwner().displayFloatingText("Power Level: 0", tower, 50, 150, 100)
        call cb_stun.applyOnlyTimed(tower, tower, 120.0)
    endif
    set u = null
                    [values] => Array
                        (
                            [visible] => true
                            [PERIODIC_period] => 1
                            [icon] => ReplaceableTextures\CommandButtons\BTNMindsooth.blp
                            [name] => Paradoxical Paradigm
                            [short_explain] => Affected towers have a chance to grant the cube experience.
                            [long_explain] => The cube has a |cffFFFF801%|r chance to gain |cffFFFF801|r experience when an affected tower attacks an enemy. This chance is attack speed adjusted.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.04|r exp
                        )

                )

            [4] => Array
                (
                    [name] => Autocast
                    [code] => if tower.userInt < 50 then
        set tower.userInt = tower.userInt + 1
        call ashbringer_cube_mana(tower)
    endif
    call tower.getOwner().displayFloatingText("Power Level: " + I2S(tower.userInt), tower, 50+4*tower.userInt, 150-3*tower.userInt, 100-2*tower.userInt)
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 0.5
                            [AUTOCAST_autoRange] => 0
                            [AUTOCAST_manacost] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNReplay-SpeedUp.blp
                            [AUTOCAST_range] => 0
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Increases the power level of the cube by |cffffff801|r. Maximum power level is |cffffff8050|r.
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_NOAC_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Increase Power
                            [AUTOCAST_targetSelf] => true
                            [short_explain] => Increases the power level of the cube.
                        )

                )

            [5] => Array
                (
                    [name] => Autocast
                    [code] => if tower.userInt > 1 then
        set tower.userInt = tower.userInt - 1
        call ashbringer_cube_mana(tower)
    endif
    call tower.getOwner().displayFloatingText("Power Level: " + I2S(tower.userInt), tower, 50+4*tower.userInt, 150-3*tower.userInt, 100-2*tower.userInt)
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 5
                            [AUTOCAST_autoRange] => 0
                            [AUTOCAST_manacost] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNReplay-SpeedDown.blp
                            [AUTOCAST_range] => 0
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Decreases the power level of the cube by |cffFFFF801|r.
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_NOAC_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Decrease Power
                            [AUTOCAST_targetSelf] => true
                            [short_explain] => Decreases the power level of the cube.
                        )

                )

            [6] => Array
                (
                    [name] => On Tower Creation
                    [code] => call SetUnitColor(tower.getUnit(), ConvertPlayerColor(1))
    set tower.userInt = 0
    set tower.userInt2 = 0
    set tower.userReal = 0.0
    set tower.userReal3 = 133742069
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

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

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

                            [Bufftip] => Enigma Cube
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNHaloShadow.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
            [0] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => MultiboardValues
                    [name] => ashbringer_cube_mb
                )

        )

    [lightning] => Array
        (
        )

)