Bonk, the Living Mountain v1
2500
ID:
200
Family ID:
Author:
Boekie
Rarity:
unique
Element:
nature
Attack Type:
Physical
Attack Range:
750
Attack CD:
3
Damage:
3670-3670
Abil. Factor:
0.4
Status:
Approved

Description:

This enormous creature is able to crush everything with its enormous hands.

Latest Upload Comment:

Restored from 1.10
Specials:
Splash attack:
   100 AoE: 100% damage
+25% dmg to masses (+0.5%/lvl)
Landslide!
Bonk has a 25% chance on attack to throw rocks at all creeps in 300 AoE around the main target. These rocks deal 700 spelldamage and stun for 0.5 seconds. Landslide deals 15 bonus spelldamage per grow, but the ability only works once Bonk has grown at least 20 times. 

Level Bonus:
+50 spelldamage
Crush!
Whenever Bonk damages a stunned creep it deals 5000 spelldamage to it. When this happens, towers in 500 range will gain 10% attackspeed and damage for 10 seconds. Crush deals 50 bonus spelldamage per grow, but the ability only works once Bonk has grown at least 10 times. 

Level Bonus:
+250 spelldamage 
+0.4% attackspeed and damage
Grow!
Every 25 seconds Bonk grows, gaining 4 experience and 3% bonus attackdamage. Bonk can grow 160 times.

Level Bonus:
+0.1% bonus attackdamage
Download

Toggle Triggers

Header

    globals
        BuffType boekie_mountainMorale_buff
        ProjectileType rock
        MultiboardValues boekie_grow_MultiboardValue 
    endglobals
    
    public function hit takes Projectile p, Unit creep returns nothing 
        local Tower tower = p.getCaster()
        if p.userInt == creep.getUID() then
            call tower.doSpellDamage(creep,700+(tower.getLevel()*50)+(tower.userInt*15),tower.calcSpellCritNoBonus()) 
            call cb_stun.applyOnlyTimed(tower, creep, 0.5)
        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
        local Modifier m = Modifier.create()  
        set boekie_mountainMorale_buff = BuffType.create(10.00, 0, true)      
        call m.addModification(MOD_DAMAGE_ADD_PERC, 0.10, 0.004)  
        call m.addModification(MOD_ATTACKSPEED, 0.10, 0.004)  
        call boekie_mountainMorale_buff.setBuffModifier(m) 
        call boekie_mountainMorale_buff.setBuffIcon('@@0@@')  
        
        set rock = ProjectileType.create("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",4,700) 
        call rock.enableHoming(ProjectileTargetEvent.hit,0) 
        
        set boekie_grow_MultiboardValue = MultiboardValues.create(1)  
        call boekie_grow_MultiboardValue.setKey(0,"Number of Grows") 
    
    endfunction

On Attack

ONATTACK_chance: 0.25 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    local Iterate it
    local Unit next
    local real tx = tower.getX()
    local real ty = tower.getY()

    if tower.userInt >= 20 then //check number of grows
        set it = Iterate.overUnitsInRangeOfUnit(tower,TARGET_CREEPS,Event.getTarget(), 300) 
        loop 
            set next = it.next()  
            exitwhen next == 0 
            set Projectile.createFromPointToUnit(rock,tower,1,0,tx,ty,100,next,true,false,false).userInt = next.getUID()
        endloop 
    endif
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local Unit creep = Event.getTarget()
    local integer level = tower.getLevel()
    local Iterate it
    local Unit next 

    if tower.userInt >= 10 then //check number of grows
        if creep.getBuffOfGroup("stun") != 0 then
            set it = Iterate.overUnitsInRangeOfUnit(tower,TARGET_TOWERS,tower,500) 
            call tower.doSpellDamage(creep, 5000+(level*250)+(tower.userInt*50),tower.calcSpellCritNoBonus())
            call Effect.createScaled("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", creep.getX(), creep.getY(), 0.0, 0, 2.0).setLifetime(3.0)

            loop
                set next = it.next()
                exitwhen next == 0
                call boekie_mountainMorale_buff.apply(tower,next,tower.getLevel())
            endloop
        endif
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt = 0 //count number of grows
endfunction

On Tower Details

function onTowerDetails takes Tower tower returns MultiboardValues
    // Show total number of grows
    call boekie_grow_MultiboardValue.setValue(0,I2S(tower.userInt)) 
    return boekie_grow_MultiboardValue 
endfunction

Periodic

PERIODIC_period: 25
function periodic takes Tower tower returns nothing
    local integer level = tower.getLevel()

    if tower.userInt < 160 then
        call Effect.createScaled("Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl", tower.getX(), tower.getY(), 30.0, 0, 1.8).setLifetime(1.0)

        call tower.modifyProperty(MOD_DAMAGE_ADD_PERC, 0.03+(level*0.001)) 
        call tower.addExp(4.0)

        set tower.userInt = tower.userInt + 1 //increment number of grows
        
        call tower.setScale(0.35 + tower.userInt * 0.0025)
    endif
endfunction