Rejuvenating Well v1
3600
ID:
579
Family ID:
Author:
drol
Rarity:
rare
Element:
nature
Attack Type:
Essence
Attack Range:
1000
Attack CD:
1.1
Damage:
2291-2370
Mana:
400
Mana regen:
5
Status:
Approved

Description:

This well contains healing powers.
Specials:
+20% dmg to orcs (+0.8%/lvl)
Replenish
Restores 20% (only half on towers of this family) of each towers maximum mana for towers in 500 range.

Level Bonus:
+0.8% maximum mana

AC_TYPE_ALWAYS_BUFF
 200, 500 range, 5s cooldown
Cleansing Water - Aura
Increases the spell damage dealt by all towers in 200 range by 25%.

Level Bonus:
+1% spell damage
Download

Toggle Triggers

Autocast

caster_art: Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl AUTOCAST_cooldown: 5 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_ALWAYS_BUFF AUTOCAST_manacost: 200 AUTOCAST_range: 500 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: true AUTOCAST_targetType: 0 target_art: Abilities\Spells\Items\AIma\AImaTarget.mdl AUTOCAST_autoRange: 500
private function onAutocast takes Tower tower returns nothing
local Iterate towers = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TYPE_TOWERS,500)
local Tower u
local real mana
local real currentmana
    
loop  
    set u = towers.next() 
    exitwhen u == 0
    if u != tower then
    set mana = GetUnitState(u.getUnit(), UNIT_STATE_MAX_MANA)
    set currentmana = GetUnitState(u.getUnit(), UNIT_STATE_MANA)
    if u.getFamily() == tower.getFamily() then
    call SetUnitState(u.getUnit(), UNIT_STATE_MANA, currentmana + mana * (0.1 + 0.004*tower.getLevel()))
    else
    call SetUnitState(u.getUnit(), UNIT_STATE_MANA, currentmana + mana * (0.2 + 0.008*tower.getLevel()))
    endif
    endif
endloop
endfunction

Header

    globals
        //@import
        BuffType drol_wellAura
    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

Tower Aura

AURA_auraEffect: drol_wellAura AURA_power: 250 AURA_level: 250 AURA_auraRange: 200 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 10 AURA_powerAdd: 10 AURA_targetSelf: true
Sorceress v1
3800
ID:
160
Family ID:
Author:
cedi
Rarity:
unique
Element:
astral
Attack Type:
Magic
Attack Range:
1200
Attack CD:
3
Damage:
5760-5771
Status:
Approved

Description:

I make your dreams come true.
Choose Modification
Cycle through the modifications:
Slow: 8% for 5 seconds, -20% dmg
Silence: 5 seconds, 50% chance, -40% dmg
Health Regeneration: -10% for 5 seconds, -25% dmg
Armor: -6% for 5 seconds, -25% dmg
Spell Vulnerability: 12% for 5 seconds, -25% dmg
AoE: 50, -15% dmg

AC_TYPE_NOAC_IMMEDIATE
 0, 0 range, 0s cooldown
Add Modification
Adds the bonus to the missile if the tower has enough damage left.

AC_TYPE_NOAC_IMMEDIATE
 0, 0 range, 0s cooldown
Remove Modification
Removes the bonus to the missile and returns the damage used.

AC_TYPE_NOAC_IMMEDIATE
 0, 0 range, 0s cooldown
Magic Missile
Whenever this tower attacks it launches a magic missile in the target's direction. The missile hits all units in 150 AoE and deals 100% of the tower's attack damage as spell damage to the hit units. The missile travels 1200 units.

Level Bonus:
+2% spell damage
Download

Toggle Triggers

Autocast

AUTOCAST_cooldown: 0 AUTOCAST_autoRange: 0 AUTOCAST_manacost: 0 AUTOCAST_range: 0 AUTOCAST_targetType: 0 AUTOCAST_numBuffsBeforeIdle: 0 caster_art: target_art: AUTOCAST_autocastType: AC_TYPE_NOAC_IMMEDIATE AUTOCAST_buffType: 0 AUTOCAST_isExtended: false AUTOCAST_targetSelf: true
private function onAutocast takes Tower tower returns nothing
    set tower.userInt2 = tower.userInt2 + 1
    if tower.userInt2 > 6 then
        set tower.userInt2 = 1
    endif
    call tower.getOwner().displaySmallFloatingText( strings[tower.userInt2], tower, 255, 255, 255, 40 )
endfunction

Autocast

