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

            [Art] => ReplaceableTextures\CommandButtons\BTNrune1.blp
            [dmgplus1] => 732
            [bldtm] => 1
            [goldcost] => 1050
            [unitSound] => ArcaneVault
            [sides1] => 1
            [manaN] => 90
            [acquire] => 900
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Rune Forge
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => .mdl
            [uberSplat] => YTDG
            [Missileart] => Abilities\Weapons\GryphonRiderMissile\GryphonRiderMissile.mdl
            [Missilespeed] => 1300
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 2
            [rangeN1] => 850
            [atkType1] => magic
            [cool1] => 1.7
            [Ubertip] => Why seek power when you can forge it?
            [scaleBull] => 0
            [abilList] => Array
                (
                )

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

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

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

            [abil_factor] => 0.35
            [author] => Ashbringer
            [alpha] => 0
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.119479
                    [y] => 15.051
                    [z] => -12.8
                    [scale] => 0.1
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -0.297162
                    [y] => -13.2934
                    [z] => -12.8
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.317145
                    [y] => 47.8938
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

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

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

            [4] => Array
                (
                    [x] => 48.393
                    [y] => 0.358846
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -48.1252
                    [y] => -0.017359
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => -35.4847
                    [y] => 35.3982
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 35.2692
                    [y] => 35.4577
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => 35.3192
                    [y] => -35.4309
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => -35.3883
                    [y] => -35.3475
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -0.283621
                    [y] => -15.5674
                    [z] => -19.2
                    [scale] => 0.11
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 0.0637681
                    [y] => 15.7368
                    [z] => -19.2
                    [scale] => 0.11
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -0.0205553
                    [y] => -0.0765017
                    [z] => 25.6
                    [scale] => 0.7
                    [rot] => 4.17134
                    [file] => Objects\InventoryItems\runicobject\runicobject.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => 40.6979
                    [y] => -42.8904
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => 0.0165444
                    [y] => 0.0152347
                    [z] => 0
                    [scale] => 0.275
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => -0.332223
                    [y] => -57.0002
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => 0.0149856
                    [y] => 55.4343
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => 40.6216
                    [y] => 41.5297
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 3.92699
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [18] => Array
                (
                    [x] => 55.2741
                    [y] => -0.457254
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [19] => Array
                (
                    [x] => -42.4704
                    [y] => -42.801
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [20] => Array
                (
                    [x] => -59.0961
                    [y] => 0.521562
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [21] => Array
                (
                    [x] => -43.1839
                    [y] => 41.2634
                    [z] => -6.4
                    [scale] => 0.05
                    [rot] => 5.49779
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 75
                    [green] => 25
                    [blue] => 75
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [22] => Array
                (
                    [x] => 48.4676
                    [y] => 0.128628
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [23] => Array
                (
                    [x] => -48.6693
                    [y] => 0.242325
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 0
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [24] => Array
                (
                    [x] => -35.2981
                    [y] => -35.7355
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [25] => Array
                (
                    [x] => 0.138769
                    [y] => -48.7467
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [26] => Array
                (
                    [x] => -35.4346
                    [y] => 35.2238
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 5.49779
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [27] => Array
                (
                    [x] => 35.1896
                    [y] => -35.3442
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 2.3562
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [28] => Array
                (
                    [x] => -0.172747
                    [y] => 48.358
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [29] => Array
                (
                    [x] => 35.5835
                    [y] => 35.8211
                    [z] => 0
                    [scale] => 0.08
                    [rot] => 3.92699
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [30] => Array
                (
                    [x] => -0.476767
                    [y] => -19.7452
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [31] => Array
                (
                    [x] => -0.248533
                    [y] => 20.4806
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [32] => Array
                (
                    [x] => 19.3151
                    [y] => 0.405576
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [33] => Array
                (
                    [x] => -20.1857
                    [y] => 0.265953
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [34] => Array
                (
                    [x] => -14.0006
                    [y] => 13.3572
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [35] => Array
                (
                    [x] => 13.8215
                    [y] => 13.6194
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [36] => Array
                (
                    [x] => 12.4299
                    [y] => -14.6352
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [37] => Array
                (
                    [x] => -14.5308
                    [y] => -13.4646
                    [z] => 25.6
                    [scale] => 0.08
                    [rot] => 0.785398
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [38] => Array
                (
                    [x] => 0.491602
                    [y] => 9.23117
                    [z] => -6.4
                    [scale] => 0.07
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [39] => Array
                (
                    [x] => -0.521871
                    [y] => -9.39321
                    [z] => -6.4
                    [scale] => 0.07
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local Runes r = tower.userInt3
    local real charge = 10 + (tower.getLevel() * 0.4)
    
    call r.add_random_charge(tower, charge)
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNrune1.blp
                            [name] => Runic Focus
                            [short_explain] => Chance on attack to generate charge.
                            [ONATTACK_chance] => 0.15
                            [ONATTACK_chanceLevelAdd] => 0.006
                            [long_explain] => Attacks have a |cffffff8015%|r chance to generate |cffffff8010|r charge for a random rune. Runes are considered charged when they have at least |cffffff80100|r charge and charge cannot exceed |cffffff80200|r.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6%|r chance|n|cffFFFF80+0.4|r charge generated
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType ashbringer_rune_atkdmg
        //@export
        BuffType ashbringer_rune_atkspd
        //@export
        BuffType ashbringer_rune_trig
        //@export
        BuffType ashbringer_rune_mana
        //@export
        BuffType ashbringer_rune_itmch
        //@export
        BuffType ashbringer_rune_crtdmg
        //@export
        BuffType ashbringer_rune_buffdur
        //@export
        BuffType ashbringer_rune_crtch
        
        //MultiboardValues ashbringer_rune_mb
    endglobals
    
    //@export
    struct Runes
        string array rune_model[11]
        integer array base_r[8]
        integer array base_g[8]
        integer array base_b[8]
        integer array bufftype[8]
        integer array current[8]
        real array charge[8]
        Effect array rune_fx[8]
        Effect array base_fx[8]
        integer array empty[8]
        integer array shuffled[8]
        
        method shuffle takes nothing returns nothing
            local integer i = 0
            local integer random
            local integer temp
            
            loop
                exitwhen i > 7
                set random = GetRandomInt(0, 7)
                if random != i then
                    set temp = shuffled[i]
                    set shuffled[i] = shuffled[random]
                    set shuffled[random] = temp
                    set i = i + 1
                endif
            endloop
        endmethod
        
        method setup takes Tower t returns nothing
            local integer i = 0
            local real angle = 0
            local real x = t.getX()
            local real y = t.getY()
            local real tx
            local real ty
            local real fade
    
            set .rune_model[0] = "war3mapImported\\GlowingRunes0_np.mdx"
            set .base_r[0] = 255
            set .base_g[0] = 0
            set .base_b[0] = 0
            set .bufftype[0] = ashbringer_rune_atkdmg
            set .current[0] = 0
            
            set .rune_model[1] = "war3mapImported\\GlowingRunes1_np.mdx"
            set .base_r[1] = 0
            set .base_g[1] = 255
            set .base_b[1] = 255
            set .bufftype[1] = ashbringer_rune_atkspd
            set .current[1] = 1
            
            set .rune_model[2] = "war3mapImported\\GlowingRunes3_np.mdx"
            set .base_r[2] = 255
            set .base_g[2] = 255
            set .base_b[2] = 0
            set .bufftype[2] = ashbringer_rune_trig
            set .current[2] = 2
            
            set .rune_model[3] = "war3mapImported\\GlowingRunes4_np.mdx"
            set .base_r[3] = 175
            set .base_g[3] = 175
            set .base_b[3] = 255
            set .bufftype[3] = ashbringer_rune_mana
            set .current[3] = 3
            
            set .rune_model[4] = "war3mapImported\\GlowingRunes5_np.mdx"
            set .base_r[4] = 255
            set .base_g[4] = 85
            set .base_b[4] = 185
            set .bufftype[4] = ashbringer_rune_itmch
            set .current[4] = 4
            
            set .rune_model[5] = "war3mapImported\\GlowingRunes6_np.mdx"
            set .base_r[5] = 0
            set .base_g[5] = 255
            set .base_b[5] = 0
            set .bufftype[5] = ashbringer_rune_crtdmg
            set .current[5] = 5
            
            set .rune_model[6] = "war3mapImported\\GlowingRunes7_np.mdx"
            set .base_r[6] = 135
            set .base_g[6] = 35
            set .base_b[6] = 255
            set .bufftype[6] = ashbringer_rune_buffdur
            set .current[6] = 6
            
            set .rune_model[7] = "war3mapImported\\GlowingRunes8_np.mdx"
            set .base_r[7] = 255
            set .base_g[7] = 115
            set .base_b[7] = 0
            set .bufftype[7] = ashbringer_rune_crtch
            set .current[7] = 7
            
            set .rune_model[8] = "Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl"
            set .rune_model[9] = "Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl"
            set .rune_model[10] = "Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl"
            
            loop
                exitwhen i > 7
                
                set .charge[i] = 0
                set angle = i * 45
                set tx = x + 48 * Cos(Deg2Rad(angle))
                set ty = y + 48 * Sin(Deg2Rad(angle))
                set fade = RMinBJ(155.0 * (.charge[i] / 100.0), 155.0) + 100.0
                set shuffled[i] = i
                
                set .rune_fx[i] = Effect.createColored(.rune_model[.current[i]], tx, ty, 25, ModuloReal(angle+180, 360), 0.45, 255, 255, 255, R2I(fade))
                set .base_fx[i] = Effect.createColored("Abilities\\Spells\\Undead\\UndeadMine\\UndeadMineCircle.mdl", tx, ty, 20, angle, 0.37, .base_r[i], .base_g[i], .base_b[i], 255)
                
                call .base_fx[i].setFacing(angle)
                
                set i = i + 1
            endloop
        endmethod
        
        method update_rune takes integer i returns nothing
            local real fade = RMinBJ(155.0 * (.charge[i] / 100.0), 155.0) + 100
            if .rune_fx[i] != 0 then
                call .rune_fx[i].setColor(255, 255, 255, R2I(fade))
            endif
        endmethod
        
        method activate_rune takes integer i, real x, real y, integer fx returns nothing
            local real angle = 0
            local real tx
            local real ty
            
            set angle = i * 45
            set tx = x + 46 * Cos(Deg2Rad(angle))
            set ty = y + 46 * Sin(Deg2Rad(angle))
            if fx == 1 then
                call Effect.createScaled("Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl", tx, ty, 25, 270, 0.3).setLifetime(1.0)
            else
                call Effect.createScaled("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", tx, ty, 25, 270, 0.3).setLifetime(1.0)
            endif
        endmethod
        
        method add_even_charge takes Tower tower, real charge returns nothing
            local integer i = 0
            
            loop
                exitwhen i > 7
                if .charge[i] < 200 then
                    set .charge[i] = .charge[i] + (charge/8)
                    if .charge[i] > 200 then
                         set .charge[i] = 200
                    endif
                    call .update_rune(i)
                endif
                set i = i + 1
            endloop
        endmethod
        
        method add_random_charge takes Tower tower, real charge returns nothing
            local integer random
            local integer i = 0
            local integer applied = 0
            
            loop
                exitwhen i > 7 or applied > 0
                set random = .shuffled[i]
                if .charge[random] < 200 then
                    set .charge[random] = .charge[random] + charge
                    if .charge[random] > 200 then
                        set .charge[random] = 200
                    endif
                    set applied = applied + 1
                    call .update_rune(i)
                    call .activate_rune(random, tower.getX(), tower.getY(), 2)
                endif
                set i = i + 1
            endloop
            
            call .shuffle()
        endmethod
        
        method activate_random takes Tower tower, integer max, real charge, integer power returns nothing
            local Iterate i
            local Tower next
            local integer level = tower.getLevel()
            local integer random
            local BuffType bt
            local integer activated = 0
            local real x = tower.getX()
            local real y = tower.getY()
            local integer count = 0
            local integer fx = GetRandomInt(9, 10)
            
            call .add_even_charge(tower, charge)
            
            call .shuffle()
            
            loop
                exitwhen count > 7 or activated >= max
                set random = .shuffled[count]
                if .charge[random] >= 100 then
                    set .charge[random] = .charge[random] - 100
                    set bt = .bufftype[random]
                    call .update_rune(random)
                    call .activate_rune(random, x, y, 1)
                    set i = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TYPE_TOWERS, 150)
                    loop
                        set next = i.next()
                        exitwhen next == 0
                    
                        call bt.applyCustomPower(tower, next, power, power)
                        if activated == 0 then
                            call Effect.createScaled(.rune_model[fx], next.getX(), next.getY(), 40, 270, 1.0).setLifetime(3.0)
                        endif
                    endloop
                    set activated = activated + 1
                endif
                set count = count + 1
            endloop
            
            if activated == 0 then
                call Effect.createScaled("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", x, y, 40, 270, 1.0).setLifetime(1.0)
            endif
        endmethod
    endstruct
    
    //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
        
        //red
        set mod = Modifier.create()
        call mod.addModification(MOD_DAMAGE_ADD_PERC, 0.0, 0.002)
        set ashbringer_rune_atkdmg = BuffType.create(5, 0.2, true)
        call ashbringer_rune_atkdmg.setBuffModifier(mod)
        call ashbringer_rune_atkdmg.setBuffIcon('@@0@@')
        //teal
        set mod = Modifier.create()
        call mod.addModification(MOD_ATTACKSPEED, 0.0, 0.002)
        set ashbringer_rune_atkspd = BuffType.create(5, 0.2, true)
        call ashbringer_rune_atkspd.setBuffModifier(mod)
        call ashbringer_rune_atkspd.setBuffIcon('@@6@@')
        //yellow
        set mod = Modifier.create()
        call mod.addModification(MOD_TRIGGER_CHANCES, 0.0, 0.002)
        set ashbringer_rune_trig = BuffType.create(5, 0.2, true)
        call ashbringer_rune_trig.setBuffModifier(mod)
        call ashbringer_rune_trig.setBuffIcon('@@7@@')
        //blue
        set mod = Modifier.create()
        call mod.addModification(MOD_MANA_REGEN_PERC, 0.0, 0.002)
        set ashbringer_rune_mana = BuffType.create(5, 0.2, true)
        call ashbringer_rune_mana.setBuffModifier(mod)
        call ashbringer_rune_mana.setBuffIcon('@@4@@')
        //pink
        set mod = Modifier.create()
        call mod.addModification(MOD_ITEM_CHANCE_ON_KILL, 0.0, 0.001)
        set ashbringer_rune_itmch = BuffType.create(5, 0.2, true)
        call ashbringer_rune_itmch.setBuffModifier(mod)
        call ashbringer_rune_itmch.setBuffIcon('@@5@@')
        //green
        set mod = Modifier.create()
        call mod.addModification(MOD_ATK_CRIT_DAMAGE, 0.0, 0.002)
        set ashbringer_rune_crtdmg = BuffType.create(5, 0.2, true)
        call ashbringer_rune_crtdmg.setBuffModifier(mod)
        call ashbringer_rune_crtdmg.setBuffIcon('@@2@@')
        //purple
        set mod = Modifier.create()
        call mod.addModification(MOD_BUFF_DURATION, 0.0, 0.002)
        set ashbringer_rune_buffdur = BuffType.create(5, 0.2, true)
        call ashbringer_rune_buffdur.setBuffModifier(mod)
        call ashbringer_rune_buffdur.setBuffIcon('@@3@@')
        //orange
        set mod = Modifier.create()
        call mod.addModification(MOD_ATK_CRIT_CHANCE, 0.0, 0.001)
        set ashbringer_rune_crtch = BuffType.create(5, 0.2, true)
        call ashbringer_rune_crtch.setBuffModifier(mod)
        call ashbringer_rune_crtch.setBuffIcon('@@1@@')
        
        //set ashbringer_rune_mb = MultiboardValues.create(2)
        //call ashbringer_rune_mb.setKey(0, "Runes Charged")
        //call ashbringer_rune_mb.setKey(1, "Total Charge")
    endfunction
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNRune2.blp
                            [name] => Mystical Runes
                            [short_explain] => Each rune grants an associated buff when activated.
                            [long_explain] => Each rune grants an associated buff when activated:|n|cffff0000Vex|r: |cffffff80+10%|r attack damage|n|cff00ffffTal|r: |cffffff80+10%|r attack speed|n|cffffff00Eth|r: |cffffff80+10%|r trigger chances|n|cffaaaaffNef|r: |cffffff80+10%|r mana regeneration|n|cffff66bbOrt|r: |cffffff80+5%|r item chance|n|cff00ff00Lem|r: |cffffff80+0.1x|r crit damage|n|cff8811ffJah|r: |cffffff80+10%|r buff duration|n|cffff6600Qol|r: |cffffff80+5%|r crit chance|n|n|cffff8000Level Bonus:|r|n|cffffff80+0.1%|r item/crit chance|n|cffffff80+0.2%|r other stats
                        )

                )

            [2] => Array
                (
                    [name] => On Tower Destruction
                    [code] => local integer i = 0
    local Runes r = tower.userInt3
    
    loop
        exitwhen i > 7
        call r.rune_fx[i].destroy()
        call r.base_fx[i].destroy()
        set i = i + 1
    endloop
    
    call r.destroy()
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [3] => Array
                (
                    [name] => Autocast
                    [code] => local Runes r = tower.userInt3
    
    //call r.activate_all(tower, 50, 1)
    call r.activate_random(tower, 3, 100 + (tower.getLevel() * 4), 50 + (tower.getLevel() * 1))
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 3
                            [AUTOCAST_autoRange] => 900
                            [AUTOCAST_manacost] => 40
                            [icon] => ReplaceableTextures\CommandButtons\BTNStormRune.blp
                            [AUTOCAST_range] => 900
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Generate |cffffff80100|r charge evenly divided amongst all runes and then attempt to activate up to |cffffff803|r charged runes. Each activated rune grants its power to towers within |cffffff80150|r range for |cffffff805|r seconds. The activated runes become depleted, requiring |cffffff80100|r charge before they can be activated again.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+4|r charge generated|n|cffFFFF80+0.2|r seconds duration
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Rune Activation
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Activate some charged runes, granting their power to adjacent towers.
                        )

                )

            [4] => Array
                (
                    [name] => On Tower Creation
                    [code] => local Runes r = Runes.create()
            
    set tower.userInt3 = r
    set tower.userInt2 = 0
    
    call r.setup(tower)
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

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

                            [Buffubertip] => Increased attack damage.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Vex
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNStaffOfSanctuary.blp
                        )

                )

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

                            [Buffubertip] => Increased crit chance.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Qol
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNWand.blp
                        )

                )

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

                            [Buffubertip] => Increased crit damage.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Lem
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNStarWand.blp
                        )

                )

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

                            [Buffubertip] => Increased buff duration.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Jah
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNWandOfNeutralization.blp
                        )

                )

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

                            [Buffubertip] => Increased mana regeneration.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Nef
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNStaffOfTeleportation.blp
                        )

                )

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

                            [Buffubertip] => Increased item chance.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Ort
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNWandOfShadowSight.blp
                        )

                )

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

                            [Buffubertip] => Increased attack speed.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Tal
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNStaffOfNegation.blp
                        )

                )

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

                            [Buffubertip] => Increased trigger chance.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Eth
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNStaffOfSilence.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

            [1] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_atkspd
                )

            [2] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_trig
                )

            [3] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_mana
                )

            [4] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_itmch
                )

            [5] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_crtdmg
                )

            [6] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_buffdur
                )

            [7] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_rune_crtch
                )

        )

    [lightning] => Array
        (
        )

)