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

            [Art] => ReplaceableTextures\CommandButtons\BTNPeriapt.blp
            [dmgplus1] => 105
            [bldtm] => 1
            [goldcost] => 200
            [sides1] => 1
            [acquire] => 900
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Firestorm Generator
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => .mdl
            [uberSplat] => YTDI
            [Missileart] => Abilities\Weapons\LavaSpawnMissile\LavaSpawnMissile.mdl
            [Missilespeed] => 1300
            [dice1] => 1
            [RngBuff1] => 250
            [rangeN1] => 900
            [atkType1] => magic
            [cool1] => 1.3
            [Ubertip] => This device has the potential for immense destruction.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

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

            [abil_factor] => 0.4
            [author] => Ashbringer
            [alpha] => 0
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => fire
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.287265
                    [y] => 0.491576
                    [z] => 32
                    [scale] => 0.6
                    [rot] => 4.71239
                    [file] => Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -4.71
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 0.917425
                    [y] => 4.10829
                    [z] => 32
                    [scale] => 1.37
                    [rot] => 0
                    [file] => Abilities\Spells\Items\AIfb\AIfbTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => 1.02274
                    [y] => 3.20333
                    [z] => 0
                    [scale] => 0.6
                    [rot] => 4.71239
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 155
                    [green] => 90
                    [blue] => 60
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -0.0133527
                    [y] => 0.972618
                    [z] => 0
                    [scale] => 0.23
                    [rot] => 4.71239
                    [file] => Doodads\Ruins\Props\Ruins_NagaCircle\Ruins_NagaCircle.mdl
                    [red] => 25
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

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

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

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

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

            [6] => Array
                (
                    [x] => -0.148344
                    [y] => 0.199712
                    [z] => 0
                    [scale] => 0.11
                    [rot] => 2.3562
                    [file] => Doodads\Underground\Structures\UndergroundArchway1\UndergroundArchway1.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => -0.0763133
                    [y] => 0.846242
                    [z] => 0
                    [scale] => 0.11
                    [rot] => 0.785398
                    [file] => Doodads\Underground\Structures\UndergroundArchway1\UndergroundArchway1.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -0.297862
                    [y] => -8.16974
                    [z] => 6.4
                    [scale] => 0.1
                    [rot] => 1.5708
                    [file] => Doodads\Underground\Structures\UndergroundArchway1\UndergroundArchway1.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => 0.387533
                    [y] => 10.4651
                    [z] => 6.4
                    [scale] => 0.1
                    [rot] => 4.71239
                    [file] => Doodads\Underground\Structures\UndergroundArchway1\UndergroundArchway1.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => 10.3624
                    [y] => 0.836575
                    [z] => 6.4
                    [scale] => 0.1
                    [rot] => 3.14159
                    [file] => Doodads\Underground\Structures\UndergroundArchway1\UndergroundArchway1.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => -10.9145
                    [y] => 1.18478
                    [z] => 6.4
                    [scale] => 0.1
                    [rot] => 0
                    [file] => Doodads\Underground\Structures\UndergroundArchway1\UndergroundArchway1.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => -1.57
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local Unit target = Event.getTarget()
    local real damage = 600 + (tower.getLevel() * 12)
    local Buff b = target.getBuffOfType(ashbringer_firestorm_buff)
    
    if b != 0 then
        set b.userReal = b.userReal + damage
        set b.userInt = 3
        call b.refreshDuration()
    else
        set b = ashbringer_firestorm_buff.apply(tower, target, 0)
        set b.userReal = damage
        set b.userInt = 3
    endif
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNFire.blp
                            [name] => Firestorm
                            [short_explain] => Attacks have a chance to cause AoE spell damage over time.
                            [ONATTACK_chance] => 0.12
                            [ONATTACK_chanceLevelAdd] => 0.003
                            [long_explain] => Attacks have a |cffffff8012%|r chance to apply Firestorm to the target, dealing |cffffff80600|r spell damage to enemies in |cffffff80250|r range over |cffffff803|r seconds. If this effect is reapplied, any remaining damage will be added to the new duration. If the target dies, any remaining damage is dealt instantly.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.3%|r chance|n|cffFFFF80+12|r damage
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType ashbringer_firestorm_buff
    endglobals
    
    function ashbringer_firestorm_periodic takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Creep target = b.getBuffedUnit()
        local real damage
        local Iterate i
        local Creep next
        
        if b.userInt > 0 and b.userReal > 0 then
            set damage = b.userReal / b.userInt
            
            set b.userReal = b.userReal - damage
            set b.userInt = b.userInt - 1
            call Effect.createScaled("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", target.getX(), target.getY(), 0, 0, 0.55).destroy()
            set i = Iterate.overUnitsInRangeOfUnit(tower, TARGET_TYPE_CREEPS, target, 250)
            loop
                set next = i.next()
                exitwhen next == 0
                call tower.doSpellDamage(target, damage, tower.calcSpellCritNoBonus())
            endloop
        else
            call b.removeBuff()
        endif
    endfunction
    
    function ashbringer_firestorm_ondeath takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Creep target = b.getBuffedUnit()
        local Iterate i
        local Creep next
        
        if b.userInt > 0 and b.userReal > 0 then
            call Effect.createScaled("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", target.getX(), target.getY(), 0, 0, 0.65).destroy()
            set i = Iterate.overUnitsInRangeOfUnit(tower, TARGET_TYPE_CREEPS, target, 250)
            loop
                set next = i.next()
                exitwhen next == 0
                call tower.doSpellDamage(target, b.userReal, tower.calcSpellCritNoBonus())
            endloop
            set b.userReal = 0
        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_firestorm_buff = BuffType.create(0, 0, false) 
        call ashbringer_firestorm_buff.setBuffIcon('@@0@@')
        call ashbringer_firestorm_buff.addPeriodicEvent(EventHandler.ashbringer_firestorm_periodic, 1)
        call ashbringer_firestorm_buff.addEventOnDeath(EventHandler.ashbringer_firestorm_ondeath) 
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BNrd
                    [oeValues] => Array
                        (
                            [Buffubertip] => Array
                                (
                                )

                            [TargetArt] => Abilities\Spells\Other\Doom\DoomTarget.mdl
                            [Bufftip] => Firestorm
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNFire.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

    [lightning] => Array
        (
        )

)