|   Baby Tuskar v1 535
                       |  ID: 142  Family ID:  Author: Palandu  Rarity: uncommon  Element: ice  Attack Type: Elemental  Attack Range: 900  Attack CD: 1.9  Damage: 1008-1008  Status: Approved |  Specials: +8% dmg to champions (+0.6%/lvl) +10% dmg to bosses (+1%/lvl) -20% dmg to air  Vicious Snow Ball Throws a fast snowball on attack at the target's head when it's not facing this tower. But the snowball only has a 20% chance to hit, where it hits is decided by the angle of attack. Temple Crusher : If it hits side-on, does 120% of its attack damage as spell damage and a 0.6 second stun. Knockdown : If it hits the back of the head, does 40% of its attack damage as spell damage and a 0.4 second stun. Level Bonus: +1% chance to hit. | Download Toggle Triggers Header     globals
        //@export
        ProjectileType billy_SnowBall
    endglobals
    
    private function billy_SnowBallHit takes Projectile p, Unit target returns nothing
        local Unit t = p.getCaster()
        if p.userInt == 0 then //miss
            call t.getOwner().displayFloatingTextX2("missed", target, 150, 50, 0, 155, 0.07, 1, 2, 0.018, 0)
        else
            call t.doSpellDamage(target, p.userReal, t.calcSpellCritNoBonus())
            call cb_stun.applyOnlyTimed(t, target, p.userReal2)
            call SFXAtUnit("Abilities\\Spells\\Other\\FrostBolt\\FrostBoltMissile.mdl", target.getUnit())
            if p.userInt2 == 1 then //temple shot
                call t.getOwner().displayFloatingTextX2("Temple Crusher!", target, 150, 50, 255, 200, 0.07, 2, 3, 0.026, 0)
            else
                call t.getOwner().displayFloatingTextX2("Knockdown!", target, 0, 0, 255, 155, 0.07, 1.5, 3, 0.022, 0)
            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 billy_SnowBall = ProjectileType.createInterpolate("Abilities\\Spells\\Items\\AIob\\AIobTarget.mdl", 2000)
        call billy_SnowBall.enableHoming(billy_SnowBallHit,0)
    endfunctionOn Attack 
                            
                                ONATTACK_chance: 1.0
                            
                                ONATTACK_chanceLevelAdd: 0.0
                            
                             function onAttack takes Tower tower returns nothing
        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(0.8)
            if facingDelta <=100 then   //temple shot
                set p.userInt2=1
                set p.userReal=tower.getCurrentAttackDamageWithBonus()*1.2
                set p.userReal2=0.6
            else                        //back of the head
                set p.userInt2=2
                set p.userReal=tower.getCurrentAttackDamageWithBonus()*0.4
                set p.userReal2=0.4
            endif
            
            //decide hit/miss
            if tower.calcChance(0.20+I2R(tower.getLevel())/100) then
                set p.userInt = 1 //hit
            else
                set p.userInt = 0 //miss
            endif
        endif
endfunction | 
|   Teenage Tuskar v1 1350
                       |  ID: 143  Family ID:  Author: Palandu  Rarity: uncommon  Element: ice  Attack Type: Elemental  Attack Range: 900  Attack CD: 1.9  Damage: 2403-2403  Status: Approved | Description: Even more of a menace than the child.  Specials: +10% dmg to champions (+0.7%/lvl) +12.5% dmg to bosses (+1.2%/lvl) -20% dmg to air  Vicious Snow Ball Throws a fast snowball on attack at the target's head when it's not facing this tower. But the snowball only has a 20% chance to hit, where it hits is decided by the angle of attack. Temple Crusher : If it hits side-on, does 120% of its attack damage as spell damage and a 0.8 second stun. Knockdown : If it hits the back of the head, does 40% of its attack damage as spell damage and a 0.6 second stun. Level Bonus: +1.25% chance to hit. | Download Toggle Triggers Header     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
    endfunctionOn Attack 
                            
                                ONATTACK_chance: 1.0
                            
                                ONATTACK_chanceLevelAdd: 0.0
                            
                             function onAttack takes Tower tower returns nothing
        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
endfunction | 
|   Fully Grown Tuskar v1 2900
                       |  ID: 144  Family ID:  Author: Palandu  Rarity: uncommon  Element: ice  Attack Type: Elemental  Attack Range: 900  Attack CD: 1.9  Damage: 4918-4918  Status: Approved | Description: Still uses childish tactics.  Specials: +12% dmg to champions (+0.8%/lvl) +15% dmg to bosses (+1.4%/lvl) -20% dmg to air  Vicious Snow Ball Throws a fast snowball on attack at the target's head when it's not facing this tower. But the snowball only has a 20% chance to hit, where it hits is decided by the angle of attack. Temple Crusher : If it hits side-on, does 120% of its attack damage as spell damage and a 1 second stun. Knockdown : If it hits the back of the head, does 40% of its attack damage as spell damage and a 0.8 second stun. Level Bonus: +1.4% chance to hit. | Download Toggle Triggers Header     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
    endfunctionOn Attack 
                            
                                ONATTACK_chance: 1.0
                            
                                ONATTACK_chanceLevelAdd: 0.0
                            
                             function onAttack takes Tower tower returns nothing
        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.8)
            if facingDelta <=100 then   //temple shot
                set p.userInt2=1
                set p.userReal=tower.getCurrentAttackDamageWithBonus()*1.2
                set p.userReal2=1.0
            else                        //back of the head
                set p.userInt2=2
                set p.userReal=tower.getCurrentAttackDamageWithBonus()*0.4
                set p.userReal2=0.8            
            endif
            
            //decide hit/miss
            if tower.calcChance(0.20+(1.4*I2R(tower.getLevel())/100)) then
                set p.userInt = 1 //hit
            else
                set p.userInt = 0 //miss
            endif
        endif
endfunction | 
Description: