Coconut Sapling v1
1500
ID:
525
Family ID:
Author:
cedi
Rarity:
rare
Element:
nature
Attack Type:
Physical
Attack Range:
825
Attack CD:
3
Damage:
1-1
Status:
Approved

Description:

Fall, fall, fall, little nuts, right on the heads of the little noobs...
Specials:
+30% dmg to orcs (+1%/lvl)
+20% dmg to humanoids (+1%/lvl)
Coconut Rain
Each time this tower attacks there is a chance to drop multiple coconuts. The chance to drop a coconut is 100% for the 1st one and after each coconut the chance is decreased by 20%. Each coconut deals 1625 spelldamage in 150 AoE and stuns for 0.5 seconds. Hit units are immune to the stun of this ability for the next 1.5 seconds.

Level Bonus:
+162.5 damage
Download

Toggle Triggers

Header

    globals
        ProjectileType cedi_Coco
        //@export
        BuffType cedi_Coco_Buff
    endglobals
    
    function cedi_Coco_Impact takes Projectile p returns nothing
        local Unit target
        local Unit caster = p.getCaster()
        local Iterate I = Iterate.overUnitsInRange( caster, TARGET_CREEPS, p.x, p.y, 150.00 )
        local real dmg = 1625.00 + I2R( caster.getLevel() ) * 162.50 
        call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", p.x, p.y ) )
        loop
            set target = I.next()
            exitwhen target == 0
            call caster.doSpellDamage( target, dmg, caster.calcSpellCritNoBonus() )
            if ( target.getBuffOfType( cedi_Coco_Buff ) == 0 ) then
                call cb_stun.applyOnlyTimed( caster, target, 0.5 )
                call cedi_Coco_Buff.applyOnlyTimed( caster, target, 1.5 )
            endif
        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
        set cedi_Coco = ProjectileType.create( "abilities\\weapons\\catapult\\catapultmissile.mdl", 4.00, 0.00 )
        call cedi_Coco.enablePhysics( 0, cedi_Coco_Impact, -15.00, 0, 1.00 )
        
        set cedi_Coco_Buff = BuffType.create( 1.5, 0.00, true )
        call cedi_Coco_Buff.setBuffIcon( '@@0@@' )
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local real chance = 1.00
    local integer casts = 0
    local Unit u = Event.getTarget()
    local Projectile p
    local real x = u.getX()
    local real y = u.getY()
    local real range
    local real angle
    loop
        if tower.calcChance( chance ) then
            set casts = casts + 1
            set chance = chance * 0.80
        else
            exitwhen true
        endif
    endloop
    loop
        exitwhen casts <= 0
        set range = GetRandomReal( 0.00, 300.00 )
        set angle = GetRandomReal( 0.00, 360.00 ) * bj_DEGTORAD
        set p = Projectile.create( cedi_Coco, tower, 1.00, tower.calcSpellCritNoBonus(), x + Cos( angle ) * range, y + Sin( angle ) * range, 1000.00, 0.00 )
        call p.setScale( 0.30 )
        call p.setGravity( GetRandomReal( 1.00, 1.50 ) )
        set casts = casts - 1
    endloop
endfunction
Monkey Boogie Palm v1
3000
ID:
531
Family ID:
Author:
cedi
Rarity:
rare
Element:
nature
Attack Type:
Physical
Attack Range:
825
Attack CD:
3
Damage:
1-1
Status:
Approved

Description:

Fall, fall, fall, little nuts, right on the heads of the little noobs...
Specials:
+50% dmg to orcs (+1%/lvl)
+40% dmg to humanoids (+1%/lvl)
Coconut Rain
Each time this tower attacks there is a chance to drop multiple coconuts. The chance to drop a coconut is 100% for the 1st one and after each coconut the chance is decreased by 17%. Each coconut deals 2600 spelldamage in 190 AoE and stuns for 0.5 seconds. Hit units are immune to the stun of this ability for the next 1.5 seconds.

Level Bonus:
+260 damage
Download

Toggle Triggers

Header

    globals
        ProjectileType cedi_Coco
        //@import
        BuffType cedi_Coco_Buff
    endglobals
    
    function cedi_Coco_Impact takes Projectile p returns nothing
        local Unit target
        local Unit caster = p.getCaster()
        local Iterate I = Iterate.overUnitsInRange( caster, TARGET_CREEPS, p.x, p.y, 190.00 )
        local real dmg = 2600.00 + I2R( caster.getLevel() ) * 260.00 
        call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", p.x, p.y ) )
        loop
            set target = I.next()
            exitwhen target == 0
            call caster.doSpellDamage( target, dmg, caster.calcSpellCritNoBonus() )
            if ( target.getBuffOfType( cedi_Coco_Buff ) == 0 ) then
                call cb_stun.applyOnlyTimed( caster, target, 0.5 )
                call cedi_Coco_Buff.applyOnlyTimed( caster, target, 1.5 )
            endif
        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
        set cedi_Coco = ProjectileType.create( "abilities\\weapons\\catapult\\catapultmissile.mdl", 4.00, 0.00 )
        call cedi_Coco.enablePhysics( 0, cedi_Coco_Impact, -15.00, 0, 1.00 )
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local real chance = 1.00
    local integer casts = 0
    local Unit u = Event.getTarget()
    local Projectile p
    local real x = u.getX()
    local real y = u.getY()
    local real range
    local real angle
    loop
        if tower.calcChance( chance ) then
            set casts = casts + 1
            set chance = chance * 0.83
        else
            exitwhen true
        endif
    endloop
    loop
        exitwhen casts <= 0
        set range = GetRandomReal( 0.00, 300.00 )
        set angle = GetRandomReal( 0.00, 360.00 ) * bj_DEGTORAD
        set p = Projectile.create( cedi_Coco, tower, 1.00, tower.calcSpellCritNoBonus(), x + Cos( angle ) * range, y + Sin( angle ) * range, 1000.00, 0.00 )
        call p.setScale( 0.30 )
        call p.setGravity( GetRandomReal( 1.00, 1.50 ) )
        set casts = casts - 1
    endloop
endfunction