Array
(
    [scriptVersion] => 7
    [oeValues] => Array
        (
            [Name] => Even More Magical Hammer
            [Art] => ReplaceableTextures\CommandButtons\BTNWandOfCyclone.blp
            [Ubertip] => The professional version.
            [abilList] => Array
                (
                )

        )

    [settings] => Array
        (
            [author] => cedi
            [authorDisplay] => MisterDualcore
            [balanceTip] => Array
                (
                )

            [rarity] => unique
            [goldcost] => 1000
            [version] => 1.0
        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Item Pickup
                    [code] => local Tower T = itm.getCarrier()
    local Buff B = T.getBuffOfType( Hammer_Mark )
    
    if B == 0 then
        //First hammer on tower
        call Hammer_Mark.apply( T, T, 1 )
    else
        //Already a hammer on the tower
        call B.setLevel( B.getLevel() + 1 )
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType Hammer_Mark
        BuffType Hammer_Aura
    endglobals
    
    function Mark_Setup takes Buff B returns nothing
        set B.userInt = 5
        set B.userInt2 = 5
        set B.userInt3 = 5
        
        set B.userReal = 50
        set B.userReal2 = 50
        set B.userReal3 = 50
    endfunction
    
    function Hammer_Aura_Trig takes Buff B returns nothing
        local Tower T = Event.getTarget()
        local integer lvl
        if Event.isSpellDamage() then
            //Has attacker the mark buff?
            set B = T.getBuffOfType( Hammer_Mark )
            if B != 0 then
                set lvl = B.getLevel()
            
                //Attacking tower carries a hammer
                //Hammer 1
                set B.userInt = B.userInt - 1
                if B.userInt <= 0 then
                    set B.userInt = 5
                    call T.addSpellCrit()
                endif
                
                //Hammer 2
                if lvl >= 2 then
                    set B.userInt2 = B.userInt2 - 1
                    if B.userInt2 <= 0 then
                        set B.userInt2 = 5
                        call T.addSpellCrit()
                    endif
                else
                    //Only 1 hammer
                    return
                endif
                
                //Hammer 3
                if lvl >= 3 then
                    set B.userInt3 = B.userInt3 - 1
                    if B.userInt3 <= 0 then
                        set B.userInt3 = 5
                        call T.addSpellCrit()
                    endif
                else
                    //Only 2 hammer
                    return
                endif
                
                //Hammer 4
                if lvl >= 4 then
                    set B.userReal = B.userReal - 10
                    if B.userReal < 5 then //Because real are realy not accurate at all.
                        set B.userReal = 50
                        call T.addSpellCrit()
                    endif
                else
                    //Only 3 hammer
                    return
                endif
                
                //Hammer 5
                if lvl >= 5 then
                    set B.userReal2 = B.userReal2 - 10
                    if B.userReal2 < 5 then //Because real are realy not accurate at all.
                        set B.userReal2 = 50
                        call T.addSpellCrit()
                    endif
                else
                    //Only 4 hammer
                    return
                endif
                
                //Hammer 6
                if lvl >= 6 then
                    set B.userReal3 = B.userReal3 - 10
                    if B.userReal3 < 5 then //Because real are realy not accurate at all.
                        set B.userReal3 = 50
                        call T.addSpellCrit()
                    endif
                endif
            endif
        endif
    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 Hammer_Mark = BuffType.create( -1, 0, true )
        call Hammer_Mark.setBuffIcon( '@@0@@' )
        call Hammer_Mark.addEventOnCreate( Mark_Setup )
        
        set Hammer_Aura = BuffType.create( -1, 0, false )
        call Hammer_Aura.setBuffIcon( '@@1@@' )
        call Hammer_Aura.addEventOnDamaged( Hammer_Aura_Trig, 1.0, 0.0 )
	endfunction
                    [values] => Array
                        (
                            [visible] => true
                            [name] => Even More Magical Weapon
                            [goldcost] => 1000
                            [explain] => Every |cffFFFF805th|r instance of spell damage is a critical hit.
                        )

                )

            [2] => Array
                (
                    [name] => On Item Drop
                    [code] => local Tower T = itm.getCarrier()
    local Buff B = T.getBuffOfType( Hammer_Mark )
    
    if B != 0 then
        //First hammer on tower
        if B.getLevel() == 1 then
            call B.removeBuff() //Only one hammer was on the tower.
        else
            call B.setLevel( B.getLevel() - 1 )
        endif
    else
        //No buff, although there is still a hammer on the tower! Shit happened!
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [3] => Array
                (
                    [name] => On Unit Comes In Range
                    [code] => local Unit U = Event.getTarget()
    if U.getBuffOfType( Hammer_Aura ) == 0 then
        call Hammer_Aura.apply( itm.getCarrier(), U, 0 )
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                            [UNITINRANGE_targetType] => TARGET_TYPE_CREEPS
                            [UNITINRANGE_range] => 2000
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Bufftip] => Epic Equipment
                            [Buffubertip] => This tower carries an even more magical hammer!
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNWandOfCyclone.blp
                            [TargetArt] => Array
                                (
                                )

                            [EditorName] => Epic Equipment
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Bufftip] => Even More Magical Hammer
                            [Buffubertip] => This unit is in range of an even more magical hammer.
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNWandOfCyclone.blp
                            [TargetArt] => Array
                                (
                                )

                            [EditorName] => Even More Magical Hammer
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)