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

            [targs1] => ground,enemies
            [goldcost] => 3050
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1500
            [file] => units\human\GryphonRider\GryphonRider.mdl
            [moveHeight] => 200
            [manaN] => 55
            [atkType1] => normal
            [modelScale] => 0.7
            [weapTp1] => missile
            [acquire] => 900
            [rangeN1] => 900
            [upgrades] => Array
                (
                )

            [cool1] => 2
            [Ubertip] => WC2 wasn't enough.
            [regenMana] => 2
            [abilList] => Array
                (
                )

            [Name] => Gryphon Rider
            [Art] => ReplaceableTextures\CommandButtons\BTNGryphonRider.blp
            [buildingShadow] => Array
                (
                )

            [unitSound] => GryphonRider
            [turnRate] => 0.5
            [sides1] => 11
            [uberSplat] => OSMA
            [auto] => Array
                (
                )

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

    [settings] => Array
        (
            [author] => cedi
            [element] => storm
            [authorDisplay] => cedi
            [alpha] => 255
            [balanceTip] => |cffFF0000Attacks GROUND only|r|n|cffFFFF00+8% |rdamage/lvl
            [rarity] => unique
            [version] => 1.0
            [abil_factor] => 0.5
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 9.86225
                    [y] => 22.134
                    [z] => -6.4
                    [scale] => 0.4
                    [rot] => 3.67172
                    [file] => Doodads\Barrens\Rocks\Barrens_Spires\Barrens_Spires0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -19.3109
                    [y] => 8.42834
                    [z] => -6.4
                    [scale] => 0.4
                    [rot] => 0.0752668
                    [file] => Doodads\Barrens\Rocks\Barrens_Spires\Barrens_Spires0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 2.47269
                    [y] => -10.781
                    [z] => -6.4
                    [scale] => 0.3
                    [rot] => 3.06525
                    [file] => Doodads\Barrens\Rocks\Barrens_Spires\Barrens_Spires1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => 24.9499
                    [y] => -18.7404
                    [z] => 57.6
                    [scale] => 1
                    [rot] => 2.79253
                    [file] => Abilities\Spells\Undead\UnholyFrenzy\UnholyFrenzyTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => -37.5578
                    [y] => 7.49299
                    [z] => 140.8
                    [scale] => 1
                    [rot] => 2.79253
                    [file] => Abilities\Spells\Undead\UnholyFrenzy\UnholyFrenzyTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [5] => Array
                (
                    [x] => 28.2689
                    [y] => 37.5682
                    [z] => 115.2
                    [scale] => 1
                    [rot] => 2.79253
                    [file] => Abilities\Spells\Undead\UnholyFrenzy\UnholyFrenzyTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_DAMAGE_BASE_PERC
                    [base] => 0
                    [add] => 0.08
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Damage
                    [code] => set Event.damage = 0
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [ONDAMAGE_chanceLevelAdd] => 0.0
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType PT
        ProjectileType HR
        BuffType BT
    endglobals
        
    function DealDamage takes Tower T, Creep C, real dmg returns nothing
        local real spell = C.getProp_SpellDmgReceived()
        local real phys = C.getProp_AtkDmgReceived()
        local real r
        local real crit = 0.0
        
        //calc spell damage taken
        //Immune?
        if C.isImmune() then
            //0% spell damage
            set spell = 0
        endif
        
        //calc physical damage taken
        //Banished?
        if C.isBanished() then
            //0% physical damage
            set phys = 0
        else
            //armor
            set phys = phys * C.getCurrentArmorDamageReduction()
        endif
        
        //we don't want anything below zero!
        if spell < 0.00 then
            set spell = 0
        endif
        if phys < 0.00 then
            set phys = 0
        endif
        
        //Result are how much physical and spell damage the unit takes.
        //Probably adding these two wont result in 100% so we have to scale them
        set r = spell + phys
        if r <= 0 then
            //shit happened...
            return
        endif
        if r != 1.0 then
            set spell = spell / r
            set phys = phys / r
        endif
        
        //crit bonus?
        if phys == 1.0 or spell == 1.0 then
            set crit = 0.05 + 0.018 * T.getLevel()
        endif
        //Now we know what we need to know to deal damage
        call T.doSpellDamage( C, dmg * spell, T.calcSpellCrit(crit, 0.0) )
        call T.doAttackDamage( C, dmg * phys, T.calcAttackMulticrit(crit, 0, 0) )
    endfunction
    
    function LineDamage takes Tower T, real sx, real sy, real angle returns nothing
        local Iterate I
        local Creep C
        local integer i = 0
        local real distance = 128.0
        local real x
        local real y
        local Effect E
        local real dmg = T.getCurrentAttackDamageWithBonus()
        local integer UID = T.getUID()
        set angle = angle * bj_DEGTORAD
        loop
            exitwhen i >= 5 or T.getUID() != UID
            set x = sx + Cos( angle ) * ( distance * i )
            set y = sy + Sin( angle ) * ( distance * i )
            set I = Iterate.overUnitsInRange( T, TARGET_CREEPS, x, y, 85.0 )
            loop
                set C = I.next()
                exitwhen C == 0
                call DealDamage( T, C, dmg )
            endloop
            //Effect creation
            call Effect.createScaled( "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", x, y, 0.00, 0.00, 0.5 ).setLifetime(1.5)
            call Effect.createColored( "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl", x, y, 0.00, 0.00, 2.0, 0, 0, 0, 255 ).setLifetime(2.5)
            
            set dmg = dmg * ( 0.6 + 0.012 * T.getLevel() )
            set i = i + 1
            call TriggerSleepAction( 0.15 )
        endloop
    endfunction
    
    function hit takes Projectile P, Creep C returns nothing
        local Tower T = P.getCaster()
        if C != 0 then
            //hit
            call DealDamage( T, C, T.getCurrentAttackDamageWithBonus() )
        endif
        call LineDamage( T, P.x, P.y, P.direction )
    endfunction
    
    function impact takes Projectile P returns nothing
        local Tower T = P.getCaster()
        local Iterate I = Iterate.overUnitsInRange( T, TARGET_CREEPS, P.x, P.y, 600.0 )
        local Unit U
        
        loop
            set U = I.next()
            exitwhen U == 0
            call DealDamage( T, U, P.userReal )
            call cb_stun.applyOnlyTimed( T, U, 1.0 )
        endloop
    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 m = Modifier.create()
        call m.addModification( MOD_DAMAGE_ADD_PERC, -0.1, 0.0 )
        
        set PT = ProjectileType.createInterpolate( "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", 1100.0 )
        call PT.setEventOnInterpolationFinished( hit )
        
        set HR = ProjectileType.create( "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", 90.0, 0.0 )
        call HR.enablePhysics( 0, impact, -30, 0, 0.0 )
        
        set BT = BuffType.create( 6.0, 0.0, false )
        call BT.setBuffIcon( '@@0@@' )
        call BT.setBuffModifier( m )
    endfunction
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNStormHammer.blp
                            [visible] => true
                            [name] => Mystical Storm Hammer
                            [short_explain] => All damage is dealt partly as spell damage and partly as attack damage.
                            [long_explain] => Whenever this tower damages a creep, part of the damage is dealt as spell damage and the rest as attack damage. The amount of spell damage depends on the magic resistance of the target. The higher the resistance, the smaller ratio of spell damage dealt. Deals no spell damage against immune creeps and deals no physical damage against banished creeps. If this ability deals all the damage in one type, it will have |cffFFFF805%|r increased critchance.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1.8%|r crit chance
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => local Projectile P = Projectile.createFromUnit( HR, tower, Event.getTarget(), 0.0, 1.0, 1.0 )
    local Iterate I = Iterate.overUnitsInRangeOfCaster( tower, TARGET_PLAYER_TOWERS, 2500.0 )
    local Tower U
    local real r = 1
    call P.setScale( 8 )
    set P.z = 1000.0
    set P.userReal = 10000.0
    
    loop
        set U = I.next()
        exitwhen U == 0
        if U.getElement() == Element.STORM then
            set r = r + ( 0.05 + 0.002 * tower.getLevel() )
            call BT.apply( tower, U, 0 )
        endif
        if r >= 2.0 then
            call I.destroy()
            exitwhen true
        endif
    endloop
    set P.userReal = P.userReal * r
                    [values] => Array
                        (
                            [caster_art] => 
                            [icon] => ReplaceableTextures\CommandButtons\BTNThunderclap.blp
                            [AUTOCAST_cooldown] => 10.0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [AUTOCAST_isExtended] => false
                            [long_explain] => Summons a hammer which falls from the sky. The hammer deals |cffFFFF8010000|r spell damage to all units in |cffFFFF80600|r AoE and stuns them for |cffFFFF801|r second. Each of the player's |cFF8080FFstorm|r tower in |cffFFFF802500|r range loses |cffFFFF8010%|r attack damage for |cffFFFF806|r seconds but increases the spell damage of the Hammer by |cffFFFF805%|r. Can gain a maximum of |cffFFFF80100%|r bonus damage.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.2%|r damage from towers
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_UNIT
                            [AUTOCAST_manacost] => 50
                            [AUTOCAST_range] => 900.0
                            [AUTOCAST_buffType] => 0
                            [name] => Hammer Fall
                            [AUTOCAST_targetSelf] => true
                            [short_explain] => Summons a mighty hammer that deals massive damage and stuns creeps on impact.
                            [AUTOCAST_targetType] => 0
                            [target_art] => 
                            [AUTOCAST_autoRange] => 900.0
                        )

                )

            [3] => Array
                (
                    [name] => On Attack
                    [code] => call Projectile.createLinearInterpolationFromUnitToUnit( PT, tower, 1.0, 1.0, tower, Event.getTarget(), 0.15, true )
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNStormBolt.blp
                            [visible] => true
                            [name] => Storm Bolt
                            [short_explain] => When this tower attacks it launches a storm bolt. The bolt deals the tower's attack damage to the target unit and reduced damage to units behind it.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => When this tower attacks it launches a storm bolt towards the target unit. Upon collision, the bolt deals the towers attack damage to the target and creates a trail of |cffFFFF805|r storm explosions. The explosions deal the tower's attack damage to every unit in |cffFFFF8085|r AOE. Each explosion deals |cffFFFF8040%|r less damage than the previous one.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80-1.2%|r damage reduction
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Bufftip] => Hammer Fall
                            [Buffubertip] => This tower has decreased attack damage.
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNThunderclap.blp
                            [TargetArt] => Array
                                (
                                )

                            [EditorName] => Hammer Fall
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)