Ancient Energy Converter v1
3500
ID:
202
Family ID:
Author:
geX
Rarity:
unique
Element:
storm
Attack Type:
Energy
Attack Range:
1600
Attack CD:
1.1
Damage:
72-2472
Mana:
1200
Mana regen:
20
Status:
Approved

Description:

Converts energy into pure destruction!
Specials:
Bounce attack:
   3 targets
   -70% damage per bounce
+25 mana/lvl
Energy Conversion
Spawns 3 orbs that last 12 seconds flying around the Converter. Each orb deals  1500 damage per second to random units in 650 range.
Additionally, the orbs have a 25% chance every second to cast a chainlightining that deals 1500 initial damage and hits up to 4 targets dealing 25% less damage with each bounce.
Units hit by the chainlightning are stunned for 0.8 seconds.

Level Bonus:
+75 orb damage
+1 orb spawned per 5 levels

AC_TYPE_OFFENSIVE_IMMEDIATE
 1200, 0.0 range, 12.0s cooldown
Download

Toggle Triggers

Autocast

caster_art: Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl AUTOCAST_cooldown: 12.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: true AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 1200 AUTOCAST_range: 0.0 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 650.0
private function onAutocast takes Tower tower returns nothing
        local integer level = tower.getLevel()
        local integer numProjectiles = 3 + level/5
        local integer i = numProjectiles
        local Projectile p
        local real x = tower.getX()
        local real y = tower.getY()
        
        //Rotate either left or right
        call myProj.setStartRotation(1.2 * (GetRandomInt(0,1)*2-1.0))
        
        //Spawn projectiles
        loop
            set i = i - 1
            set p = Projectile.create(myProj,tower,1.0+level*0.05,tower.calcSpellCritNoBonus(),x,y,80.0,i*360.0/numProjectiles)
            call p.setScale(2.0)
            call p.addAbility('@@0@@')
            exitwhen i < 1
        endloop
    
endfunction

Header

    globals
        Cast lightCast
        ProjectileType myProj
        TargetType myTargType
    endglobals
    
    function damageStun takes DummyUnit d returns nothing
        call cb_stun.applyOnlyTimed(d.getCaster(),Event.getTarget(),0.8)
    endfunction
    
    function periodicLightning takes Projectile p returns nothing
        local Iterate it
        local Unit u
        local Unit caster = p.getCaster()
        if caster.calcChance(0.25) then
            set it = it.overUnitsInRange(caster,myTargType,p.x,p.y,650.0)
            set u = it.next()
            if u != 0 then
                call lightCast.targetCastFromPoint(caster, u,p.x,p.y,p.getDmgRatio(),p.getCritRatio())
                call it.destroy()
            endif
        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 lightCast = Cast.create('@@1@@',"chainlightning",5.0)
        call lightCast.setDamageEvent(damageStun)
        call lightCast.setSourceHeight(80.0)
        set myProj = ProjectileType.create("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl",12.0,250.0)
        call myProj.enablePeriodic(periodicLightning,1.0)
        set myTargType = TargetType.create(TARGET_TYPE_CREEPS)
    endfunction
Caged Inferno v1
3500
ID:
204
Family ID:
Author:
cedi
Rarity:
rare
Element:
fire
Attack Type:
Elemental
Attack Range:
900
Attack CD:
0.4
Damage:
533-533
Status:
Approved

Description:

The fire of the demon Nerz'ragul destroyed half of the world. After years the mighty spellcaster Theradom caged it in a magical circle.
Specials:
-50% dmg to magical
+50% dmg to nature (+1%/lvl)
Melt
The enormous heat of the caged inferno decreases the armor of all creeps in 900 range by 2 and damages them by 40. Each second creeps in 900 range around the caged inferno lose 1 extra armor and the fire damage will increase by 40.

Level Bonus:
+0.08 start armor reduction
+0.04 armor reduction
+1.6 damage
Download

Toggle Triggers

