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

            [Art] => ReplaceableTextures\CommandButtons\BTNForgottenOne.blp
            [dmgplus1] => 5225
            [bldtm] => 1
            [goldcost] => 3500
            [unitSound] => FacelessOne
            [sides1] => 1
            [Missilearc] => 0.35
            [acquire] => 1200
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => The Kraken
            [weapTp1] => msplash
            [MissileHoming] => 1
            [file] => Units\Creeps\ForgottenOne\ForgottenOne.mdl
            [Harea1] => 100
            [uberSplat] => YTDB
            [Missilespeed] => 1050
            [Missileart] => Abilities\Weapons\ChimaeraAcidMissile\ChimaeraAcidMissile.mdl
            [Qfact1] => 0.25
            [Qarea1] => 250
            [dice1] => 1
            [RngBuff1] => 250
            [Hfact1] => 0.5
            [modelScale] => 0.3
            [rangeN1] => 1200
            [atkType1] => hero
            [cool1] => 5
            [Ubertip] => What can you do with a drunken sailor, what can you do... toss him in my gorge.
            [abilList] => Array
                (
                )

            [moveHeight] => -8
            [buildingShadow] => Array
                (
                )

            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

    [settings] => Array
        (
            [balanceTip] => |cffCCFF00Splash attack:|n   |cffFFFF00100|r AoE: |cffFFFF0050%|r damage|r|n   |cffFFFF00250|r AoE: |cffFF800025%|r damage|r|n|cffFFFF00+10% |rdmg to bosses (|cffFFFF00+1%|r/lvl)|n|cffFFFF00+2% |rattackspeed/lvl
            [abil_factor] => 0.3
            [author] => cedi, Deemzul, His_Shadow, Ashbringer, Moppy
            [alpha] => 255
            [authorDisplay] => cedi, Deemzul, His_Shadow, |cffff6600Ashbringer|r, |c006969FFMoppy|r
            [version] => 1.0
            [element] => darkness
            [rarity] => unique
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 23.0342
                    [y] => -36.0618
                    [z] => -12.8
                    [scale] => 0.24
                    [rot] => 2.61799
                    [file] => Units\Creeps\ForgottenOne\ForgottenOneTent.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [1] => Array
                (
                    [x] => -21.8431
                    [y] => -35.3646
                    [z] => -12.8
                    [scale] => 0.24
                    [rot] => 0.523599
                    [file] => Units\Creeps\ForgottenOne\ForgottenOneTent.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [2] => Array
                (
                    [x] => -39.4534
                    [y] => 7.92605
                    [z] => -12.8
                    [scale] => 0.24
                    [rot] => 5.75959
                    [file] => Units\Creeps\ForgottenOne\ForgottenOneTent.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [3] => Array
                (
                    [x] => 18.2341
                    [y] => -7.78796
                    [z] => 0
                    [scale] => 0.48
                    [rot] => 3.66519
                    [file] => Doodads\Barrens\Props\Barrens_Bones\Barrens_Bones7.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [4] => Array
                (
                    [x] => 36.8086
                    [y] => -8.4205
                    [z] => -12.8
                    [scale] => 0.24
                    [rot] => 3.14159
                    [file] => Units\Creeps\ForgottenOne\ForgottenOneTent.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [5] => Array
                (
                    [x] => -14.4539
                    [y] => 35.4227
                    [z] => -12.8
                    [scale] => 0.24
                    [rot] => 4.71239
                    [file] => Units\Creeps\ForgottenOne\ForgottenOneTent.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [6] => Array
                (
                    [x] => 27.4125
                    [y] => 27.9246
                    [z] => -12.8
                    [scale] => 0.24
                    [rot] => 3.66519
                    [file] => Units\Creeps\ForgottenOne\ForgottenOneTent.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [7] => Array
                (
                    [x] => -19.2365
                    [y] => -29.3188
                    [z] => 0
                    [scale] => 0.32
                    [rot] => 0
                    [file] => Doodads\Barrens\Props\Barrens_Bones\Barrens_Bones7.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [8] => Array
                (
                    [x] => -12.5379
                    [y] => 11.5225
                    [z] => 0
                    [scale] => 0.48
                    [rot] => 4.71239
                    [file] => Doodads\Barrens\Props\Barrens_Bones\Barrens_Bones7.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [9] => Array
                (
                    [x] => 2.94452
                    [y] => 22.4479
                    [z] => 0
                    [scale] => 0.48
                    [rot] => 4.71239
                    [file] => Doodads\Barrens\Props\Barrens_Bones\Barrens_Bones7.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [10] => Array
                (
                    [x] => -1.3195
                    [y] => -48.8027
                    [z] => 0
                    [scale] => 0.375
                    [rot] => 2.96706
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [11] => Array
                (
                    [x] => 18.5908
                    [y] => -50.0638
                    [z] => 0
                    [scale] => 0.375
                    [rot] => 5.23599
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [12] => Array
                (
                    [x] => -31.6559
                    [y] => -41.9562
                    [z] => 0
                    [scale] => 0.375
                    [rot] => 4.45059
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [13] => Array
                (
                    [x] => -45.56
                    [y] => -5.58094
                    [z] => 0
                    [scale] => 0.375
                    [rot] => 2.96706
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [14] => Array
                (
                    [x] => -25.873
                    [y] => -20.4943
                    [z] => 0
                    [scale] => 0.4
                    [rot] => 3.14159
                    [file] => Doodads\Barrens\Props\Barrens_Bones\Barrens_Bones7.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [15] => Array
                (
                    [x] => 39.8078
                    [y] => -37.7503
                    [z] => 0
                    [scale] => 0.375
                    [rot] => 0.523599
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile3.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [16] => Array
                (
                    [x] => 41.7541
                    [y] => 12.7898
                    [z] => 0
                    [scale] => 0.375
                    [rot] => 0.523599
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

            [17] => Array
                (
                    [x] => -40.6917
                    [y] => -12.4391
                    [z] => 0
                    [scale] => 0.32
                    [rot] => 3.14159
                    [file] => Doodads\Barrens\Props\Barrens_Bones\Barrens_Bones7.mdl
                    [red] => 15
                    [green] => 15
                    [blue] => 15
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

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

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_DMG_TO_BOSS
                    [base] => 0.1
                    [add] => 0.01
                )

            [1] => Array
                (
                    [id] => MOD_ATTACKSPEED
                    [base] => 0
                    [add] => 0.02
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType myBuff
        Unit array resultArray
        TargetType TT_GROUND
    endglobals

    function fire_tentacles takes Tower tower returns nothing
        local integer lvl = tower.getLevel()
        local Iterate inRange = Iterate.overUnitsInRangeOfCaster(tower, TT_GROUND, 1200)
        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
    
        if lvl == 25 then       // +1 tentacle on level 15 and 25
            set loopCounter = 8
        else
            if lvl > 14  then
                set loopCounter = 7
            else 
                set loopCounter = 6
            endif
        endif
        
        //loop through the iterate; store results in an array for random target selection in the second loop
        //This way we can get the same unit multiple times (vs. only getting one unit once by using Iterate.nextRandom)
        loop
            set next = inRange.next()
            exitwhen next == 0
            set resultArray[indexCounter] = next
            set indexCounter = indexCounter + 1
        endloop
            
        if(indexCounter > 0) then //If there were any creeps in range
            //Set cooldown (so that comes-in-range can't fire tentacles while they're on cooldown)
            set tower.userInt = Game.getGameTime() + 100 - 1 * lvl
            loop
                set loopCounter = loopCounter - 1
                set next = resultArray[GetRandomInt(0, indexCounter - 1)]
                call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\Impale\\ImpaleHitTarget.mdl", GetUnitX(next.getUnit()) + GetRandomReal(-35, 35), GetUnitY(next.getUnit()) + GetRandomReal( -35, 35)))
                call cb_stun.applyOnlyTimed(tower, next, 0.4)
                call tower.doCustomAttackDamage(next, tower.getCurrentAttackDamageWithBonus() * (0.15 + lvl * 0.002), tower.calcAttackMulticrit(0.0, 0.0, 0), AttackType.PHYSICAL)
                exitwhen loopCounter == 0
            endloop
            //Enable periodic with the cooldown
            if tower.userInt3 != 0 then
                call PeriodicEvent(tower.userInt3).enableAdvanced(4, false)
            endif
        else
            //No creeps were in range; periodic will go to sleep
            if tower.userInt3 != 0 then
                call PeriodicEvent(tower.userInt3).disable()
            endif
        endif
    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 myBuff = BuffType.create(5, 0.2, false)
        call mod.addModification(MOD_ARMOR, -15, -0.6)
        call myBuff.setBuffModifier(mod)
        call myBuff.setBuffIcon('@@0@@')
        set TT_GROUND = TargetType.create(TARGET_TYPE_CREEPS + TARGET_TYPE_SIZE_MASS + TARGET_TYPE_SIZE_NORMAL + TARGET_TYPE_SIZE_CHAMPION + TARGET_TYPE_SIZE_BOSS)
	endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Kill
                    [code] => local Unit c = Event.getTarget()
    local integer size = c.getSize()
    
    if size == SIZE_MASS then
        call tower.modifyProperty(MOD_DAMAGE_BASE_PERC, 0.005)
    elseif size == SIZE_NORMAL then
        call tower.modifyProperty(MOD_DAMAGE_BASE_PERC, 0.01)
    elseif size == SIZE_CHAMPION then
        call tower.modifyProperty(MOD_DAMAGE_BASE_PERC, 0.02)
    elseif size == SIZE_AIR then
        call tower.modifyProperty(MOD_DAMAGE_BASE_PERC, 0.02)
    elseif size == SIZE_BOSS then
        call tower.modifyProperty(MOD_DAMAGE_BASE_PERC, 0.10)
    endif
    call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Orc\\OrcLargeDeathExplode\\OrcLargeDeathExplode.mdl", GetUnitX(c.getUnit()), GetUnitY(c.getUnit())))
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNCannibalize.blp
                            [name] => Eat the Dead
                            [short_explain] => The Kraken gains a permanent increase in base attack damage on kill.
                            [long_explain] => For every kill, the Kraken's base attack damage increases permanently:|n|n|cffFFFF80+0.5%|r for masses |n|cffFFFF80+1%|r for normals|n|cffFFFF80+2%|r for champions|n|cffFFFF80+2%|r for air|n|cffFFFF80+10%|r for bosses
                        )

                )

            [2] => Array
                (
                    [name] => On Damage
                    [code] => call myBuff.apply(tower, Event.getTarget(), tower.getLevel())
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 0.3
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNCorrosiveBreath.blp
                            [name] => Acid Goo
                            [short_explain] => Chance on hit to reduce affected enemies' armor.
                            [ONDAMAGE_chanceLevelAdd] => 0.01
                            [long_explain] => The Kraken's spit has a |cffFFFF8030%|r chance on hit to reduce affected enemies' armor by |cffFFFF8015|r for |cffFFFF805|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1%|r chance|n|cffFFFF80+0.6|r armor reduction|n|cffFFFF80+0.2|r seconds duration
                        )

                )

            [3] => Array
                (
                    [name] => Periodic
                    [code] => local integer lvl = tower.getLevel()
    
    //Store PeriodicEvent into userInt3
    if tower.userInt3 == 0 then
        set tower.userInt3 = Event.getCurrentPeriodicEvent()
    endif    
    call fire_tentacles(tower)
                    [values] => Array
                        (
                            [visible] => true
                            [PERIODIC_period] => 4
                            [icon] => ReplaceableTextures\CommandButtons\BTNImpale.blp
                            [name] => Tentacle Attack
                            [short_explain] => Periodically stuns and deals a percentage of current attack damage as |cffC0C0C0Physical|r damage to nearby non-flying enemies.
                            [long_explain] => Every |cffFFFF804|r seconds, the Kraken attacks random non-flying enemies with |cffFFFF806|r tentacles. Each tentacle deals |cffFFFF8015%|r of the Kraken's current attack damage as |cffC0C0C0Physical|r damage and stuns for |cffFFFF800.4|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.2%|r damage|n|cffFFFF80+1|r tentacle at levels |cffFFFF8015|r and |cffFFFF8025|r
                        )

                )

            [4] => Array
                (
                    [name] => On Unit Comes In Range
                    [code] => if tower.userInt < Game.getGameTime() then
        call fire_tentacles(tower)
    endif
                    [values] => Array
                        (
                            [UNITINRANGE_targetType] => TARGET_TYPE_CREEPS
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [UNITINRANGE_range] => 1200
                            [long_explain] => 
                        )

                )

            [5] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userInt = 0   //Stores the tentacles' cooldown for 'fired already' state
    set tower.userInt3 = 0  //Stores the PeriodicEvent
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BNab
                    [oeValues] => Array
                        (
                            [EditorName] => Acid Goo
                            [Buffubertip] => Armor Reduced.
                            [TargetArt] => Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
                            [Bufftip] => Acid Goo
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNCorrosiveBreath.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

    [lightning] => Array
        (
        )

)