Array
(
    [scriptVersion] => 7
    [oeValues] => Array
        (
            [RngBuff1] => 250
            [MissileHoming] => 1
            [Upgrade] => Array
                (
                )

            [targs1] => Array
                (
                )

            [goldcost] => 300
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1500
            [file] => Doodads\Icecrown\Props\IceTorch\IceTorch.mdl
            [manaN] => 30
            [atkType1] => hero
            [weapTp1] => missile
            [Missilearc] => 0.2
            [acquire] => 875
            [rangeN1] => 875
            [upgrades] => Array
                (
                )

            [cool1] => 1.6
            [Ubertip] => This altar is haunted by lost souls.
            [regenMana] => 2
            [abilList] => Array
                (
                )

            [mana0] => 5
            [Name] => Necromantic Altar
            [Missileart] => Abilities\Weapons\SludgeMissile\SludgeMissile.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNAcidBomb.blp
            [buildingShadow] => Array
                (
                )

            [sides1] => 1
            [auto] => Array
                (
                )

            [dmgplus1] => 286
            [bldtm] => 1
        )

    [settings] => Array
        (
            [author] => Boekie
            [element] => darkness
            [authorDisplay] => |cff00CD00Boekie|r
            [alpha] => 255
            [balanceTip] => Array
                (
                )

            [rarity] => uncommon
            [version] => 1.0
            [abil_factor] => 0.55
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -1.39922
                    [y] => -10.9143
                    [z] => 0
                    [scale] => 0.8
                    [rot] => 4.53786
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => 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
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Autocast
                    [code] => 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
                    [values] => Array
                        (
                            [caster_art] => 
                            [icon] => ReplaceableTextures\CommandButtons\BTNLocustSwarm.blp
                            [AUTOCAST_cooldown] => 1
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [AUTOCAST_isExtended] => false
                            [long_explain] => Hits |cffFFFF803|r random creeps in |cffFFFF80875|r range, the first one suffers |cffFFFF80200|r spelldamage, the second one suffers |cffFFFF80400|r spelldamage and the third one suffers |cffFFFF80600|r spelldamage.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+12/24/36|r spelldamage
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_manacost] => 20
                            [AUTOCAST_range] => 875
                            [AUTOCAST_buffType] => 0
                            [name] => Soul Revenge
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Hits 3 random creeps with dark powers.
                            [AUTOCAST_targetType] => 0
                            [target_art] => Abilities\Spells\Undead\Curse\CurseTarget.mdl
                            [AUTOCAST_autoRange] => 875
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)