Header

    globals
        BuffType myBuff
    endglobals
    
    function Create takes Buff b returns nothing
        local integer lvl = b.getCaster().getLevel()
        set b.userReal = 2.0 + 0.08 * lvl
        set b.userReal2 = 40.0 + 1.6 * lvl
        call b.getBuffedUnit().modifyProperty( MOD_ARMOR, -b.userReal )
    endfunction
    
    function Destroy takes Buff b returns nothing
        call b.getBuffedUnit().modifyProperty( MOD_ARMOR, b.userReal )
    endfunction
    
    function Reaction takes Buff b returns nothing
        local integer lvl = b.getCaster().getLevel()
        
        set b.userReal = b.userReal + 1.0 + 0.04 * lvl
        set b.userReal2 = b.userReal2 + 40.0 + 1.6 * lvl 
        
        call b.getCaster().doSpellDamage(b.getBuffedUnit(), b.userReal2, b.getCaster().calcSpellCritNoBonus()) 
        call b.getBuffedUnit().modifyProperty( MOD_ARMOR, -1.0 - 0.04 * lvl )
    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 myBuff = BuffType.createAuraEffectType(false)
        call myBuff.addPeriodicEvent( EventHandler.Reaction, 1.00 )
        call myBuff.addEventOnCleanup( EventHandler.Destroy )
        call myBuff.addEventOnCreate( EventHandler.Create )
        //call m.addModification(MOD_ARMOR,-1.0,-0.5)
        //call myBuff.setBuffModifier(m)
        call myBuff.setBuffIcon('@@0@@')
    endfunction

Tower Aura

AURA_auraEffect: myBuff AURA_power: 1 AURA_level: 1 AURA_auraRange: 900 AURA_targetType: TARGET_TYPE_CREEPS AURA_levelAdd: 0 AURA_powerAdd: 0 AURA_targetSelf: false
Scales v1
3500
ID:
210
Family ID:
Author:
cedi
Rarity:
unique
Element:
storm
Attack Type:
Energy
Attack Range:
1500
Attack CD:
1.5
Damage:
843-851
Mana:
1100
Mana regen:
10
Status:
Approved

Description:

Brrizzl fizzl.
Specials:
+20% dmg to air (+0.8%/lvl)
Lightmare
Summons a storm cloud which attacks units in 1500 range. Every 0.33 seconds the cloud attacks up to 3 targets with forked lightning. Each lightning deals 1300 spell damage. Lightmare lasts 10 seconds and does not benefit from buff duration.

Level Bonus:
+52 spell damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 1000, 1500.0 range, 10.5s cooldown
I Scale
This tower gains 1.66% spell damage, spell crit damage and 0.125% spell crit chance for each level the player survives.
Electrify
Whenever this tower damages a creep, it has a 20% chance to electrify it for 5 seconds. Each second, all creeps in 225 range of the electrified unit take 900 spell damage.

Level Bonus:
+0.8% chance
+36 spell damage per second
Overcharge
Whenever this tower deals damage with its attacks or its other innate abilities it has a 25% chance to deal 900 spell damage to the damaged unit. Overcharge can trigger itself, but the chance to do so is decreased by 5% for each time it retriggers.

Level Bonus:
+36 spell damage
+1% chance
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 10.5 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 1000 AUTOCAST_range: 1500.0 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: true AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 1500.00
private function onAutocast takes Tower tower returns nothing
    local Effect E = Effect.createScaled( "Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", tower.getX(), tower.getY(), 300.00, 0.00, 0.60 )
    local integer UID = tower.getUID()
    call E.setLifetime( 10.0 )
    set tower.userInt2 = 1
    call TriggerSleepAction( 10.0 )
    if UID == tower.getUID() then
        set tower.userInt2 = 0
    endif
endfunction

Header

    globals
        Cast TUNDER
        BuffType ELEC
        MultiboardValues MB
    endglobals
    
    function overchargeDamage takes Tower tower, Creep targ, integer level returns nothing
        local unit u = targ.getUnit()
        local integer i = 0
        loop
            exitwhen GetWidgetLife( u ) <= 0.405
            if tower.calcChance( ( 0.25 + level / 100.00 ) - i * 0.05 ) then
                call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl", u, "origin" ) )
                call tower.doSpellDamage( targ, 900.0 + level * 36.0, tower.calcSpellCritNoBonus() )
            else
                exitwhen true
            endif
            set i = i + 1
        endloop
        set u = null    
    endfunction
    
    function overchargeA takes SpellDummy D returns nothing
        local Tower tower = D.getCaster()
        call overchargeDamage(tower,Event.getTarget(),tower.getLevel())
    endfunction
    
    function elec takes Buff B returns nothing
        local Tower tower = B.getCaster()
        local Unit targ = B.getBuffedUnit()
        local Iterate I = Iterate.overUnitsInRangeOfUnit( tower, TARGET_TYPE_CREEPS, targ, 225.0 )
        local real dmg = 900.0 + 36.0 * tower.getLevel()
        local Unit U
        loop
            set U = I.next()
            exitwhen U == 0
            if U != targ then
                call tower.doSpellDamage( U, dmg, tower.calcSpellCritNoBonus() )
                call overchargeDamage(tower,U,tower.getLevel())
            endif
        endloop
    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 TUNDER = Cast.create( '@@0@@', "forkedlightning", 2.0 )
        call TUNDER.setSourceHeight( 300.00 )
        call TUNDER.setDamageEvent( overchargeA )
        
        set ELEC = BuffType.create( 5.0, 0.00, false )
        call ELEC.setBuffIcon( '@@2@@' )
        call ELEC.addPeriodicEvent( elec, 1.0 )
        
        set MB = MultiboardValues.create( 3 )
        call MB.setKey( 0, "Spell Damage Bonus" )
        call MB.setKey( 1, "Spell Crit Damage Bonus" )
        call MB.setKey( 2, "Spell Crit Chance Bonus" )
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    local integer i = tower.getOwner().getTeam().getLevel()
    local integer i2 = i
    if i > tower.userInt then
        set i = i - tower.userInt
        set tower.userInt3 = tower.userInt3 + i
        
        call tower.modifyProperty( MOD_SPELL_DAMAGE_DEALT, i / 60.00 )
        call tower.modifyProperty( MOD_SPELL_CRIT_DAMAGE, i / 60.00 )
        call tower.modifyProperty( MOD_SPELL_CRIT_CHANCE, i / 800.00 )
        
        set tower.userInt = i2
    endif