AUTOCAST_cooldown: 0 AUTOCAST_autoRange: 0 AUTOCAST_manacost: 0 AUTOCAST_range: 0 AUTOCAST_targetType: 0 AUTOCAST_numBuffsBeforeIdle: 0 caster_art: target_art: AUTOCAST_autocastType: AC_TYPE_NOAC_IMMEDIATE AUTOCAST_buffType: 0 AUTOCAST_isExtended: false AUTOCAST_targetSelf: true
private function onAutocast takes Tower tower returns nothing
    local Data d = tower.userInt
    //inc
    if tower.userInt2 == 1 then
        //slow
        if d.dmg >= 20 then
            set d.slow = d.slow + 8
            set d.dmg = d.dmg - 20
        endif
    elseif tower.userInt2 == 2 then
        //silence
        if d.dmg >= 40 then
            set d.silence = d.silence + 5
            set d.dmg = d.dmg - 40
        endif
    elseif tower.userInt2 == 3 then
        //regen
        if d.dmg >= 25 then
            set d.regen = d.regen + 10
            set d.dmg = d.dmg - 25
        endif
    elseif tower.userInt2 == 4 then
        //armor
        if d.dmg >= 25 then
            set d.armor = d.armor + 6
            set d.dmg = d.dmg - 25
        endif
    elseif tower.userInt2 == 5 then
        //spell
        if d.dmg >= 25 then
            set d.spell = d.spell + 12
            set d.dmg = d.dmg - 25
        endif
    elseif tower.userInt2 == 6 then
        //aoe
        if d.dmg >= 15 then
            set d.aoe = d.aoe + 50
            set d.dmg = d.dmg - 15
        endif
    endif
endfunction

Autocast

AUTOCAST_cooldown: 0 AUTOCAST_autoRange: 0 AUTOCAST_manacost: 0 AUTOCAST_range: 0 AUTOCAST_targetType: 0 AUTOCAST_numBuffsBeforeIdle: 0 caster_art: target_art: AUTOCAST_autocastType: AC_TYPE_NOAC_IMMEDIATE AUTOCAST_buffType: 0 AUTOCAST_isExtended: false AUTOCAST_targetSelf: true
private function onAutocast takes Tower tower returns nothing
    local Data d = tower.userInt
    //inc
    if tower.userInt2 == 1 then
        //slow
        if d.slow >= 8 then
            set d.slow = d.slow - 8
            set d.dmg = d.dmg + 20
        endif
    elseif tower.userInt2 == 2 then
        //silence
        if d.silence >= 5 then
            set d.silence = d.silence - 5
            set d.dmg = d.dmg + 40
        endif
    elseif tower.userInt2 == 3 then
        //regen
        if d.regen >= 10 then
            set d.regen = d.regen - 10
            set d.dmg = d.dmg + 25
        endif
    elseif tower.userInt2 == 4 then
        //armor
        if d.armor >= 6 then
            set d.armor = d.armor - 6
            set d.dmg = d.dmg + 25
        endif
    elseif tower.userInt2 == 5 then
        //spell
        if d.spell >= 12 then
            set d.spell = d.spell - 12
            set d.dmg = d.dmg + 25
        endif
    elseif tower.userInt2 == 6 then
        //aoe
        if d.aoe > 150 then
            set d.aoe = d.aoe - 50
            set d.dmg = d.dmg + 15
        endif
    endif
endfunction

