Dark Battery v1
500
ID:
345
Family ID:
Author:
tolleder
Rarity:
rare
Element:
darkness
Attack Type:
Decay
Attack Range:
800
Attack CD:
3
Damage:
822-822
Mana:
250
Mana regen:
2
Status:
Approved

Description:

A tower which can store dark 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 points damage and applies corruption.

Level Bonus:
+12 damage

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

Level Bonus:
+0.4% damage from attacks
+0.2% 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()*12+300,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,tower.getLevel(),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.05,0.002)
        call moreDmg.addModification(MOD_ATK_DAMAGE_RECEIVED,0.10,0.004)
        
        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(),tower.getLevel(),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)+13.0,128.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
Poison Battery v1
500
ID:
348
Family ID:
Author:
tolleder
Rarity:
rare
Element:
nature
Attack Type:
Decay
Attack Range:
800
Attack CD:
3
Damage:
822-822
Mana:
250
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store poison 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 damage and applies poison.

Level Bonus:
+12 damage

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

Level Bonus:
+3 poison damage
+0.3 seconds poison duration
+0.12% 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()*3+100,tower.calcSpellCritNoBonus())
    endfunction
       
    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 slow=Modifier.create()
        call slow.addModification(MOD_MOVESPEED,-0.05,-0.0012)
        
        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.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)-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)
            //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 Battery v1
500
ID:
351
Family ID:
Author:
tolleder
Rarity:
rare
Element:
fire
Attack Type:
Elemental
Attack Range:
800
Attack CD:
3
Damage:
822-822
Mana:
250
Mana regen:
2
Status:
Approved

Description:

A tower which can store fire 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 points damage and incinerates the target.

Level Bonus:
+12 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 5% more damage from Fire towers and receives 120 spelldamage every second for 9 seconds

Level Bonus:
+5 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()*5+120,tower.calcSpellCritNoBonus())
    endfunction
       
    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 m = Modifier.create()
        set slowAndDamage=BuffType.create(9,0.3,false)
            // new fire weakening
        call m.addModification(MOD_DMG_FROM_FIRE, 5/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.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)+30.0,GetUnitY(towerUnit)+25.0,190.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
Storm Battery v1
500
ID:
357
Family ID:
Author:
tolleder
Rarity:
rare
Element:
storm
Attack Type:
Energy
Attack Range:
800
Attack CD:
3
Damage:
822-822
Mana:
250
Mana regen:
2
Status:
Approved

Description:

A rare tower which can store electricity 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 electrifies the target.

Level Bonus:
+12 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 100, 1200 range, 20.0s cooldown
Electrify
The Storm Battery'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 40% extra damage. 

Level Bonus:
+0.3% chance
+0.8% 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
        //@export
        BuffType Tolleder_StormBat_bT
        //@export
        ProjectileType Tolleder_StormBat_pT
    endglobals
    
    public function hit takes Projectile p, Unit creep returns nothing
        local Tower tower=p.getCaster()
        local integer towerLevel=tower.getLevel()
        call tower.doSpellDamage(creep,p.userReal,tower.calcSpellCritNoBonus())
        //call slowAndDamage.apply(tower,creep,tower.getLevel())
        set Tolleder_StormBat_bT.applyCustomPower(tower,creep,R2I(1000.*(p.userReal2)*(0.2+0.003*I2R(towerLevel))),towerLevel).userReal=p.userReal2+1.
    endfunction
    
    public function onDamaged takes Buff b returns nothing
        local Tower tower=b.getCaster()
        local Playor plr=tower.getOwner()
        if tower.calcChance(0.2+I2R(b.getPower())*0.003) then
            set Event.damage=Event.damage*b.userReal //*(1.+0.4+0.008*b.getPower())
            call plr.displaySmallFloatingText(I2S(R2I(Event.damage)), b.getBuffedUnit(),128,255,255,20.)
        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 Tolleder_StormBat_bT=BuffType.create(9,0.3,false)
        call Tolleder_StormBat_bT.setBuffIcon('@@0@@')
        call Tolleder_StormBat_bT.addEventOnDamaged(EventHandler.onDamaged,1.,0.) //0.2,0.003)
        call Tolleder_StormBat_bT.setStackingGroup("StormBattery")
        //userReal=How many times the damage
        
        set Tolleder_StormBat_pT=ProjectileType.create("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",10.0,1200.0)        
        call Tolleder_StormBat_pT.enableHoming(ProjectileTargetEvent.hit,0.0)
        //userReal=Damage on hit
        //userReal2=Bonus damage
    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.4+0.008*I2R(towerLevel))*(0.2+0.003*I2R(towerLevel))),towerLevel).userReal=0.4+0.008*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
    
    // mana cost paying
    if tower.subtractMana(10,false) == 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()*12+300
            set p.userReal2=0.4+0.008*I2R(tower.getLevel())
            
            call p.setScale(0.5)
        endif
        
        // Manacost already payed
        // 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
