Array
(
    [scriptVersion] => 8
    [oeValues] => Array
        (
            [auto] => Array
                (
                )

            [Art] => ReplaceableTextures\CommandButtons\BTNArcaneSanctum.blp
            [dmgplus1] => 157
            [bldtm] => 1
            [goldcost] => 250
            [unitSound] => ArcaneSanctum
            [sides1] => 1
            [manaN] => 100
            [acquire] => 800
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => School of Magic
            [weapTp1] => missile
            [impactZ] => 60
            [file] => .mdl
            [MissileHoming] => 1
            [uberSplat] => YTDG
            [Missilespeed] => 1350
            [Missileart] => Objects\InventoryItems\runicobject\runicobject.mdl
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 2
            [modelScale] => 0.1
            [rangeN1] => 800
            [propWin] => 10
            [atkType1] => magic
            [cool1] => 2.5
            [Ubertip] => A proud institution of higher learning and lower safety standards.
            [scaleBull] => 0
            [abilList] => Array
                (
                )

            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
            [teamColor] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffFFFF00+25% |rexp gain (|cffFFFF00+1%|r/lvl)
            [abil_factor] => 0.2
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => arcane
            [rarity] => uncommon
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.463017
                    [y] => 28.9823
                    [z] => 6.4
                    [scale] => 0.35
                    [rot] => 4.45059
                    [file] => buildings\human\ArcaneSanctum\ArcaneSanctum.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => true
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 8
                )

            [1] => Array
                (
                    [x] => 0.283456
                    [y] => 26.2731
                    [z] => -19.2
                    [scale] => 1.55
                    [rot] => 3.15905
                    [file] => war3mapImported\GeneralAuraTargetWhite.mdl
                    [red] => 85
                    [green] => 55
                    [blue] => 175
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [2] => Array
                (
                    [x] => -41.7382
                    [y] => -30.7505
                    [z] => 0
                    [scale] => 0.25
                    [rot] => 5.29094
                    [file] => units\human\Priest\Priest_V1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 8
                )

            [3] => Array
                (
                    [x] => 43.6467
                    [y] => -43.2271
                    [z] => -19.2
                    [scale] => 0.45
                    [rot] => 0.453786
                    [file] => Doodads\Cityscape\Props\MagicRunes\MagicRunes1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [4] => Array
                (
                    [x] => 0.951771
                    [y] => 3.35909
                    [z] => -6.4
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [5] => Array
                (
                    [x] => 0.834554
                    [y] => -2.76979
                    [z] => -12.8
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [6] => Array
                (
                    [x] => 18.2425
                    [y] => -6.32496
                    [z] => -6.4
                    [scale] => 0.2
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [7] => Array
                (
                    [x] => -16.2529
                    [y] => -6.84324
                    [z] => -6.4
                    [scale] => 0.2
                    [rot] => 3.14159
                    [file] => Doodads\Cityscape\Structures\CityLowWall90\CityLowWall90.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [8] => Array
                (
                    [x] => 18.4303
                    [y] => -23.3703
                    [z] => -6.4
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [9] => Array
                (
                    [x] => -15.7706
                    [y] => -23.1498
                    [z] => -6.4
                    [scale] => 0.2
                    [rot] => 4.71239
                    [file] => Doodads\Cityscape\Structures\City_LowWall_TallEndCap\City_LowWall_TallEndCap.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [10] => Array
                (
                    [x] => 18.6226
                    [y] => -24.0947
                    [z] => 19.2
                    [scale] => 0.15
                    [rot] => 4.22424
                    [file] => Doodads\Cityscape\Props\CrystalLamp\CrystalLamp.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

            [11] => Array
                (
                    [x] => -16.1998
                    [y] => -22.8542
                    [z] => 19.2
                    [scale] => 0.15
                    [rot] => 5.12515
                    [file] => Doodads\Cityscape\Props\CrystalLamp\CrystalLamp.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                    [pcolor] => 255
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_EXP_RECEIVED
                    [base] => 0.25
                    [add] => 0.01
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType ashbringer_praxis_buff
        ProjectileType ashbringer_peer_projectile
    endglobals
    
    //@export
    function ashbringer_theory_cast takes Tower tower returns nothing
        local Iterate i = Iterate.overUnitsInRangeOfCaster(tower, TARGET_TYPE_TOWERS, 200)
        local Unit next
        local Buff b
        
        loop
            set next = i.next()
            exitwhen next == 0
            set b = next.getBuffOfType(ashbringer_praxis_buff)
            if b != 0 then
                set b.userInt = b.userInt + 2
            endif
        endloop
    endfunction
    
    function ashbringer_praxis_onattack takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Unit target = Event.getTarget()
        local Projectile p
        
        if b.userInt > 0 then
            set b.userInt = b.userInt - 1
            set p = Projectile.createFromPointToUnit(ashbringer_peer_projectile, tower, 0.0, 0.0, tower.getX()+GetRandomReal(-40, 40), tower.getY()+GetRandomReal(-40, 40), GetRandomReal(60, 80), target, true, false, false)
            set p.userReal = R2I(tower.userInt + (tower.getLevel() * tower.userInt2))
            set p.accelerate = 100
        endif
    endfunction
    
    function ashbringer_peer_hit takes Projectile p, Unit target returns nothing
        local Tower tower = p.getCaster()
        call tower.doSpellDamage(target, p.userReal, tower.calcSpellCritNoBonus())
    endfunction
    
    function ashbringer_praxis_oncast takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local real xp = (tower.userReal + (b.getPower() * tower.userReal2)) * RMaxBJ(1, Event.getAutocastType().getCooldown())
        
        if xp > 0 then
            call b.getBuffedUnit().addExp(xp)
        endif
        set b.userInt = b.userInt + 1
    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 mod = Modifier.create()
        
        set ashbringer_praxis_buff = BuffType.createAuraEffectType(true)
        call ashbringer_praxis_buff.setBuffIcon('@@0@@')
        call ashbringer_praxis_buff.addEventOnSpellCast(ashbringer_praxis_oncast)
        call ashbringer_praxis_buff.addEventOnAttack(ashbringer_praxis_onattack, 1, 0)
        
        set ashbringer_peer_projectile = ProjectileType.create("war3mapImported\\SpiritOfVengeanceMissilePink.mdx", 5.0, 10)
        call ashbringer_peer_projectile.enableHoming(ashbringer_peer_hit, 0.0)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Tower Aura
                    [code] => Array
                        (
                        )

                    [values] => Array
                        (
                            [AURA_powerAdd] => 1
                            [visible] => true
                            [AURA_auraEffect] => ashbringer_praxis_buff
                            [AURA_levelAdd] => 1
                            [AURA_power] => 0
                            [icon] => ReplaceableTextures\CommandButtons\BTNBansheeAdept.blp
                            [AURA_targetType] => TARGET_TYPE_TOWERS
                            [long_explain] => When a tower in |cffFFFF80200|r range casts a spell, it will gain |cffFFFF800.25|r experience, multiplied by the spell's cooldown. Additionally, the tower will gain the effect of Peer Review for |cffFFFF801|r attack.|n|nDoes not apply to this tower.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.01|r experience
                            [AURA_targetSelf] => false
                            [name] => Arcane Praxis
                            [AURA_level] => 0
                            [short_explain] => Nearby towers gain experience when they cast a spell.
                            [AURA_auraRange] => 200
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => call ashbringer_theory_cast(tower)
    call Effect.createScaled("Abilities\\Spells\\Items\\AItb\\AItbTarget.mdl", tower.getX(), tower.getY(), 0, 270, 0.5).setLifetime(3)
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 2
                            [AUTOCAST_autoRange] => 900
                            [AUTOCAST_manacost] => 40
                            [icon] => ReplaceableTextures\CommandButtons\BTNBlink.blp
                            [AUTOCAST_range] => 900
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => The school will assist the next |cffFFFF802|r attacks made by each tower in |cffFFFF80200|r range, dealing |cffFFFF80160|r spell damage to their target.|n|nDoes not apply to this tower.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+8|r spell damage
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_ALWAYS_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Peer Review
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Assists the next |cffFFFF802|r attacks made by each nearby tower,  dealing spell damage.
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userInt = 160
    set tower.userInt2 = 8
    set tower.userReal = 0.25
    set tower.userReal2 = 0.01
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BNrd
                    [oeValues] => Array
                        (
                            [Buffubertip] => Gains experience on spell cast.
                            [TargetArt] => Array
                                (
                                )

                            [Bufftip] => Arcane Praxis
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNBansheeAdept.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
            [0] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => ashbringer_praxis_buff
                )

        )

    [lightning] => Array
        (
        )

)