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

            [Art] => ReplaceableTextures\CommandButtons\BTNShadowFury.blp
            [bldtm] => 1
            [dmgplus1] => 102
            [goldcost] => 125
            [unitSound] => DraeneiChieftainHut
            [sides1] => 7
            [acquire] => 800
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Shard of Darkness
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => Objects\InventoryItems\CrystalShard\CrystalShard.mdl
            [uberSplat] => YTDB
            [Missileart] => war3mapImported\SpiritOfVengeanceMissileShadow.mdl
            [Missilespeed] => 1200
            [dice1] => 1
            [RngBuff1] => 250
            [modelScale] => 0.45
            [rangeN1] => 800
            [atkType1] => hero
            [cool1] => 2
            [Ubertip] => Pure darkness in crystal form, something that shouldn't exist.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

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

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00-80% |rdmg to undead
            [abil_factor] => 0.35
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [element] => darkness
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -0.0684925
                    [y] => 0.0372007
                    [z] => -12.8
                    [scale] => 1.2
                    [rot] => 1.72788
                    [file] => war3mapImported\GeneralAuraTargetWhite.mdl
                    [red] => 155
                    [green] => 1
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -17.332
                    [y] => 0.0813919
                    [z] => 25.6
                    [scale] => 0.06
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 25
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.0257224
                    [y] => 17.0099
                    [z] => 25.6
                    [scale] => 0.06
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 25
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -0.217749
                    [y] => -17.0413
                    [z] => 25.6
                    [scale] => 0.06
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 25
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => 16.5664
                    [y] => -0.116732
                    [z] => 25.6
                    [scale] => 0.06
                    [rot] => 0
                    [file] => Doodads\Cityscape\Props\City_Oblisk\City_Oblisk.mdl
                    [red] => 25
                    [green] => 25
                    [blue] => 25
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -0.11642
                    [y] => 0.05807
                    [z] => 57.6
                    [scale] => 1.55
                    [rot] => 3.57793
                    [file] => war3mapImported\SpiritOfVengeanceMissileShadow.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => -0.317898
                    [y] => -8.43947
                    [z] => 0
                    [scale] => 0.06
                    [rot] => 1.5708
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 35
                    [green] => 35
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => 0.136588
                    [y] => 8.53211
                    [z] => 0
                    [scale] => 0.06
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_ColumnSemiCircle\City_ColumnSemiCircle.mdl
                    [red] => 35
                    [green] => 35
                    [blue] => 35
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -0.104714
                    [y] => 0.15201
                    [z] => -0.00000476837
                    [scale] => 0.699999
                    [rot] => 1.58825
                    [file] => war3mapImported\BlackGlow2.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_DMG_TO_UNDEAD
                    [base] => -0.8
                    [add] => 0
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Level Up
                    [code] => set tower.userReal = 30 + (tower.getLevel() * 1.2)
    set tower.userReal2 = 0.1 + (tower.getLevel() * 0.004)
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType ashbringer_blight_aura
        BuffType ashbringer_blight_buff
    endglobals

    function ashbringer_blight_onattack takes Buff b returns nothing
        local Tower caster = b.getCaster()
        local Tower tower = b.getBuffedUnit()
        local Unit target = Event.getTarget()
        local real damage = caster.userReal * tower.getCurrentAttackspeed() / (tower.getRange() / 800.00) * caster.getProp_BuffDuration()

        set b = target.getBuffOfType(ashbringer_blight_buff)
        if b != 0 then
            set damage = b.userReal + damage
            set b.userReal = damage
            call b.refreshDuration()
        else
            set b = ashbringer_blight_buff.apply(caster, target, caster.getLevel())
            set b.userReal = damage
            set b.userInt = 1
            set b.userReal2 = caster.userReal2
        endif
    endfunction

    function ashbringer_blight_periodic takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Creep target = b.getBuffedUnit()
        local real multiplier = 3 * b.userReal2 * (1 - (GetUnitState(target.getUnit(), UNIT_STATE_LIFE) / GetUnitState(target.getUnit(), UNIT_STATE_MAX_LIFE)))
        local real duration = RMaxBJ(1.0, b.getRemainingDuration())
        local real damage = b.userReal / duration
        
        if damage > 0 then
            set b.userInt = 0
            call tower.doCustomAttackDamage(target, damage * tower.getProp_SpellDmgDealt() * (1 + multiplier), tower.calcSpellCritNoBonus(), AttackType.DECAY)
            set b.userReal = b.userReal - damage
            set b.userInt = 1
        endif
    endfunction

    function ashbringer_blight_ondamage takes Buff b returns nothing
        local Tower tower = Event.getTarget()
        local Creep target = b.getBuffedUnit()
        local real multiplier
        
        if b.userInt == 0 or tower.getElement() != Element.DARKNESS then
            return
        endif
        
        set multiplier = b.userReal2 * (1 - (GetUnitState(target.getUnit(), UNIT_STATE_LIFE) / GetUnitState(target.getUnit(), UNIT_STATE_MAX_LIFE)))
        set Event.damage = Event.damage * (1 + multiplier)
    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_blight_aura = BuffType.createAuraEffectType(true)
        call ashbringer_blight_aura.setBuffIcon('@@1@@')
        call ashbringer_blight_aura.addEventOnAttack(ashbringer_blight_onattack, 1, 0)
        
        set ashbringer_blight_buff = BuffType.create(5, 0, false)
        call ashbringer_blight_buff.setBuffIcon('@@0@@')
        call ashbringer_blight_buff.addPeriodicEvent(ashbringer_blight_periodic, 1.0)
        call ashbringer_blight_buff.addEventOnDamaged(ashbringer_blight_ondamage, 1.0, 0)
	endfunction
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNImprovedUnholyStrength.blp
                            [name] => Wither
                            [short_explain] => Enemies affected by Shadowblight take increased damage from |cFF8A5300Darkness|r towers based on missing health.
                            [long_explain] => Enemies affected by Shadowblight take up to |cffFFFF8010%|r increased damage from |cFF8A5300Darkness|r towers based on how much health they are missing, starting at |cffFFFF800%|r at full health and reaching the full effect near death. This effect is tripled for Shadowblight damage.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.4%|r damage taken
                        )

                )

            [2] => Array
                (
                    [name] => Tower Aura
                    [code] => Array
                        (
                        )

                    [values] => Array
                        (
                            [AURA_powerAdd] => 1
                            [visible] => true
                            [AURA_auraEffect] => ashbringer_blight_aura
                            [AURA_levelAdd] => 1
                            [AURA_power] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNOrbOfDarkness.blp
                            [AURA_targetType] => TARGET_TYPE_TOWERS
                            [long_explain] => Towers within |cffFFFF80200|r range inflict Shadowblight on attack, a disease that deals |cffFFFF8030|r |cff808000Decay|r damage over |cffFFFF805|r seconds. This damage can accumulate, scales with spell damage and is range and attack speed adjusted. Increasing the buffs duration will increase the damage proportionately.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1.2|r |cff808000Decay|r damage
                            [AURA_targetSelf] => true
                            [name] => Shadowblight
                            [AURA_level] => 0
                            [short_explain] => Towers within |cffFFFF80200|r range inflict Decay damage over time when they attack.
                            [AURA_auraRange] => 200
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userReal = 30 + (tower.getLevel() * 1.2)
    set tower.userReal2 = 0.1 + (tower.getLevel() * 0.004)
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Targetattach] => chest
                            [EditorName] => Shadowblight
                            [Buffubertip] => Taking decay damage over time.
                            [TargetArt] => war3mapImported\SpiritOfVengeanceMissileShadow.mdx
                            [Targetattachcount] => 1
                            [Bufftip] => Shadowblight
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfDarkness.blp
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [EditorName] => Shadowblight
                            [Buffubertip] => Attacks cause enemies to take damage over time.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Shadowblight
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNOrbOfDarkness.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

    [lightning] => Array
        (
        )

)