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

            [Art] => ReplaceableTextures\CommandButtons\BTNFlakCannons.blp
            [dmgplus1] => 0
            [bldtm] => 1
            [unitSound] => AmmoDump
            [goldcost] => 150
            [sides1] => 1
            [manaN] => 100
            [acquire] => 850
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Ammo Box
            [impactZ] => 60
            [file] => .mdl
            [MissileHoming] => 1
            [Missilespeed] => 1500
            [dice1] => 1
            [RngBuff1] => 250
            [modelScale] => 0.1
            [rangeN1] => 850
            [propWin] => 10
            [atkType1] => siege
            [cool1] => 1.3
            [Ubertip] => Keep your Iron towers well supplied.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+4 |rmana/lvl
            [abil_factor] => 0
            [author] => Ashbringer, Moppy
            [alpha] => 0
            [authorDisplay] => |cffff6600Ashbringer|r, |c006969FFMoppy|r
            [version] => 1.0
            [element] => iron
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.0783312
                    [y] => 0.000288612
                    [z] => 0
                    [scale] => 0.8
                    [rot] => 4.29351
                    [file] => Doodads\LordaeronSummer\Terrain\Crates\Crates0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 22.5225
                    [y] => 20.7692
                    [z] => 0
                    [scale] => 0.55
                    [rot] => 4.45681
                    [file] => Doodads\LordaeronSummer\Props\Weapons\Weapons.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

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

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Level Up
                    [code] => if tower.userInt == 1 then
        set tower.userReal2 = 55 + (tower.getLevel() * 2)
        set tower.userInt2 = R2I(tower.userReal2)
        call tower.refreshAuras()
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType ashbringer_ammo_buff
    endglobals
    
    function ashbringer_ammo_attack takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Tower buffed = b.getBuffedUnit()
        local real mana_cost = buffed.getBaseAttackspeed()
        local Effect e = tower.userInt3
        
        if tower.userInt == 1 then
            set tower.userReal = tower.userReal - mana_cost
            if tower.userReal <= 0 then
                set tower.userReal = 0
                set tower.userInt = 0
                set tower.userInt2 = 0
                call tower.refreshAuras()
                call e.setColor(255, 255, 255, 255)
            endif
            call SetUnitState(tower.getUnit(), UNIT_STATE_MANA, tower.userReal)
        else
        endif
    endfunction
    
    function ashbringer_ammo_refresh takes Buff b returns nothing
        local Tower tower = b.getCaster()
        
        call b.setPower(tower.userInt2)
    endfunction
    
    //@export
    function ashbringer_ammo_restock takes Tower tower, real stock, real xp returns nothing
        local Effect e = tower.userInt3
        local Playor playa = tower.getOwner()
        
        call e.setColor(255, 255, 255, 0)
        call tower.addExp(xp)
        set tower.userReal = RMinBJ(GetUnitState(tower.getUnit(), UNIT_STATE_MAX_MANA), tower.userReal + stock)
        call SetUnitState(tower.getUnit(), UNIT_STATE_MANA, tower.userReal)
        set tower.userInt = 1
        set tower.userInt2 = R2I(tower.userReal2)
        call tower.refreshAuras()
        call playa.displaySmallFloatingText("+" + I2S(R2I(stock)) + " stock", tower, 255,255,185, 30.0)
    endfunction
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
        local Modifier mod = Modifier.create()
        
        set ashbringer_ammo_buff = BuffType.createAuraEffectType(true)
        call ashbringer_ammo_buff.setBuffIcon('@@0@@')
        call ashbringer_ammo_buff.addEventOnAttack(ashbringer_ammo_attack, 1.0, 0.0)
        call ashbringer_ammo_buff.setEventOnRefresh(ashbringer_ammo_refresh)
        call mod.addModification(MOD_DPS_ADD, 0.0, 1.0)
        call ashbringer_ammo_buff.setBuffModifier(mod)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => On Tower Destruction
                    [code] => local Effect e = tower.userInt3
    
    call e.destroy()
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

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

                    [values] => Array
                        (
                            [AURA_powerAdd] => 0
                            [visible] => true
                            [AURA_auraEffect] => ashbringer_ammo_buff
                            [AURA_levelAdd] => 0
                            [AURA_power] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNHumanArtilleryUpOne.blp
                            [AURA_targetType] => TARGET_TYPE_TOWERS + TARGET_TYPE_ELEMENT_IRON
                            [long_explain] => Mana represents how much stock is available. While there is stock available, increases the attack dps of |cFFC0C0C0Iron|r towers within |cffFFFF80150|r range by |cffFFFF8055|r, but each attack made by an affected tower will drain stock equal to that tower's base attack cooldown.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+2|r attack dps
                            [AURA_targetSelf] => false
                            [name] => Ammo Supply
                            [AURA_level] => 0
                            [short_explain] => Increases attack dps of adjacent |cFFC0C0C0Iron|r towers as long as there is stock available.
                            [AURA_auraRange] => 150
                        )

                )

            [4] => Array
                (
                    [name] => Periodic
                    [code] => call ashbringer_ammo_restock(tower, 40 + (tower.getLevel() * 1), 2)
                    [values] => Array
                        (
                            [visible] => true
                            [PERIODIC_period] => 20
                            [icon] => ReplaceableTextures\CommandButtons\BTNEngineeringUpgrade.blp
                            [name] => Logistics
                            [short_explain] => Gains stock and experience every |cffFFFF8020|r seconds.
                            [long_explain] => Every |cffFFFF8020|r seconds, the tower gains |cffFFFF8040|r stock and |cffFFFF802|r experience.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1|r stock
                        )

                )

            [5] => Array
                (
                    [name] => On Tower Creation
                    [code] => local Effect e = Effect.createColored("Abilities\\Spells\\Orc\\StasisTrap\\StasisTotemTarget.mdl", tower.getX(), tower.getY(), 80, 270, 1.4, 255, 255, 255, 0)
    set tower.userInt3 = e
    set tower.userInt = 1
    call tower.addManaPerc(1)
    set tower.userReal = GetUnitState(tower.getUnit(), UNIT_STATE_MANA)
    set tower.userReal2 = 55 + (tower.getLevel() * 2)
    set tower.userInt2 = R2I(tower.userReal2)
    call tower.refreshAuras()
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BNrd
                    [oeValues] => Array
                        (
                            [Buffubertip] => Increased attack dps.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Ammo Supply
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNHumanArtilleryUpOne.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
            [0] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_ammo_buff
                )

        )

    [lightning] => Array
        (
        )

)