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

            [Art] => ReplaceableTextures\CommandButtons\BTNBearForm.blp
            [turnRate] => 3
            [dmgplus1] => 801
            [bldtm] => 1
            [goldcost] => 600
            [unitSound] => DruidOfTheClaw
            [sides1] => 1
            [manaN] => 500
            [acquire] => 900
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Initiate Druid of the Claw
            [weapTp1] => missile
            [file] => units\nightelf\DruidoftheClaw\DruidoftheClaw.mdl
            [uberSplat] => YTDH
            [Missilespeed] => 1800
            [Missileart] => war3mapImported\SpiritOfVengeanceMissileRed.mdl
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 5
            [modelScale] => 0.45
            [rangeN1] => 900
            [atkType1] => siege
            [cool1] => 1.8
            [Ubertip] => Woke up on the wrong side of the barrow den.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

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

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => Array
                (
                )

            [abil_factor] => 0.65
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => nature
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -20.5778
                    [y] => -29.6015
                    [z] => 0
                    [scale] => 0.23
                    [rot] => 3.42469
                    [file] => Doodads\LordaeronSummer\Terrain\LoardaeronRockChunks\LoardaeronRockChunks1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 24.4301
                    [y] => -6.59901
                    [z] => 0
                    [scale] => 0.38
                    [rot] => 4.76475
                    [file] => Doodads\LordaeronSummer\Terrain\LoardaeronRockChunks\LoardaeronRockChunks4.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -27.2107
                    [y] => 19.1902
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 2.15771
                    [file] => Doodads\LordaeronSummer\Terrain\LoardaeronRockChunks\LoardaeronRockChunks2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 13.2242
                    [y] => 38.5397
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 1.298
                    [file] => Doodads\LordaeronSummer\Terrain\LoardaeronRockChunks\LoardaeronRockChunks1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => -42.7981
                    [y] => -4.32474
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 3.06043
                    [file] => Doodads\LordaeronSummer\Terrain\LoardaeronRockChunks\LoardaeronRockChunks2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [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_bearform_buff
    endglobals
    
    //@export
    function ashbringer_druidoftheclaw_ondamage takes Tower tower, Creep target, real damage, integer count, real crit returns nothing
        local Iterate i
        local Creep next
        
        if tower.userInt == 1 then
            set i = Iterate.overUnitsInRangeOfUnit(tower, TARGET_TYPE_CREEPS, target, 200)
            loop
                set next = i.next()
                exitwhen next == 0 or count == 0
                if next != target then
                    set count = count - 1
                    call Effect.createSimpleOnUnit("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", next, "origin").destroy()
                    call tower.doAttackDamage(next, tower.getCurrentAttackDamageWithBonus() * damage, crit)
                endif
            endloop
            if next != 0 then
                call i.destroy()
            endif
        endif
    endfunction
    
    function ashbringer_bearform_create takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        
        set tower.userInt = 1
        set b.userReal = 2
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, -2)
        call SetUnitAnimation(tower.getUnit(), "morph")
        call AddUnitAnimationProperties(tower.getUnit(), "alternate", true)
    endfunction
    
    function ashbringer_bearform_periodic takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        
        if GetUnitState(tower.getUnit(), UNIT_STATE_MANA) > 0 then
            set b.userReal = b.userReal + 0.2
            call tower.modifyProperty(MOD_MANA_REGEN_PERC, -0.2)
        else
            call b.removeBuff()
        endif
    endfunction
    
    function ashbringer_bearform_attack takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        
        call tower.addManaPerc(0.01)
    endfunction
    
    function ashbringer_bearform_cleanup takes Buff b returns nothing
        local Tower tower = b.getBuffedUnit()
        
        set tower.userInt = 0
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, b.userReal)
        call SetUnitAnimation(tower.getUnit(), "morph alternate")
        call AddUnitAnimationProperties(tower.getUnit(), "alternate", false)
    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 mod = Modifier.create()
        
        set ashbringer_bearform_buff = BuffType.create(-1, 0, true)
        call ashbringer_bearform_buff.setBuffIcon('@@0@@')
        call mod.addModification(MOD_DAMAGE_BASE_PERC, 1.0, 0.04)
        call ashbringer_bearform_buff.setBuffModifier(mod)
        call ashbringer_bearform_buff.addEventOnCreate(ashbringer_bearform_create)
        call ashbringer_bearform_buff.addPeriodicEvent(ashbringer_bearform_periodic, 2)
        call ashbringer_bearform_buff.addEventOnAttack(ashbringer_bearform_attack, 1, 0)
        call ashbringer_bearform_buff.addEventOnCleanup(ashbringer_bearform_cleanup)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Tower Destruction
                    [code] => call tower.getBuffOfType(ashbringer_bearform_buff).removeBuff()
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => On Damage
                    [code] => local Creep target = Event.getTarget()
    local real damage = 0.25 + (tower.getLevel() * 0.01)
    
    if Event.isMainTarget() then
        call Effect.createSimpleOnUnit("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", target, "origin").destroy()
        call ashbringer_druidoftheclaw_ondamage(tower, target, damage, 2, Event.getCriticalMultiplier())
        set Event.damage = Event.damage * (1 + damage)
    endif
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 0.15
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNStrengthOfTheWild.blp
                            [name] => Maul
                            [short_explain] => Attacks have a chance to deal additional damage. Hits additional enemies while in Bear Form.
                            [ONDAMAGE_chanceLevelAdd] => 0.006
                            [long_explain] => Attacks have a |cffFFFF8015%|r chance to deal |cffFFFF8025%|r more damage. If the druid is in Bear Form, the extra damage hits up to |cffFFFF802|r additional enemies in |cffFFFF80200|r range of the primary target.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF800.6%|r chance|n|cffFFFF801%|r damage
                        )

                )

            [3] => Array
                (
                    [name] => Autocast
                    [code] => local integer power = R2I(1.0 + (tower.getLevel() * 0.04))
    local Buff b = tower.getBuffOfType(ashbringer_bearform_buff)
    
    call tower.addManaPerc(0.5)
    if b != 0 then
        call tower.modifyProperty(MOD_MANA_REGEN_PERC, b.userReal - 2)
        set b.userReal = 2
    else
        call ashbringer_bearform_buff.apply(tower, tower, power)
    endif
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 90
                            [AUTOCAST_autoRange] => 900
                            [AUTOCAST_manacost] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNEnchantedBears.blp
                            [AUTOCAST_range] => 900
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
                            [long_explain] => The druid transforms into a bear, increasing base attack damage by |cffFFFF80100%|r. Bear Form drains mana at an increasing rate and ends when the druid runs out of mana. Restores |cffFFFF8050%|r of maximum mana upon transforming and |cffFFFF801%|r of maximum mana on attack.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF804%|r attack damage
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Bear Form
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Transform into a bear, gaining increased strength at the cost of mana.
                        )

                )

            [4] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userInt = 0
    call SetUnitAnimation(tower.getUnit(), "stand")
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => Rupture
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Binf
                    [oeValues] => Array
                        (
                            [Targetattach] => Array
                                (
                                )

                            [Buffubertip] => Increased base attack damage.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Bear Form
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNEnchantedBears.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

    [lightning] => Array
        (
        )

)