endfunction

On Damage

ONDAMAGE_chance: 0.2 ONDAMAGE_chanceLevelAdd: 0.008
function onDamage takes Tower tower returns nothing
    call ELEC.apply( tower, Event.getTarget(), tower.getLevel() )
endfunction

On Damage

ONDAMAGE_chance: 1.00 ONDAMAGE_chanceLevelAdd: 0.00
function onDamage takes Tower tower returns nothing
    call overchargeDamage(tower,Event.getTarget(),tower.getLevel())
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt = tower.getOwner().getTeam().getLevel()
    set tower.userInt2 = 0
    set tower.userInt3 = 0
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
    call MB.setValue( 0, formatPercent( tower.userInt3 * 1.66/100,2 ) ) 
    call MB.setValue( 1, formatPercent( tower.userInt3 * 1.66/100,2 ) )
    call MB.setValue( 2, formatPercent( tower.userInt3 * 0.125/100,2 ) )
    return MB
endfunction

Periodic

PERIODIC_period: 0.33
function periodic takes Tower tower returns nothing
    local Iterate I
    local Unit U
    if tower.userInt2 == 1 then

    set I = Iterate.overUnitsInRangeOfCaster( tower, TARGET_TYPE_CREEPS, 1500.00 )
    set U = I.next()
    if U != 0 then
        call TUNDER.targetCastFromCaster( tower, U, 1300.00 + tower.getLevel() * 52.0, tower.calcSpellCritNoBonus() )
        call I.destroy()
    endif
    
    endif
endfunction
Keeper of the Twin Flames v1
3500
ID:
213
Family ID:
Author:
DaveMatthews
Rarity:
unique
Element:
fire
Attack Type:
Physical
Attack Range:
900
Attack CD:
1.1
Damage:
2825-2825
Status:
Approved

Description:

A fighter skilled in both physical and magical attacks.
Twin Pulses
Every time this tower has launched 8 red flames, it releases a green pulse, dealing 75% of its attack damage as spell damage in 900 AoE and every time it has launched 8 green flames, it releases a red pulse, dealing 75% of its attack damage as physical damage in 900 AoE. 

Level Bonus: 
+1% damage 
-1 flame needed at level 15 and 25
Twin Flames
On each attack, this tower has a chance equal to its crit chance to launch a green flame, dealing 75% of tower's attack damage as spell damage, and a chance equal to its spell crit chance to launch a red flame, dealing 75% of tower's attack damage as physical damage. 

Level Bonus: 
+1% damage
Twin Disciplines
Each time it scores a critical hit with an attack, this tower gains 2% bonus critical chance or spell critical chance, both stacking up to 10 times, for 7 seconds. The lower chance will always be prioritized.
Download

Toggle Triggers

Header

    globals
        //@import
        BuffType dave_physical_buff
        //@import
        BuffType dave_spell_buff
        //@import
        ProjectileType dave_red
        //@import
        ProjectileType dave_green
    endglobals

    private function init takes nothing returns nothing
    endfunction

On Attack

ONATTACK_chance: 1 ONATTACK_chanceLevelAdd: 0
function onAttack takes Tower tower returns nothing
local Projectile p
local Iterate it
local Effect e
local Unit u
local integer level = tower.getLevel()