Header

    globals
        ProjectileType PT
        BuffType Slow
        BuffType Armor
        BuffType Spell
        BuffType Regen
        string array strings[7]
        MultiboardValues MB
    endglobals
    
    struct Data
        integer slow       = 0 //+0.05
        integer silence    = 0 //+5.0
        integer regen      = 0 //+0.05
        integer armor      = 0 //+1
        integer spell      = 0 //+0.06
        integer aoe        = 150 //No percentage, integer value!
        integer dmg        = 100
    endstruct
    
    function coll takes Projectile P, Unit U returns nothing
        local Tower T = P.getCaster() 
        local Data d = T.userInt
        
        if d.slow > 0.0 then
            //slow
            call Slow.apply( T, U, d.slow )
        endif
        if d.silence > 0.0 then
            //silence
            if ( T.calcChance( 0.5 ) ) then
                call cb_silence.applyOnlyTimed( T, U, d.silence )
            endif
        endif
        if d.regen > 0.0 then
            //regen
            call Regen.apply( T, U, d.regen )
        endif
        if d.armor > 0.0 then
            //armor
            call Armor.apply( T, U, d.armor )
        endif
        if d.spell > 0.0 then
            //spell
            call Spell.apply( T, U, d.spell )
        endif
        
        if d.dmg > 0.0 then
            call T.doSpellDamage( U, T.getCurrentAttackDamageWithBonus() * ( d.dmg / 100.00 ), T.calcSpellCritNoBonus() )
        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
        local Modifier m = Modifier.create()
        
        set PT = ProjectileType.createRanged( "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl", 1200.0, 1200.0 )
        call PT.enableCollision( coll, 150.0, TARGET_CREEPS, false )
        
        call m.addModification( MOD_MOVESPEED, 0.00, -0.01 )
        set Slow = BuffType.create( 5.0, 0.0, false )
        call Slow.setBuffModifier( m )
        call Slow.setBuffIcon( '@@0@@' )
        
        set m = Modifier.create()
        call m.addModification( MOD_ARMOR_PERC, 0.0, -0.01 )
        set Armor = BuffType.create( 5.0, 0.0, false )
        call Armor.setBuffModifier( m )
        call Armor.setBuffIcon( '@@1@@' )
        
        set m = Modifier.create()
        call m.addModification( MOD_SPELL_DAMAGE_RECEIVED, 0.0, 0.01 )
        set Spell = BuffType.create( 5.0, 0.0, false )
        call Spell.setBuffModifier( m )
        call Spell.setBuffIcon( '@@2@@' )
        
        set m = Modifier.create()
        call m.addModification( MOD_HP_REGEN_PERC, 0.0, -0.01 )
        set Regen = BuffType.create( 5.0, 0.00, false )
        call Regen.setBuffModifier( m )
        call Regen.setBuffIcon( '@@3@@' )
        
        set strings[1] = "Slow"
        set strings[2] = "Silence"
        set strings[3] = "Health Regeneration"
        set strings[4] = "Armor"
        set strings[5] = "Spell Vulnerability"
        set strings[6] = "AoE"
        
        set MB = MultiboardValues.create( 2 )
        call MB.setKey( 0, "Damage %" )
        call MB.setKey( 1, "Modification" )
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    local Data d = tower.userInt
    local Projectile P = Projectile.createFromUnitToUnit( PT, tower, 1.0, 1.0, tower, Event.getTarget(), false, true, false )
    call P.setCollisionParameters( d.aoe, TARGET_CREEPS )
    call P.setScale( d.aoe / 150.0 * 6.0 ) //150 aoe has a missile size of 4 (8)
    set P.z = 60.0
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    set Event.damage = 0
endfunction

On Level Up

function onLevelUp takes Tower tower returns nothing
    local Data d = tower.userInt
    if Event.isLevelUp() then
        set d.dmg = d.dmg + 2
    else
        set d.dmg = d.dmg - 2
    endif
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    local Data data = Data.create()
    set tower.userInt = data
    set tower.userInt2 = 1
    
    set tower.userInt3 = 0
    
    set data.dmg = data.dmg + tower.getLevel() * 2
endfunction

On Tower Destruction

function onDestruct takes Tower tower returns nothing
    local Data data = tower.userInt
    call data.destroy()
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
    local Data d = tower.userInt
    local Playor p = Event.getMBObserver()
    local real t = 3.0
    
    call MB.setValue( 0, I2S( d.dmg ) + "%" )
    call MB.setValue( 1, strings[tower.userInt2] )
    
    call p.clearScreen()
    
    call p.displayTimedText( "|cffFF8000Sorceress Stats:|r", t )
    call p.displayTimedText( "Slow: |cffFFFF80" + I2S( d.slow ) + "%|r", t )
    call p.displayTimedText( "Silence: |cffFFFF80" + I2S( d.silence ) + "|r seconds", t )
    call p.displayTimedText( "Health Regeneration: |cffFFFF80-" + I2S( d.regen ) + "%|r", t )
    call p.displayTimedText( "Armor: |cffFFFF80-" + I2S( d.armor ) + "%|r", t )
    call p.displayTimedText( "Spell Vulnerability: |cffFFFF80-" + I2S( d.spell ) + "%|r", t )
    call p.displayTimedText( "AoE: |cffFFFF80" + I2S( d.aoe ) + "|r", t )
    
    return MB
endfunction
Ymir v1
3800
ID:
372
Family ID:
Author:
IamanEvilMan
Rarity:
unique
Element:
ice
Attack Type:
Elemental
Attack Range:
900
Attack CD:
1.5
Damage:
2300-2300
Status:
Approved

Description:

From the flesh of Ymir, king of the Jötanr, gods fashioned the mortal realms. Born of venom dripped into the frozen waters of Elivágar, Ymir was exiled to the lonely wastes of Ginnungagap where he mastered Icy powers.
Specials:
Splash attack:
   400 AoE: 25% damage
+10% damage/lvl
Wrath of Ymir
When Ymir damages a creep, there is a 20% chance that he deals an additional 10% of his attack damage as spell damage and slows the target by an amount equal to the percent of its remaining hitpoints for 2 seconds. 

