Tidewater Stream v1
3150
ID:
112
Family ID:
Author:
cedi
Rarity:
unique
Element:
ice
Attack Type:
Elemental
Attack Range:
820
Attack CD:
1.8
Damage:
3388-3388
Status:
Approved

Description:

Some people think the purling noise of a river is calming.
Spring Tide
Whenever this tower attacks it has a 15% chance to launch a wave. The wave travels 1200 units and has a 200 AoE. It deals 2200 spell damage to each creep it hits. Every 0.4 seconds the wave has a 35% chance to drag a stone with it. The stone travels 500 units, deals 2200 spell damage on collision and stuns for 0.65 seconds.

Level Bonus:
+88 spell damage
+0.6% chance to launch a wave
Splash
Whenever this tower deals damage through attacks it has a 20% chance to deal 4000 spell damage in 175 AoE around the attacked unit. Also increases the spell damage the hit units take by 12.5% for 6 seconds.

Level Bonus:
+160 spell damage
+0.5% more spell damage taken
Calming Noises - Aura
Increases the spell crit chance of towers in 250 range by 10%.

Level Bonus:
+0.4% spell crit chance
Download

Toggle Triggers

Header

    globals
        BuffType cedi_brookcalm
        BuffType cedi_brooksplash
        
        ProjectileType water
        ProjectileType stone
    endglobals
    
    function hitwater takes Projectile P, Unit U returns nothing
        call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl", U.getUnit(), "chest" ) )
        call P.getCaster().doSpellDamage( U, 2200.0 + P.getCaster().getLevel() * 88.0, P.getCaster().calcSpellCritNoBonus() )
    endfunction
    
    function periodicwater takes Projectile P returns nothing
        local Tower C = P.getCaster()
        local real r = P.direction + GetRandomReal( -30, 30 )
        if C.calcChance( 0.35 ) then
            set P = Projectile.create( stone, C, 1.0, C.calcSpellCritNoBonus(), P.x + GetRandomReal( -30.0, 30.0 ), P.y + GetRandomReal( -30.0, 30.0 ), 0.00, r )
            call DestroyEffect( AddSpecialEffect( "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", P.x, P.y ) )
        endif
    endfunction
    
    function hitstone takes Projectile P, Unit U returns nothing
        call P.getCaster().doSpellDamage( U, 2200.0 + P.getCaster().getLevel() * 88.0, P.getCaster().calcSpellCritNoBonus() )
        call cb_stun.applyOnlyTimed( P.getCaster(), U, 0.65 )
    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_SPELL_CRIT_CHANCE, 0.1, 0.004 )
        
        set cedi_brookcalm = BuffType.createAuraEffectType( true )
        call cedi_brookcalm.setBuffIcon( '@@0@@' )
        call cedi_brookcalm.setBuffModifier( m )
        
        set m = Modifier.create()
        call m.addModification( MOD_SPELL_DAMAGE_RECEIVED, 0.125, 0.005 )
        
        set cedi_brooksplash = BuffType.create( 6.0, 0, false )
        call cedi_brooksplash.setBuffIcon( '@@1@@' )
        call cedi_brooksplash.setBuffModifier( m )
        
        set water = ProjectileType.createRanged( "Doodads\\Terrain\\CliffDoodad\\Waterfall\\Waterfall.mdl", 1200.0, 700.0 )
        call water.enableCollision( hitwater, 200.0, TARGET_TYPE_CREEPS, false )
        call water.enablePeriodic( periodicwater, 0.4 )
        call water.disableExplodeOnExpiration()
        
        set stone = ProjectileType.createRanged( "Abilities\\Weapons\\RockBoltMissile\\RockBoltMissile.mdl", 500.0, 800.0 )
        call stone.enableCollision( hitstone, 64.0, TARGET_TYPE_CREEPS, true )
    endfunction

On Attack

ONATTACK_chance: 0.15 ONATTACK_chanceLevelAdd: 0.006
function onAttack takes Tower tower returns nothing
    local unit t = Event.getTarget().getUnit()
    local real r = bj_RADTODEG * Atan2(GetUnitY( t ) - GetUnitY(tower.getUnit()), GetUnitX( t ) - GetUnitX(tower.getUnit()))
    local Projectile P = Projectile.createFromUnit( water, tower, tower, r, 1.0, tower.calcSpellCritNoBonus() )
    call P.setScale( 0.8 )
    set t = null
endfunction

On Damage

ONDAMAGE_chance: 0.2 ONDAMAGE_chanceLevelAdd: 0.004
function onDamage takes Tower tower returns nothing
    local Iterate I = Iterate.overUnitsInRangeOfUnit( tower, TARGET_TYPE_CREEPS, Event.getTarget(), 175.0 )
    local Unit U = Event.getTarget()
    local unit u = U.getUnit()
    local Effect E = Effect.createScaled( "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl", GetUnitX( u ), GetUnitY( u ), GetUnitFlyHeight( u ), 0.00, 0.6 )
    local integer lvl = tower.getLevel()
    call E.setLifetime( 3.0 )
    call tower.doSpellDamageAoEUnit( U, 175.0, 4000.0 + lvl * 160.0, tower.calcSpellCritNoBonus(), 0.0 )
    
    loop
        set U = I.next()
        exitwhen U == 0
        call cedi_brooksplash.apply( tower, U, lvl )
    endloop
    
    set u = null
endfunction

Tower Aura

AURA_auraEffect: cedi_brookcalm AURA_power: 1 AURA_level: 1 AURA_auraRange: 250 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 1 AURA_powerAdd: 1 AURA_targetSelf: true