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

            [targs1] => Array
                (
                )

            [goldcost] => 1350
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1100
            [targCount1] => 1
            [moveHeight] => 28
            [file] => Units\Creeps\tuskar\tuskar.mdl
            [atkType1] => pierce
            [dmgpt1] => 0.4
            [modelScale] => 0.6
            [weapTp1] => missile
            [acquire] => 900
            [rangeN1] => 900
            [upgrades] => Array
                (
                )

            [cool1] => 1.9
            [Ubertip] => Even more of a menace than the child.
            [backSw1] => 0.5
            [abilList] => Array
                (
                )

            [Name] => Teenage Tuskar
            [Missileart] => abilities\weapons\TuskarSpear\TuskarSpear.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNTuskaarBrown.blp
            [buildingShadow] => Array
                (
                )

            [turnRate] => 0.14
            [sides1] => 1
            [uberSplat] => Array
                (
                )

            [auto] => Array
                (
                )

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

    [settings] => Array
        (
            [author] => Palandu
            [element] => ice
            [authorDisplay] => |cffbdb76bPalandu|r
            [alpha] => 255
            [balanceTip] => |cffFFFF00+10% |rdmg to champions (|cffFFFF00+0.7%|r/lvl)|n|cffFFFF00+12.5% |rdmg to bosses (|cffFFFF00+1.2%|r/lvl)|n|cffFFFF00-20% |rdmg to air
            [rarity] => uncommon
            [version] => 1.0
            [abil_factor] => 0.85
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 1.29834
                    [y] => 17.1281
                    [z] => 0
                    [scale] => 1.02
                    [rot] => 1.74533
                    [file] => Doodads\Ashenvale\Structures\AshenRubble\AshenRubble2.mdl
                    [red] => 1
                    [green] => 50
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -33.4313
                    [y] => 11.5108
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 0
                    [file] => Doodads\Icecrown\Rocks\IceBlock\IceBlock2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 25.3611
                    [y] => 30.0285
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 3.19395
                    [file] => Doodads\Icecrown\Rocks\IceBlock\IceBlock2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => 13.7053
                    [y] => -38.0736
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 3.80482
                    [file] => Doodads\Icecrown\Rocks\IceBlock\IceBlock2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => 0.0000152588
                    [y] => -0.734596
                    [z] => 0
                    [scale] => 1.45
                    [rot] => 1.309
                    [file] => Abilities\Spells\Items\AIob\AIobTarget.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 155
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

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

            [1] => Array
                (
                    [id] => MOD_DMG_TO_BOSS
                    [base] => 0.125
                    [add] => 0.012
                )

            [2] => Array
                (
                    [id] => MOD_DMG_TO_AIR
                    [base] => -0.2
                    [add] => 0
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        //@import
        ProjectileType billy_SnowBall
    endglobals
    
    //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
    endfunction
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Attack
                    [code] => local Unit u = Event.getTarget()
        local real facingDelta
        local real unitToTowerVector = Atan2(tower.getY() - u.getY(), tower.getX() - u.getX())*bj_RADTODEG
        local Projectile p
        
        if (unitToTowerVector < 0) then
           set unitToTowerVector = unitToTowerVector + 360
        endif
        
        set facingDelta = unitToTowerVector - GetUnitFacing(u.getUnit()) 
        
        if (facingDelta < 0) then               
            set facingDelta = facingDelta + 360
        endif
        
        if (facingDelta > 180) then
            set facingDelta = 360 - facingDelta
        endif
        
        if facingDelta >=80 then   //launch
            set p = Projectile.createFromUnitToUnit(billy_SnowBall, tower, 100, 0, tower, Event.getTarget(), true, false, true)
            call p.setScale(1.3)
            if facingDelta <=100 then   //temple shot
                set p.userInt2=1
                set p.userReal=tower.getCurrentAttackDamageWithBonus()*1.2
                set p.userReal2=0.8
            else                        //back of the head
                set p.userInt2=2
                set p.userReal=tower.getCurrentAttackDamageWithBonus()*0.4
                set p.userReal2=0.6
            endif
            
            //decide hit/miss
            if tower.calcChance(0.2+I2R(tower.getLevel())/80) then
                set p.userInt = 1 //hit
            else
                set p.userInt = 0 //miss
            endif
        endif
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNFrostBolt.blp
                            [visible] => true
                            [name] => Vicious Snow Ball
                            [short_explain] => Hurls snowballs at the enemies heads.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => Throws a fast snowball on attack at the target's head when it's not facing this tower. But the snowball only has a |cffFFFF8020%|r chance to hit, where it hits is decided by the angle of attack.|n|n|cff9b32ffTemple Crusher|r : If it hits side-on, does |cffFFFF80120%|r of its attack damage as spell damage and a |cffFFFF800.8|r second stun.|n|n|cff00ff9bKnockdown|r : If it hits the back of the head, does |cffFFFF8040%|r of its attack damage as spell damage and a |cffFFFF800.6|r second stun.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1.25%|r chance to hit.
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
            [0] => Array
                (
                    [export] => false
                    [category] => global
                    [typ] => ProjectileType
                    [name] => billy_SnowBall
                )

        )

)