Lesser Wolves Den v1
500
ID:
471
Family ID:
Author:
ColdRocker
Rarity:
rare
Element:
nature
Attack Type:
Physical
Attack Range:
700
Attack CD:
1.6
Damage:
535-535
Status:
Approved

Description:

A supporting tower that increases nearby towers attack speeds.
Wolven Tenacity - Aura
The strong physical presence of the wolves encourages nearby towers within a 200 radius, to increase their attack speed by 10%.

Level Bonus:
+0.5% attack speed
Download

Toggle Triggers

Header

    globals
      //@export
      BuffType speed_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
    local Modifier m = Modifier.create()  
      //  set SoA=MultiboardValues.create(1)  
       // call SoA.setKey(0,"Maturity Damage Bonus")
        set speed_aura = BuffType.createAuraEffectType(true)  
        call m.addModification(MOD_ATTACKSPEED,0.0,0.0001)  
        call speed_aura.setBuffModifier(m)  
        call speed_aura.setBuffIcon('@@0@@')
        call speed_aura.setStackingGroup("wolf_aura")
    endfunction

Tower Aura

AURA_auraEffect: speed_aura AURA_power: 1000 AURA_level: 1000 AURA_auraRange: 200 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 50 AURA_powerAdd: 50 AURA_targetSelf: true
Miner v1
500
ID:
622
Family ID:
Author:
drol
Rarity:
rare
Element:
iron
Attack Type:
Decay
Attack Range:
1000
Attack CD:
1.8
Damage:
614-633
Status:
Approved

Description:

This loner has been searching for gold and treasure his entire life.
Specials:
+20% bounty collected (+0.8%/lvl)
Goldrush
The miner has a 20% chance on attack to go into a goldrush, increasing attackspeed by more than 20% depending on the player's gold and making each hit gain 1.0 gold. Goldrush lasts 5 seconds. Cannot retrigger while in goldrush!

Hint: Check multiboard to view exact attack speed bonus

Level Bonus:
+0.04 gold gained
+0.1 seconds duration
Excavation
Every 20 seconds the miner has a 25% chance to find 7.5 gold.

Level Bonus:
+0.3 gold
Download

Toggle Triggers

Header

    globals
        //@export
        BuffType drol_goldrush
        //@export
        MultiboardValues drol_excavationMulti
    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
    
        local Modifier m = Modifier.create()
    
        set drol_goldrush = BuffType.create(5,0.1,true)
        
        call m.addModification(MOD_ATTACKSPEED, 0.2, 0.01)
        
        call drol_goldrush.setBuffIcon('@@0@@')
        call drol_goldrush.setBuffModifier(m)
        
        call drol_goldrush.setStackingGroup("drol_goldrush")

        set   drol_excavationMulti = MultiboardValues.create(2)
        call  drol_excavationMulti.setKey(0,"Gold gained") 
        call  drol_excavationMulti.setKey(1,"Goldrush bonus")
    
    endfunction

On Attack