Level Bonus:
+0.4% chance 
+0.6% damage
Blood of Ymir
When a creep comes in 900 range of Ymir, he debuffs the creep for 6 seconds, increasing vulnerability to Ice towers by 25%. 

Level Bonus:
+0.08 seconds duration
+0.4% vulnerability
Flesh of Ymir - Aura
The ancient Flesh of Ymir grants him -25% debuff duration. 

Level Bonus:
-0.6% debuff duration
Download

Toggle Triggers

Header

globals
    BuffType IamAnEvilMan_Blood_of_Ymir 
    BuffType IamAnEvilMan_Flesh_of_Ymir
    BuffType IamAnEvilMan_Wrath_of_Ymir
    MultiboardValues EvilManValues
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()
    call m.addModification(MOD_DMG_FROM_ICE, 0.25, 0.004) 
    set IamAnEvilMan_Blood_of_Ymir = BuffType.create( 6.00, 0.08, false )
    call IamAnEvilMan_Blood_of_Ymir.setBuffModifier(m)
    call IamAnEvilMan_Blood_of_Ymir.setStackingGroup("IamAnEvilMan_Blood_of_Ymir")
    call IamAnEvilMan_Blood_of_Ymir.setBuffIcon('@@0@@')
   
    set m = Modifier.create()
    call m.addModification(MOD_DEBUFF_DURATION,-0.25,-0.006)
    set IamAnEvilMan_Flesh_of_Ymir = BuffType.createAuraEffectType(true)
    call IamAnEvilMan_Flesh_of_Ymir.setBuffModifier(m)
    call IamAnEvilMan_Flesh_of_Ymir.setStackingGroup("IamAnEvilMan_Flesh_of_Ymir")
    call IamAnEvilMan_Flesh_of_Ymir.setBuffIcon('@@1@@')
    
    set m = Modifier.create()
    call m.addModification(MOD_MOVESPEED,-1,0.001) 
    set IamAnEvilMan_Wrath_of_Ymir=BuffType.create(0,0,false) 
    call IamAnEvilMan_Wrath_of_Ymir.setBuffModifier(m)     
    call IamAnEvilMan_Wrath_of_Ymir.setBuffIcon('@@2@@')  

    set EvilManValues = MultiboardValues.create(1)
    call EvilManValues.setKey(0, "Wrath Spelldamage")
    
endfunction

On Damage

ONDAMAGE_chance: .20 ONDAMAGE_chanceLevelAdd: 0.004
function onDamage takes Tower tower returns nothing
    
    local Creep target = Event.getTarget()
    local integer slow_power = 1000-R2I(target.getLifePercent()*1000) //slow becomes less powerful with every cast
    local real Wrath_Dmg = tower.getCurrentAttackDamageWithBonus() * (.1 + .006*tower.getLevel())
    
    call tower.doSpellDamage(target, Wrath_Dmg, tower.calcSpellCritNoBonus())
    call IamAnEvilMan_Wrath_of_Ymir.applyCustomTimed(tower, target, slow_power, 2.0)
    call SFXAtUnit("Abilities\\Weapons\\ZigguratFrostMissile\\ZigguratFrostMissile.mdl", target.getUnit())
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    //This allows Ymir to turn and face his foes
    call AddUnitAnimationProperties(tower.getUnit(), "stand alternate", false)
    //Ymir only gains Base Damage if he kills a unit under the effects of his debuff, so previous kills do not count
    set tower.userInt = 0
    
    
    
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
    local real Wrath_Dmg = tower.getCurrentAttackDamageWithBonus() * (.1 + .006*tower.getLevel())

    call EvilManValues.setValue(0, I2S(R2I(Wrath_Dmg)))
    return EvilManValues    
    
endfunction

On Unit Comes In Range

UNITINRANGE_targetType: TARGET_TYPE_CREEPS UNITINRANGE_range: 900
function onUnitInRange takes Tower tower returns nothing
    call IamAnEvilMan_Blood_of_Ymir.apply(tower, Event.getTarget(), tower.getLevel())
endfunction

Tower Aura

AURA_auraEffect: IamAnEvilMan_Flesh_of_Ymir AURA_power: 0 AURA_level: 0 AURA_auraRange: 0.00 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 1 AURA_powerAdd: 1 AURA_targetSelf: true
Ancient Owl of Wisdom v1
3900
ID:
191
Family ID:
Author:
Der_kleine_Tomy
Rarity:
unique
Element:
astral
Attack Type:
Energy
Attack Range:
900
Attack CD:
2
Damage:
2977-2977
Status:
Approved

Description:

Strong spell damage tower which gets stronger with experience. Can even damage immune units with it's spells.
Specials:
5% spell crit chance (+0.15%/lvl)
+1% spell damage/lvl
Weak Spots:
The Ancient Owl of Wisdom is able to find weak spots even on magic immune units. It's Energyball deals 15% of its spell damage as energy damage to immune units.