if tower.calcChance( tower.getProp_SpellCritChance() ) then
    set Projectile.createBezierInterpolationFromUnitToUnit(dave_red,tower,1,1,tower,Event.getTarget(),0,0.3,0,true).userReal = 0.75+0.01*level
    if tower.userInt >= tower.userInt3 then
    set tower.userInt = 0
    set it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,900)
    loop
      set u = it.next()
      exitwhen u == 0
      call tower.doSpellDamage(u,tower.getCurrentAttackDamageWithBonus()*(0.75+0.01*level),tower.calcSpellCritNoBonus())
      call SFXOnUnit("Abilities\\Spells\\NightElf\\Immolation\\ImmolationDamage.mdl",u.getUnit(), "chest")
      set e = Effect.createColored("Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl",tower.getX()-48,tower.getY()+48, 40, 0.0, 0.42, 0, 255, 0, 255)
      call e.setLifetime(0.5)
    endloop
    else
    set tower.userInt = tower.userInt + 1
    endif
endif
    
if tower.calcChance( tower.getProp_AtkCritChance() ) then
    set Projectile.createBezierInterpolationFromUnitToUnit(dave_green,tower,1,1,tower,Event.getTarget(),0,-0.3,0,true).userReal = 0.75+0.01*level
    if tower.userInt2 >= tower.userInt3 then
    set tower.userInt2 = 0
    set it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,900)
    loop
      set u = it.next()
      exitwhen u == 0
      call tower.doAttackDamage(u,tower.getCurrentAttackDamageWithBonus()*(0.75+0.01*level),tower.calcAttackMulticrit(0,0,0))
      call SFXOnUnit("Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeEmbers.mdl",u.getUnit(), "chest")
      set e = Effect.createColored("Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl",tower.getX()+48,tower.getY()+48, 40, 0.0, 0.42, 255, 0, 0, 255)
      call e.setLifetime(0.5)
    endloop 
    else 
    set tower.userInt2 = tower.userInt2 + 1
    endif
endif
endfunction

On Damage

ONDAMAGE_chance: 1 ONDAMAGE_chanceLevelAdd: 0
function onDamage takes Tower tower returns nothing
local Buff b = tower.getBuffOfType(dave_physical_buff)
local Buff s = tower.getBuffOfType(dave_spell_buff)
local integer levelP
local integer levelS

if b != 0 then
   set levelP = b.getLevel()
endif

if s !=0 then
   set levelS = s.getLevel()
endif

if Event.isAttackDamageCritical() then
  if tower.getProp_AtkCritChance() < tower.getProp_SpellCritChance() or levelS == 10 then
     if b==0 then
        call dave_physical_buff.apply(tower,tower,1)
     else
        call dave_physical_buff.apply(tower,tower,IMinBJ(levelP + 1, 10))
     endif
  elseif tower.getProp_AtkCritChance() > tower.getProp_SpellCritChance() or levelP == 10 then
     if s==0 then
        call dave_spell_buff.apply(tower,tower, 1)
     else
        call dave_spell_buff.apply(tower,tower,IMinBJ(levelS + 1, 10))
     endif
  endif
endif
endfunction

On Level Up

function onLevelUp takes Tower tower returns nothing
  if tower.getLevel() < 15 then
    set tower.userInt3 = 8
  elseif tower.getLevel() < 25 then
    set tower.userInt3 = 7 
  elseif tower.getLevel() == 25 then
    set tower.userInt3 = 6
  endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
  set tower.userInt = 0
  set tower.userInt2 = 0
  
  if tower.getLevel() < 15 then
    set tower.userInt3 = 8
  elseif tower.getLevel() < 25 then
    set tower.userInt3 = 7 
  elseif tower.getLevel() == 25 then
    set tower.userInt3 = 6
  endif
endfunction
Void Dragon v1
3500
ID:
248
Family ID:
Author:
Chronos
Rarity:
rare
Element:
darkness
Attack Type:
Essence
Attack Range:
1000
Attack CD:
1.35
Damage:
7669-8001
Status:
Approved

Description:

Selfish creature, harbringer of the void.
Specials:
-80% exp gain (-10%/lvl)
+4% attackspeed/lvl
+20% damage/lvl
Silence
Units damaged by this tower are silenced for 1.75 seconds. Bosses are silenced only for 1/4 of the normal duration.

Level Bonus:
+0.13 seconds duration
Void
Every second, this unit loses 1.5% of its experience. This tower will not lose levels in this way. Replacing a tower with this tower will reset the experience to 0 unless the replaced tower is of this tower ' s family. 

Level Bonus:
+0.03% periodical experience lost
Download

