Array
(
    [scriptVersion] => 7
    [oeValues] => Array
        (
            [RngBuff1] => 250
            [MissileHoming] => 1
            [Upgrade] => Array
                (
                )

            [uberSplat] => YTDI
            [targs1] => Array
                (
                )

            [goldcost] => 65
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1500
            [atkType1] => pierce
            [modelScale] => 0.6
            [weapTp1] => missile
            [acquire] => 800
            [rangeN1] => 800
            [upgrades] => Array
                (
                )

            [cool1] => 1.4
            [Ubertip] => Burning structure with a small synergetic effect for its element.
            [green] => 100
            [abilList] => Array
                (
                )

            [launchZ] => 87
            [Name] => Burning Watchtower
            [Missileart] => Abilities\Weapons\FlamingArrow\FlamingArrowMissile.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNDemolish.blp
            [buildingShadow] => Array
                (
                )

            [blue] => 100
            [sides1] => 2
            [auto] => Array
                (
                )

            [dmgplus1] => 50
            [bldtm] => 1
        )

    [settings] => Array
        (
            [author] => Natac
            [element] => fire
            [authorDisplay] => Natac
            [alpha] => 255
            [balanceTip] => Array
                (
                )

            [rarity] => uncommon
            [version] => 1.0
            [abil_factor] => 0.5
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -15.3882
                    [y] => -26.4198
                    [z] => 96
                    [scale] => 0.2
                    [rot] => 4.17134
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.56
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -0.113677
                    [y] => -2.10442
                    [z] => 96
                    [scale] => 0.5
                    [rot] => 2.99089
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 22.7913
                    [y] => -16.5175
                    [z] => 96
                    [scale] => 0.2
                    [rot] => 5.74213
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.56
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => 12.9423
                    [y] => 21.8149
                    [z] => 96
                    [scale] => 0.2
                    [rot] => 1.02974
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.56
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => -24.8084
                    [y] => 12.1218
                    [z] => 96
                    [scale] => 0.2
                    [rot] => 2.60054
                    [file] => Doodads\Outland\Props\Grate\Grate1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.56
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Damage
                    [code] => local integer towerLevel = tower.getLevel()
    local Unit    target     = Event.getTarget()
    local real    level      = 1 + towerLevel*0.1
    local real    duration   = 5 + towerLevel*0.12
    local Buff    b          = natac_burning_buff.applyCustomTimed(tower, target, R2I(level*100), duration)
    
    // Upgrade AOE-damage, if it makes sense
    if(b.userInt < 49) then
        set b.userInt = 49
    endif
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [icon] => ReplaceableTextures\CommandButtons\BTNImmolationOn.blp
                            [visible] => true
                            [name] => Burn
                            [short_explain] => Let firetowers deal more and more damage to a unit, which will explode on death.
                            [ONDAMAGE_chanceLevelAdd] => 0.0
                            [long_explain] => Starts to burn a target. On every further hit of a fire tower, the target will receive more bonus damage then before. Burning Structures will increase the bonus damage by |cffFFFF801|r, any other fire towers by |cffFFFF800.3|r. If the unit dies, it explodes and deals |cffFFFF8049|r damage to nearby units in a range of |cffFFFF80200|r.|nLasts |cffFFFF805|r seconds after the last attack of a fire tower.|n|n|cffFF8000Level Bonus:|r|n+ |cffFFFF800.1|r damage gain (Burning Structrues)|n+ |cffFFFF800.03|r damage gain (Other fire towers)|n+ |cffFFFF800.12|r seconds burn duration
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //This buff is configurated as follows:
        //level: damage gain per attack
        //userReal: Already done bonus damage on the buffed unit
        //userInt: AOE-Damage if the buffed unit dies
        //@export
        BuffType   natac_burning_buff
    endglobals
    
    // b.userReal: The user Real is the current bonus damage of the buff. Init with 0
    function initOnCreate takes Buff b returns nothing
        set b.userReal  = 0.0
        set b.userInt = 0
    endfunction
    
    // Increase damage gain and do direct damage to the target by setting the event damage
    function damageOnFireAttack takes Buff b returns nothing 
        local real    damageGain 
        local real    damageFactor
        local Unit    attacker       = Event.getTarget()
        local boolean isBurningTower 
        if(Element.FIRE == attacker.getCategory()) then
            set isBurningTower = Tower(attacker).getFamily() == Tower(b.getCaster()).getFamily()
            if(isBurningTower) then 
                set damageFactor = 1.0 // is Burning Tower
            else
                set damageFactor = 0.3 // is other fire tower
            endif
            
            set  damageGain   = damageFactor * b.getLevel() * 0.01 //Added power with "*100", so multiply with 0.01
            set  b.userReal   = b.userReal + damageGain
            set  Event.damage = Event.damage + b.userReal
            
            if(isBurningTower) then //Display damage
                call attacker.getOwner().displaySmallFloatingText(I2S(R2I(b.userReal)), b.getBuffedUnit(),255,90,0, 40.0)
            endif
            
            call b.refreshDuration() // Reset duration
        endif
    endfunction 
    
    // Does damage to all units around the buffed unit, if the buffed unit dies
    // b.userInt: AOE damage of the current buff.
    function explodeOnDeath takes Buff b returns nothing 
        local Unit killer      = Event.getTarget()
        local Unit buffedUnit  = b.getBuffedUnit()
        call  SFXAtUnit("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",buffedUnit.getUnit())
        call  killer.doSpellDamageAoEUnit(buffedUnit,200, b.userInt, killer.calcSpellCritNoBonus(),0.0)
    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  natac_burning_buff = BuffType.create(0.0, 0.0, false) //CustomTime applied
        call natac_burning_buff.setBuffIcon('@@0@@')
        call natac_burning_buff.addEventOnCreate(EventHandler.initOnCreate)
        call natac_burning_buff.addEventOnDamaged(EventHandler.damageOnFireAttack,1.0,0.0)
        call natac_burning_buff.addEventOnDeath(EventHandler.explodeOnDeath)
	endfunction
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Bpxf
                    [oeValues] => Array
                        (
                            [Bufftip] => Burning
                            [Targetattach] => chest
                            [Buffubertip] => This unit burns more with every hit of a firetower and will explode on death.
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNImmolationOn.blp
                            [SpecialArt] => Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
                            [TargetArt] => Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

)