Sapphirons Cold Grave v1
4000
ID:
526
Family ID:
Author:
cedi
Rarity:
unique
Element:
ice
Attack Type:
Elemental
Attack Range:
1500
Attack CD:
4
Damage:
1-1
Status:
Approved

Description:

Sapphiron died a long time ago, but his bones do still carry an unbelievable power.
Ice Shard
This tower fires an ice shard towards an enemy. After a distance of 300 the ice shard splits into 2 new shards which will split again. If a shard collides with an enemy it deals 2280 spell damage. There is a maximum of 4 splits.

Level Bonus:
+85 damage
Liquide Ice
Each time an ice shard damages an enemy, it decreases the target's defense against ice towers. The target takes 15% more damage from attacks of ice towers. The effect lasts until the creep's death and stacks.

Level Bonus:
+0.4% damage increase
Download

Toggle Triggers

Header

    globals
        ProjectileType shard
        BuffType b
    endglobals
        
    function Expiration takes Projectile p returns nothing
        local integer i = p.userInt
        local real angle = p.direction
        local Unit tower = p.getCaster()
        local Projectile P
        if i > 0 then
            set i = i - 1
            set p.userInt = i
            set P = Projectile.create( shard, tower, 1.00, tower.calcSpellCritNoBonus(), p.x, p.y, p.z, angle + 15.00 )
            set P.userInt = i
            set P = Projectile.create( shard, tower, 1.00, tower.calcSpellCritNoBonus(), p.x, p.y, p.z, angle - 15.00 )
            set P.userInt = i
        endif
    endfunction
            
    function Impact takes Projectile p, Unit target returns nothing
        local Unit caster = p.getCaster()
        local Buff B = target.getBuffOfType( b )
        local real r = 0.15 + 0.004 * I2R( caster.getLevel() )
        call caster.doSpellDamage( target, 2280.00 + 85.00 * I2R( caster.getLevel() ), caster.calcSpellCritNoBonus() )
        call SFXAtUnit( "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl", target.getUnit() )
        call target.modifyProperty( MOD_DMG_FROM_ICE, r )
        if B == 0 then
            set B = b.apply( caster, target, 1 )
            set B.userReal = r
        else
            call B.setLevel( B.getLevel() + 1 )
            set B.userReal = B.userReal + r
        endif
        call caster.getOwner().displayFloatingText( "|cFFBFFFFF" + I2S( R2I( B.userReal * 100.00 + 0.5 ) ) + "%|r", target, 255, 255, 255 )
    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 shard = ProjectileType.createRanged( "Abilities\\Weapons\\LichMissile\\LichMissile.mdl", 300.00, 400.00 )
        call shard.setEventOnExpiration( Expiration )
        call shard.enableCollision( Impact, 75.00, TARGET_CREEPS, true )
        set b = BuffType.create( -1.00, 0.00, false )
        call b.setBuffIcon( '@@0@@' )
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local Projectile P = Projectile.createFromUnitToUnit( shard, tower, 1.00, tower.calcSpellCritNoBonus(), tower, Event.getTarget(), false, true, false )
    set P.userInt = 4
endfunction