Toggle Triggers

Header

    globals
       //@import
        real array Chronos_voidLevelExp
    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 ONDAMAGE_chanceLevelAdd: 0
function onDamage takes Tower tower returns nothing
    local real silenceDuration = 1.75 + 0.13 * tower.getLevel()
    local Unit creep = Event.getTarget()
    if creep.getSize() == SIZE_BOSS then
        set silenceDuration = silenceDuration / 4
    endif
    call cb_silence.applyOnlyTimed(tower, Event.getTarget(), silenceDuration)
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    if Event.getPrecedingTower().getFamily() == tower.getFamily() then
        call tower.removeExpFlat(tower.getExp() * (0.5 + 0.01 * tower.getLevel())) //This is actually part of the Void ability from the Void Drake.
    elseif Event.getPrecedingTower().getFamily() != tower.getFamily() and tower.getExp() > 0 then
        call tower.removeExpFlat(tower.getExp())
    endif
endfunction

Periodic

PERIODIC_period: 1
function periodic takes Tower tower returns nothing
    local integer level = tower.getLevel()
    local real exp = tower.getExp()
    local real expRemoved = exp * (0.015+0.0003*level)
    if expRemoved >= (exp - Chronos_voidLevelExp[level]) then
        set expRemoved = (exp - Chronos_voidLevelExp[level]) - 0.01
    endif
    if expRemoved >= 0.1 and level != 25 then
        call tower.removeExpFlat(expRemoved)
    endif
endfunction
Red Lightning Conductor v1
3500
ID:
289
Family ID:
Author:
SirCoqaLot.
Rarity:
rare
Element:
storm
Attack Type:
Energy
Attack Range:
1200
Attack CD:
1.65
Damage:
384-1283
Status:
Approved

Description:

A very advanced construction for its times. It harbors a throbbing red crystal at its center, which has been rumored to drive anyone insane.
Specials:
Bounce attack:
   3 targets
   -60% damage per bounce
Lightning Shock
This tower has a 30% chance to deal 3500 spell damage to its target whenever it deals damage. This ability has a 10%  bonus chance to crit with 60%  bonus damage.

Level Bonus:
+0.5% chance
+140 damage
Lightning Charge - Aura
Towers in 250 range have their spell damage increased by 35%.

Level Bonus:
+0.6% spell damage
Download

Toggle Triggers

Header

    globals
        //@import
        BuffType sir_spell_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.3 ONDAMAGE_chanceLevelAdd: 0.005
function onDamage takes Tower tower returns nothing
    local Unit creep = Event.getTarget()
    call Lightning.createFromUnitToUnit("AFOD", tower, creep).setLifetime(0.2)
    call tower.doSpellDamage(creep,3500*(1+tower.getLevel()*0.04),tower.calcSpellCrit(0.1,0.6))
endfunction

Tower Aura

AURA_auraEffect: sir_spell_aura AURA_power: 3500 AURA_level: 3500 AURA_auraRange: 250 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 60 AURA_powerAdd: 60 AURA_targetSelf: true
Inflamed Stone Pillars v1
3500
ID:
302
Family ID:
Author:
SirCoqaLot.
Rarity:
rare
Element:
fire
Attack Type:
Magic
Attack Range:
850
Attack CD:
1
Damage:
1-518
Mana:
50
Mana regen:
7.5
Status:
Unapproved

Description:

Advanced tower that will critical strike if it is has enough mana.
Specials:
+2% mana regen/lvl
Spellfire
This tower treats all spell modifiers as attack bonuses, with an 100% bonus gain of stated effect. 

Level Bonus:
+4% bonus gain
Spellfire Projectiles
If this tower has at least 20 mana when it attacks, it will pay all its mana to proc a critical strike. 20 Mana is used to grant the critical strike and every further point of mana spent grants 10% more critical damage to that attack. 

Level Bonus:
-.3 Mana needed
Download

Toggle Triggers

Header

    globals

     //@import
    BuffType spellFlameDamage 
    //@import
    BuffType spellFlameCritDamage
    //@import 
    BuffType spellFlameCritChance

    endglobals
    
    //@import
    function addAttackStats takes Tower tower returns nothing
    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
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    local real  mana = GetUnitState(tower.getUnit(),UNIT_STATE_MANA)
    call addAttackStats(tower)
    if mana >= (20 - 0.2*tower.getLevel()) then
        call tower.subtractMana(mana, false) 
        call tower.addCustomAttackCrit((mana - (20 - 0.2*tower.getLevel())) *0.08+tower.getProp_AtkCritDamage())
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing

endfunction