Level Bonus:
+0.6% damage
Energyball
The Ancient Owl of Wisdom has a 30% chance to cast Energyball on the attacked creep. The Energyball deals 6500 + [3.25x Towerexp] spell damage in a 100 AoE around the attacked creep. The experience bonus cannot exceed [150x current wave] damage.

Level Bonus:
+2 AoE
+0.4% chance
Energy Aura
Every 4 seconds, for each creep in 900 range the Ancient Owl of Wisdom has a 10% chance to cast Energyball on it.

Level Bonus:
+0.2% chance
Download

Toggle Triggers

Header

    globals
    //@import
      ProjectileType tomy_energyballPT
    endglobals
    
    
 function Tomy_Energyball_Start takes Unit target, Tower tower returns nothing
    set Projectile.createFromUnitToUnit(tomy_energyballPT,tower,0,0,tower,target,true,false,false).userInt = tower
 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: 0.30 ONATTACK_chanceLevelAdd: 0.004
function onAttack takes Tower tower returns nothing
    call Tomy_Energyball_Start(Event.getTarget(),tower)
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
 set tower.userInt = 2
endfunction

Periodic

PERIODIC_period: 4.0
function periodic takes Tower tower returns nothing
 
    local Unit target
    local Iterate it = Iterate.overUnitsInRangeOfCaster(tower,TARGET_CREEPS,900)
   
    loop
        set target = it.next()
        exitwhen target == 0
        if tower.calcChance(0.10+0.002*tower.getLevel()) then
            call Tomy_Energyball_Start(target,tower)
        endif 
    endloop
  
endfunction
Time Manipulator v1
4000
ID:
23
Family ID:
Author:
Majildian
Rarity:
unique
Element:
astral
Attack Type:
Magic
Attack Range:
950
Attack CD:
3
Damage:
3994-3994
Mana:
550
Mana regen:
5
Status:
Approved

Description:

An elven mage who has devoted his entire life to the study of time.
Time Field
The Manipulator creates a field of time that inflicts future injuries upon creatures around him dealing 1500 damage every second for 10 seconds. This ability benefits from the buff duration bonus of Time Twist. 

Level Bonus:
+75 damage

AC_TYPE_OFFENSIVE_IMMEDIATE
 500, 950 range, 30s cooldown
Future Knowledge
The Manipulator travels into the future to learn more and returns to where he left every 10 seconds, increasing his experience by 2. If he has 700 or more exp then he will exchange 50 experience for 5% extra spell damage. If the Manipulator is replaced by another tower, this process is reversed and all experience refunded.
Time Twist - Aura
The Manipulator reaches into the timestream and twists it causing future and past events to occur in the present, granting towers in 240 range: 
+10% experience gain 
+10% attack speed 
+5% mana regen
+12.5% buff duration 

Level Bonus:
+1.6% exp gain
+1% attack speed
+2% mana regen
+1.5% buff duration
Download

Toggle Triggers

Autocast

caster_art: Abilities\Spells\Other\Drain\DrainCaster.mdl AUTOCAST_cooldown: 30 AUTOCAST_numBuffsBeforeIdle: 1 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 500 AUTOCAST_range: 950 AUTOCAST_buffType: MajTimeField AUTOCAST_targetSelf: true AUTOCAST_targetType: TARGET_TYPE_CREEPS target_art: AUTOCAST_autoRange: 925
private function onAutocast takes Tower tower returns nothing
    call MajTimeField.apply(tower,tower,tower.getLevel())
endfunction

Header

    globals
        BuffType MajManipAura
        BuffType MajTimeField
        MultiboardValues MajFutureKnowledge
    endglobals
    
    function MajFieldDamage takes Buff b returns nothing 
        local Tower caster = b.getCaster()
        call caster.doSpellDamagePBAoE(950,b.getLevel()*75+1500,caster.calcSpellCritNoBonus(),0.0)
    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 MajManipMod = Modifier.create()
        
        set MajTimeField = BuffType.create(10,0.0,false)
        call MajTimeField.addPeriodicEvent(MajFieldDamage,1.0)
        call MajTimeField.setSpecialEffectAdvanced("Doodads\\Cinematic\\EnergyField\\EnergyField.mdl", 0, 0, 0, 3.5, 0, 255, 255, 255, 255, 180)
        
        set MajManipAura = BuffType.createAuraEffectType(true)
     
        call MajManipMod.addModification(MOD_EXP_RECEIVED,0.1,0.016)
        call MajManipMod.addModification(MOD_ATTACKSPEED,0.1,0.01)
        call MajManipMod.addModification(MOD_MANA_REGEN_PERC,0.05,0.02)
        call MajManipMod.addModification(MOD_BUFF_DURATION,0.125,0.015)
        call MajManipAura.setBuffModifier(MajManipMod)
        call MajManipAura.setBuffIcon('@@0@@')
        
        set MajFutureKnowledge = MultiboardValues.create(1)
        call MajFutureKnowledge.setKey(0,"Exp Exchanged")
    endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt = 0
