Necromantic Altar v1
300
ID:
4
Family ID:
Author:
Boekie
Rarity:
uncommon
Element:
darkness
Attack Type:
Decay
Attack Range:
875
Attack CD:
1.6
Damage:
287-287
Abil. Factor:
0.55
Status:
Approved

Description:

This altar is haunted by lost souls.

Latest Upload Comment:

Restored from 1.10
Soul Revenge
Hits 3 random creeps in 875 range, the first one suffers 200 spelldamage, the second one suffers 400 spelldamage and the third one suffers 600 spelldamage.

Level Bonus:
+12/24/36 spelldamage
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 1 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_manacost: 20 AUTOCAST_range: 875 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: false AUTOCAST_targetType: 0 target_art: Abilities\Spells\Undead\Curse\CurseTarget.mdl AUTOCAST_autoRange: 875
private function onAutocast takes Tower tower returns nothing
    local integer  lvl = tower.getLevel()
    local Iterate inRange = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TYPE_CREEPS,875) //Can set this at the start.
    local Unit next //Used as next during the iterate and the unit to affect during the other loop.
    local integer indexCounter = 0
    local integer loopCounter = 3
    local integer counter = 1

    loop
        set next=inRange.next()
        exitwhen next==0
        set resultArray[indexCounter] = next
        set indexCounter = indexCounter+1
    endloop
   
    if(indexCounter > 0) then //Commented lines here are for setting the period to a low time when no creeps are around,
                              //remove them if you don't want this to happen. Also if these lines are used, the On Level
                              //Up code isn't needed.
        loop
            set loopCounter = loopCounter - 1
            set next = resultArray[GetRandomInt(0,indexCounter-1)]
            call tower.doSpellDamage(next,(200+lvl*12)*counter,tower.calcSpellCritNoBonus())
            call SFXAtUnit("Abilities\\Spells\\Items\\AIre\\AIreTarget.mdl",next.getUnit())
            set counter = counter + 1
            exitwhen loopCounter == 0
        endloop
    
    endif
    
endfunction

Header

    globals
    Unit array resultArray //Instead of numResults, use a resultArray so you only have to iterate once.
    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