Magic Storage v1
1200
ID:
332
Family ID:
Author:
tolleder
Rarity:
rare
Element:
astral
Attack Type:
Magic
Attack Range:
800
Attack CD:
3
Damage:
1973-1973
Mana:
300
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store magic energy for later use.
Specials:
+10 mana/lvl
Storage Overload
The tower attacks creeps in a range of 1200 every 0.2 seconds till all mana is gone. Each attack (or try to attack) costs 10 mana, deals 750 spelldamage and applies Faerie Fire.

Level Bonus:
+30 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 100, 1200 range, 20.0s cooldown
Faerie Fire
A creep hit by one of this tower's shots takes 15% extra damage from spells and debuffs last 25% longer for 9 seconds.

Level Bonus:
+0.6% extra spell damage
+0.8% extra debuff duration
+0.3 seconds Faerie Fire duration
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 20.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 100 AUTOCAST_range: 1200 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local PeriodicEvent pE
    call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)+100)
    if tower.userInt!=0 then
        set pE=tower.userInt
        call pE.enable()
    endif
    set towerUnit = null
endfunction

Header

    globals
        BuffType slowAndDamage
        ProjectileType pT
    endglobals
    
    public function hit takes Projectile p, Unit creep returns nothing
        local Tower tower=p.getCaster()
        call tower.doSpellDamage(creep,tower.getLevel()*30+750,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,2*tower.getLevel()+26,tower.getLevel())
    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 sWeakeness=Modifier.create()
        call sWeakeness.addModification(MOD_SPELL_DAMAGE_RECEIVED,0.15,0.006)
        call sWeakeness.addModification(MOD_DEBUFF_DURATION,0.25,0.008)
        
        set slowAndDamage=BuffType.create(9,0.3,false)
        call slowAndDamage.setBuffIcon('@@0@@')
        call slowAndDamage.setBuffModifier(sWeakeness)
        call slowAndDamage.setStackingGroup("MagicBattery")
        
        set pT=ProjectileType.create("Abilities\\Weapons\\ProcMissile\\ProcMissile.mdl",10.0,1200.0)        
        call pT.enableHoming(ProjectileTargetEvent.hit,0.0)
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    call slowAndDamage.applyCustomPower(tower,Event.getTarget(),2*tower.getLevel()+26,tower.getLevel())
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt=0
    call SetUnitState(tower.getUnit(),UNIT_STATE_MANA,0)
endfunction

Periodic

PERIODIC_period: 0.2
function periodic takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local Iterate inRange
    local real numResults=0.0
    local Unit result
    local Unit next
    local Projectile p
    local PeriodicEvent pE
    
    if GetUnitState(towerUnit,UNIT_STATE_MANA)>10 then
        //Random creep in range
        set inRange=Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,1200)
        loop
            set next=inRange.next()
            exitwhen next==0
            
            set numResults=numResults+1.0 
            if GetRandomReal(0.0,1.0)<=1.0/numResults then
                set result=next
            endif
        endloop
        
        if numResults>0.5 then
            //if GetRandomReal(0.0,3.0)<=2.0 then
                if GetRandomReal(0.0,2.0)<=1.0 then
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)+2.0,GetUnitY(towerUnit)-1.0,154.0,result,true,false,false)
                else
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)+49.0,GetUnitY(towerUnit)-51.0,109.0,result,true,false,false)
                endif
            //else
                //set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-32.0,GetUnitY(towerUnit)-2.0,147.0,result,true,false,false)
            //endif
            call p.setScale(0.5)
        endif
        
        
        //Manacost
        call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)-10)
    else
        set pE=Event.getCurrentPeriodicEvent()
        set tower.userInt=pE
        call pE.disable()
    endif
    set towerUnit = null
endfunction
Dark Storage v1
1200
ID:
346
Family ID:
Author:
tolleder
Rarity:
rare
Element:
darkness
Attack Type:
Decay
Attack Range:
800
Attack CD:
3
Damage:
1973-1973
Mana:
300
Mana regen:
2
Status:
Approved

Description:

A tower which can store dark energy for later use.
Specials:
+10 mana/lvl
Storage Overload
The tower attacks creeps in a range of 1200 every 0.2 seconds till all mana is gone. Each attack (or try to attack) costs 10 mana, deals 750 points damage and applies corruption.

Level Bonus:
+30 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 100, 1200 range, 20.0s cooldown
Corruption
A corrupted creep takes 20% extra damage from attacks and 10% extra damage from spells for 9 seconds

