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

            [Art] => ReplaceableTextures\CommandButtons\BTNWorkshop.blp
            [turnRate] => 3
            [dmgplus1] => 3587
            [bldtm] => 1
            [goldcost] => 750
            [sides1] => 1
            [maxPitch] => -50
            [launchZ] => 40
            [acquire] => 1000
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Flak Cannon MK1
            [red] => 80
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => war3mapImported\Square_Column.mdl
            [Missilespeed] => 1500
            [Missileart] => Abilities\Spells\Other\TinkerRocket\TinkerRocketMissile.mdl
            [dice1] => 1
            [RngBuff1] => 250
            [green] => 80
            [modelScale] => 0.2
            [rangeN1] => 1000
            [atkType1] => hero
            [cool1] => 2
            [Ubertip] => Designed to politely ask aircraft to leave the airspace. If they refuse, it escalates the conversation violently.
            [blue] => 80
            [abilList] => Array
                (
                )

            [moveHeight] => 30
            [buildingShadow] => Array
                (
                )

            [targs1] => air
            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFF0000Attacks AIR only|r
            [abil_factor] => 0.55
            [author] => Moppy
            [alpha] => 255
            [authorDisplay] => |c006969FFMoppy|r
            [version] => 1.0
            [element] => iron
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 62.3509
                    [y] => 0.187883
                    [z] => 0
                    [scale] => 0.3
                    [rot] => 3.14159
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 80
                    [green] => 80
                    [blue] => 80
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 0.056553
                    [y] => 62.8296
                    [z] => 0
                    [scale] => 0.3
                    [rot] => 4.71239
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 80
                    [green] => 80
                    [blue] => 80
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => 0.899674
                    [y] => 16.917
                    [z] => 0
                    [scale] => 0.12
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 90
                    [green] => 90
                    [blue] => 90
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -0.0719986
                    [y] => -16.9423
                    [z] => 0
                    [scale] => 0.12
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 90
                    [green] => 90
                    [blue] => 90
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => 0.443054
                    [y] => -0.0952911
                    [z] => -6.4
                    [scale] => 0.375
                    [rot] => 2.87979
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => 0.497696
                    [y] => 0.31398
                    [z] => -6.4
                    [scale] => 0.375
                    [rot] => 3.27249
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 0.631424
                    [y] => -0.243866
                    [z] => -6.4
                    [scale] => 0.375
                    [rot] => 2.48709
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 0.458237
                    [y] => 0.0655212
                    [z] => -6.4
                    [scale] => 0.375
                    [rot] => 3.66519
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => 0.202713
                    [y] => 0.489563
                    [z] => 25.6
                    [scale] => 0.225
                    [rot] => 2.87979
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => 0.25737
                    [y] => 0.898834
                    [z] => 25.6
                    [scale] => 0.225
                    [rot] => 3.27249
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => 0.391098
                    [y] => 0.340973
                    [z] => 25.6
                    [scale] => 0.225
                    [rot] => 2.48709
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 0.217911
                    [y] => 0.650375
                    [z] => 25.6
                    [scale] => 0.225
                    [rot] => 3.66519
                    [file] => Abilities\Spells\Orc\ReinforcedTrollBurrow\ReinforcedTrollBurrowTarget.mdl
                    [red] => 70
                    [green] => 70
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -26.9608
                    [y] => 39.641
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 5.49779
                    [file] => Doodads\Cityscape\Props\EmptyCrates\EmptyCrates0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => 0.0759429
                    [y] => -11.0562
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 90
                    [green] => 90
                    [blue] => 90
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => 0.649727
                    [y] => 11.665
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 90
                    [green] => 90
                    [blue] => 90
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => 49.6044
                    [y] => -28.3899
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 0.872665
                    [file] => Doodads\Cityscape\Props\EmptyCrates\EmptyCrates0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => -43.5933
                    [y] => -17.5622
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Props\EmptyCrates\EmptyCrates2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => 0.534888
                    [y] => 1.0543
                    [z] => 12.8
                    [scale] => 0.25
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Props\CrystalLamp\CrystalLamp.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => 36.9483
                    [y] => -32.5551
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 4.18879
                    [file] => Buildings\Other\BarrelsUnit1\BarrelsUnit1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => -50.9461
                    [y] => 35.7003
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 4.71239
                    [file] => Buildings\Other\BarrelsUnit0\BarrelsUnit0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [20] => Array
                (
                    [x] => 18.7335
                    [y] => 45.624
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 4.71239
                    [file] => Buildings\Other\BarrelsUnit0\BarrelsUnit0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [21] => Array
                (
                    [x] => 30.7891
                    [y] => 37.3848
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 5.23599
                    [file] => Buildings\Other\BarrelsUnit0\BarrelsUnit0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [22] => Array
                (
                    [x] => 24.5953
                    [y] => 42.3587
                    [z] => 12.8
                    [scale] => 0.25
                    [rot] => 1.74533
                    [file] => Buildings\Other\BarrelsUnit0\BarrelsUnit0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [23] => Array
                (
                    [x] => -45.2737
                    [y] => 19.3025
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 3.83973
                    [file] => Buildings\Other\BarrelsUnit1\BarrelsUnit1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType moppy_aads_aura
        ProjectileType moppy_adds_shot
    endglobals
    
    function moppy_adds_projectile takes Projectile p, Unit c returns nothing
        local Tower t = p.getCaster()
        call t.doAttackDamage(c, t.getCurrentAttackDamageWithBonus(), t.calcAttackMulticrit(0.0, 0.0, 0))
    endfunction
    
    function moppy_adds_projectile_create takes Buff b returns nothing
        local Tower t = b.getCaster()
        local Tower a = b.getBuffedUnit()
        local Unit c = Event.getTarget()
        local real angle
        local Projectile p
        
        set angle = AngleBetweenPoints(GetUnitLoc(t.getUnit()), GetUnitLoc(c.getUnit()))
        
        if a != t then
            if c.getSize() == SIZE_AIR then
                if a.calcChance(a.getBaseAttackspeed() * (t.userReal + t.userReal2 * t.getLevel())) then
                    set p = Projectile.createFromPointToUnit(moppy_adds_shot, t, 1, 0, t.getX() + 6 * Cos(angle * bj_DEGTORAD), t.getY() + 6 * Sin(angle * bj_DEGTORAD), 40, c, true, false, false)
                    set p.direction = angle
                    call p.setScale(0.2)
                endif
            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 m = Modifier.create()
        
        set moppy_aads_aura = BuffType.createAuraEffectType(true)        
        call m.addModification(MOD_DMG_TO_AIR, 0.0, 0.001)
        call moppy_aads_aura.setBuffModifier(m)
        call moppy_aads_aura.setBuffIcon('@@0@@')

        set moppy_adds_shot = ProjectileType.create("Abilities\\Spells\\Other\\TinkerRocket\\TinkerRocketMissile.mdl", 4, 1500)
        call moppy_adds_shot.enableHoming(moppy_adds_projectile, 0.0)        
        call moppy_aads_aura.addEventOnAttack(EventHandler.moppy_adds_projectile_create, 1.0, 0.0)
	endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

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

                    [values] => Array
                        (
                            [AURA_powerAdd] => 4
                            [visible] => true
                            [AURA_auraEffect] => moppy_aads_aura
                            [AURA_levelAdd] => 4
                            [AURA_power] => 200
                            [icon] => ReplaceableTextures\CommandButtons\BTNClusterRockets.blp
                            [AURA_targetType] => TARGET_TYPE_TOWERS
                            [long_explain] => Increases damage against Air of towers in |cffFFFF80200|r range by |cffFFFF8020%|r. When another tower in range attacks, it has a |cffFFFF805%|r attack speed adjusted chance to command the Flak Cannon to fire an additional projectile at that tower's target.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.4%|r damage against Air|n|cffFFFF80+0.1%|r chance
                            [AURA_targetSelf] => true
                            [name] => Anti-Aircraft Defense System
                            [AURA_level] => 200
                            [short_explain] => Increases damage against Air of nearby towers. When another tower in range attacks, it has a chance to command the Flak Cannon to fire an additional projectile at that tower's target.
                            [AURA_auraRange] => 200
                        )

                )

            [2] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userReal = 0.05
    set tower.userReal2 = 0.001
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

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

                            [EditorName] => Anti-Aircraft Defense System
                            [Buffubertip] => Damage against Air increased. Each other tower has a chance on attack to command the Flak Cannon to fire an additional projectile at its respective target.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Anti-Aircraft Defense System
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNClusterRockets.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

    [lightning] => Array
        (
        )

)