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

            [targs1] => Array
                (
                )

            [goldcost] => 3500
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1500
            [moveHeight] => 10
            [file] => units\undead\HeroDeathKnight\HeroDeathKnight.mdl
            [manaN] => 50
            [atkType1] => hero
            [modelScale] => 0.8
            [weapTp1] => missile
            [acquire] => 900
            [rangeN1] => 875
            [upgrades] => Array
                (
                )

            [cool1] => 1.1
            [Ubertip] => Feeds on souls to unleash his full power.
            [abilList] => Array
                (
                )

            [Name] => Death Knight
            [Missileart] => Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNHeroDeathKnight.blp
            [buildingShadow] => Array
                (
                )

            [unitSound] => HeroDeathKnight
            [sides1] => 1
            [uberSplat] => OSMA
            [auto] => Array
                (
                )

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

    [settings] => Array
        (
            [author] => DaveMatthews
            [element] => darkness
            [authorDisplay] => DaveMatthews
            [alpha] => 255
            [balanceTip] => |cffFFFF00+2 |rmana/lvl
            [rarity] => unique
            [version] => 1.0
            [abil_factor] => 0.6
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 3.69273
                    [y] => 2.86568
                    [z] => 0
                    [scale] => 0.9
                    [rot] => 5.41052
                    [file] => Doodads\Cityscape\Props\CityGrave\CityGrave0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -36.7108
                    [y] => -22.7917
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 4.69494
                    [file] => Environment\BlightDoodad\BlightDoodad.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 28.3906
                    [y] => 15.771
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 4.69494
                    [file] => Environment\BlightDoodad\BlightDoodad.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => -38.9808
                    [y] => 23.2704
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 4.69494
                    [file] => Environment\BlightDoodad\BlightDoodad.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => 40.8474
                    [y] => -37.1339
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 4.69494
                    [file] => Environment\BlightDoodad\BlightDoodad.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [5] => Array
                (
                    [x] => 52.1862
                    [y] => 47.164
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 5.41052
                    [file] => Doodads\Icecrown\Props\IceTorch\IceTorch.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [6] => Array
                (
                    [x] => -51.7721
                    [y] => 42.4444
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 5.41052
                    [file] => Doodads\Icecrown\Props\IceTorch\IceTorch.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [7] => Array
                (
                    [x] => -46.3081
                    [y] => -45.8897
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 4.71239
                    [file] => units\creeps\FelstalkerPurple\FelstalkerPurple.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [8] => Array
                (
                    [x] => -18.0721
                    [y] => -26.3671
                    [z] => 19.2
                    [scale] => 0.8
                    [rot] => 5.23599
                    [file] => Doodads\Dungeon\Props\Chain\Chain0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [9] => Array
                (
                    [x] => 55.2781
                    [y] => -0.836961
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 1.3439
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [10] => Array
                (
                    [x] => 46.2286
                    [y] => -41.8211
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 4.69494
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_MANA
                    [base] => 0
                    [add] => 2
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Damage
                    [code] => local unit towerUnit = tower.getUnit()
    local integer level = tower.getLevel()
    local real mana = GetUnitState(towerUnit,UNIT_STATE_MANA)
    local real maxMana = GetUnitState(towerUnit,UNIT_STATE_MAX_MANA)
     
    call SetUnitState(towerUnit , UNIT_STATE_MANA, mana+(maxMana*0.01))
    set Event.damage = Event.damage+(Event.damage*((maxMana-mana)*(0.0025+0.0001*level)))
    set towerUnit = null
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [icon] => ReplaceableTextures\CommandButtons\BTNDevourMagic.blp
                            [visible] => true
                            [name] => Insatiable Hunger
                            [short_explain] => Deals bonus damage based on missing mana.
                            [ONDAMAGE_chanceLevelAdd] => 0.0
                            [long_explain] => On each attack, the death knight deals |cffFFFF800.25%|r bonus damage for each mana point he's currently missing and replenishes |cffFFFF801%|r of his maximum mana. He replenishes |cffFFFF805%|r of his maximum mana for each unit he kills. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.01%|r damage per mana point
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType dave_will_positive
        BuffType dave_will_negative
        BuffType dave_withering
    endglobals
    
    function OnWithering takes Buff b returns nothing
        local Unit buffed = b.getBuffedUnit()
        local Unit caster = b.getCaster()
        local unit u = buffed.getUnit()
        local real hp = GetWidgetLife(u)
        local real damage = hp * 0.05
    
        call SetWidgetLife(u, hp - damage)
        set u = null
    endfunction
      

    private function init takes nothing returns nothing
        local Modifier m = Modifier.create()
        local Modifier n = Modifier.create()
        local Modifier o = Modifier.create()
        
        set dave_will_positive = BuffType.create(5.0,0.0,true)
        call dave_will_positive.setBuffModifier(m)
        call m.addModification(MOD_DAMAGE_BASE_PERC,0.0,0.002)
        call dave_will_positive.setBuffIcon( '@@0@@' )
        
        set dave_will_negative = BuffType.create(5.0,0,false)
        call dave_will_negative.setBuffModifier(n)
        call n.addModification(MOD_DAMAGE_BASE_PERC,-0.0,-0.002)
        call dave_will_negative.setBuffIcon( '@@1@@' )
        
        set dave_withering = BuffType.create(4.0,0,false)
        call dave_withering.setBuffModifier(o)
        call o.addModification(MOD_HP_REGEN_PERC,-0.5,-0.1)
        call o.addModification(MOD_EXP_GRANTED,-0.5,0.01)
        call o.addModification(MOD_BOUNTY_GRANTED,-0.5,0.01)
        call dave_withering.addPeriodicEvent(EventHandler.OnWithering,1)
        call dave_withering.setBuffIcon( '@@2@@' )
	endfunction
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => .
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => local integer numTowers = 0
    local integer level = tower.getLevel() 
    local Tower u
    local Iterate it = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TOWERS, 200)
    local unit towerUnit = tower.getUnit()
    local real mana = GetUnitState(towerUnit, UNIT_STATE_MANA)
     
    call SetUnitState(towerUnit , UNIT_STATE_MANA, mana/2)
    loop
        set u = it.next()
        exitwhen u == 0
        if u != tower and u.getGoldcost() >= 1300 then
            set numTowers = numTowers + 1
            call dave_will_negative.apply(tower, u, (50 + level))
        endif
    endloop
    if numTowers > 0 then
        call dave_will_positive.apply(tower, tower, (75 + level) * numTowers)
    endif
    set towerUnit = null
                    [values] => Array
                        (
                            [caster_art] => Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl
                            [icon] => ReplaceableTextures\CommandButtons\BTNUnholyFrenzy.blp
                            [AUTOCAST_cooldown] => 10
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [AUTOCAST_isExtended] => false
                            [long_explain] => The death knight decreases the base attack damage of all towers in |cffFFFF80200|r range by |cffFFFF8010%|r and loses |cffFFFF8050%|r of his remaining mana to increase his base damage by |cffFFFF8015%|r for each tower affected for |cffFFFF805|r seconds. Only towers that cost at least |cffFFFF801300|r gold are affected by this spell. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.2%|r damage absorbed
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_manacost] => 50
                            [AUTOCAST_range] => 900
                            [AUTOCAST_buffType] => 0
                            [name] => Will of the Undying
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Absorbs the attack damage of nearby towers.
                            [AUTOCAST_targetType] => 0
                            [target_art] => 
                            [AUTOCAST_autoRange] => 900
                        )

                )

            [3] => Array
                (
                    [name] => On Unit Comes In Range
                    [code] => local integer level = tower.getLevel()
    
    if tower.calcChance(0.15+level*0.004) then
       call dave_withering.apply(tower,Event.getTarget(),level)
    endif
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNDeathCoil.blp
                            [visible] => true
                            [name] => Withering Presence
                            [short_explain] => Units that come near the death knight have a chance to have their hp regeneration reduced and lose a percentage of their health every second, but grant less experience and gold.
                            [UNITINRANGE_targetType] => TARGET_TYPE_CREEPS
                            [long_explain] => Whenever a unit comes in |cffFFFF80900|r range of the death knight, it has a |cffFFFF8015%|r chance to have its health regeneration reduced by |cffFFFF8050%|r and to lose |cffFFFF805%|r of its current health every second for |cffFFFF804|r seconds. Units affected by this spell grant |cffFFFF8050%|r less experience and bounty on death. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.4%|r chance |r|n|cffFFFF80+1%|r health regen reduction |r|n|cffFFFF80-1%|r experience and bounty reduction
                            [UNITINRANGE_range] => 900
                        )

                )

            [4] => Array
                (
                    [name] => On Kill
                    [code] => local unit towerUnit = tower.getUnit()
    local real mana = GetUnitState(towerUnit, UNIT_STATE_MANA)
    local real maxMana = GetUnitState(towerUnit,UNIT_STATE_MAX_MANA)
     
    call SetUnitState(towerUnit , UNIT_STATE_MANA, mana+(maxMana*0.05))
    set towerUnit = null
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Bcri
                    [oeValues] => Array
                        (
                            [Bufftip] => Will of the Undying
                            [Targetattach] => weapon
                            [Buffubertip] => This unit has its damage increased.
                            [Targetattachcount] => 1
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNUnholyFrenzy.blp
                            [TargetArt] => Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => Bcri
                    [oeValues] => Array
                        (
                            [Bufftip] => Will of the Undying
                            [Targetattach] => chest
                            [Buffubertip] => This unit has its damage decreased.
                            [Targetattachcount] => 1
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNUnholyFrenzy.blp
                        )

                )

            [2] => Array
                (
                    [id] => @@2@@
                    [derivedFrom] => Bcri
                    [oeValues] => Array
                        (
                            [Bufftip] => Withering Presence
                            [Targetattach] => chest
                            [Buffubertip] => This unit has its health regeneration reduced and takes more damage from darkness.
                            [Targetattachcount] => 1
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNDeathCoil.blp
                            [TargetArt] => Abilities\Spells\Other\Drain\DrainCaster.mdl
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)