Level Bonus:
+0.8% damage from attacks
+0.4% damage from spells
+0.3 seconds duration
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 20.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 100 AUTOCAST_range: 1200 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local PeriodicEvent pE
    call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)+100)
    if tower.userInt!=0 then
        set pE=tower.userInt
        call pE.enable()
    endif
    set towerUnit = null
endfunction

Header

    globals
        BuffType slowAndDamage
        ProjectileType pT
    endglobals
    
    public function hit takes Projectile p, Unit creep returns nothing
        local Tower tower=p.getCaster()
        call tower.doSpellDamage(creep,tower.getLevel()*30+750,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,2*tower.getLevel()+26,tower.getLevel())
    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 moreDmg=Modifier.create()
        call moreDmg.addModification(MOD_SPELL_DAMAGE_RECEIVED,0.10,0.004)
        call moreDmg.addModification(MOD_ATK_DAMAGE_RECEIVED,0.20,0.008)
        
        set slowAndDamage=BuffType.create(9,0.3,false)
        call slowAndDamage.setBuffIcon('@@0@@')
        call slowAndDamage.setBuffModifier(moreDmg)
        call slowAndDamage.setStackingGroup("DarkBattery")
        
        set pT=ProjectileType.create("Abilities\\Spells\\Items\\OrbCorruption\\OrbCorruptionMissile.mdl",10.0,1200.0)        
        call pT.enableHoming(ProjectileTargetEvent.hit,0.0)
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    call slowAndDamage.applyCustomPower(tower,Event.getTarget(),2*tower.getLevel()+26,tower.getLevel())
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt=0
    call SetUnitState(tower.getUnit(),UNIT_STATE_MANA,0)
endfunction

Periodic

PERIODIC_period: 0.2
function periodic takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local Iterate inRange
    local real numResults=0.0
    local Unit result
    local Unit next
    local Projectile p
    local PeriodicEvent pE
    
    if GetUnitState(towerUnit,UNIT_STATE_MANA)>10 then
        //Random creep in range
        set inRange=Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,1200)
        loop
            set next=inRange.next()
            exitwhen next==0
            
            set numResults=numResults+1.0 
            if GetRandomReal(0.0,1.0)<=1.0/numResults then
                set result=next
            endif
        endloop
        
        if numResults>0.5 then
            //if GetRandomReal(0.0,3.0)<=2.0 then
                if GetRandomReal(0.0,2.0)<=1.0 then
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-17.0,GetUnitY(towerUnit)-3.0,128.0,result,true,false,false)
                else
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)+26.0,GetUnitY(towerUnit)-5.0,192.0,result,true,false,false)
                endif
            //else
                //set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-32.0,GetUnitY(towerUnit)-2.0,147.0,result,true,false,false)
            //endif
            call p.setScale(0.5)
        endif
        
        
        //Manacost
        call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)-10)
    else
        set pE=Event.getCurrentPeriodicEvent()
        set tower.userInt=pE
        call pE.disable()
    endif
    set towerUnit = null
endfunction
Poison Storage v1
1200
ID:
349
Family ID:
Author:
tolleder
Rarity:
rare
Element:
nature
Attack Type:
Decay
Attack Range:
800
Attack CD:
3
Damage:
1973-1973
Mana:
300
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store poison for later use.
Specials:
+10 mana/lvl
Storage Overload
The tower attacks creeps in a range of 1200 every 0.2 seconds till all mana is gone. Each attack (or try to attack) costs 10 mana, deals 750 damage and applies poison.

Level Bonus:
+30 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 100, 1200 range, 20.0s cooldown
Poison
An infected creep takes 240 spelldamage every second for 9 seconds and is slowed by 7%.

Level Bonus:
+8 poison damage
+0.3 seconds poison duration
+0.28% slow
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 20.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 100 AUTOCAST_range: 1200 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local PeriodicEvent pE
    call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)+100)
    if tower.userInt!=0 then
        set pE=tower.userInt
        call pE.enable()
    endif
    set towerUnit = null
endfunction

