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

            [Art] => ReplaceableTextures\CommandButtons\BTNSylvanusWindrunner.blp
            [turnRate] => 3
            [dmgplus1] => 1976
            [bldtm] => 1
            [goldcost] => 3600
            [unitSound] => Sylvanus
            [sides1] => 1
            [Missilearc] => 0.15
            [acquire] => 1300
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Stormbringer
            [weapTp1] => missile
            [impactZ] => 60
            [file] => units\creeps\SylvanusWindrunner\SylvanusWindrunner.mdl
            [Missileart] => war3mapImported\LightningArrow1.mdl
            [Missilespeed] => 1600
            [dice1] => 1
            [RngBuff1] => 250
            [modelScale] => 0.65
            [rangeN1] => 1300
            [atkType1] => normal
            [cool1] => 1.5
            [Ubertip] => She brings... the storm.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [moveHeight] => 110
            [customTeamColor] => 1
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
            [teamColor] => 1
            [castpt] => 0.3
        )

    [settings] => Array
        (
            [balanceTip] => Array
                (
                )

            [abil_factor] => 0.4
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => storm
            [rarity] => unique
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.437306
                    [y] => 1.6872
                    [z] => 0
                    [scale] => 0.7
                    [rot] => 2.11993
                    [file] => buildings\human\HumanTower\HumanTower.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => true
                    [animation] => stand ready attack
                    [aniSpeed] => 50
                    [pcolor] => 2
                )

            [1] => Array
                (
                    [x] => 47.8529
                    [y] => -47.12
                    [z] => -6.4
                    [scale] => 0.35
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -0.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -48.2475
                    [y] => -47.805
                    [z] => -6.4
                    [scale] => 0.35
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -0.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 47.8542
                    [y] => 48.4574
                    [z] => -6.4
                    [scale] => 0.35
                    [rot] => 3.92699
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -0.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -48.0666
                    [y] => 48.3903
                    [z] => -6.4
                    [scale] => 0.35
                    [rot] => 5.49779
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -0.15
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => 36.0364
                    [y] => 36.0638
                    [z] => 102.4
                    [scale] => 0.3
                    [rot] => 3.92653
                    [file] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => -36.2456
                    [y] => -36.4579
                    [z] => 102.4
                    [scale] => 0.3
                    [rot] => 0.789169
                    [file] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => -38.6649
                    [y] => 35.3136
                    [z] => 102.4
                    [scale] => 0.3
                    [rot] => 5.53847
                    [file] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => 38.3453
                    [y] => -35.4831
                    [z] => 102.4
                    [scale] => 0.3
                    [rot] => 2.39954
                    [file] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => -0.691162
                    [y] => 24.289
                    [z] => -6.4
                    [scale] => 1
                    [rot] => 4.56384
                    [file] => Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => 0.143524
                    [y] => -29.0105
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => -0.484511
                    [y] => 28.8397
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -29.0587
                    [y] => -0.351645
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => 28.7915
                    [y] => 0.276391
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => -38.3375
                    [y] => -48.4563
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => -19.336
                    [y] => -48.4562
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => -0.334565
                    [y] => -48.4562
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => 18.6669
                    [y] => -48.4562
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => 37.7419
                    [y] => -48.4514
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => 0.291596
                    [y] => -27.9119
                    [z] => 44.8
                    [scale] => 0.14
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [20] => Array
                (
                    [x] => -0.33644
                    [y] => 29.9382
                    [z] => 44.8
                    [scale] => 0.14
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [21] => Array
                (
                    [x] => -28.9106
                    [y] => 0.746937
                    [z] => 44.8
                    [scale] => 0.14
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [22] => Array
                (
                    [x] => 28.9395
                    [y] => 1.37497
                    [z] => 44.8
                    [scale] => 0.14
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -5.2
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [23] => Array
                (
                    [x] => -37.83
                    [y] => 46.6674
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [24] => Array
                (
                    [x] => 47.4692
                    [y] => 38.2266
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [25] => Array
                (
                    [x] => 47.4692
                    [y] => 19.2251
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [26] => Array
                (
                    [x] => 47.4692
                    [y] => 0.223663
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [27] => Array
                (
                    [x] => 47.4692
                    [y] => -18.7778
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [28] => Array
                (
                    [x] => 47.4741
                    [y] => -37.8528
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [29] => Array
                (
                    [x] => -48.213
                    [y] => 38.4941
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [30] => Array
                (
                    [x] => -48.2129
                    [y] => 19.4927
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [31] => Array
                (
                    [x] => -48.2129
                    [y] => 0.491227
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [32] => Array
                (
                    [x] => -48.2129
                    [y] => -18.5102
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [33] => Array
                (
                    [x] => -48.2081
                    [y] => -37.5853
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 0.000000119209
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [34] => Array
                (
                    [x] => -18.7549
                    [y] => 46.6723
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [35] => Array
                (
                    [x] => 0.246508
                    [y] => 46.6723
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [36] => Array
                (
                    [x] => 19.248
                    [y] => 46.6723
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [37] => Array
                (
                    [x] => 38.2494
                    [y] => 46.6723
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [38] => Array
                (
                    [x] => -0.103183
                    [y] => -5.96337
                    [z] => 25.6
                    [scale] => 0.85
                    [rot] => 1.63091
                    [file] => Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [39] => Array
                (
                    [x] => -19.2633
                    [y] => -4.59355
                    [z] => -25.6
                    [scale] => 1
                    [rot] => 5.64686
                    [file] => Abilities\Spells\Orc\Purge\PurgeBuffTarget.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] => On Attack
                    [code] => local Buff b = tower.getBuffOfType(ashbringer_arrowstorm_buff)
    local Creep next
    local Creep target = Event.getTarget()
    
    set tower.userInt2 = target
    
    if tower.calcChance(0.1 + (tower.getLevel() * 0.004)) then
        if b == 0 then
            set b = ashbringer_arrowstorm_buff.apply(tower, tower, 0)
        endif
        set tower.userInt = tower.userInt + 3 + ((tower.getLevel() - ModuloInteger(tower.getLevel(), 10)) / 10)
    endif
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNThunderArrow.blp
                            [name] => Arrowstorm
                            [short_explain] => Attacks have a chance to unleash a barrage of arrows.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => Attacks have a |cffffff8010%|r chance to grant |cffffff803|r charges of Arrowstorm. As long as the tower has charges, it will rapidly fire additional arrows at random enemies within |cffffff80350|r range of the last attacked enemy and consumes |cffffff801|r charge per arrow. Each additional arrow has a |cffffff801%|r chance per stored charge to fire another. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.4%|r chance|n|cffFFFF80+1|r charge every |cffffff8010|r levels
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType ashbringer_arrowstorm_buff
        BuffType ashbringer_beacon_buff
    
        ProjectileType ashbringer_arrowstorm_missile
        
        MultiboardValues ashbringer_arrowstorm_count
    endglobals
    
    struct Beacons
        integer max
        Effect array e[3]
        boolean array b[3]
        real array x[3]
        real array y[3]
    endstruct
    
    function ashbringer_calc_surestrike takes Tower tower, Creep c, real damage, boolean is_already_dealt returns real
        local real armor_perc = 0.25 + (tower.getLevel() * 0.01)
        local real damage_perc = 0.25 + (tower.getLevel() * 0.01)
        local Buff b = c.getBuffOfType(ashbringer_beacon_buff)
        local real armor_reduction = c.getCurrentArmorDamageReduction()
        local real armor_inverse = 1 / (1 - armor_reduction)
        
        if b != 0 then
            set armor_perc = armor_perc * 2
            set damage_perc = damage_perc * 2
        endif
        
        set damage = ((damage * armor_perc) / AttackType.ENERGY.getDamageAgainst(c.getArmorType())) + (damage * (1 - armor_perc))
        
        if is_already_dealt then
            set damage = damage * armor_inverse
        endif
        
        set damage = ((damage * armor_perc) * armor_inverse) + (damage * (1 - armor_perc))
        set damage = damage * (1 + damage_perc)
        
        return damage
    endfunction
    
    function ashbringer_update_surestrikes takes Tower tower returns nothing
        local real bonus
    
        set bonus = tower.getProp_Attackspeed() + tower.userReal
        set bonus = (bonus * 0.5) - tower.userReal
        set tower.userReal = bonus + tower.userReal
        if bonus!=0 then
            call tower.modifyProperty(MOD_ATTACKSPEED, -bonus)
        endif
    endfunction
    
    function ashbringer_arrowstorm_fire takes Tower t, Creep c returns nothing
        local Buff b
        local Projectile p
        local real direction
        
        if t.userInt > 0 then
            set p = Projectile.createLinearInterpolationFromPointToUnit(ashbringer_arrowstorm_missile, t, 0.0, 0.0, t.getX(), t.getY(), 170, c, 0.15, true)
            //set p = Projectile.createFromPointToUnit(ashbringer_arrowstorm_missile, t, 0.0, 0.0, t.getX(), t.getY(), 170.0, c, true, false, true)
            set p.userInt = c.getUID()
            set t.userInt = t.userInt - 1
            //set direction = GetUnitFacing(t.getUnit()) + 180
            //if direction > 359 then
            //    set direction = direction - 360
            //endif
            //set p.direction = GetUnitFacing(t.getUnit())
            
            if t.userInt < 1 then
                set b = t.getBuffOfType(ashbringer_arrowstorm_buff)
                if b != 0 then
                    call b.removeBuff()
                endif
            endif
        endif
    endfunction
    
    function ashbringer_arrowstorm_hit takes Projectile p, Creep c returns nothing 
        local Tower tower = p.getCaster()
        
        if p.userInt == c.getUID() then
            call tower.doAttackDamage(c, ashbringer_calc_surestrike(tower, c, tower.getCurrentAttackDamageWithBonus(), false), tower.calcAttackMulticrit(0, 0, 0))
            
            if tower.calcChance(0.01 * (tower.userInt * 1.0)) and p.userInt == c.getUID() then
                call ashbringer_arrowstorm_fire(tower, c)
            endif
        endif
    endfunction
    
    function ashbringer_arrowstorm_periodic takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        local Creep target = tower.userInt2
        local Iterate i
        local Creep next
        local real distance
        
        if target.getUID() > 0 and tower.isStunned() == false and tower.userInt > 0 then 
            set distance = DistanceBetweenPoints(GetUnitLoc(tower.getUnit()), GetUnitLoc(target.getUnit()))
            if distance < tower.getRange() then
                set i = Iterate.overUnitsInRangeOfUnit(tower, TARGET_TYPE_CREEPS, target, 350)
                set next = i.nextRandom()
                call ashbringer_arrowstorm_fire(tower, next)
                set next = i.nextRandom()
                if next != 0 then
                    call i.destroy()
                endif
            else
                set tower.userInt2 = 0
            endif
        endif
    endfunction
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
        set ashbringer_arrowstorm_missile = ProjectileType.createInterpolate("war3mapImported\\LightningArrow1.mdx", 1600)
        call ashbringer_arrowstorm_missile.enableHoming(ashbringer_arrowstorm_hit, 0)
        
        set ashbringer_arrowstorm_buff = BuffType.createAuraEffectType(true)
        call ashbringer_arrowstorm_buff.setBuffIcon('@@0@@')
        call ashbringer_arrowstorm_buff.addPeriodicEvent(ashbringer_arrowstorm_periodic, 0.5)
        
        set ashbringer_beacon_buff = BuffType.create(1.1, 0.0, false)
        call ashbringer_beacon_buff.setBuffIcon('@@1@@')
        
        set ashbringer_arrowstorm_count = MultiboardValues.create(1)  
        call ashbringer_arrowstorm_count.setKey(0, "Arrow Storm Charges") 
    endfunction
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNImprovedStrengthOfTheMoon.blp
                            [name] => Sure Strikes
                            [short_explain] => This tower deals more damage and ignores armor but gains half attack speed stats.
                            [long_explain] => Attacks and Arrow Storm deal |cffffff8025%|r more damage and ignore |cffffff8025%|r of the enemy's armor and armor type. However, the tower's attack speed is halved.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1%|r damage multiplier|n|cffFFFF80+1%|r armor ignore
                        )

                )

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

                        )

                )

            [3] => Array
                (
                    [name] => On Tower Destruction
                    [code] => local Beacons be = tower.userInt3
    local integer count = 1
    
    loop
        set count = count - 1
        if be.b[count] == true then
            call be.e[count].destroy()
        endif
        
        exitwhen count==0
    endloop
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [4] => Array
                (
                    [name] => On Damage
                    [code] => set Event.damage = ashbringer_calc_surestrike(tower, Event.getTarget(), Event.damage, true)
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [ONDAMAGE_chanceLevelAdd] => 0.0
                            [long_explain] => 
                        )

                )

            [5] => Array
                (
                    [name] => Periodic
                    [code] => local Beacons be = tower.userInt3
    local Iterate i
    local integer count = 0
    local integer max_beacons = 1
    local real damage = tower.getCurrentAttackDamageWithBonus() * (1.0 + (tower.getLevel() * 0.04))
    local Creep next
    
    call ashbringer_update_surestrikes(tower)
    
    loop
        if be.b[count] == true then
            set i = Iterate.overUnitsInRange(tower, TARGET_TYPE_CREEPS, be.x[count], be.y[count], 250)
            loop
                set next = i.next()
                exitwhen next == 0
                if next.getUID() != 0 then
                    call Effect.createSimpleAtUnit("Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl", next).setLifetime(3.0)
                    call tower.doAttackDamage(next, damage*2, tower.calcAttackCritNoBonus())
                    call ashbringer_beacon_buff.apply(tower, next, 0)
                endif
            endloop
            //call i.destroy()
        endif
        
        set count = count + 1
        exitwhen count==max_beacons
    endloop
                    [values] => Array
                        (
                            [visible] => false
                            [PERIODIC_period] => 1.0
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [6] => Array
                (
                    [name] => Autocast
                    [code] => local Beacons be = tower.userInt3
    local real target_x = GetSpellTargetX()
    local real target_y = GetSpellTargetY()
    local real dist1
    local real dist2 = 0
    local integer subcount
    local integer max_beacons = 1
    local integer count = 0
    local integer sel = max_beacons + 1
    
    loop
        if be.b[count]==false then
            set be.b[count] = true
            set be.e[count] = Effect.createAnimatedScaled("Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl", target_x, target_y, 40.0, 0.0, 1.0)
            //call ma.e[count].setAnimationSpeed(2.0)
           // call ma.e[count].setScale(2.0)
            set be.x[count] = target_x
            set be.y[count] = target_y
            set be.max = count
            
            set sel = count
            set count = max_beacons
        else
        endif
        set count = count + 1
        
        exitwhen count>=max_beacons
    endloop
    
    if sel>max_beacons then
        set count = 0
        call be.e[0].destroy()
        loop
            if count<(max_beacons-1) then
                set be.b[count] = be.b[count+1]
                set be.e[count] = be.e[count+1]
                set be.x[count] = be.x[count+1]
                set be.y[count] = be.y[count+1]
            endif
            set count = count + 1
            
            exitwhen count==max_beacons
        endloop
        
        set be.b[max_beacons-1] = true
        set be.e[max_beacons-1] = Effect.createAnimatedScaled("Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl", target_x, target_y, 40.0, 0.0, 1.0)
        //call ma.e[max_mach-1].setAnimationSpeed(2.0)
        //call ma.e[max_mach-1].setScale(2.0)
        set be.x[max_beacons-1] = target_x
        set be.y[max_beacons-1] = target_y
        
        set sel = 0
    endif
    
    //set tower.userInt3 = ma
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 60
                            [AUTOCAST_autoRange] => 0
                            [AUTOCAST_manacost] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNMonsoon.blp
                            [AUTOCAST_range] => 1100
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Summon a Storm Beacon at the target location. Storm Beacon deals |cffffff80100%|r of attack damage to enemies within |cffffff80250|r range every |cffffff801|r second and doubles effect of Sure Strikes on them for |cffffff801|r second. The Storm Beacon lasts indefinitely but is limited to |cffffff801|r.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+4%|r damage
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_NOAC_POINT
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => true
                            [name] => Storm Beacon
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Place a permanent beacon which damages enemies near it.
                        )

                )

            [7] => Array
                (
                    [name] => On Tower Creation
                    [code] => local Beacons be = Beacons.create()
    local integer count = 0
    
    set tower.userInt = 0
    set tower.userInt2 = 0
    set tower.userReal2 = I2R(tower.getUID())
    set be.max = 1 + 1
    
    loop
        set be.e[count] = 0
        set be.b[count] = false
        set count = count + 1
        exitwhen count==3
    endloop
    set tower.userInt3 = be
    set tower.userReal = 0
    call SetUnitColor(tower.getUnit(), ConvertPlayerColor(1))
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => weapon
                            [Buffubertip] => Attacks additional enemies.
                            [TargetArt] => Abilities\Spells\Items\AIlb\AIlbTarget.mdl
                            [Bufftip] => Arrow Storm
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNThunderArrow.blp
                        )

                )

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

                            [TargetArt] => Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl
                            [Bufftip] => Storm Beacon
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNMonsoon.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)