Liquid Gold v1
447
lvl: 15

ID:

186

Author:

drol

Rarity:

rare

Status:

Approved

Description:

Boosts damage with a drawback.

Latest Upload Comment:

Restored from 1.10
Hangover
Each attack has a 10% attackspeed adjusted chance to give the user a hangover, slowing its attackspeed by 30% for 8 seconds and stunning it for 3 seconds when it expires.

Level Bonus:
+1% attackspeed
-0.1 second stun duration
Specials:
+35% damage
Download

Toggle Triggers

Header

goldcost: 0
    globals
        BuffType drol_hangover
    endglobals
    
    function drolDrunk takes Buff b returns nothing
        local Unit tower = b.getCaster()
        call cb_stun.applyOnlyTimed(tower,tower,3-tower.getLevel()*0.1)
    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_ATTACKSPEED,-0.30,0.01)
        set drol_hangover = BuffType.create(8,0,false)
        call drol_hangover.setBuffModifier(m)
        call drol_hangover.setBuffIcon('@@0@@')
        call drol_hangover.setEventOnExpire(EventHandler.drolDrunk)
    
    endfunction

On Attack

goldcost: -600 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.calcBadChance(0.1 * speed) then
        call drol_hangover.apply(tower,tower,tower.getLevel())
    endif
endfunction