Header

    globals
        BuffType slowAndDamage
        ProjectileType pT
    endglobals
    
    public function damagePeriodic takes Buff b returns nothing //Poisondamage
        local Tower tower=b.getCaster()
        call tower.doSpellDamage(b.getBuffedUnit(),b.getPower()*8+240,tower.calcSpellCritNoBonus())
    endfunction
       
    public function hit takes Projectile p, Unit creep returns nothing
        local Tower tower=p.getCaster()
        call tower.doSpellDamage(creep,tower.getLevel()*30+750,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,2*tower.getLevel()+26,tower.getLevel())
    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 slow=Modifier.create()
        call slow.addModification(MOD_MOVESPEED,-0.07,-0.0028)
        
        set slowAndDamage=BuffType.create(9,0.3,false)
        call slowAndDamage.setBuffIcon('@@0@@')
        call slowAndDamage.addPeriodicEvent(EventHandler.damagePeriodic,1.0)
        call slowAndDamage.setBuffModifier(slow)
        call slowAndDamage.setStackingGroup("PoisonBattery")
        
        set pT=ProjectileType.create("Abilities\\Spells\\Items\\OrbVenom\\OrbVenomMissile.mdl",10.0,1200.0)        
        call pT.enableHoming(ProjectileTargetEvent.hit,0.0)
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    call slowAndDamage.applyCustomPower(tower,Event.getTarget(),2*tower.getLevel()+26,tower.getLevel())
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt=0
    call SetUnitState(tower.getUnit(),UNIT_STATE_MANA,0)
endfunction

Periodic

PERIODIC_period: 0.2
function periodic takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local Iterate inRange
    local real numResults=0.0
    local Unit result
    local Unit next
    local Projectile p
    local PeriodicEvent pE
    
    if GetUnitState(towerUnit,UNIT_STATE_MANA)>10 then
        //Random creep in range
        set inRange=Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,1200)
        loop
            set next=inRange.next()
            exitwhen next==0
            
            set numResults=numResults+1.0 
            if GetRandomReal(0.0,1.0)<=1.0/numResults then
                set result=next
            endif
        endloop
        
        if numResults>0.5 then
            //if GetRandomReal(0.0,3.0)<=2.0 then
                if GetRandomReal(0.0,2.0)<=1.0 then
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-11.0,GetUnitY(towerUnit)-5.0,122.0,result,true,false,false)
                else
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-25.0,GetUnitY(towerUnit)-10.0,179.0,result,true,false,false)
                endif
            //else
                //set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-32.0,GetUnitY(towerUnit)-2.0,147.0,result,true,false,false)
            //endif
            call p.setScale(0.5)
        endif
        
        
        //Manacost
        call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)-10)
    else
        set pE=Event.getCurrentPeriodicEvent()
        set tower.userInt=pE
        call pE.disable()
    endif
    set towerUnit = null
endfunction
Fire Storage v1
1200
ID:
352
Family ID:
Author:
tolleder
Rarity:
rare
Element:
fire
Attack Type:
Elemental
Attack Range:
800
Attack CD:
3
Damage:
1973-1973
Mana:
300
Mana regen:
2
Status:
Approved

Description:

A tower which can store fire for later use.
Specials:
+10 mana/lvl
Storage Overload
The tower attacks creeps in a range of 1200 every 0.2 seconds till all mana is gone. Each attack (or try to attack) costs 10 mana, deals 750 points damage and incinerates the target.

Level Bonus:
+30 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 100, 1200 range, 20.0s cooldown
Incinerate
This tower's attacks set the target on fire. A burning creep takes 10% more damage from Fire towers and receives 300 spelldamage every second for 9 seconds

Level Bonus:
+12 damage
+0.3 seconds duration
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 20.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 100 AUTOCAST_range: 1200 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local PeriodicEvent pE
    call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)+100)
    if tower.userInt!=0 then
        set pE=tower.userInt
        call pE.enable()
    endif
    set towerUnit = null
endfunction

Header

    globals
        BuffType slowAndDamage
        ProjectileType pT
    endglobals
    
    public function damagePeriodic takes Buff b returns nothing //Poisondamage
        local Tower tower=b.getCaster()
        call tower.doSpellDamage(b.getBuffedUnit(),b.getPower()*12+300,tower.calcSpellCritNoBonus())
    endfunction
       
    public function hit takes Projectile p, Unit creep returns nothing
        local Tower tower=p.getCaster()
        call tower.doSpellDamage(creep,tower.getLevel()*30+750,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,tower.getLevel()+26,tower.getLevel())
    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 slowAndDamage=BuffType.create(9,0.3,false)
            // new fire weakening
        call m.addModification(MOD_DMG_FROM_FIRE, 10/100.0, 0)
        call slowAndDamage.setBuffModifier(m)
            // end new fire
        call slowAndDamage.setBuffIcon('@@0@@')
        call slowAndDamage.addPeriodicEvent(EventHandler.damagePeriodic,1.0)
        call slowAndDamage.setStackingGroup("FireBattery")
        

        set pT=ProjectileType.create("Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdl",10.0,1200.0)        
        call pT.enableHoming(ProjectileTargetEvent.hit,0.0)
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    call slowAndDamage.applyCustomPower(tower,Event.getTarget(),tower.getLevel()+26,tower.getLevel())
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt=0
    call SetUnitState(tower.getUnit(),UNIT_STATE_MANA,0)
