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

            [Art] => ReplaceableTextures\CommandButtons\BTNElementalConvergence.blp
            [dmgplus1] => 841
            [bldtm] => 1
            [goldcost] => 2750
            [unitSound] => ObsidianDestroyer
            [sides1] => 1
            [Missilearc] => 0.1
            [manaN] => 100
            [launchZ] => 80
            [acquire] => 1200
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Orb of Elemental Infusion
            [weapTp1] => msplash
            [file] => .mdl
            [MissileHoming] => 1
            [Harea1] => 250
            [uberSplat] => YTDG
            [Missilespeed] => 1800
            [Missileart] => Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
            [Qfact1] => 0.5
            [Qarea1] => 250
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 3
            [Hfact1] => 0.5
            [rangeN1] => 1200
            [atkType1] => chaos
            [cool1] => 2.2
            [Ubertip] => Humming with energy.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffCCFF00Splash attack:|n   |cffFFFF00150|r AoE: |cff00FF00100%|r damage|r|n   |cffFFFF00250|r AoE: |cffFFFF0050%|r damage|r
            [abil_factor] => 0.2
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => unique
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -12.6525
                    [y] => -33.4237
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -0.0231292
                    [y] => 0.184941
                    [z] => 83.2
                    [scale] => 1.15
                    [rot] => 3.24631
                    [file] => Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
                    [red] => 155
                    [green] => 55
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -4.11932
                    [y] => 0.238333
                    [z] => 32
                    [scale] => 0.08
                    [rot] => 0.000000238419
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 31.931
                    [y] => -31.9383
                    [z] => 19.2
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -32.1334
                    [y] => -32.0283
                    [z] => 19.2
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -0.0626826
                    [y] => -4.35729
                    [z] => 32
                    [scale] => 0.08
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 4.14835
                    [y] => 0.0115417
                    [z] => 32
                    [scale] => 0.08
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 0.0917058
                    [y] => 4.60717
                    [z] => 32
                    [scale] => 0.08
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -0.112213
                    [y] => 0.132822
                    [z] => 89.6
                    [scale] => 1.45
                    [rot] => 4.43314
                    [file] => Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                    [red] => 255
                    [green] => 35
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => 0.0604063
                    [y] => 0.416423
                    [z] => -0.000000953674
                    [scale] => 0.35
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => 32.3589
                    [y] => 31.8679
                    [z] => 0
                    [scale] => 0.28
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => -32.2339
                    [y] => 32.0257
                    [z] => 0
                    [scale] => 0.28
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -32.5004
                    [y] => -32.9537
                    [z] => 0
                    [scale] => 0.28
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => -0.387103
                    [y] => -27.4206
                    [z] => 12.8
                    [scale] => 0.08
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => -27.2578
                    [y] => 0.225159
                    [z] => 12.8
                    [scale] => 0.08
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => 0.528682
                    [y] => 28.1946
                    [z] => 12.8
                    [scale] => 0.08
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => 28.0173
                    [y] => 0.781387
                    [z] => 12.8
                    [scale] => 0.08
                    [rot] => 0.000000357628
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 145
                    [green] => 45
                    [blue] => 215
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => -32.1379
                    [y] => 31.9815
                    [z] => 19.2
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => 31.944
                    [y] => 31.9899
                    [z] => 19.2
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => 32.701
                    [y] => -33.1416
                    [z] => 0
                    [scale] => 0.28
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_LowWall_ShortEndCap\City_LowWall_ShortEndCap.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [20] => Array
                (
                    [x] => 12.7478
                    [y] => -33.4432
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [21] => Array
                (
                    [x] => -0.14912
                    [y] => 0.179247
                    [z] => 76.8
                    [scale] => 2.05
                    [rot] => 4.71239
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [22] => Array
                (
                    [x] => -12.0377
                    [y] => 34.467
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [23] => Array
                (
                    [x] => 13.3626
                    [y] => 34.4475
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [24] => Array
                (
                    [x] => 0.239886
                    [y] => -30.5546
                    [z] => 32
                    [scale] => 1.3
                    [rot] => 0.907571
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 255
                    [green] => 155
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [25] => Array
                (
                    [x] => -30.7025
                    [y] => 0.185505
                    [z] => 32
                    [scale] => 1.3
                    [rot] => 0.907571
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 255
                    [green] => 155
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [26] => Array
                (
                    [x] => 0.399934
                    [y] => 31.9287
                    [z] => 32
                    [scale] => 1.3
                    [rot] => 0.907571
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 255
                    [green] => 155
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [27] => Array
                (
                    [x] => 30.9005
                    [y] => -0.251178
                    [z] => 32
                    [scale] => 1.3
                    [rot] => 0.907571
                    [file] => Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
                    [red] => 255
                    [green] => 155
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [28] => Array
                (
                    [x] => -33.8049
                    [y] => 12.6416
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [29] => Array
                (
                    [x] => -33.8243
                    [y] => -12.7587
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [30] => Array
                (
                    [x] => 33.7939
                    [y] => 12.3586
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [31] => Array
                (
                    [x] => 33.7744
                    [y] => -13.0417
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 155
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType ashbringer_infusion_celestial
        BuffType ashbringer_infusion_darkness
        BuffType ashbringer_infusion_nature
        BuffType ashbringer_infusion_fire
        BuffType ashbringer_infusion_ice
        BuffType ashbringer_infusion_storm
        BuffType ashbringer_infusion_iron
        BuffType ashbringer_infusion_arcane
        
        BuffType ashbringer_infusion_buff
        BuffType ashbringer_attunement_buff
        
        BuffType ashbringer_darkness_buff
        BuffType ashbringer_nature_buff
        BuffType ashbringer_ice_buff
        BuffType ashbringer_iron_buff
        
        string array infusion_on_hit[8]
    endglobals
    
    struct elements
        Effect array se[4]
        
        integer array a[8]  //passive ability
        integer array b[8]  //BuffType
        string array e[8]   //effect on change/infusion path
        string array o[8]   //orb effect path
        integer array m[8]  //damage taken mod
        integer array t[8]  //attack type for buff
        string array s[8]   //corner effect path
        integer array sr[8] //corner effect red
        integer array sg[8] //corner effect green
        integer array sb[8] //corner effect blue
        real array ss[8]    //corner effect scale
        
        method sfx takes Tower tower returns nothing
            call Effect.createSimpleAtUnit(.e[tower.userInt], tower).setLifetime(2.0)
        endmethod
        
        method update_sfx takes Tower tower, boolean destroy returns nothing
            local Effect fx
            local integer green = 255
            local real scale = 1.25
            local integer count = 0
            local real angle = 0
            local real x = tower.getX()
            local real y = tower.getY()
            local real target_x = tower.getX()
            local real target_y = tower.getY()
            
            if destroy then
                set fx = tower.userInt3
                call fx.destroy()
            endif
            if tower.userInt == 7 then
                set green = 75
            elseif tower.userInt == 2 or tower.userInt == 3 then
                set scale = 1.7
            endif
            set fx = Effect.createColored(.o[tower.userInt], tower.getX(), tower.getY(), 85.0, 270.0, scale, 255, green, 255, 255)
            set tower.userInt3 = fx
            
            loop
                exitwhen count > 3
                if destroy then
                    call .se[count].destroy()
                endif
                set angle = (count * 90) + 45
                set target_x = x + 46 * Cos(Deg2Rad(angle))
                set target_y = y + 46 * Sin(Deg2Rad(angle))
                set .se[count] = Effect.createColored(.s[tower.userInt], target_x, target_y, 62.0, angle, .ss[tower.userInt], .sr[tower.userInt], .sg[tower.userInt], .sb[tower.userInt], 255)
                
                set count = count + 1
            endloop
        endmethod
    endstruct
    
    function ashbringer_attunement_create takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        local Tower t = b.getCaster()
        local elements e = t.userInt2
        local integer count = 0
        
        set b.userInt = t.userInt
        set b.userReal = 0.15 + (t.getLevel() * 0.006)
        
        loop
            exitwhen count > 7
            
            if count == b.userInt then
                call c.modifyProperty(e.m[count], -b.userReal)
            else
                call c.modifyProperty(e.m[count], b.userReal)
            endif
            
            set count = count + 1
        endloop
    endfunction
    
    function ashbringer_attunement_cleanup takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        local Tower t = b.getCaster()
        local elements e = t.userInt2
        local integer count = 0
        
        loop
            exitwhen count > 7
            
            if count == b.userInt then
                call c.modifyProperty(e.m[count], b.userReal)
            else
                call c.modifyProperty(e.m[count], -b.userReal)
            endif
            
            set count = count + 1
        endloop
    endfunction
    
    function ashbringer_celestial_infusion takes Buff b returns nothing
        local Tower t = b.getBuffedUnit()
        local Iterate i
        local Tower next
        local real chance = 0.025 + (t.getLevel() * 0.001)
        
        if t.calcChance(chance) then
            call Effect.createScaled("Abilities\\Spells\\Undead\\ReplenishHealth\\ReplenishHealthCasterOverhead.mdl", t.getX(), t.getY(), 160, 270, 1.4).setLifetime(2.0)
            set i = Iterate.overUnitsInRangeOfCaster(t, TARGET_TYPE_TOWERS, 450)
            loop
                set next = i.next()
                exitwhen next == 0
                if next != t then
                    call next.addExp(1.0)
                endif
            endloop
        endif
    endfunction
    
    function ashbringer_nature_infusion takes Buff b returns nothing
        local Tower t = b.getCaster()
        local Creep c = b.getBuffedUnit()
        local real damage = t.getCurrentAttackDamageWithBonus() * 0.5 + (t.getLevel() * 0.02) / 5
        
        call t.doCustomAttackDamage(c, damage, t.calcAttackCritNoBonus(), AttackType.ESSENCE)
    endfunction
    
    function ashbringer_fire_infusion takes Tower t, Creep c, real damage returns nothing
        local Iterate i = Iterate.overUnitsInRangeOfUnit(t, TARGET_TYPE_CREEPS, c, 150 + (t.getLevel() * 2))
        local Creep next
        
        if damage > 0 then
            loop
                set next = i.next()
                exitwhen next == 0
                if next != c then
                    call t.doAttackDamage(next, damage, t.calcAttackMulticrit(0, 0, 0))
                    call Effect.createSimpleOnUnit("Abilities\\Spells\\Items\\AIfb\\AIfbSpecialArt.mdl", next, "chest").setLifetime(0.4)
                endif
            endloop
        endif
    endfunction
    
    function ashbringer_storm_infusion takes Buff b returns nothing
        local Tower t = b.getBuffedUnit()
        local Iterate i = Iterate.overUnitsInRangeOfCaster(t, TARGET_TYPE_CREEPS, t.getRange())
        local Creep next = i.nextRandom()
        
        if next != 0 then
            call t.doCustomAttackDamage(next, t.getCurrentAttackDamageWithBonus(), t.calcAttackMulticrit(0, 0, 0), AttackType.ENERGY)
            call Effect.createSimpleAtUnit("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", next).setLifetime(2.0)
            call Lightning.createFromUnitToUnit("CLPB", t, next).setLifetime(0.1)
            call i.destroy()
        endif
    endfunction
    
    function ashbringer_arcane_infusion takes Tower t, Creep c, integer level returns nothing
        local real mana = 32 + (level * 0.32)
        
        set mana = c.subtractMana(mana, true)
        if mana > 0 then
            call t.doSpellDamage(c, mana*200, t.calcSpellCritNoBonus())
        endif
    endfunction
    
    function ashbringer_infusion_create takes Buff b returns nothing
        local Tower t = b.getCaster()
        local elements e = t.userInt2
        
        set b.userInt = t.userInt
        set b.userInt2 = e.t[t.userInt]
    endfunction
    
    function ashbringer_infusion_cleanup takes Buff b returns nothing
        local Tower t = b.getCaster()
        local Tower target = b.getBuffedUnit()
        local elements e = t.userInt2
        local Buff sb = target.getBuffOfType(e.b[b.userInt])
        
        if sb != 0 then
            call sb.removeBuff()
        endif
    endfunction
    
    function ashbringer_infusion_ondamage takes Buff b returns nothing
        local Tower t = b.getBuffedUnit()
        local Creep c = Event.getTarget()
        local AttackType at = b.userInt2
        local integer level = t.getLevel()
        local real damage = Event.damage * (0.1 + (level * 0.004))
        
        if Event.isMainTarget() then
            set damage = damage / t.getAttackType().getDamageAgainst(c.getArmorType())
            set damage = damage * at.getDamageAgainst(c.getArmorType())
            
            if c.isImmune() and b.userInt == 7 then
                set damage = 0
            endif
            
            set Event.damage = Event.damage + damage
            
            call Effect.createSimpleOnUnit(infusion_on_hit[b.userInt], c, "chest").setLifetime(1.0)
            if b.userInt == 1 then
                call ashbringer_darkness_buff.apply(t, c, level)
            elseif b.userInt == 2 then
                call ashbringer_nature_buff.apply(t, c, level)
            elseif b.userInt == 3 then
                call ashbringer_fire_infusion(t, c, damage)
            elseif b.userInt == 4 then
                call ashbringer_ice_buff.apply(t, c, level)
            elseif b.userInt == 6 then
                call ashbringer_iron_buff.apply(t, c, level)
            elseif b.userInt == 7 then
                call ashbringer_arcane_infusion(t, c, level)
            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
        local Modifier mod = Modifier.create()
        
        set ashbringer_infusion_buff = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_buff.setBuffIcon('@@10@@')
        //call ashbringer_infusion_buff.addEventOnCreate(ashbringer_infusion_create)
        //call ashbringer_infusion_buff.addEventOnCleanup(ashbringer_infusion_cleanup)
        
        //Abilities\\Spells\\Items\\AIta\\CrystalBallCaster.mdl
        set ashbringer_infusion_celestial = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_celestial.setBuffIcon('@@17@@')
        call ashbringer_infusion_celestial.setSpecialEffectColored("Abilities\\Spells\\Items\\OrbCorruption\\OrbCorruption.mdl", 200, 1.4, 255, 255, 255, 255)
        call mod.addModification(MOD_TRIGGER_CHANCES, 0.15, 0.006)
        call ashbringer_infusion_celestial.setBuffModifier(mod)
        call ashbringer_infusion_celestial.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_celestial.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_celestial.addEventOnKill(ashbringer_celestial_infusion)
        call ashbringer_infusion_celestial.setStackingGroup("orbInfusion")
        
        //Abilities\\Spells\\Undead\\Curse\\CurseTarget.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_darkness = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_darkness.setBuffIcon('@@18@@')
        call ashbringer_infusion_darkness.setSpecialEffectColored("Abilities\\Spells\\Items\\OrbDarkness\\OrbDarkness.mdl", 200, 1.4, 255, 255, 255, 255)
        call mod.addModification(MOD_BUFF_DURATION, 0.2, 0.008)
        call ashbringer_infusion_darkness.setBuffModifier(mod)
        call ashbringer_infusion_darkness.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_darkness.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_darkness.setStackingGroup("orbInfusion")
        
        //Abilities\\Spells\\Other\\Parasite\\ParasiteTarget.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_nature = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_nature.setBuffIcon('@@15@@')
        call ashbringer_infusion_nature.setSpecialEffectColored("Abilities\\Spells\\Items\\OrbVenom\\OrbVenom.mdl", 200, 1.9, 255, 255, 255, 255)
        call mod.addModification(MOD_SPELL_CRIT_CHANCE, 0.075, 0.003)
        call mod.addModification(MOD_ATK_CRIT_CHANCE, 0.075, 0.003)
        call ashbringer_infusion_nature.setBuffModifier(mod)
        call ashbringer_infusion_nature.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_nature.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_nature.setStackingGroup("orbInfusion")
        
        //Abilities\\Spells\\Other\\SoulBurn\\SoulBurnbuff.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_fire = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_fire.setBuffIcon('@@16@@')
        call ashbringer_infusion_fire.setSpecialEffectColored("Abilities\\Spells\\Items\\AIfb\\AIfbTarget.mdl", 200, 1.9, 255, 255, 255, 255)
        call mod.addModification(MOD_DAMAGE_ADD_PERC, 0.15, 0.006)
        call mod.addModification(MOD_SPELL_DAMAGE_DEALT, 0.15, 0.006)
        call ashbringer_infusion_fire.setBuffModifier(mod)
        call ashbringer_infusion_fire.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_fire.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_fire.setStackingGroup("orbInfusion")
        
        //Abilities\\Weapons\\ZigguratFrostMissile\\ZigguratFrostMissile.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_ice = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_ice.setBuffIcon('@@13@@')
        call ashbringer_infusion_ice.setSpecialEffectColored("Abilities\\Spells\\Items\\AIob\\AIobTarget.mdl", 200, 1.4, 255, 255, 255, 255)
        call mod.addModification(MOD_DEBUFF_RESISTANCE, 0.15, 0.006)
        call ashbringer_infusion_ice.setBuffModifier(mod)
        call ashbringer_infusion_ice.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_ice.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_ice.setStackingGroup("orbInfusion")
        
        //Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_storm = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_storm.setBuffIcon('@@14@@')
        call ashbringer_infusion_storm.setSpecialEffectColored("Abilities\\Spells\\Items\\AIlb\\AIlbTarget.mdl", 200, 1.4, 255, 255, 255, 255)
        call mod.addModification(MOD_ATTACKSPEED, 0.15, 0.006)
        call ashbringer_infusion_storm.setBuffModifier(mod)
        call ashbringer_infusion_storm.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_storm.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_storm.addEventOnAttack(ashbringer_storm_infusion, 0.1, 0.004)
        call ashbringer_infusion_storm.setStackingGroup("orbInfusion")
        
        //Abilities\\Spells\\Human\\InnerFire\\InnerFireTarget.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_iron = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_iron.setBuffIcon('@@11@@')
        call ashbringer_infusion_iron.setSpecialEffectColored("Abilities\\Spells\\Items\\OrbSlow\\OrbSlow.mdl", 200, 1.4, 255, 255, 255, 255)
        call mod.addModification(MOD_BOUNTY_RECEIVED, 0.4, 0.016)
        call ashbringer_infusion_iron.setBuffModifier(mod)
        call ashbringer_infusion_iron.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_iron.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_iron.setStackingGroup("orbInfusion")
        
        //Abilities\\Spells\\Human\\MagicSentry\\MagicSentryCaster.mdl
        set mod = Modifier.create()
        set ashbringer_infusion_arcane = BuffType.create(10, 0.2, true)
        call ashbringer_infusion_arcane.setBuffIcon('@@12@@')
        call ashbringer_infusion_arcane.setSpecialEffectColored("Abilities\\Spells\\Items\\AIlb\\AIlbTarget.mdl", 200, 1.4, 255, 75, 255, 255)
        call mod.addModification(MOD_MANA_REGEN_PERC, 0.15, 0.006)
        call ashbringer_infusion_arcane.setBuffModifier(mod)
        call ashbringer_infusion_arcane.addEventOnCreate(ashbringer_infusion_create)
        call ashbringer_infusion_arcane.addEventOnDamage(ashbringer_infusion_ondamage, 1.0, 0.0)
        call ashbringer_infusion_arcane.setStackingGroup("orbInfusion")
        
        //darkness debuff
        set mod = Modifier.create()
        set ashbringer_darkness_buff = BuffType.create(5.0, 0.0, false)
        call ashbringer_darkness_buff.setBuffIcon('@@8@@')
        call mod.addModification(MOD_ATK_DAMAGE_RECEIVED, 0.15, 0.008)
        call mod.addModification(MOD_SPELL_DAMAGE_RECEIVED, 0.15, 0.008)
        call ashbringer_darkness_buff.setBuffModifier(mod)
        
        //nature debuff
        set ashbringer_nature_buff = BuffType.create(5.1, 0.0, false)
        call ashbringer_nature_buff.setBuffIcon('@@20@@')
        call ashbringer_nature_buff.addPeriodicEvent(ashbringer_nature_infusion, 1.0)
        
        //ice debuff
        set mod = Modifier.create()
        set ashbringer_ice_buff = BuffType.create(5.0, 0.0, false)
        call ashbringer_ice_buff.setBuffIcon('@@19@@')
        call mod.addModification(MOD_MOVESPEED, -0.15, -0.006)
        call ashbringer_ice_buff.setBuffModifier(mod)
        
        //iron debuff
        set mod = Modifier.create()
        set ashbringer_iron_buff = BuffType.create(5.0, 0.0, false)
        call ashbringer_iron_buff.setBuffIcon('@@21@@')
        call mod.addModification(MOD_ARMOR_PERC, -0.1, -0.016)
        call ashbringer_iron_buff.setBuffModifier(mod)
        
        
        set ashbringer_attunement_buff = BuffType.create(5.0, 0, false)
        call ashbringer_attunement_buff.setBuffIcon('@@9@@')
        call ashbringer_attunement_buff.addEventOnCreate(EventHandler.ashbringer_attunement_create)
        call ashbringer_attunement_buff.addEventOnCleanup(EventHandler.ashbringer_attunement_cleanup)
        
        set infusion_on_hit[0] = "Abilities\\Spells\\Items\\OrbCorruption\\OrbCorruptionSpecialArt.mdl" //Abilities\\Spells\\NightElf\\ThornsAura\\ThornsAuraDamage.mdl
        set infusion_on_hit[1] = "Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl"
        set infusion_on_hit[2] = "Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl"
        set infusion_on_hit[3] = "Abilities\\Spells\\Items\\AIfb\\AIfbSpecialArt.mdl"
        set infusion_on_hit[4] = "Abilities\\Spells\\Items\\AIob\\AIobSpecialArt.mdl"
        set infusion_on_hit[5] = "Abilities\\Spells\\Items\\AIlb\\AIlbSpecialArt.mdl"
        set infusion_on_hit[6] = "Abilities\\Weapons\\Rifle\\RifleImpact.mdl"
        set infusion_on_hit[7] = "Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl"
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Tower Destruction
                    [code] => local elements e = tower.userInt2
    local Effect fx = tower.userInt3
    local integer count = 0
    
    call fx.destroy()
    loop
        exitwhen count > 3
        
        call e.se[count].destroy()
        
        set count = count + 1
    endloop
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => On Damage
                    [code] => local Creep target = Event.getTarget()
    local Buff b = target.getBuffOfType(ashbringer_attunement_buff)
    
    if b != 0 then
        call b.refreshDuration()
    else
        call ashbringer_attunement_buff.apply(tower, target, tower.getLevel())
    endif
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNDispelMagic.blp
                            [name] => Elemental Attunement
                            [short_explain] => Creeps hit take decreased damage from towers of the chosen Elemental Affinity but take increased damage from all other elements.
                            [ONDAMAGE_chanceLevelAdd] => 0
                            [long_explain] => Creeps hit are attuned to the chosen Elemental Affinity of the Orb for |cffffff805|r seconds, decreasing the damage they take from towers of that element by |cffffff8015%|r but increasing the damage they take from towers of all other elements by the same amount.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6%|r damage reduced/increased
                        )

                )

            [3] => Array
                (
                    [name] => Periodic
                    [code] => //checks if ability missing or has wrong ability
    local integer count = 0
    local elements e = tower.userInt2
    local integer check
    
    if tower.userReal < 1 then
        loop
            exitwhen count > 7
            set check = GetUnitAbilityLevel(tower.getUnit(), e.a[count])
            if check !=1 and count == tower.userInt then
                call UnitAddAbility(tower.getUnit(), e.a[count])
            elseif check ==1 and count != tower.userInt then
                call UnitRemoveAbility(tower.getUnit(), e.a[count])
            endif
            set count = count + 1
        endloop
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [PERIODIC_period] => 60
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [4] => Array
                (
                    [name] => Autocast
                    [code] => local elements e = tower.userInt2
    local BuffType bt = e.b[tower.userInt]
    
    call e.sfx(tower)
    call ashbringer_infusion_buff.apply(tower, Event.getTarget(), tower.getLevel())
    call bt.apply(tower, Event.getTarget(), tower.getLevel())
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 10
                            [AUTOCAST_autoRange] => 450
                            [AUTOCAST_manacost] => 80
                            [icon] => ReplaceableTextures\CommandButtons\BTNElementalConvergence.blp
                            [AUTOCAST_range] => 450
                            [AUTOCAST_targetType] => TARGET_TYPE_TOWERS
                            [AUTOCAST_numBuffsBeforeIdle] => 1
                            [caster_art] => 
                            [long_explain] => Infuse a target tower with the power of the chosen element for |cffffff8010|r seconds. See the chosen element for specific effects.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.2|r seconds duration
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_BUFF
                            [AUTOCAST_buffType] => ashbringer_infusion_buff
                            [AUTOCAST_isExtended] => false
                            [name] => Elemental Infusion
                            [AUTOCAST_targetSelf] => true
                            [short_explain] => Infuse a tower with a powerful buff based on of the chosen Elemental Affinity.
                        )

                )

            [5] => Array
                (
                    [name] => Autocast
                    [code] => local elements e = tower.userInt2
    
    call UnitRemoveAbility(tower.getUnit(), e.a[tower.userInt])
    if tower.userInt < 7 then
        set tower.userInt = tower.userInt + 1
    else
        set tower.userInt = 0
    endif
    call UnitAddAbility(tower.getUnit(), e.a[tower.userInt])
    call e.sfx(tower)
    call e.update_sfx(tower, true)
    //set tower.userReal = 0.0
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 10
                            [AUTOCAST_autoRange] => 0
                            [AUTOCAST_manacost] => 80
                            [icon] => ReplaceableTextures\CommandButtons\BTNReplay-Loop.blp
                            [AUTOCAST_range] => 0
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Cycle the Orb's Elemental Affinity to the next element. The order of elements is:|n|cFFFFFF80Celestial|r > |cFF8A5300Darkness|r > |cFF80FF00Nature|r > |cFFFF5300Fire|r > |cFF00FFFFIce|r > |cFF8080FFStorm|r > |cFFC0C0C0Iron|r > |cFFFF77FFArcane|r
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_NOAC_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Elemental Affinity
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Select the tower's elemental affinity.
                        )

                )

            [6] => Array
                (
                    [name] => On Tower Creation
                    [code] => local elements e = elements.create()
    //local Effect fx
    
    //celestial
    set e.b[0] = ashbringer_infusion_celestial
    set e.a[0] = '@@7@@'
    set e.e[0] = "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl"
    set e.o[0] = "Abilities\\Spells\\Items\\OrbCorruption\\OrbCorruption.mdl"
    set e.m[0] = MOD_DMG_FROM_ASTRAL
    set e.t[0] = AttackType.ENERGY
    set e.s[0] = "Abilities\\Spells\\Items\\AIta\\CrystalBallCaster.mdl"
    set e.sr[0] = 255
    set e.sg[0] = 255
    set e.sb[0] = 255
    set e.ss[0] = 0.3
    //darkness
    set e.b[1] = ashbringer_infusion_darkness
    set e.a[1] = '@@5@@'
    set e.e[1] = "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl"
    set e.o[1] = "Abilities\\Spells\\Items\\OrbDarkness\\OrbDarkness.mdl"
    set e.m[1] = MOD_DMG_FROM_DARKNESS
    set e.t[1] = AttackType.DECAY
    set e.s[1] = "Abilities\\Spells\\Undead\\Curse\\CurseTarget.mdl"
    set e.sr[1] = 255
    set e.sg[1] = 255
    set e.sb[1] = 255
    set e.ss[1] = 0.45
    //nature
    set e.b[2] = ashbringer_infusion_nature
    set e.a[2] = '@@6@@'
    set e.e[2] = "Objects\\Spawnmodels\\NightElf\\NEDeathSmall\\NEDeathSmall.mdl"
    set e.o[2] = "Abilities\\Spells\\Items\\OrbVenom\\OrbVenom.mdl"
    set e.m[2] = MOD_DMG_FROM_NATURE
    set e.t[2] = AttackType.PHYSICAL
    set e.s[2] = "Abilities\\Spells\\NightElf\\FaerieFire\\FaerieFireTarget.mdl"
    set e.sr[2] = 55
    set e.sg[2] = 255
    set e.sb[2] = 55
    set e.ss[2] = 0.35
    //fire
    set e.b[3] = ashbringer_infusion_fire
    set e.a[3] = '@@3@@'
    set e.e[3] = "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl"
    set e.o[3] = "Abilities\\Spells\\Items\\AIfb\\AIfbTarget.mdl"
    set e.m[3] = MOD_DMG_FROM_FIRE
    set e.t[3] = AttackType.ELEMENTAL
    set e.s[3] = "Abilities\\Weapons\\WitchDoctorMissile\\WitchDoctorMissile.mdl"
    set e.sr[3] = 255
    set e.sg[3] = 155
    set e.sb[3] = 0
    set e.ss[3] = 0.3
    //ice
    set e.b[4] = ashbringer_infusion_ice
    set e.a[4] = '@@4@@'
    set e.e[4] = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
    set e.o[4] = "Abilities\\Spells\\Items\\AIob\\AIobTarget.mdl"
    set e.m[4] = MOD_DMG_FROM_ICE
    set e.t[4] = AttackType.ELEMENTAL
    set e.s[4] = "Abilities\\Spells\\Undead\\FrostArmor\\FrostArmorTarget.mdl"
    set e.sr[4] = 255
    set e.sg[4] = 255
    set e.sb[4] = 255
    set e.ss[4] = 0.18
    //storm
    set e.b[5] = ashbringer_infusion_storm
    set e.a[5] = '@@1@@'
    set e.e[5] = "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl" //Abilities\\Weapons\\Bolt\\BoltImpact.mdl"
    set e.o[5] = "Abilities\\Spells\\Items\\AIlb\\AIlbTarget.mdl"
    set e.m[5] = MOD_DMG_FROM_STORM
    set e.t[5] = AttackType.ENERGY
    set e.s[5] = "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
    set e.sr[5] = 255
    set e.sg[5] = 255
    set e.sb[5] = 255
    set e.ss[5] = 0.32
    //iron
    set e.b[6] = ashbringer_infusion_iron
    set e.a[6] = '@@2@@'
    set e.e[6] = "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"
    set e.o[6] = "Abilities\\Spells\\Items\\OrbSlow\\OrbSlow.mdl"
    set e.m[6] = MOD_DMG_FROM_IRON
    set e.t[6] = AttackType.PHYSICAL
    set e.s[6] = "Objects\\InventoryItems\\PotofGold\\PotofGold.mdl"
    set e.sr[6] = 255
    set e.sg[6] = 255
    set e.sb[6] = 255
    set e.ss[6] = 0.3
    //arcane
    set e.b[7] = ashbringer_infusion_arcane
    set e.a[7] = '@@0@@'
    set e.e[7] = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl"
    set e.o[7] = "Abilities\\Spells\\Items\\AIlb\\AIlbTarget.mdl"
    set e.m[7] = MOD_DMG_FROM_ARCANE
    set e.t[7] = AttackType.MAGIC
    set e.s[7] = "Objects\\InventoryItems\\runicobject\\runicobject.mdl"
    set e.sr[7] = 255
    set e.sg[7] = 255
    set e.sb[7] = 255
    set e.ss[7] = 0.24
    
    
    set tower.userInt = 0
    set tower.userInt2 = e
    set tower.userReal = 0.0
    call UnitAddAbility(tower.getUnit(), e.a[tower.userInt])
    //set fx = Effect.createColored(e.o[tower.userInt], tower.getX(), tower.getY(), 55.0, 270.0, 1.15, 255, 255, 255, 255)
    set tower.userInt3 = 0
    call e.update_sfx(tower, false)
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+15%|r mana regeneration|n|cffffff8010%|r of attack damage dealt as extra |cffFF0080Magic|r damage|nAttacks burn |cffffff8032|r mana on hit, dealing |cffffff80200|r spell damage per point of mana burnt|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.6%|r mana regeneration|n|cffffff80+0.4%|r |cffFF0080Magic|r damage|n|cffffff80+0.32|r mana burnt
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrbofSlowness.blp
                            [Untip] => |cFFFF77FFArcane Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Arcane)
                            [Tip] => |cFFFF77FFArcane Affinity|r
                            [Name] => Arcane Affinity
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+15%|r attack speed|n|cffffff8010%|r of attack damage dealt as extra |cff00ffffEnergy|r damage|n|cffffff8010%|r chance on attack to strike a nearby enemy with lightning, dealing attack damage as |cff00ffffEnergy|r damage|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.6%|r attack speed|n|cffffff80+0.4%|r |cff00ffffEnergy|r damage|n|cffffff80+0.4%|r lightning chance
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrbOfLightning.blp
                            [Untip] => |cFF8080FFStorm Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Storm)
                            [Tip] => |cFF8080FFStorm Affinity|r
                            [Name] => Storm Affinity
                        )

                )

            [2] => Array
                (
                    [id] => @@2@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+40%|r bounty received|n|cffffff8010%|r of attack damage dealt as extra |cffc0c0c0Physical|r damage|nAttacks reduce enemy armor by |cffffff8010%|r for |cffffff805|r seconds|n|n|cffff8000Level Bonus:|r|n|cffffff80+1.6%|r bounty received|n|cffffff80+0.4%|r |cffc0c0c0Physical|r damage|n|cffffff80+0.4%|r armor reduction
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrb.blp
                            [Untip] => |cFFC0C0C0Iron Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Iron)
                            [Tip] => |cFFC0C0C0Iron Affinity|r
                            [Name] => Iron Affinity
                        )

                )

            [3] => Array
                (
                    [id] => @@3@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff8015%|r attack and spell damage|n|cffffff8010%|r of attack damage dealt as extra |cffff8000Elemental|r splash damage in |cffffff80150|r range|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.6%|r attack and spell damage|n|cffffff80+0.4%|r |cffff8000Elemental|r damage|n|cffffff80+2|r splash range
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrbOfFire.blp
                            [Untip] => |cFFFF5300Fire Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Fire)
                            [Tip] => |cFFFF5300Fire Affinity|r
                            [Name] => Fire Affinity
                        )

                )

            [4] => Array
                (
                    [id] => @@4@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+15%|r debuff resistance|n|cffffff8010%|r of attack damage dealt as extra |cffff8000Elemental|r damage|nAttacks slow enemies by |cffffff8015%|r for |cffffff805|r seconds|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.6%|r debuff resistance|n|cffffff80+0.4%|r |cffff8000Elemental|r damage|n|cffffff80+0.6%|r slow
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrbOfFrost.blp
                            [Untip] => |cFF00FFFFIce Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Ice)
                            [Tip] => |cFF00FFFFIce Affinity|r
                            [Name] => Ice Affinity
                        )

                )

            [5] => Array
                (
                    [id] => @@5@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+20%|r buff duration|n|cffffff8010%|r of attack damage dealt as extra |cff808000Decay|r damage|nAttacks cause enemies to take |cffffff8015%|r increased attack and spell damage for |cffffff805|r seconds|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.8%|r buff duration|n|cffffff80+0.4%|r |cff808000Decay|r damage|n|cffffff80+0.6%|r increased damage taken
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrbOfDarkness.blp
                            [Untip] => |cFF8A5300Darkness Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Darkness)
                            [Tip] => |cFF8A5300Darkness Affinity|r
                            [Name] => Darkness Affinity
                        )

                )

            [6] => Array
                (
                    [id] => @@6@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+7.5%|r attack and spell crit chance|n|cffffff8010%|r of attack damage dealt as extra |cffc0c0c0Physical|r damage|nAttacks poison enemies, dealing |cffffff8050%|r of attack damage as |cff80ff00Essence|r damage over |cffffff805|r seconds|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.3%|r attack and spell crit chance|n|cffffff80+0.4%|r |cffc0c0c0Physical|r damage|n|cffffff80+2%|r poison damage
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNOrbOfVenom.blp
                            [Untip] => |cFF80FF00Nature Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Nature)
                            [Tip] => |cFF80FF00Nature Affinity|r
                            [Name] => Nature Affinity
                        )

                )

            [7] => Array
                (
                    [id] => @@7@@
                    [derivedFrom] => Asth
                    [oeValues] => Array
                        (
                            [Ubertip] => |cff0078d7Elemental Infusion Effects:|r|n|cffffff80+15%|r trigger chance|n|cffffff8010%|r of attack damage dealt as extra |cff00ffffEnergy|r damage|n|cffffff802.5%|r chance on kill to give |cffffff801|r xp to nearby towers within |cffffff80450|r range|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.6%|r trigger chance|n|cffffff80+0.4%|r |cff00ffffEnergy|r damage|n|cffffff80+0.1%|r xp chance
                            [Buttonpos] => 1
                            [Art] => ReplaceableTextures\CommandButtons\BTNHolyBolt.blp
                            [Untip] => |cFFFFFF80Celestial Affinity|r
                            [Requires] => Array
                                (
                                )

                            [EditorSuffix] => (Celestial)
                            [Tip] => |cFFFFFF80Celestial Affinity|r
                            [Name] => Celestial Affinity
                        )

                )

        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@8@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Buffubertip] => Increased attack and spell damage taken.
                            [TargetArt] => Abilities\Spells\Items\OrbDarkness\OrbDarkness.mdl
                            [Bufftip] => Malice of Darkness
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfDarkness.blp
                        )

                )

            [1] => Array
                (
                    [id] => @@9@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Takes less damage from towers of the chosen element and more damage from others.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Elemental Attunement
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNDispelMagic.blp
                        )

                )

            [2] => Array
                (
                    [id] => @@10@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with elemental magic.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Elemental Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNElementalConvergence.blp
                        )

                )

            [3] => Array
                (
                    [id] => @@11@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the might of Iron.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Iron Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrb.blp
                        )

                )

            [4] => Array
                (
                    [id] => @@12@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the brilliance of Arcane.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Arcane Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbofSlowness.blp
                        )

                )

            [5] => Array
                (
                    [id] => @@13@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the resilience of Ice.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Ice Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfFrost.blp
                        )

                )

            [6] => Array
                (
                    [id] => @@14@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the wrath of Storm.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Storm Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfLightning.blp
                        )

                )

            [7] => Array
                (
                    [id] => @@15@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the ferocity of Nature.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Nature Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfVenom.blp
                        )

                )

            [8] => Array
                (
                    [id] => @@16@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the fury of Fire.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Fire Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfFire.blp
                        )

                )

            [9] => Array
                (
                    [id] => @@17@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the blessing of Celestial.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Celestial Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNHolyBolt.blp
                        )

                )

            [10] => Array
                (
                    [id] => @@18@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Infused with the malice of Darkness.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Darkness Infusion
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfDarkness.blp
                        )

                )

            [11] => Array
                (
                    [id] => @@19@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Buffubertip] => Reduced movement speed.
                            [TargetArt] => Abilities\Spells\Items\AIob\AIobTarget.mdl
                            [Bufftip] => Resilience of Ice
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfFrost.blp
                        )

                )

            [12] => Array
                (
                    [id] => @@20@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Buffubertip] => Taking Essence damage over time.
                            [TargetArt] => Abilities\Spells\Items\OrbVenom\OrbVenom.mdl
                            [Bufftip] => Ferocity of Nature
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfVenom.blp
                        )

                )

            [13] => Array
                (
                    [id] => @@21@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Buffubertip] => Reduced armor.
                            [TargetArt] => Abilities\Spells\Items\OrbSlow\OrbSlow.mdl
                            [Bufftip] => Might of Iron
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrb.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)