ONATTACK_chance: 0.2 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    if tower.getBuffOfGroup("drol_goldrush") == 0 then
        call drol_goldrush.applyCustomTimed(tower,tower,R2I(Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5) / 5.), 5. + tower.getLevel() * 0.1)
    endif
    
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    local real goldBonus = 1.0 + tower.getLevel() * 0.04
     
    if Event.isMainTarget() and tower.getBuffOfGroup("drol_goldrush") > 0 then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    
    local Tower preceding = Event.getPrecedingTower()  
    
    if(preceding.getFamily() == tower.getFamily()) then  
        set tower.userReal = preceding.userReal
    else  
        set tower.userReal = 0.0
    endif 
    
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
    call   drol_excavationMulti.setValue(0,I2S(R2I(tower.userReal)))
    call   drol_excavationMulti.setValue(1,I2S(20 + R2I(Pow(GetPlayerState(tower.getOwner().getThePlayer(), PLAYER_STATE_RESOURCE_GOLD),0.5)/5)) + "%")
    return drol_excavationMulti
endfunction

Periodic

PERIODIC_period: 20
function periodic takes Tower tower returns nothing
    local real goldBonus = 7.5 + tower.getLevel() * 0.3
    local Effect targetEffect 

    set targetEffect = Effect.createScaled("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl", GetUnitX(tower.getUnit()), GetUnitY(tower.getUnit()), 0, 0, 0.8)
    call targetEffect.setLifetime(0.1) 
        
    if tower.calcChance(0.25) then
        set tower.userReal = tower.userReal + goldBonus
        call tower.getOwner().giveGold(goldBonus, tower.getUnit(), false, true)
    endif
endfunction
Icy Spirit v1
500
ID:
644
Family ID:
Author:
Boekie
Rarity:
rare
Element:
ice
Attack Type:
Energy
Attack Range:
950
Attack CD:
2
Damage:
169-169
Status:
Approved

Description:

An icy spirit that lives in the north. It can invoke an ice nova.
Nova Storm
When this tower attacks there is a 25% chance to hit 3 creeps in 900 range around it with ice novas. A nova hits all creeps in 200 AoE dealing 350 spelldamage at the centre, dropping off to 50% at the sides. Also slows by 12.5% for 4 seconds.

Level Bonus:
+17.5 spelldamage 
+0.5% chance 
+0.5% slow 
+1 nova at lvl 15 and 25
Download

Toggle Triggers

Header

    globals
        //@export  
        BuffType boekie_icySpirit_buff
    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
        local Modifier slow=Modifier.create() 
        
        call slow.addModification(MOD_MOVESPEED,0,-0.001) 
        set boekie_icySpirit_buff=BuffType.create(5,0,false)  
        call boekie_icySpirit_buff.setBuffIcon('@@0@@') 
        call boekie_icySpirit_buff.setBuffModifier(slow)
    endfunction

On Attack

ONATTACK_chance: 0.25 ONATTACK_chanceLevelAdd: 0.005
function onAttack takes Tower tower returns nothing
    local integer level = tower.getLevel() 

    if tower.userInt != 0 then
        if level < 15 then
            set tower.userInt2 = 3 
        elseif level < 25 then
            set tower.userInt2 = 4
        else
            set tower.userInt2 = 5
        endif

        call PeriodicEvent(tower.userInt).enable() 
    endif 
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt = 0 //Saves the periodic
    set tower.userInt2 = 0 //Saves the number of novas remaining to fire
endfunction

Periodic

PERIODIC_period: 0.1
function periodic takes Tower tower returns nothing
    local Iterate it
    local Unit target
    local integer level = tower.getLevel()

    if tower.userInt2 > 0 then 
        set it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,900) 
        set target = it.nextRandom()

        if target != 0 then
            call it.destroy()
            call tower.doSpellDamageAoEUnit(target,200,350.0+(level*17.5),tower.calcSpellCritNoBonus(),0.5) 
            call SFXOnUnit("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",target.getUnit(),"origin")

            set it = Iterate.overUnitsInRangeOfUnit(tower,TARGET_CREEPS,target,200) 
            loop
                set target = it.next()
                exitwhen target == 0
                call boekie_icySpirit_buff.apply(tower,target,125+level*5)
            endloop 
        endif

        set tower.userInt2 = tower.userInt2 - 1 
    else
        //Save the periodic event
        if tower.userInt == 0 then
            set tower.userInt = Event.getCurrentPeriodicEvent()
        endif
        call PeriodicEvent(tower.userInt).disable()
    endif 
endfunction