endfunction

Periodic

PERIODIC_period: 0.2
function periodic takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local Iterate inRange
    local real numResults=0.0
    local Unit result
    local Unit next
    local Projectile p
    local PeriodicEvent pE
    
    if GetUnitState(towerUnit,UNIT_STATE_MANA)>10 then
        //Random creep in range
        set inRange=Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,1200)
        loop
            set next=inRange.next()
            exitwhen next==0
            
            set numResults=numResults+1.0 
            if GetRandomReal(0.0,1.0)<=1.0/numResults then
                set result=next
            endif
        endloop
        
        if numResults>0.5 then
            //if GetRandomReal(0.0,3.0)<=2.0 then
                if GetRandomReal(0.0,2.0)<=1.0 then
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-30.0,GetUnitY(towerUnit)-17.0,205.0,result,true,false,false)
                else
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)+33.0,GetUnitY(towerUnit)+17.0,140.0,result,true,false,false)
                endif
            //else
                //set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-32.0,GetUnitY(towerUnit)-2.0,147.0,result,true,false,false)
            //endif
            call p.setScale(0.5)
        endif
        
        //Manacost
        call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)-10)
    else
        set pE=Event.getCurrentPeriodicEvent()
        set tower.userInt=pE
        call pE.disable()
    endif
    set towerUnit = null
endfunction
Storm Storage v1
1200
ID:
358
Family ID:
Author:
tolleder
Rarity:
rare
Element:
storm
Attack Type:
Energy
Attack Range:
800
Attack CD:
3
Damage:
1973-1973
Mana:
300
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store electricity for later use.
Specials:
+10 mana/lvl
Storage Overload
The tower attacks creeps in a range of 1200 every 0.2 seconds till all mana is gone. Each attack (or try to attack) costs 10 mana, deals 750 spelldamage and electrifies the target.

Level Bonus:
+30 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 100, 1200 range, 20.0s cooldown
Electrify
The Storm Storage's projectiles electrify their target for 9 seconds. Every time an electrified creep is damaged by an attack or spell it has a chance of 20% to take 80% extra damage. 

Level Bonus:
+0.3% chance
+1.6% damage
+0.3 seconds duration
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 20.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 100 AUTOCAST_range: 1200 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local PeriodicEvent pE
    call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)+100)
    if tower.userInt!=0 then
        set pE=tower.userInt
        call pE.enable()
    endif
    set towerUnit = null
endfunction

Header

    globals
        //@import
        BuffType Tolleder_StormBat_bT
        //@import
        ProjectileType Tolleder_StormBat_pT
    endglobals

    //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
    endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local integer towerLevel=tower.getLevel()
    //call slowAndDamage.apply(tower,Event.getTarget(),tower.getLevel())
    set Tolleder_StormBat_bT.applyCustomPower(tower,Event.getTarget(),R2I(1000.*(0.8+0.016*I2R(towerLevel))*(0.2+0.003*I2R(towerLevel))),towerLevel).userReal=0.8+0.016*I2R(towerLevel)+1.
    
    
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt=0
    call SetUnitState(tower.getUnit(),UNIT_STATE_MANA,0)
endfunction

Periodic

PERIODIC_period: 0.2
function periodic takes Tower tower returns nothing
    local unit towerUnit=tower.getUnit()
    local Iterate inRange
    local real numResults=0.0
    local Unit result
    local Unit next
    local Projectile p
    local PeriodicEvent pE
    
    if GetUnitState(towerUnit,UNIT_STATE_MANA)>10 then
        //Random creep in range
        set inRange=Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,1200)
        loop
            set next=inRange.next()
            exitwhen next==0
            
            set numResults=numResults+1.0 
            if GetRandomReal(0.0,1.0)<=1.0/numResults then
                set result=next
            endif
        endloop
        
        if numResults>0.5 then
            set p= Projectile.createFromPointToUnit(Tolleder_StormBat_pT,tower,1.0,1.0,GetUnitX(towerUnit)+3.0,GetUnitY(towerUnit)-6.0,160.0,result,true,false,false)
            set p.userReal=tower.getLevel()*30+750
            set p.userReal2=0.8+0.016*I2R(tower.getLevel())
            
            call p.setScale(0.5)
        endif
        
        
        //Manacost
        call SetUnitState(towerUnit,UNIT_STATE_MANA,GetUnitState(towerUnit,UNIT_STATE_MANA)-10)
    else
        set pE=Event.getCurrentPeriodicEvent()
        set tower.userInt=pE
        call pE.disable()
    endif
    set towerUnit = null