endfunction

On Tower Destruction

function onDestruct takes Tower tower returns nothing
    call tower.addExpFlat(tower.userInt)
endfunction

On Tower Details

function onTowerDetails takes Tower tower returns MultiboardValues
     call MajFutureKnowledge.setValue(0, I2S(tower.userInt))
     return MajFutureKnowledge
endfunction

Periodic

PERIODIC_period: 10
function periodic takes Tower tower returns nothing
    if tower.getExp() >= 700 then
        call tower.removeExpFlat(50)
        set tower.userInt = tower.userInt + 50
        call tower.modifyProperty(MOD_SPELL_DAMAGE_DEALT, 0.05)
        call SFXOnUnit("Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl", tower.getUnit(), "overhead")
    else
        call tower.addExp(2)
        call SFXOnUnit("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", tower.getUnit(), "origin")
    endif
endfunction

Tower Aura

AURA_auraEffect: MajManipAura AURA_power: 0 AURA_level: 0 AURA_auraRange: 240 AURA_targetType: TARGET_TYPE_TOWERS AURA_levelAdd: 1 AURA_powerAdd: 1 AURA_targetSelf: true
Taita, the Hermit v1
4000
ID:
215
Family ID:
Author:
DaveMatthews
Rarity:
unique
Element:
ice
Attack Type:
Elemental
Attack Range:
1000
Attack CD:
1.3
Damage:
3112-3112
Status:
Approved

Description:

Standing on a snowy peak, he's watched the world below for decades.
Frost Bolt
On attack, this tower has a chance, equal to the percentage of movement speed the attacked unit is missing, to launch a frost bolt, dealing 20% of the tower's attack damage as elemental damage in 200 AoE around the target for each stack of icy touch the creep has. This spell deals double damage to stunned targets. 

Level Bonus:
+0.4% damage per stack
Icy Touch
Each attack slows the attacked unit by 10% for 5 seconds, stacking up to 6 times. This tower deals additional 10% damage for every stack of icy touch the target has. 

Level Bonus:
+0.2% damage per stack
Cold Blood
Every time it kills a unit, this tower gains 50% attack speed for 3 seconds. 

Level Bonus:
+0.5% attack speed
Download

Toggle Triggers

Header

    globals
      BuffType dave_blood
      BuffType dave_touch
      ProjectileType dave_frostbolt
    endglobals
    
    
    function boltHit takes Projectile p, Unit creep returns nothing
    local Tower tower = p.getCaster()
    local integer level= tower.getLevel()
    local Buff b = creep.getBuffOfType(dave_touch)
    local real damage = tower.getCurrentAttackDamageWithBonus()
    local integer bufflevel = 0
    
    if b!= 0 then
      set bufflevel = b.getLevel()
    endif
    
    if creep.getBuffOfGroup( "stun" )!=0 then
       call tower.doAttackDamageAoEUnit(creep,200,2*(damage*(bufflevel*(0.2+(0.004*level)))), tower.calcAttackMulticrit(0,0,0),0)
    else
       call tower.doAttackDamageAoEUnit(creep,200,damage*(bufflevel*(0.2+(0.004*level))), tower.calcAttackMulticrit(0,0,0),0)
    endif
    endfunction

    private function init takes nothing returns nothing
    local Modifier m = Modifier.create()
    local Modifier o = Modifier.create()
        
    set dave_blood = BuffType.create(3.0,0.0,true)
    call dave_blood.setBuffModifier(m)
    call dave_blood.setBuffIcon( '@@0@@' )
    call m.addModification(MOD_ATTACKSPEED,0.5,0.005)
    
    set dave_touch = BuffType.create(5.0,0.0,false)
    call dave_touch.setBuffModifier(o)
    call dave_touch.setBuffIcon( '@@1@@' )
    call o.addModification(MOD_MOVESPEED,0.0,-0.1)
    
    set dave_frostbolt = ProjectileType.create("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl",4,900) 
    call dave_frostbolt.enableHoming(ProjectileTargetEvent.boltHit,0)
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
local Projectile p
local Unit creep = Event.getTarget()
local unit u = creep.getUnit()
local real speed = GetUnitDefaultMoveSpeed(u)
local real currentSpeed = GetUnitMoveSpeed(u)
local real slow = ((speed - currentSpeed) / speed)

