Storm Focus v1
2800
ID:
130
Family ID:
Author:
SirCoqalot.
Rarity:
unique
Element:
storm
Attack Type:
Energy
Attack Range:
1600
Attack CD:
3
Damage:
9222-14222
Mana:
20
Mana regen:
1.5
Status:
Approved

Description:

Advanced storm tower that emphasizes the use of anti air towers.
Specials:
Attacks AIR only
+10% dmg to air
Freezing Gust
Casts a buff on a tower in 800 range, doubling the effect of 'Gust' and increasing that tower's damage against air units by 10% for 5 seconds. 

Level Bonus:
+0.05 seconds duration
+0.8% damage against air

AC_TYPE_ALWAYS_BUFF
 15, 800 range, 0s cooldown
Gust - Aura
Towers in 800 range around the Storm Focus gain additional attackdamage equal to 50% of the bonus damage against air they have. 

Level Bonus:
+0.8% of bonus damage against air as additional attackdamage
Download

Toggle Triggers

Autocast

caster_art: Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl AUTOCAST_cooldown: 0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: true AUTOCAST_autocastType: AC_TYPE_ALWAYS_BUFF AUTOCAST_manacost: 15 AUTOCAST_range: 800 AUTOCAST_buffType: sir_focus_buff AUTOCAST_targetSelf: false AUTOCAST_targetType: TARGET_TYPE_TOWERS target_art: AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing

endfunction

Header

    globals
        BuffType sir_focus_aura
        BuffType sir_focus_buff
    endglobals
    
    function auraOnCreate takes Buff b returns nothing
        set b.userReal = 0 //Will store tower's bonus damage 
    endfunction
    
    function auraPeriodic takes Buff b returns nothing    
        local Tower tower = b.getCaster()
        local Tower buffee = b.getBuffedUnit()
        local real multiplier = 0.5 + 0.008 * tower.getLevel()
        local real bonusDamage = 1.0
        if buffee.getBuffOfType(sir_focus_buff) != 0 then
            set bonusDamage = 2.0
        endif
        //Calculate and set new damage bonus
        set bonusDamage = bonusDamage * (buffee.getDamageToSize(SIZE_AIR) - 1) * multiplier
        call buffee.modifyProperty(MOD_DAMAGE_ADD_PERC, bonusDamage - b.userReal)
        set b.userReal = bonusDamage
    endfunction
    
    function auraOnCleanup takes Buff b returns nothing
        call b.getBuffedUnit().modifyProperty(MOD_DAMAGE_ADD_PERC, -b.userReal)
    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()
    set sir_focus_aura = BuffType.createAuraEffectType(false)
    set sir_focus_buff = BuffType.create(5,0.05,true)
    call m.addModification(MOD_DMG_TO_AIR,0.1,0.008)
    call sir_focus_aura.setBuffIcon('@@0@@')
    call sir_focus_aura.addEventOnCreate(auraOnCreate)
    call sir_focus_aura.addPeriodicEvent(auraPeriodic, 1.0)
    call sir_focus_aura.addEventOnCleanup(auraOnCleanup)
    call sir_focus_buff.setBuffIcon('@@1@@')
    call sir_focus_buff.setBuffModifier(m)
    endfunction

Tower Aura

AURA_auraEffect: sir_focus_aura AURA_power: 0 AURA_level: 0 AURA_auraRange: 800 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 1 AURA_powerAdd: 1 AURA_targetSelf: true