endfunction
Mana-Bound Drake v1
1200
ID:
369
Family ID:
Author:
SirCoqaLot.
Rarity:
rare
Element:
astral
Attack Type:
Elemental
Attack Range:
950
Attack CD:
3
Damage:
1207-1307
Mana:
600
Mana regen:
30
Status:
Approved

Description:

Playful Faerie-Dragon that uses mana to its advantage.
Specials:
+2.4 mana regen/lvl
Unstable Energies
This tower has a 28% chance on damage to release a powerful energy blast, dealing [current mana x 9.5] Elemental damage to the target, but consuming 75% of its own current mana. 

Level Bonus:
+0.48% chance 
-1% current mana consumed
Mana Distortion Field - Aura
Towers in 200 range burn 3 mana on attack, costing the drake 14 mana. The mana burned and spent is attackspeed and range adjusted and the tower deals 75 spelldamage per mana point burned.

Level Bonus:
+6 spelldamage per mana point burned
Download

Toggle Triggers

Header

            globals
    //@import
    BuffType sir_drake_aura
    endglobals
    
    
    //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
    endfunction
        

On Damage

ONDAMAGE_chance: 0.28 ONDAMAGE_chanceLevelAdd: 0.048
function onDamage takes Tower tower returns nothing
            
local unit towerunit = tower.getUnit()
    
    call tower.doAttackDamage(Event.getTarget(),9.5 * GetUnitState(towerunit,UNIT_STATE_MANA),tower.calcAttackMulticrit(0,0,0)) //deal the damage
    call tower.subtractManaPerc(0.75-0.01*tower.getLevel(),true)//drain the mana
    call SFXAtUnit("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",Event.getTarget().getUnit())// add some fancy effect
    set towerunit = null
        
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
            
set tower.userReal = 14
        
endfunction

Tower Aura

AURA_powerAdd: 6 AURA_auraEffect: sir_drake_aura AURA_levelAdd: 0 AURA_power: 75 AURA_targetType: TARGET_TYPE_TOWERS AURA_targetSelf: false AURA_level: 300 AURA_auraRange: 200
            
        
Atom Smasher v1
1200
ID:
402
Family ID:
Author:
the_red_terror
Rarity:
rare
Element:
iron
Attack Type:
Energy
Attack Range:
900
Attack CD:
1
Damage:
780-780
Status:
Approved

Description:

Gains more speed and damage on each attack, while losing the bonus on kill.
Energy Acceleration
Every attack increases attack speed and damage by 3%. 

Level Bonus:
+0.1% attack speed and damage
Errant Tachyons
On kill, this tower is stunned for 2 seconds and the bonus from Energy Acceleration is lost.
Download

Toggle Triggers

Header

            globals
        MultiboardValues Red_Terror_Values
    endglobals

    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    //@import
    function redterror_energy_rotation takes Tower tower returns nothing
    endfunction

    
    private function init takes nothing returns nothing
            set Red_Terror_Values = MultiboardValues.create(1)
            call Red_Terror_Values.setKey(0, "Acceleration")
    endfunction
        

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
            
local integer lvl = tower.getLevel()
        call tower.modifyProperty(MOD_DAMAGE_ADD_PERC,0.03+(lvl*0.001))
        call tower.modifyProperty(MOD_ATTACKSPEED,0.03+(lvl*0.001))
        set tower.userReal = tower.userReal+(0.03+(lvl*0.001))
            call redterror_energy_rotation(tower)
        
endfunction

On Kill

function onKill takes Tower tower returns nothing
            
local integer lvl = tower.getLevel()
            call  SFXAtUnit("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",Event.getTarget().getUnit())
                call tower.modifyProperty(MOD_DAMAGE_ADD_PERC,-(tower.userReal))
                call tower.modifyProperty(MOD_ATTACKSPEED,-(tower.userReal))
                call cb_stun.applyOnlyTimed(tower,tower,2)
                set tower.userReal = 0
                    call redterror_energy_rotation(tower)
        
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
            
local Effect e = Effect.createAnimatedScaled("Abilities\\Spells\\Orc\\SpiritLink\\SpiritLinkTarget.mdl",tower.getX(), tower.getY(), 8.0, 0.0, 1.50)
    set tower.userInt2 = e
    set tower.userReal = 0
    call redterror_energy_rotation(tower)
        
endfunction

On Tower Destruction

function onDestruct takes Tower tower returns nothing
            
local Effect e = tower.userInt2
    call e.destroy()
        
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
            
call Red_Terror_Values.setValue(0, R2SW((tower.userReal*100),1,1))
        return Red_Terror_Values
        
endfunction