Icy Spirit v1
500
ID:
644
Family ID:
Author:
Boekie
Rarity:
rare
Element:
ice
Attack Type:
Energy
Attack Range:
950
Attack CD:
2
Damage:
169-169
Abil. Factor:
0.15
Status:
Approved

Description:

An icy spirit that lives in the north. It can invoke an ice nova.

Latest Upload Comment:

Restored from 1.10
Nova Storm
When this tower attacks there is a 25% chance to hit 3 creeps in 900 range around it with ice novas. A nova hits all creeps in 200 AoE dealing 350 spelldamage at the centre, dropping off to 50% at the sides. Also slows by 12.5% for 4 seconds.

Level Bonus:
+17.5 spelldamage 
+0.5% chance 
+0.5% slow 
+1 nova at lvl 15 and 25
Download

Toggle Triggers

Header

    globals
        //@export  
        BuffType boekie_icySpirit_buff
    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
        local Modifier slow=Modifier.create() 
        
        call slow.addModification(MOD_MOVESPEED,0,-0.001) 
        set boekie_icySpirit_buff=BuffType.create(5,0,false)  
        call boekie_icySpirit_buff.setBuffIcon('@@0@@') 
        call boekie_icySpirit_buff.setBuffModifier(slow)
    endfunction

On Attack

ONATTACK_chance: 0.25 ONATTACK_chanceLevelAdd: 0.005
function onAttack takes Tower tower returns nothing
    local integer level = tower.getLevel() 

    if tower.userInt != 0 then
        if level < 15 then
            set tower.userInt2 = 3 
        elseif level < 25 then
            set tower.userInt2 = 4
        else
            set tower.userInt2 = 5
        endif

        call PeriodicEvent(tower.userInt).enable() 
    endif 
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt = 0 //Saves the periodic
    set tower.userInt2 = 0 //Saves the number of novas remaining to fire
endfunction

Periodic

PERIODIC_period: 0.1
function periodic takes Tower tower returns nothing
    local Iterate it
    local Unit target
    local integer level = tower.getLevel()

    if tower.userInt2 > 0 then 
        set it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,900) 
        set target = it.nextRandom()

        if target != 0 then
            call it.destroy()
            call tower.doSpellDamageAoEUnit(target,200,350.0+(level*17.5),tower.calcSpellCritNoBonus(),0.5) 
            call SFXOnUnit("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",target.getUnit(),"origin")

            set it = Iterate.overUnitsInRangeOfUnit(tower,TARGET_CREEPS,target,200) 
            loop
                set target = it.next()
                exitwhen target == 0
                call boekie_icySpirit_buff.apply(tower,target,125+level*5)
            endloop 
        endif

        set tower.userInt2 = tower.userInt2 - 1 
    else
        //Save the periodic event
        if tower.userInt == 0 then
            set tower.userInt = Event.getCurrentPeriodicEvent()
        endif
        call PeriodicEvent(tower.userInt).disable()
    endif 
endfunction