if tower.calcChance(slow) then
   set p = Projectile.createFromUnitToUnit(dave_frostbolt, tower,1,1, tower, creep, true, false, false)
endif
set u = null
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
local Unit target = Event.getTarget()
local Buff b = target.getBuffOfType(dave_touch)
local integer bufflevel = 0
local real damage = tower.getCurrentAttackDamageWithBonus()
local integer level = tower.getLevel()

if b != 0 then
   set bufflevel = b.getLevel()
   set Event.damage = Event.damage*(1+(bufflevel*(0.1+0.002*level)))
endif

if bufflevel < 6 then
    call dave_touch.apply(tower, target, bufflevel+1)
endif
endfunction

On Kill

function onKill takes Tower tower returns nothing
local integer level = tower.getLevel()

call dave_blood.apply(tower,tower,level)
endfunction
Chaining Storm v1
4000
ID:
303
Family ID:
Author:
SternBogen
Rarity:
unique
Element:
storm
Attack Type:
Energy
Attack Range:
1100
Attack CD:
1.5
Damage:
946-952
Mana:
100
Mana regen:
10
Status:
Approved

Description:

A mighty storm surrounds this tower to crush enemies in range!
Specials:
+50% dmg to air (+2%/lvl)
+15 mana/lvl
+0.1 mana regen/lvl
Strong Wind
All creeps in 900 range are affected by Strong Winds. Every second a creep is under this effect, it loses 3% of its movespeed and it is dealt 10% of towers attack damage for every 1% of movespeed it is missing. Slow effect stacks up to 15 times. Slow effect and damage is doubled for air units.

Level Bonus:
+0.08% slow
+5 damage per 1% slow
Chaining Storm
Whenever this tower attacks, it has a 25% chance to cast a Chaining Storm at the position of the attacked creep for the cost of 100 mana. All creeps in 350 range of the Chaining Storm suffer 200 spelldamage multiplied by the number of creeps hit. They are also weakened to receive 2% more damage from Storm, Ice and Astral Towers for each hitted creep. All effects of this ability are doubled and a 25% higher spell critical chance is applied whenever the main target hit is an air unit.

Level Bonus:
+1.25% trigger chance
+65 damage
+0.12% received damage
Storm Power - Aura
If a creep dies while under the effect of Strong Wind its living energy is converted in +35 mana and boost this tower's abilities. Each death increases the triggerchance for Chaining Storm by +0.02% (maximum total triggerchance for Chaining Storm is 75%) and also increase the damage dealt with Strong Winds by 0.05 damage per 1% slow.
Download

Toggle Triggers

