Purifying Gloves v1
150
lvl: 2

ID:

120

Author:

drol

Rarity:

rare

Status:

Approved

Description:

Mends every wound, hurts every villain.

Latest Upload Comment:

Restored from 1.10
Purify
Grants the carrier a 12.5% attackspeed adjusted chance on attack to cast a purifying beam of magic. Deals 250 spelldamage on the first target and bounces to 2 other targets. Each bounce reduces the damage by 25%. Undead and Orc creeps also get stunned for 0.5 seconds when hit by this beam.
Download

Toggle Triggers

Header

goldcost: 0
    globals
        Cast drol_chainCast
    endglobals
    
    function drol_chainStun takes DummyUnit d returns nothing
    
        local Unit creep = Event.getTarget()
        
        if creep.getCategory() == 0 or creep.getCategory() == 3 then
            call cb_stun.applyOnlyTimed(d.getCaster(),Event.getTarget(),0.5)
        endif
    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 drol_chainCast = Cast.create('@@0@@',"chainlightning",5.0)
        call drol_chainCast.setDamageEvent(drol_chainStun)
    
    endfunction

On Attack

goldcost: 150 ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Item itm returns nothing
    
    local Tower tower = itm.getCarrier()
    local real speed = tower.getBaseAttackspeed() 
    
    if tower.calcChance(0.125 * speed) then
    call drol_chainCast.targetCastFromCaster(tower, Event.getTarget(),1,tower.calcSpellCritNoBonus())
    endif
endfunction