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

            [Art] => ReplaceableTextures\CommandButtons\BTNSacrifice.blp
            [dmgplus1] => 1233
            [bldtm] => 1
            [goldcost] => 1300
            [sides1] => 1
            [manaN] => 100
            [acquire] => 850
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Sacrificial Lamb
            [red] => 100
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => Doodads\Ruins\Props\RuinsBloodyAltar\RuinsBloodyAltar.mdl
            [Missileart] => Abilities\Weapons\AvengerMissile\AvengerMissile.mdl
            [Missilespeed] => 1500
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 2.5
            [green] => 50
            [modelScale] => 0.75
            [rangeN1] => 850
            [atkType1] => hero
            [cool1] => 1
            [Ubertip] => Sacrifices itself to boost nearby towers.
            [blue] => 100
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+0.1 |rmana regen/lvl
            [abil_factor] => 0.9
            [author] => DaveMatthews
            [alpha] => 255
            [authorDisplay] => DaveMatthews
            [version] => 1.0
            [element] => darkness
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.0000172264
                    [y] => 46.0436
                    [z] => 32
                    [scale] => 0.7
                    [rot] => 3.14159
                    [file] => units\critters\Sheep\Sheep.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -2.01254
                    [y] => -10.6206
                    [z] => 0
                    [scale] => 0.9
                    [rot] => 4.79966
                    [file] => Doodads\BlackCitadel\Props\RuneArt\RuneArt2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => -39.7957
                    [y] => 6.32029
                    [z] => 0
                    [scale] => 0.6
                    [rot] => 3.83973
                    [file] => Doodads\LordaeronSummer\Props\SittingCorpse\SittingCorpse.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => 60.545
                    [y] => 37.0017
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 5.68977
                    [file] => Doodads\LordaeronSummer\Props\ImpaledBody\ImpaledBody0.mdl
                    [red] => 150
                    [green] => 150
                    [blue] => 150
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_MANA_REGEN
                    [base] => 0
                    [add] => 0.1
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local integer numTowers
    local integer level = tower.getLevel() 
    local Tower u
    local Buff b
    local Iterate it = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TOWERS, 200)

    set b = tower.getBuffOfType(dave_blood_altar)
    set numTowers = it.count() - 1

    if b == 0 then
      call SFXAtUnit("Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodKnight.mdl", tower.getUnit())
        loop
            set u = it.next()
            exitwhen u == 0
            if u != tower and numTowers > 0 then
                call dave_blood_target.apply(tower, u, (50 + level)/numTowers)
            endif
        endloop
        if numTowers > 0 then
            call dave_blood_altar.apply(tower, tower, level)
            call tower.addExp(0.25 * numTowers)
        endif
    else
      call it.destroy()    
    endif
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNImpale.blp
                            [name] => Blood Spill
                            [short_explain] => Has a chance to sacrifice its attack speed to boost surrounding towers.
                            [ONATTACK_chance] => 0.15
                            [ONATTACK_chanceLevelAdd] => 0.002
                            [long_explain] => On attack, this tower has a |cffFFFF8015%|r chance to lose |cffFFFF80100%|r attack speed and boost the attack speed of all towers in |cffFFFF80200|r range by |cffFFFF8050%|r, equally divided among them, for |cffFFFF806|r seconds. Every time it casts Blood Spill, the tower gains |cffFFFF800.25|r experience for every other tower affected. Cannot retrigger when the buff is already active. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1%|r attack speed |r|n|cffFFFF80+0.2%|r chance
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType dave_sacrifice_target
        //@export
        BuffType dave_sacrifice_altar
        //@export
        BuffType dave_blood_target
        //@export
        BuffType dave_blood_altar
    endglobals
    
    function resetBonus takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
       call tower.modifyProperty(MOD_DPS_ADD, -b.userReal)
    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_blood_target = BuffType.create(6.0,0.0,true)
        call dave_blood_target.setBuffModifier(m)
        call m.addModification(MOD_ATTACKSPEED,0.0,0.01)
        call dave_blood_target.setBuffIcon( '@@0@@' )
        
        set dave_blood_altar = BuffType.create(6.0,0,false)
        call dave_blood_altar.setBuffModifier(n)
        call n.addModification(MOD_ATTACKSPEED,-1.0,0.0)
        call dave_blood_altar.setBuffIcon( '@@1@@' )
        
        set dave_sacrifice_target = BuffType.create(6.0,0,true)
        call dave_sacrifice_target.addEventOnCleanup(resetBonus)
        call dave_sacrifice_target.setBuffIcon( '@@2@@' )
        
        set dave_sacrifice_altar = BuffType.create(6.0,0,false)
        call dave_sacrifice_altar.setBuffModifier(o)
        call o.addModification(MOD_DAMAGE_ADD_PERC,-1.0,0)
        call dave_sacrifice_altar.setBuffIcon( '@@3@@' )
	endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => local Tower target = Event.getTarget()
    local Buff b

    if target.getFamily() != tower.getFamily() then
        if target.getBuffOfType(dave_sacrifice_target) != 0 then
            call dave_sacrifice_target.apply(tower, target, 0)
        else
            set b = dave_sacrifice_target.apply(tower, target, 0)
            set b.userReal = tower.getCurrentAttackDamageWithBonus()*(0.3+(0.006*tower.getLevel()))
            call target.modifyProperty(MOD_DPS_ADD, b.userReal) 
        endif
        
        call dave_sacrifice_altar.apply(tower, tower, tower.getLevel())
    endif
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 6
                            [AUTOCAST_autoRange] => 500
                            [AUTOCAST_manacost] => 90
                            [icon] => ReplaceableTextures\CommandButtons\BTNSacrifice.blp
                            [AUTOCAST_range] => 500
                            [AUTOCAST_targetType] => TARGET_TYPE_TOWERS
                            [AUTOCAST_numBuffsBeforeIdle] => 1
                            [caster_art] => Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
                            [long_explain] => This tower loses |cffFFFF80100%|r of its damage to boost the dps of a tower in |cffFFFF80500|r range by |cffFFFF8030%|r of its total damage for |cffFFFF806|r seconds. This buff has no effect on towers of the same family.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6%|r bonus damage
                            [target_art] => Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_BUFF
                            [AUTOCAST_buffType] => dave_sacrifice_target
                            [AUTOCAST_isExtended] => false
                            [name] => Sacrifice
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Sacrifices its damage to boost another tower.
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Bhea
                    [oeValues] => Array
                        (
                            [Buffubertip] => This unit has its attack speed increased.
                            [Bufftip] => Blood Spill
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNImpale.blp
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => Bhea
                    [oeValues] => Array
                        (
                            [Buffubertip] => This unit has its attack speed reduced.
                            [Bufftip] => Blood Spill
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNImpale.blp
                        )

                )

            [2] => Array
                (
                    [id] => @@2@@
                    [derivedFrom] => Bhea
                    [oeValues] => Array
                        (
                            [Buffubertip] => This unit has its attack damage increased.
                            [Bufftip] => Sacrifice
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNSacrifice.blp
                        )

                )

            [3] => Array
                (
                    [id] => @@3@@
                    [derivedFrom] => Bhea
                    [oeValues] => Array
                        (
                            [Buffubertip] => This unit has its attack damage reduced.
                            [Bufftip] => Sacrifice
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNSacrifice.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

            [1] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => dave_sacrifice_altar
                )

            [2] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => dave_blood_target
                )

            [3] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => dave_blood_altar
                )

        )

)