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

            [Art] => ReplaceableTextures\CommandButtons\BTNSatyrTrickster.blp
            [turnRate] => 3
            [dmgplus1] => 717
            [bldtm] => 1
            [goldcost] => 1200
            [unitSound] => Satyr
            [sides1] => 1
            [Missilearc] => 0.05
            [manaN] => 100
            [acquire] => 850
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Hellcaller
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => units\creeps\SatyrTrickster\SatyrTrickster.mdl
            [uberSplat] => YTDB
            [Missileart] => Abilities\Weapons\DemonHunterMissile\DemonHunterMissile.mdl
            [Missilespeed] => 1400
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 2
            [modelScale] => 0.6
            [rangeN1] => 850
            [atkType1] => magic
            [cool1] => 1.7
            [Ubertip] => He was once a night elf, but centuries of practicing chaos magic has permanently disfigured his mind, body and soul.
            [scaleBull] => 0
            [abilList] => @@1@@
            [moveHeight] => 23
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

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

    [settings] => Array
        (
            [balanceTip] => Array
                (
                )

            [abil_factor] => 0.3
            [author] => Ashbringer
            [alpha] => 255
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [element] => darkness
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.121471
                    [y] => 0.161476
                    [z] => 0.000000953674
                    [scale] => 0.8
                    [rot] => 4.63092
                    [file] => Doodads\BlackCitadel\Props\RuneArt\RuneArt1.mdl
                    [red] => 1
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => 0.00692971
                    [y] => 0.0815944
                    [z] => -19.2
                    [scale] => 1.65
                    [rot] => 0.244346
                    [file] => war3mapImported\GeneralAuraTargetWhite.mdl
                    [red] => 115
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -0.081094
                    [y] => 0.0376238
                    [z] => -19.2
                    [scale] => 1.65
                    [rot] => 0.244346
                    [file] => war3mapImported\GeneralAuraTargetWhite.mdl
                    [red] => 115
                    [green] => 255
                    [blue] => 1
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => -0.101533
                    [y] => -0.00881797
                    [z] => -0.000000953674
                    [scale] => 0.9
                    [rot] => 0.698132
                    [file] => Doodads\Barrens\Rocks\Geyser\Geyser0.mdl
                    [red] => 55
                    [green] => 105
                    [blue] => 55
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local real meteor_damage = 3000 + (tower.getLevel() * 120)
    local real stun = 0.5 + (tower.getLevel() * 0.02)
    
    call ashbringer_mark_trigger(tower, Event.getTarget(), meteor_damage, stun)
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNAntiMagicShell.blp
                            [name] => Doom Brand
                            [short_explain] => Attacks have a chance to summon a fel meteor after a delay, which stuns and deals spell damage in an area.
                            [ONATTACK_chance] => 0.075
                            [ONATTACK_chanceLevelAdd] => 0.003
                            [long_explain] => Attacks have a |cffffff807.5%|r chance to brand the target for |cffffff803|r seconds. When the brand ends, the target will be stunned for |cffffff801|r second and a fel meteor is summoned at their location. The meteor lands after |cffffff801|r second, dealing |cffffff803000|r spell damage to enemies in |cffffff80300|r area and stunning them for |cffffff800.5|r seconds. Doom Brand can stack but the duration cannot be refreshed or extended.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.3%|r chance|n|cffFFFF80+120|r spell damage|n|cffFFFF80+0.02|r stun duration
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType ashbringer_mark_buff
        Cast ashbringer_chaosrain_cast
        BuffType ashbringer_chaosrain_buff
    endglobals
    
    //@export
    function ashbringer_mark_trigger takes Tower tower, Unit target, real meteor_damage, real stun returns nothing
        local Buff b = target.getBuffOfType(ashbringer_mark_buff)
        
        if b != 0 then
            call b.setPower(b.getPower() + 1)
            if meteor_damage > b.userReal then
                set b.userReal = meteor_damage
            endif
            if stun > b.userReal2 then
                set b.userReal2 = stun
            endif
        else
            set b = ashbringer_mark_buff.apply(tower, target, 1)
            set b.userInt = 3
            set b.userReal = meteor_damage
            set b.userReal2 = stun
        endif
    endfunction
    
    function ashbringer_mark_create takes Buff b returns nothing
        call b.setRemainingDuration(3)
    endfunction
    
    function ashbringer_mark_cleanup takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Creep target = b.getBuffedUnit()
        local Iterate i
        local Creep next
        local real target_x = target.getX()
        local real target_y = target.getY()
        local real crit = tower.calcSpellCritNoBonus()
        local real damage = b.userReal * b.getPower()
        local real stun_duration = b.userReal2
        
        call cb_stun.applyOnlyTimed(tower, target, 1)
        call Effect.createSimple("Units\\Demon\\Infernal\\InfernalBirth.mdl", target_x, target_y).setLifetime(1)
        call TriggerSleepAction(0.75)
        set i = Iterate.overUnitsInRange(tower, TARGET_TYPE_CREEPS, target_x, target_y, 300)
        loop
            set next = i.next()
            exitwhen next == 0
            call tower.doSpellDamage(next, damage, crit)
            call cb_stun.applyOnlyTimed(tower, next, stun_duration)
        endloop
    endfunction
    
    //@export
    function ashbringer_chaosrain_start takes Tower tower, Unit target, real duration, real initial_damage, real dot_damage, real dot_duration returns nothing
        local SpellDummy d
        
        set ashbringer_chaosrain_cast.x = target.getX()
        set ashbringer_chaosrain_cast.y = target.getY()
        set d = SpellDummy.getDummy(tower, initial_damage, tower.calcSpellCritNoBonus(), ashbringer_chaosrain_cast)
        call IssuePointOrderById(d.u, OrderId("blizzard"), target.getX(), target.getY())
        set d.userReal = dot_damage
        set d.userReal2 = dot_duration
        call d.setRemainingLifetime(duration)
    endfunction
    
    function ashbringer_chaosrain_hit takes DummyUnit d returns nothing
        local Tower tower = d.getCaster()
        local Buff b = Event.getTarget().getBuffOfType(ashbringer_chaosrain_buff)
        
        if b != 0 then
            call b.setPower(b.getPower() + 1)
            if d.userReal > b.userReal then
                set b.userReal = d.userReal
            endif
            call b.refreshDuration()
        else
            set b = ashbringer_chaosrain_buff.applyCustomTimed(tower, Event.getTarget(), 1, d.userReal2)
            set b.userReal = d.userReal
        endif
    endfunction
    
    function ashbringer_chaosrain_periodic takes Buff b returns nothing
        local Tower tower = b.getCaster()
        local Creep target = b.getBuffedUnit()
        
        call tower.doSpellDamage(target, b.userReal * b.getPower(), tower.calcSpellCritNoBonus())
    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
        set ashbringer_mark_buff = BuffType.create(30, 0, false)
        call ashbringer_mark_buff.setBuffIcon('@@5@@')
        call ashbringer_mark_buff.addEventOnCreate(ashbringer_mark_create)
        call ashbringer_mark_buff.addEventOnCleanup(ashbringer_mark_cleanup)
        
        set ashbringer_chaosrain_buff = BuffType.create(0.0, 0, false)
        call ashbringer_chaosrain_buff.setBuffIcon('@@2@@')
        call ashbringer_chaosrain_buff.addPeriodicEvent(ashbringer_chaosrain_periodic, 1)
        
        set ashbringer_chaosrain_cast = Cast.create('@@0@@', "blizzard", 30.00)
        call ashbringer_chaosrain_cast.setDamageEvent( EventHandler.ashbringer_chaosrain_hit)
    endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => local real initial_damage = 500 + (tower.getLevel() * 20)
    local real dot_damage = 125 + (tower.getLevel() * 5)
    
    call ashbringer_chaosrain_start(tower, Event.getTarget(), 5*tower.getProp_BuffDuration(), initial_damage, dot_damage, 4)
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 6
                            [AUTOCAST_autoRange] => 850
                            [AUTOCAST_manacost] => 80
                            [icon] => ReplaceableTextures\CommandButtons\BTNInfernal.blp
                            [AUTOCAST_range] => 850
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => Calls down |cffFFFF805|r waves of felfire over |cffFFFF805|r seconds. Each wave deals |cffFFFF80500|r initial spell damage to enemies in |cffFFFF80300|r range and sets them aflame, dealing |cffFFFF80125|r spell damage per second for |cffFFFF804|r seconds. Number of waves is increased by buff duration and the damage over time can stack.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+20|r initial spell damage|n|cffFFFF80+5|r spell damage per second
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_UNIT
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => false
                            [name] => Rain of Chaos
                            [AUTOCAST_targetSelf] => false
                            [short_explain] => Calls down waves of felfire over an area, dealing spell damage.
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Creation
                    [code] => call SetUnitColor(tower.getUnit(), ConvertPlayerColor(6))
    set tower.userReal = 125
    set tower.userReal2 = 5
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => AHbz
                    [oeValues] => Array
                        (
                            [Cost1] => 0
                            [Rng1] => 99999
                            [EfctID1] => @@3@@
                            [DataD1] => 0
                            [Art] => ReplaceableTextures\CommandButtons\BTNBlizzard.blp
                            [DataF1] => 99999
                            [hero] => 0
                            [DataA1] => 30
                            [BuffID1] => @@2@@,@@4@@
                            [Cool1] => 1
                            [Area1] => 300
                            [DataC1] => 9
                            [DataB1] => 1
                            [Name] => Chaos Rain
                            [levels] => 1
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => Asph
                    [oeValues] => Array
                        (
                            [Ubertip] => -HIDE-
                            [Targetattach] => weapon
                            [Art] => Array
                                (
                                )

                            [Targetattach1] => Array
                                (
                                )

                            [Untip] => -HIDE-
                            [Targetattach2] => Array
                                (
                                )

                            [Targetattachcount] => 1
                            [Missileart] => Abilities\Weapons\DemonHunterMissile\DemonHunterMissile.mdl
                            [Unubertip] => -HIDE-
                            [Tip] => -HIDE-
                            [Cool1] => 0.01
                            [Name] => Chaos Sphere
                        )

                )

        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@2@@
                    [derivedFrom] => BHbd
                    [oeValues] => Array
                        (
                            [Targetattach] => origin
                            [EditorName] => Chaos Rain
                            [Buffubertip] => Taking spell damage over time.
                            [TargetArt] => war3mapImported\ImmolationGreenDamage.mdx
                            [Bufftip] => Rain of Chaos
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNInfernal.blp
                        )

                )

            [1] => Array
                (
                    [id] => @@3@@
                    [derivedFrom] => XHbz
                    [oeValues] => Array
                        (
                            [EditorName] => Chaos Rain (Effect)
                            [Effectsoundlooped] => RainOfFireLoop
                            [EffectArt] => war3mapImported\RainOfFireTargetFel.mdx
                            [Effectsound] => RainOfFireWave
                            [Buffart] => Array
                                (
                                )

                        )

                )

            [2] => Array
                (
                    [id] => @@4@@
                    [derivedFrom] => BHbz
                    [oeValues] => Array
                        (
                            [EditorName] => Chaos Rain (Caster)
                            [Buffart] => Array
                                (
                                )

                        )

                )

            [3] => Array
                (
                    [id] => @@5@@
                    [derivedFrom] => BHbd
                    [oeValues] => Array
                        (
                            [Targetattach] => overhead
                            [Buffubertip] => Summoning a fel meteor.
                            [TargetArt] => war3mapImported\BrandChaos.mdx
                            [Bufftip] => Doom Brand
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNAntiMagicShell.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)