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

            [targs1] => Array
                (
                )

            [goldcost] => 3000
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1200
            [file] => Doodads\Ruins\Props\RuinsObelisk\RuinsObelisk1.mdl
            [manaN] => 350
            [atkType1] => magic
            [modelScale] => 0.65
            [weapTp1] => missile
            [acquire] => 800
            [rangeN1] => 800
            [upgrades] => Array
                (
                )

            [cool1] => 3
            [Ubertip] => A rare tower which can store magic energy for later use.
            [regenMana] => 2
            [abilList] => Array
                (
                )

            [launchZ] => 160
            [Name] => Celestial Accumulator
            [Missileart] => Abilities\Weapons\ProcMissile\ProcMissile.mdl
            [launchX] => 1
            [Art] => ReplaceableTextures\CommandButtons\BTNWispSplode.blp
            [buildingShadow] => ShadowGuardTower
            [sides1] => 1
            [auto] => Array
                (
                )

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

    [settings] => Array
        (
            [author] => tolleder
            [element] => astral
            [authorDisplay] => tolleder
            [alpha] => 255
            [balanceTip] => |cffFFFF00+10 |rmana/lvl
            [rarity] => rare
            [version] => 1.0
            [abil_factor] => 0.4
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 52.3077
                    [y] => -52.1345
                    [z] => 108.8
                    [scale] => 0.65
                    [rot] => 3.10669
                    [file] => Abilities\Spells\Items\OrbSlow\OrbSlow.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -48.7305
                    [y] => 42.539
                    [z] => 108.8
                    [scale] => 0.65
                    [rot] => 3.10669
                    [file] => Abilities\Spells\Items\OrbSlow\OrbSlow.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 50.8944
                    [y] => -51.7684
                    [z] => 0
                    [scale] => 0.65
                    [rot] => 0.942478
                    [file] => Doodads\Ruins\Props\RuinsPillar\RuinsPillar0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => 0.675836
                    [y] => 2.30881
                    [z] => 153.6
                    [scale] => 0.85
                    [rot] => 3.36849
                    [file] => Abilities\Spells\Items\OrbSlow\OrbSlow.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => -47.2251
                    [y] => 49.1274
                    [z] => 0
                    [scale] => 0.65
                    [rot] => 0.942478
                    [file] => Doodads\Ruins\Props\RuinsPillar\RuinsPillar0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [5] => Array
                (
                    [x] => -47.9378
                    [y] => -48.714
                    [z] => 0
                    [scale] => 0.65
                    [rot] => 2.79253
                    [file] => Doodads\Ruins\Props\RuinsPillar\RuinsPillar2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [6] => Array
                (
                    [x] => 46.1454
                    [y] => 45.9255
                    [z] => 0
                    [scale] => 0.65
                    [rot] => 3.83973
                    [file] => Doodads\Ruins\Props\RuinsPillar\RuinsPillar2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [7] => Array
                (
                    [x] => 4.17323
                    [y] => -50.1248
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 1.5708
                    [file] => Doodads\Ruins\Structures\RuinsArchway0_\RuinsArchway0_0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [8] => Array
                (
                    [x] => -48.1957
                    [y] => 3.96458
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 0
                    [file] => Doodads\Ruins\Structures\RuinsArchway0_\RuinsArchway0_0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [9] => Array
                (
                    [x] => 46.7025
                    [y] => -2.30208
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 0
                    [file] => Doodads\Ruins\Structures\RuinsArchway0_\RuinsArchway0_0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [10] => Array
                (
                    [x] => -1.9224
                    [y] => 48.8408
                    [z] => 0
                    [scale] => 0.14
                    [rot] => 4.71239
                    [file] => Doodads\Ruins\Structures\RuinsArchway0_\RuinsArchway0_0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_MANA
                    [base] => 0
                    [add] => 10
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userInt=0
    call SetUnitState(tower.getUnit(),UNIT_STATE_MANA,0)
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Damage
                    [code] => call slowAndDamage.applyCustomPower(tower,Event.getTarget(),3*tower.getLevel()+52,tower.getLevel())
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 1.0
                            [icon] => ReplaceableTextures\CommandButtons\BTNFaerieFire.blp
                            [visible] => true
                            [name] => Faerie Fire
                            [short_explain] => Makes the attacked creep more vulnerable against spells/debuffs
                            [ONDAMAGE_chanceLevelAdd] => 0.0
                            [long_explain] => A creep hit by one of this tower's shots takes |cffFFFF8020%|r extra damage from spells and has |cffFFFF8030%|r reduced debuff resistance for |cffFFFF809|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.8%|r extra spell damage|n|cffFFFF80-1%|r debuff resistance|n|cffFFFF80+0.3|r seconds duration
                        )

                )

            [2] => Array
                (
                    [name] => Header
                    [code] => 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()*72+1800,tower.calcSpellCritNoBonus())
        call slowAndDamage.applyCustomPower(tower,creep,3*tower.getLevel()+52,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 sWeakeness=Modifier.create()
        call sWeakeness.addModification(MOD_SPELL_DAMAGE_RECEIVED,0.20,0.008)
        call sWeakeness.addModification(MOD_DEBUFF_RESISTANCE,-0.30,-0.01)
        
        set slowAndDamage=BuffType.create(9,0.3,false)
        call slowAndDamage.setBuffIcon('@@0@@')
        call slowAndDamage.setBuffModifier(sWeakeness)
        call slowAndDamage.setStackingGroup("MagicBattery")
        
        set pT=ProjectileType.create("Abilities\\Weapons\\ProcMissile\\ProcMissile.mdl",10.0,1200.0)        
        call pT.enableHoming(ProjectileTargetEvent.hit,0.0)
	endfunction
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [3] => Array
                (
                    [name] => Periodic
                    [code] => 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)+1.0,GetUnitY(towerUnit)+2.0,154.0,result,true,false,false)
                else
                    set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)-49.0,GetUnitY(towerUnit)+43.0,109.0,result,true,false,false)
                endif
            else
                set p= Projectile.createFromPointToUnit(pT,tower,1.0,1.0,GetUnitX(towerUnit)+52.0,GetUnitY(towerUnit)-52.0,109.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
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [PERIODIC_period] => 0.2
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [4] => Array
                (
                    [name] => Autocast
                    [code] => 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
                    [values] => Array
                        (
                            [caster_art] => 
                            [icon] => ReplaceableTextures\CommandButtons\BTNWispSplode.blp
                            [AUTOCAST_cooldown] => 20.0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [visible] => true
                            [AUTOCAST_isExtended] => false
                            [long_explain] => The tower attacks creeps in a range of |cffFFFF801200|r every |cffFFFF800.2|r seconds till all mana is gone. Each attack (or try to attack) costs |cffFFFF8010|r mana, deals |cffFFFF801800|r spelldamage and applies Faerie Fire.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+72|r damage
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_manacost] => 100
                            [AUTOCAST_range] => 1200
                            [name] => Accumulator Overload
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Multiple attacks at a high rate for mana
                            [AUTOCAST_targetType] => 0
                            [target_art] => 
                            [AUTOCAST_autoRange] => 800
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Bslo
                    [oeValues] => Array
                        (
                            [Bufftip] => Faerie Fire
                            [Targetattach] => head
                            [Buffubertip] => On this creep debuffs last longer and it takes extra damage from spells.
                            [Targetattachcount] => 1
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNFaerieFire.blp
                            [TargetArt] => Abilities\Spells\NightElf\FaerieFire\FaerieFireTarget.mdl
                            [EditorName] => Faerie Fire
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)