Header

    globals
        BuffType stern_slowBuffCS
        MultiboardValues stern_stormPowerMB
    endglobals
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    
    function strongWindOnCreate takes Buff b returns nothing
        set b.userInt = 0 //will be used to store buff level
        set b.userInt2 = 0 // counts number of stacks
        set b.userReal = 0.0 //records movespeed stolen (in case aura has levelled)
        set b.userReal2 = 0.03 //stores slow factor, so that we don't need to recalculate it every second
    endfunction
    
    function strongWindPeriodic takes Buff b returns nothing
        local Tower caster = b.getCaster()
        local Unit creep = b.getBuffedUnit()
        local integer buffLevel = b.getLevel()
        // local unit u = caster.getUnit()
        
        //Check if aura level hasn't changed
        if buffLevel != b.userInt then
            set b.userInt = buffLevel
            //Give creep back its old movespeed and calculate new slow factor.
            set b.userReal2 = 0.03 + 0.0008 * buffLevel
            if (creep.getSize() == SIZE_AIR) then
                set b.userReal2 = b.userReal2 * 2
            endif
            
            //Adjust movespeed accordingly
            call creep.modifyProperty(MOD_MOVESPEED, b.userReal - b.userReal2 * b.userInt2)
            set b.userReal = b.userReal2 * b.userInt2
        endif
        
        //Apply slow
        if b.userInt2 < 15 then //Max 15 stacks
            //Add slow
            set b.userInt2 = b.userInt2 + 1
            call creep.modifyProperty(MOD_MOVESPEED, -b.userReal2)
            set b.userReal = b.userReal + b.userReal2
        endif
        
        //Deal damage
        call caster.doAttackDamage(creep, b.userReal * 10 * caster.getCurrentAttackDamageWithBonus() * (1 + 0.05 * buffLevel + 0.0005 * caster.userInt), caster.calcAttackMulticrit(0,0,0))
        // method displayFloatingText takes string whichText, Unit whichUnit, integer red, integer green, integer blue returns nothing
        // call caster.getOwner().displayFloatingText(R2S(1 + 0.05 * buffLevel + 0.0005 * caster.userInt), caster, 200, 0, 0)
        // call caster.getOwner().displayFloatingText(R2S(b.userReal), caster, 0, 200, 0)
        
        // userReal 0.01 -> 0.02 -> *100   10% of damage  -> *10 total
        // call caster.getOwner().displayFloatingText(R2S(b.userReal * 10 * caster.getCurrentAttackDamageWithBonus() * (1 + 0.05 * buffLevel + 0.0005 * caster.userInt)), creep, 200, 0, 0)
    endfunction
    
    function strongWindOnCleanup takes Buff b returns nothing
        local Tower caster = b.getCaster()
        local Unit creep = b.getBuffedUnit()
        if (GetUnitState(creep.getUnit(), UNIT_STATE_LIFE) > 0) then
            //Give creep its movespeed back
            call creep.modifyProperty(MOD_MOVESPEED, b.userReal)
        else
            // creep died under the effect? Increse storm power!
            set caster.userInt = caster.userInt + 1
            // + mana
            call caster.subtractMana(-35,true)
        endif

    endfunction
    
    private function init takes nothing returns nothing
        set stern_slowBuffCS = BuffType.createAuraEffectType(false)
        call stern_slowBuffCS.setBuffIcon('@@0@@')
        call stern_slowBuffCS.addEventOnCreate(strongWindOnCreate)
        call stern_slowBuffCS.addPeriodicEvent(strongWindPeriodic, 1.0)
        call stern_slowBuffCS.addEventOnCleanup(strongWindOnCleanup)
        
        set stern_stormPowerMB = MultiboardValues.create(1)
        call stern_stormPowerMB.setKey(0,"Storm Power")
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    
    local Unit creep = Event.getTarget()
    local real x = creep.getX()
    local real y = creep.getY()
    local integer numCreeps = 0
    local integer lvl = tower.getLevel()
    local Creep curCreep
    local Iterate creepsInRange
    local real bonusSpellCrit = 0.0
    local real mod
    local real airBonus = 1.0
    local unit towerUnit = tower.getUnit()
    local real mana = GetUnitState(towerUnit, UNIT_STATE_MANA)
    
    if tower.calcChance(0.25 + 0.0125 * lvl + tower.userInt * 0.0002) and tower.subtractMana(100, false) == 100 then
        // remove Mana
        // First Iteration
        // for damage -> count creeps (save in: numCreeps)
        
        set creepsInRange = Iterate.overUnitsInRangeOfUnit(tower, TARGET_CREEPS, creep, 350)
        loop
            set curCreep = creepsInRange.next()
            exitwhen curCreep == 0
            set numCreeps = numCreeps + 1
        endloop
        
        // do effects
        call Effect.createSimple("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", x, y).destroy()
        call Effect.createSimple("Abilities\\Spells\\NightElf\\Cyclone\\CycloneTarget.mdl", x, y).destroy()
        call Effect.createSimple("Abilities\\Spells\\Other\\Drain\\ManaDrainTarget.mdl", x, y).setLifetime(1)
        
        //Adjust ratios against air.
        if (SIZE_AIR == creep.getSize()) then
            set bonusSpellCrit = 0.25
            set airBonus = 2.0
        endif
        call tower.doSpellDamageAoEUnit(creep, 350, numCreeps * airBonus * (200 + lvl * 65), tower.calcSpellCritNoBonus() + bonusSpellCrit,0)
        
        // weaken creeps (weakening is divided by the number of creeps hit)
        set creepsInRange = Iterate.overUnitsInRangeOfUnit(tower, TARGET_CREEPS, creep, 350)
        set mod = (0.02 + 0.0012 * lvl) * numCreeps
        loop
            set curCreep = creepsInRange.next()
            exitwhen curCreep == 0
            call curCreep.modifyProperty(MOD_DMG_FROM_STORM, mod)
            call curCreep.modifyProperty(MOD_DMG_FROM_ICE, mod)
            call curCreep.modifyProperty(MOD_DMG_FROM_ASTRAL, mod)
        endloop
    endif
    set towerUnit = null
endfunction

On Tower Creation

function onCreate takes Tower tower returns nothing
    set tower.userInt = 0 //Storm Power
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Tower tower returns MultiboardValues
    call stern_stormPowerMB.setValue(0, I2S(tower.userInt))
    return stern_stormPowerMB
endfunction

Tower Aura

AURA_powerAdd: 1 AURA_auraEffect: stern_slowBuffCS AURA_levelAdd: 1 AURA_power: 0 AURA_targetType: TARGET_TYPE_CREEPS AURA_targetSelf: false AURA_level: 0 AURA_auraRange: 900.0