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

            [Art] => ReplaceableTextures\CommandButtons\BTNWindWalkOn.blp
            [dmgplus1] => 53
            [bldtm] => 1
            [goldcost] => 50
            [sides1] => 3
            [acquire] => 800
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Broken Circle of Wind
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => Abilities\Spells\Other\Tornado\TornadoElementalSmall.mdl
            [Missileart] => Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
            [Missilespeed] => 1500
            [dice1] => 1
            [RngBuff1] => 250
            [modelScale] => 0.25
            [rangeN1] => 1100
            [atkType1] => siege
            [cool1] => 1.4
            [Ubertip] => Strong gusts of wind often linger around these ruins.
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+70% |rdmg to air (|cffFFFF00+2%|r/lvl)
            [abil_factor] => 0.86
            [author] => SternBogen / Natac & girlfriend
            [alpha] => 255
            [authorDisplay] => SternBogen / Natac & girlfriend
            [version] => 1.29
            [element] => storm
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 50.7923
                    [y] => -0.605411
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 2.91511
                    [file] => Doodads\Cityscape\Structures\City_ColumnSingle1_Ruined\City_ColumnSingle1_Ruined.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => 18.0821
                    [y] => 41.3126
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 1.27409
                    [file] => Doodads\Cityscape\Structures\City_ColumnSingle\City_ColumnSingle.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 0.386889
                    [y] => -0.877714
                    [z] => 38.4
                    [scale] => 0.55
                    [rot] => 3.57793
                    [file] => Abilities\Spells\Items\AIlb\AIlbTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => -50.971
                    [y] => 1.40884
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 4.9578
                    [file] => Doodads\Cityscape\Structures\City_ColumnSingle1_Ruined\City_ColumnSingle1_Ruined.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => -1.36
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => -52.1577
                    [y] => 4.1011
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 2.31767
                    [file] => Doodads\Cityscape\Structures\City_ColumnSingle2_Ruined\City_ColumnSingle2_Ruined.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [5] => Array
                (
                    [x] => 51.6205
                    [y] => -17.7068
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 5.99118
                    [file] => Doodads\Cityscape\Structures\City_ColumnSingle2_Ruined\City_ColumnSingle2_Ruined.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [6] => Array
                (
                    [x] => 17.5556
                    [y] => -42.0723
                    [z] => 0
                    [scale] => 0.15
                    [rot] => 3.84157
                    [file] => Doodads\Cityscape\Structures\City_ColumnSingle1_Ruined\City_ColumnSingle1_Ruined.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_DMG_TO_AIR
                    [base] => 0.7
                    [add] => 0.02
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local Creep target = Event.getTarget()
    local real damage = 20 + 2 * tower.getLevel()
    local Buff b
    if (target.getSize() == SIZE_MASS or target.getSize() == SIZE_NORMAL or target.getSize() == SIZE_CHAMPION) then
        if(tower.calcChance(0.20 + (0.003 * tower.getLevel()))) then
            set b = target.getBuffOfType(sternbogen_broken_wind)
            if b != 0 then
                set damage = RMaxBJ(b.userReal3, damage)
            endif
            set b = sternbogen_broken_wind.applyCustomTimed(tower, target, tower.getLevel(), 0.5)
            if b != 0 then
                set b.userReal3 = damage
            endif
        endif
    endif
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNStun.blp
                            [name] => Wind of Death
                            [short_explain] => Grants a chance to catch a nonboss creep in a cyclone and cause physical damage to nearby creeps.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => On attack this tower has a |cffFFFF8020%|r chance to catch a ground, non-boss unit in a cyclone for |cffFFFF800.5|r seconds, dealing |cffFFFF8020|r physical damage to all units in |cffFFFF80300|r AoE when it falls back down. Falling champions deal |cffFFFF8025%|r more damage. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+2|r damage|n|cffFFFF80+0.3%|r chance to catch
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType sternbogen_broken_wind
    endglobals
    
    // Creep got buffed -> move creep up
    function cyclone_creep_up takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        // (start) cyclone animation
        set b.userInt = Effect.createAnimated("Abilities\\Spells\\NightElf\\Cyclone\\CycloneTarget.mdl", c.getX(), c.getY(), 0.0, 0.0)
        call Effect(b.userInt).noDeathAnimation()
        // move creep up
        call c.adjustHeight(300, 1000)
    endfunction 
    
    // turn the creep (cyclone) -> Periodic event
    function cyclone_creep_turn takes Buff b returns nothing 
        local unit real_unit = b.getBuffedUnit().getUnit()
        call SetUnitFacing(real_unit, GetUnitFacing(real_unit) + 150.0)
        set real_unit = null
    endfunction 
    

    
    // move creep down and do damage
    function cyclone_creep_down takes Buff b returns nothing 
        local Tower t = b.getCaster()
        local Creep c = b.getBuffedUnit()
        local real ratio = 1
        // set units back (down)
        call c.adjustHeight(-300, 2500)
        // remove the cyclone
        call Effect(b.userInt).destroy()
        // effects
        call Effect.createSimpleAtUnit("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", c).destroy()
        call Effect.createSimpleAtUnit("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", c).destroy()
        // do damage
        if c.getSize() == SIZE_CHAMPION then
            set ratio = 1.25
        endif
        call t.doAttackDamageAoEUnit(c, ratio * 300.0, b.userReal3, t.calcAttackMulticrit(0,0,0), 0.0)
    endfunction
    
    private function init takes nothing returns nothing
        set sternbogen_broken_wind = BuffType.createDuplicate(cb_stun, 1.0, 0, false)
        call sternbogen_broken_wind.setBuffIcon('@@0@@')
        
        // on creation on buff ON the creep -> lift unit up
        call sternbogen_broken_wind.addEventOnCreate(cyclone_creep_up)
        // during buffed: periodic -> rotate creep
        call sternbogen_broken_wind.addPeriodicEvent(cyclone_creep_turn, 0.1)
        // buff ends -> unit down, damage or if creep gets killed while lift up
        call sternbogen_broken_wind.addEventOnCleanup(cyclone_creep_down)

	endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Bcyc
                    [oeValues] => Array
                        (
                            [Buffubertip] => This unit is caught in a deadly cyclone and  when it comes down it will damage all nearby creeps.
                            [EffectArt] => Abilities\Spells\NightElf\Cyclone\CycloneTarget.mdl
                            [Bufftip] => Caught in the spin
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNStun.blp
                        )

                )

        )

    [units] => Array
        (
        )

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

        )

)