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

            [Art] => ReplaceableTextures\CommandButtons\BTNSpell_Frost_WizardMark.blp
            [turnRate] => 3
            [dmgplus1] => 525
            [bldtm] => 1
            [goldcost] => 425
            [sides1] => 1
            [Missilearc] => 0.6
            [maxPitch] => -30
            [launchZ] => 0
            [acquire] => 2500
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Glacial Mortar
            [red] => 55
            [weapTp1] => msplash
            [uberSplat] => YTDN
            [Missilespeed] => 1500
            [Missileart] => Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
            [dice1] => 1
            [RngBuff1] => 250
            [green] => 95
            [animProps] => upgrade,third
            [modelScale] => 0.31
            [rangeN1] => 2500
            [atkType1] => pierce
            [cool1] => 7
            [Ubertip] => A not-so-warm welcome to the frozen wastes.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

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

            [targs1] => ground
            [weapsOn] => 1
            [minRange] => 1250
            [teamColor] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF001250|r |cffFF0000minimum attack range|r|n|cffFF0000Attacks GROUND only|r|n|cffCCFF00Splash attack:|n   |cffFFFF00325|r AoE: |cff00FF00100%|r damage|r|n|cffFFFF00+3% |rdamage/lvl
            [abil_factor] => 0.35
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => ice
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.294107
                    [y] => 3.48087
                    [z] => -38.4
                    [scale] => 0.9
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Props\CrystalLamp\CrystalLamp.mdl
                    [red] => 55
                    [green] => 95
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -0.0884388
                    [y] => 6.40416
                    [z] => 38.4
                    [scale] => 0.8
                    [rot] => 1.5708
                    [file] => Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.421782
                    [y] => -14.156
                    [z] => 64
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 0.138042
                    [y] => 14.3955
                    [z] => 64
                    [scale] => 0.1
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -0.257348
                    [y] => -11.4488
                    [z] => 70.4
                    [scale] => 0.08
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => 0.183234
                    [y] => 11.4385
                    [z] => 70.4
                    [scale] => 0.08
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => -23.8397
                    [y] => -23.8644
                    [z] => 0
                    [scale] => 0.17
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => -23.4798
                    [y] => 23.5898
                    [z] => 0
                    [scale] => 0.17
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => 23.4891
                    [y] => 23.3433
                    [z] => 0
                    [scale] => 0.17
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => 23.1292
                    [y] => -23.1846
                    [z] => 0
                    [scale] => 0.17
                    [rot] => 0.785398
                    [file] => war3mapImported\Square_Column.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -0.497647
                    [y] => -15.6375
                    [z] => 0
                    [scale] => 0.11
                    [rot] => 1.5708
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 0.347389
                    [y] => 15.4505
                    [z] => 0
                    [scale] => 0.11
                    [rot] => 4.71239
                    [file] => war3mapImported\City_ColumnSemiCircle2.mdl
                    [red] => 25
                    [green] => 30
                    [blue] => 85
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -0.0487958
                    [y] => 0.0496686
                    [z] => 64
                    [scale] => 0.75
                    [rot] => 1.29154
                    [file] => Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => 0.0735215
                    [y] => -0.0708155
                    [z] => 57.6
                    [scale] => 1
                    [rot] => 4.08407
                    [file] => Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => -0.0255665
                    [y] => 0.0760866
                    [z] => -19.2
                    [scale] => 1.7
                    [rot] => 2.60054
                    [file] => Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => -0.0246518
                    [y] => 0.0843454
                    [z] => -12.8
                    [scale] => 0.85
                    [rot] => 4.72984
                    [file] => Doodads\Icecrown\Water\IceEdge\IceEdge2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_DAMAGE_BASE_PERC
                    [base] => 0
                    [add] => 0.03
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local Creep target = Event.getTarget()
    local real debuff_dmg = 0.05 + (tower.getLevel() * 0.002)
    
    call ashbringer_frostburn_launch(tower, target.getX(), target.getY(), 2, debuff_dmg, 0)
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNSpell_Frost_FrostWard.blp
                            [name] => Glacial Volley
                            [short_explain] => Attacks bombard the area around the target with additional projectiles.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 1.0
                            [long_explain] => Attacks bombard the area around the target with |cffffff802|r additional projectiles. The further away the enemy is, the greater the spread of the projectiles.
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType ashbringer_frostburn_missile
        //@export
        BuffType ashbringer_frostburn_buff
    endglobals
    
    //@export
    function ashbringer_frostburn_launch takes Tower tower, real x, real y, integer count, real debuff_dmg, real z returns nothing
        local real tower_x = tower.getX()
        local real tower_y = tower.getY()
        local real target_x 
        local real target_y
        local real random_angle
        local real random_distance
        local real crit = tower.calcAttackMulticrit(0, 0, 0)
        local real distance = DistanceBetweenPoints(Location(tower_x, tower_y), Location(x, y))
        local Projectile p
        
        loop
            exitwhen count == 0
            set random_angle = GetRandomReal(0, 360)
            set random_distance = GetRandomReal(50, 250 + (distance / 10) )
            set target_x = x + random_distance * Cos(Deg2Rad(random_angle))
            set target_y = y + random_distance * Sin(Deg2Rad(random_angle))
            set p = Projectile.createLinearInterpolationFromPointToPoint(ashbringer_frostburn_missile, tower, 0, 0, tower_x, tower_y, z, target_x, target_y, 0, 0.6)
            set p.userReal = tower.getCurrentAttackDamageWithBonus()
            set p.userReal2 = crit
            set p.userReal3 = tower.getCurrentAttackDamageWithBonus() * debuff_dmg
            call p.setScale(1.4)
            set count = count - 1
            call TriggerSleepAction(0.02)
            //set p.speed = distance
        endloop
    endfunction
    
    function ashbringer_frostburn_hit takes Projectile p returns nothing
        local Tower tower = p.getCaster()
        local Iterate i
        local Creep next
        local Buff b
        
        set i = Iterate.overUnitsInRange(tower, TARGET_TYPE_CREEPS, p.x, p.y, 325)
        loop
            set next = i.next()
            exitwhen next == 0
            call tower.doAttackDamage(next, p.userReal, p.userReal2)
            call Effect.createSimpleOnUnit("Abilities\\Spells\\Items\\AIob\\AIobSpecialArt.mdl", next, "chest").destroy()
            set b = next.getBuffOfType(ashbringer_frostburn_buff)
            if b!=0 then
                set b.userInt = b.userInt + 1
                if p.userReal3 > b.userReal then
                    set b.userReal = p.userReal3
                endif
                call b.refreshDuration()
            else
                set b = ashbringer_frostburn_buff.apply(tower, next, tower.getLevel())
                set b.userInt = 1
                set b.userInt2 = tower
                set b.userReal = p.userReal3
            endif
        endloop
    endfunction
    
    function ashbringer_frostburn_periodic takes Buff b returns nothing
        local Tower tower = b.userInt2
        local Creep target = b.getBuffedUnit()
        
        call tower.doSpellDamage(target, b.userReal * b.userInt, tower.calcSpellCritNoBonus())
    endfunction
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
        local Modifier mod = Modifier.create()
        set ashbringer_frostburn_missile = ProjectileType.create("Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl", 15, 1500) 
        call ashbringer_frostburn_missile.setEventOnCleanup(ProjectileEvent.ashbringer_frostburn_hit)
        
        set ashbringer_frostburn_buff = BuffType.create(5, 0.12, false)
        call ashbringer_frostburn_buff.setBuffIcon('@@0@@')
        call ashbringer_frostburn_buff.addPeriodicEvent(ashbringer_frostburn_periodic, 1)
        call ashbringer_frostburn_buff.setBuffModifier(mod)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => On Damage
                    [code] => local Creep target = Event.getTarget()
    local Buff b
    local real debuff_dmg = tower.getCurrentAttackDamageWithBonus() * 0.05 + (tower.getLevel() * 0.002)
    
    set b = target.getBuffOfType(ashbringer_frostburn_buff)
    if b!=0 then
        set b.userInt = b.userInt + 1
        if debuff_dmg > b.userReal then
            set b.userReal = debuff_dmg
        endif
        call b.refreshDuration()
    else
        set b = ashbringer_frostburn_buff.apply(tower, target, tower.getLevel())
        set b.userInt = 1
        set b.userInt2 = tower
        set b.userReal = debuff_dmg
    endif
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNFrostArmor.blp
                            [name] => Bonechill
                            [short_explain] => Enemies hit take stacking spell damage over time.
                            [ONDAMAGE_chanceLevelAdd] => 0
                            [long_explain] => Each volley hit inflicts a stack of Bonechill on the enemy. Bonechill deals |cffffff805%|r of attack damage as spell damage per stack per second. Lasts |cffffff805|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffffff80+0.2%|r of attack damage as spell damage|n|cffffff80+0.12|r seconds duration
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Creation
                    [code] => 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] => chest
                            [Buffubertip] => Taking damage over time and takes increased damage.
                            [TargetArt] => Abilities\Spells\Other\FrostDamage\FrostDamage.mdl
                            [Bufftip] => Bonechill
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNFrostArmor.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

    [lightning] => Array
        (
        )

)