Haunted Rubble v1
34
ID:
166
Family ID:
Author:
KublaiKhan1/Velex
Rarity:
common
Element:
darkness
Attack Type:
Essence
Attack Range:
900
Attack CD:
2
Damage:
61-62
Abil. Factor:
.85
Status:
Approved

Description:

Tower with a chance to slow the movement speed of a unit on attacks.

Latest Upload Comment:

Restored from 1.10
Atrophy
When this tower attacks a creep it has a 15% (10% for bosses) chance to slow it by  15% for 5 seconds.

Level Bonus:
+0.15% (0.1% for bosses) chance
Download

Toggle Triggers

Header

  globals 
    //@export
    BuffType velex_slow
  endglobals
//The init function
private function init takes nothing returns nothing
    local Modifier slow=Modifier.create() 
  call slow.addModification(MOD_MOVESPEED,0,-0.001) 
  set velex_slow=BuffType.create(0,0,false) // apply custom timed  
  call velex_slow.setBuffIcon('@@0@@')
  call velex_slow.setBuffModifier(slow) 
  call velex_slow.setStackingGroup("velex_slow1") 
endfunction

On Attack

ONATTACK_chance: 1 ONATTACK_chanceLevelAdd: 0
function onAttack takes Tower tower returns nothing
        local Unit creep = Event.getTarget() 
        local integer size = creep.getSize()
        local boolean calc
        
        if size == SIZE_BOSS then 
            set calc=tower.calcChance((.15+tower.getLevel()*0.0015)*2/3)
        else
            set calc=tower.calcChance(.15+tower.getLevel()*0.0015)
        endif
        if(calc==true) then
                call velex_slow.applyCustomTimed(tower,Event.getTarget(),R2I(0.15*1000),5)
        endif
        
    
endfunction