Garden of Eden v1
3000
ID:
652
Family ID:
Author:
Majildian
Rarity:
unique
Element:
nature
Attack Type:
Essence
Attack Range:
800
Attack CD:
1
Damage:
1885-1888
Status:
Approved

Description:

A natural wonder, once lost to the sands of time, has re-appeared harnessing a spiteful vengence.
Specials:
+50% dmg to nature
+50% dmg to orcs
+50% dmg to humanoids
Eden's Wrath
The garden uses half of the stored lifeforce to create a huge explosion, dealing [current spawn level x 15] spell damage in 1600 AoE for each lifeforce stored.

AC_TYPE_OFFENSIVE_IMMEDIATE
 0, 800 range, 10.0s cooldown
Essence of the Mortals
When the garden kills a nature, orc or human unit, its lifeforce is captured in the fountain. For each lifeforce stored in the fountain, the garden deals an additional [current spawn level x 2] spell damage on attack. Maximum of 5 stored lifeforce.

Level Bonus:
+1 maximum lifeforce
Download

Toggle Triggers

Autocast

caster_art: none AUTOCAST_cooldown: 10.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 0 AUTOCAST_range: 800 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: none AUTOCAST_autoRange: 800
private function onAutocast takes Tower tower returns nothing
    local real x = tower.getX()
    local real y = tower.getY()
    local Effect Boom
    local integer UID = tower.getUID()
    if tower.userInt > 0 then
        set Boom = Effect.createAnimatedScaled("Units\\NightElf\\Wisp\\WispExplode.mdl",x,y,0,0,8.0)
        call Boom.setAnimationSpeed(.6)
        call Boom.setLifetime(2.0)
        set Boom = Effect.createAnimatedScaled("Units\\NightElf\\Wisp\\WispExplode.mdl",x,y,0,0,8.0)
        call Boom.setAnimationSpeed(.7)
        call Boom.setLifetime(2.0)
        set Boom = Effect.createAnimatedScaled("Units\\NightElf\\Wisp\\WispExplode.mdl",x,y,0,0,8.0)
        call Boom.setAnimationSpeed(.8)
        call Boom.setLifetime(2.0)
        set Boom = Effect.createAnimatedScaled("Units\\NightElf\\Wisp\\WispExplode.mdl",x,y,0,0,8.0)
        call Boom.setAnimationSpeed(.9)
        call Boom.setLifetime(2.0)
        call TriggerSleepAction(0.5)
        if tower.getUID() == UID then
            call tower.doSpellDamagePBAoE(1600.0,tower.userInt*15*tower.userInt2,tower.calcSpellCritNoBonus(),0.0)
            set tower.userInt = R2I(tower.userInt*0.5)
        endif
    endif
endfunction

Header

    globals
        MultiboardValues lfValue
    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
        set lfValue=MultiboardValues.create(1)
        call lfValue.setKey(0,"Lifeforce Stored")  
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    local Creep target = Event.getTarget()
    set tower.userInt2 = target.getSpawnLevel()
    call tower.doSpellDamage(target,tower.userInt*2*tower.userInt2,tower.calcSpellCritNoBonus())
endfunction

On Kill

function onKill takes Tower tower returns nothing
    local integer category = Creep(Event.getTarget()).getCategory()
    if tower.userInt < (tower.getLevel()+5) and (category == CATEGORY_NATURE or category == CATEGORY_ORC or category == CATEGORY_HUMANOID) then
        set tower.userInt = (tower.userInt+1)
        call SFXAtUnit("Objects\\Spawnmodels\\NightElf\\NEDeathMedium\\NEDeath.mdl",tower.getUnit())
    endif
endfunction

On Tower Creation

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

On Tower Details

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