Broken Circle of Wind v1
50
ID:
312
Family ID:
Author:
SternBogen / Natac & girlfriend
Rarity:
uncommon
Element:
storm
Attack Type:
Physical
Attack Range:
1100
Attack CD:
1.4
Damage:
54-56
Abil. Factor:
0.86
Status:
Approved

Description:

Strong gusts of wind often linger around these ruins.

Latest Upload Comment:

Restored from 1.10
Specials:
+70% dmg to air (+2%/lvl)
Wind of Death
On attack this tower has a 20% chance to catch a ground, non-boss unit in a cyclone for 0.5 seconds, dealing 20 physical damage to all units in 300 AoE when it falls back down. Falling champions deal 25% more damage. 

Level Bonus:
+2 damage
+0.3% chance to catch
Download

Toggle Triggers

Header

    globals
        //@export
        BuffType sternbogen_broken_wind
    endglobals
    
    // Creep got buffed -> move creep up
    function cyclone_creep_up takes Buff b returns nothing
        local Creep c = b.getBuffedUnit()
        // (start) cyclone animation
        set b.userInt = Effect.createAnimated("Abilities\\Spells\\NightElf\\Cyclone\\CycloneTarget.mdl", c.getX(), c.getY(), 0.0, 0.0)
        call Effect(b.userInt).noDeathAnimation()
        // move creep up
        call c.adjustHeight(300, 1000)
    endfunction 
    
    // turn the creep (cyclone) -> Periodic event
    function cyclone_creep_turn takes Buff b returns nothing 
        local unit real_unit = b.getBuffedUnit().getUnit()
        call SetUnitFacing(real_unit, GetUnitFacing(real_unit) + 150.0)
        set real_unit = null
    endfunction 
    

    
    // move creep down and do damage
    function cyclone_creep_down takes Buff b returns nothing 
        local Tower t = b.getCaster()
        local Creep c = b.getBuffedUnit()
        local real ratio = 1
        // set units back (down)
        call c.adjustHeight(-300, 2500)
        // remove the cyclone
        call Effect(b.userInt).destroy()
        // effects
        call Effect.createSimpleAtUnit("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", c).destroy()
        call Effect.createSimpleAtUnit("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", c).destroy()
        // do damage
        if c.getSize() == SIZE_CHAMPION then
            set ratio = 1.25
        endif
        call t.doAttackDamageAoEUnit(c, ratio * 300.0, b.userReal3, t.calcAttackMulticrit(0,0,0), 0.0)
    endfunction
    
    private function init takes nothing returns nothing
        set sternbogen_broken_wind = BuffType.createDuplicate(cb_stun, 1.0, 0, false)
        call sternbogen_broken_wind.setBuffIcon('@@0@@')
        
        // on creation on buff ON the creep -> lift unit up
        call sternbogen_broken_wind.addEventOnCreate(cyclone_creep_up)
        // during buffed: periodic -> rotate creep
        call sternbogen_broken_wind.addPeriodicEvent(cyclone_creep_turn, 0.1)
        // buff ends -> unit down, damage or if creep gets killed while lift up
        call sternbogen_broken_wind.addEventOnCleanup(cyclone_creep_down)

    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
  
    local Creep target = Event.getTarget()
    local real damage = 20 + 2 * tower.getLevel()
    local Buff b
    if (target.getSize() == SIZE_MASS or target.getSize() == SIZE_NORMAL or target.getSize() == SIZE_CHAMPION) then
        if(tower.calcChance(0.20 + (0.003 * tower.getLevel()))) then
            set b = target.getBuffOfType(sternbogen_broken_wind)
            if b != 0 then
                set damage = RMaxBJ(b.userReal3, damage)
            endif
            set b = sternbogen_broken_wind.applyCustomTimed(tower, target, tower.getLevel(), 0.5)
            if b != 0 then
                set b.userReal3 = damage
            endif
        endif
    endif 
endfunction