Array
(
    [scriptVersion] => 8
    [oeValues] => Array
        (
            [targCount1] => 3
            [Farea1] => 450
            [auto] => Array
                (
                )

            [Art] => ReplaceableTextures\CommandButtons\BTNFaerieFire.blp
            [damageLoss1] => 0.6
            [dmgplus1] => 83
            [bldtm] => 1
            [goldcost] => 200
            [unitSound] => ChimaeraRoost
            [sides1] => 1
            [acquire] => 900
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Faerie Rubble
            [weapTp1] => mbounce
            [file] => .mdl
            [uberSplat] => ESMB
            [Missileart] => Abilities\Spells\NightElf\FaerieFire\FaerieFireTarget.mdl
            [Missilespeed] => 1150
            [dice1] => 1
            [RngBuff1] => 250
            [rangeN1] => 900
            [atkType1] => magic
            [cool1] => 1.3
            [Ubertip] => One of nature's many secrets.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffCCFF00Bounce attack:|n   |cffFFFF003|r targets|n   |cffFFFF00-60%|r damage per bounce
            [abil_factor] => 0.4
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => nature
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 16.6716
                    [y] => 10.9607
                    [z] => 0
                    [scale] => 0.3
                    [rot] => 2.3993
                    [file] => Doodads\Ruins\Rocks\Ruins_Rock\Ruins_Rock9.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 115
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -0.171041
                    [y] => 0.0532446
                    [z] => 0
                    [scale] => 0.7
                    [rot] => 5.91667
                    [file] => buildings\other\CircleOfPower\CircleOfPower.mdl
                    [red] => 115
                    [green] => 255
                    [blue] => 115
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.216682
                    [y] => 0.236111
                    [z] => 32
                    [scale] => 1
                    [rot] => 4.41568
                    [file] => Abilities\Spells\NightElf\FaerieFire\FaerieFireTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -27.1226
                    [y] => -22.9344
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 4.06985
                    [file] => Doodads\Ruins\Props\Stone\Stone3.mdl
                    [red] => 115
                    [green] => 255
                    [blue] => 115
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -27.5064
                    [y] => 11.1349
                    [z] => 0
                    [scale] => 0.45
                    [rot] => 5.41509
                    [file] => Doodads\Northrend\Structures\NorthrendRubble\NorthrendRubble0.mdl
                    [red] => 185
                    [green] => 255
                    [blue] => 125
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => 34.3572
                    [y] => -17.9665
                    [z] => 0
                    [scale] => 0.2
                    [rot] => 1.15192
                    [file] => Doodads\Ruins\Rocks\Ruins_Rock\Ruins_Rock9.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 115
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 9.02609
                    [y] => -25.3962
                    [z] => 0
                    [scale] => 0.45
                    [rot] => 0.962446
                    [file] => Doodads\Northrend\Structures\NorthrendRubble\NorthrendRubble0.mdl
                    [red] => 185
                    [green] => 255
                    [blue] => 125
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 40.651
                    [y] => 3.2243
                    [z] => 0
                    [scale] => 0.45
                    [rot] => 3.90954
                    [file] => Doodads\Ruins\Plants\Ruins_Flower\Ruins_Flower1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -17.7671
                    [y] => 0.552707
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 1.81568
                    [file] => Doodads\Ruins\Plants\Ruins_Shrub\Ruins_Shrub0.mdl
                    [red] => 115
                    [green] => 255
                    [blue] => 115
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => 15.5949
                    [y] => 28.0732
                    [z] => 0
                    [scale] => 0.45
                    [rot] => 2.56607
                    [file] => Doodads\Ruins\Plants\Ruins_Flower\Ruins_Flower1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -34.006
                    [y] => -2.35048
                    [z] => 0
                    [scale] => 0.45
                    [rot] => 3.31805
                    [file] => Doodads\Ruins\Plants\Ruins_Flower\Ruins_Flower1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 16.8548
                    [y] => -15.3041
                    [z] => 0
                    [scale] => 0.3
                    [rot] => 1.13446
                    [file] => Doodads\Ruins\Plants\Ruins_Shrub\Ruins_Shrub0.mdl
                    [red] => 115
                    [green] => 255
                    [blue] => 115
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType ashbringer_faerie_buff
    endglobals
    
    //@export
    function ashbringer_faerie_trigger takes Tower tower, Unit target, real dmg_base, real dmg_pl, integer stacks, integer duration returns nothing
        local real damage = dmg_base + (tower.getLevel() * dmg_pl)
        local Buff b = target.getBuffOfType(ashbringer_faerie_buff)
        local integer power
        
        if b != 0 then
            if b.userInt==0 then
                call b.setLevel(stacks)
                call b.setPower(stacks)
                set b.userReal = damage
                set b.userInt = duration
                set b.userInt2 = target.getUID()
            else
                set damage = damage + b.userReal
                set b.userReal = damage
                set power = b.getPower() + stacks
                call b.setLevel(power)
                call b.setPower(power)
            endif
        else
            set b = ashbringer_faerie_buff.applyCustomPower(tower, target, stacks, stacks)
            set b.userReal = damage
            set b.userInt = duration
            set b.userInt2 = target.getUID()
        endif
    endfunction
    
    function ashbringer_faerie_periodic takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Creep target = b.getBuffedUnit()
        local real damage
        
        if b.userInt>0 and b.userReal>0 then
            set damage = b.userReal / b.userInt
            call tower.doSpellDamage(target, damage, tower.calcSpellCritNoBonus())
            set b.userReal = b.userReal - damage
            set b.userInt = b.userInt - 1
        endif
    endfunction
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
        local Modifier m = Modifier.create()
    
        set ashbringer_faerie_buff = BuffType.create(8, 0, false) 
        call ashbringer_faerie_buff.setBuffIcon('@@0@@')
        call m.addModification(MOD_ARMOR, 0, -0.5)
        call ashbringer_faerie_buff.setBuffModifier(m)
        call ashbringer_faerie_buff.addPeriodicEvent(EventHandler.ashbringer_faerie_periodic, 1)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Damage
                    [code] => call ashbringer_faerie_trigger(tower, Event.getTarget(), 250, 5, 1, 8)
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 0.12
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNFaerieFire.blp
                            [name] => Faerie Wrath
                            [short_explain] => Attack hits have a chance to reduce armor and deal spell damage over time.
                            [ONDAMAGE_chanceLevelAdd] => 0.003
                            [long_explain] => Attacks have a |cffffff8012%|r chance on hit to deal |cffffff80250|r spell damage to the target over |cffffff808|r seconds, while reducing armor by |cffffff800.5|r. The duration of this effect cannot be extended or refreshed. New applications will add their damage to the remaining duration and reduce the target's armor further.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.3%|r chance|n|cffFFFF80+5|r damage
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BNrd
                    [oeValues] => Array
                        (
                            [Targetattach] => chest
                            [Buffubertip] => Reduced armor and taking damage over time.
                            [TargetArt] => Abilities\Spells\NightElf\FaerieFire\FaerieFireTarget.mdl
                            [Bufftip] => Faerie Wrath
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNFaerieFire.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

    [lightning] => Array
        (
        )

)