Magic Battery v1
500
ID:
331
Family ID:
Author:
tolleder
Rarity:
rare
Element:
astral
Attack Type:
Magic
Attack Range:
800
Attack CD:
3
Damage:
822-822
Mana:
250
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store magic energy for later use.
Specials:
+10 mana/lvl
Battery 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 300 spelldamage and applies Faerie Fire.

Level Bonus:
+12 damage

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

Level Bonus:
+0.4% extra spell damage
+0.6% 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()*12+300,tower.calcSpellCritNoBonus())
        call slowAndDamage.apply(tower,creep,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.10,0.004)
        call sWeakeness.addModification(MOD_DEBUFF_DURATION,0.20,0.006)
        
        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.apply(tower,Event.getTarget(),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,166.0,result,true,false,false)
                //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)
            //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
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
Magic Accumulator v1
3000
ID:
334
Family ID:
Author:
tolleder
Rarity:
rare
Element:
astral
Attack Type:
Magic
Attack Range:
800
Attack CD:
3
Damage:
4933-4933
Mana:
350
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store magic energy for later use.
Specials:
+10 mana/lvl
Accumulator 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 1800 spelldamage and applies Faerie Fire.

Level Bonus:
+72 damage

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

Level Bonus:
+0.8% extra spell damage
+1% 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()*72+1800,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,3*tower.getLevel()+52,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.20,0.008)
        call sWeakeness.addModification(MOD_DEBUFF_DURATION,0.30,0.01)
        
        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(),3*tower.getLevel()+52,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)+1.0,GetUnitY(towerUnit)+2.0,154.0,result,true,false,false)
                else
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-49.0,GetUnitY(towerUnit)+43.0,109.0,result,true,false,false)
                endif
            else
                set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)+52.0,GetUnitY(towerUnit)-52.0,109.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