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

            [Art] => ReplaceableTextures\CommandButtons\BTNRazorback.blp
            [turnRate] => 3
            [dmgplus1] => 378
            [bldtm] => 1
            [goldcost] => 800
            [sides1] => 20
            [blend] => -4
            [manaN] => 100
            [acquire] => 800
            [upgrades] => Array
                (
                )

            [Upgrade] => Array
                (
                )

            [Name] => Quillboar Thornweaver
            [weapTp1] => missile
            [MissileHoming] => 1
            [file] => units\creeps\Bristleback\Bristleback.mdl
            [uberSplat] => OSMA
            [Missileart] => Abilities\Weapons\QuillSprayMissile\QuillSprayMissile.mdl
            [Missilespeed] => 1300
            [dice1] => 1
            [RngBuff1] => 250
            [regenMana] => 1
            [modelScale] => 0.7
            [rangeN1] => 800
            [backSw1] => 0.3
            [atkType1] => siege
            [cool1] => 0.9
            [Ubertip] => Advanced Nature tower that is able to release a spray of thorns from it's back.
            [abilList] => Array
                (
                )

            [moveHeight] => 41
            [dmgpt1] => 0.4
            [buildingShadow] => Array
                (
                )

            [castbsw] => 0
            [targs1] => Array
                (
                )

            [weapsOn] => 1
        )

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

            [abil_factor] => 0.5
            [author] => SirCoqaLot.
            [alpha] => 255
            [authorDisplay] => SircoqaLot.
            [version] => 1.0
            [element] => nature
            [rarity] => rare
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 7.56607
                    [y] => 26.5825
                    [z] => 0
                    [scale] => 0.9
                    [rot] => 3.51567
                    [file] => Doodads\Ruins\Rocks\Ruins_Rock\Ruins_Rock5.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -53.4381
                    [y] => 19.2804
                    [z] => 0
                    [scale] => 1.4
                    [rot] => 3.83486
                    [file] => Doodads\Ashenvale\Plants\AshenShrooms\AshenShrooms0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 24.8968
                    [y] => -49.3728
                    [z] => 0
                    [scale] => 0.6
                    [rot] => 2.34648
                    [file] => Doodads\Ashenvale\Plants\AshenShrooms\AshenShrooms0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => -39.3442
                    [y] => -46.7869
                    [z] => 0
                    [scale] => 0.65
                    [rot] => 1.9404
                    [file] => Doodads\Ashenvale\Plants\AshenShrooms\AshenShrooms0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => 37.7746
                    [y] => -36.4866
                    [z] => 0
                    [scale] => 1
                    [rot] => 5.29527
                    [file] => Doodads\LordaeronSummer\Props\HeadOnSpear\HeadOnSpear2.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Attack
                    [code] => local integer level = tower.getLevel()
    call quillspray(tower,1350)
    if level == 25 then 
        if tower.calcChance(0.03) then
            call quillspray(tower,1500)
            call quillspray(tower,1700)
        elseif tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    elseif level > 15 then
        if tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    endif
                    [values] => Array
                        (
                            [visible] => true
                            [icon] => ReplaceableTextures\CommandButtons\BTNQuillSprayOff.blp
                            [name] => Occasional Quillspray
                            [short_explain] => Every attack of this tower has a chance to trigger a Quillspray
                            [ONATTACK_chance] => 0.12
                            [ONATTACK_chanceLevelAdd] => 0.0015
                            [long_explain] => On attack this tower has a |cffFFFF8012%|r chance to trigger a Quillspray. |n|n|cffFFFF80Hint:|r This Quillspray costs no mana. |n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.15%|r chance
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
    //@export
    ProjectileType sir_boar_proj
    //@export
    BuffType sir_boar_debuff
    endglobals
    
    //@export
    function quillspray takes Tower tower, real speed returns nothing
    local Iterate i
    local Unit u
    local Projectile p
    set i = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TYPE_CREEPS,800)
    
    loop
        set u = i.next()
        exitwhen u == 0 
        set p = Projectile.createFromUnitToUnit(sir_boar_proj,tower,1.0,1.0,tower,u,true,false,false)
        call p.setScale(0.7)
        set p.speed = speed
    endloop
    endfunction
    
    private function sir_boar_hit takes Projectile p , Unit creep returns nothing
        local Tower tower = p.getCaster()
        local integer buffLevel = IMinBJ(creep.getBuffOfType(sir_boar_debuff).getLevel(),40)
        call tower.doAttackDamage(creep,(0.3+tower.getLevel()*0.002)*tower.getCurrentAttackDamageWithBonus()*Pow(1.11,I2R(buffLevel)),tower.calcAttackMulticrit(0,0,0))
        call sir_boar_debuff.applyAdvanced(tower,creep,buffLevel+1,0,1.5)
    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 sir_boar_debuff = BuffType.create(0,0,false)
    call sir_boar_debuff.setBuffIcon('@@0@@')
    set sir_boar_proj = ProjectileType.create("Abilities\\Weapons\\QuillSprayMissile\\QuillSprayMissile.mdl",2,1300)
    call sir_boar_proj.enableHoming(ProjectileTargetEvent.sir_boar_hit,0)
	endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [icon] => 
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => Autocast
                    [code] => local integer level = tower.getLevel()
    call quillspray(tower,1350)
    if level == 25 then 
        if tower.calcChance(0.03) then
            call quillspray(tower,1500)
            call quillspray(tower,1700)
         elseif tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    elseif level > 15 then
        if tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    endif
                    [values] => Array
                        (
                            [AUTOCAST_cooldown] => 0.2
                            [AUTOCAST_autoRange] => 700
                            [AUTOCAST_manacost] => 5
                            [icon] => ReplaceableTextures\CommandButtons\BTNQuillSpray.blp
                            [AUTOCAST_range] => 800
                            [AUTOCAST_targetType] => 0
                            [AUTOCAST_numBuffsBeforeIdle] => 0
                            [caster_art] => 
                            [long_explain] => This tower deals |cffFFFF8030%|r of its attack damage as physical damage to every unit in |cffFFFF80800|r range around it. A creep hit by a Quillspray receives |cffFFFF8011%|r more damage than it did from the previous Quillspray, if hit again within |cffFFFF801.5|r seconds. This effect stacks up to |cffFFFF8040|r times.|n|n|cffFFFF80Hint:|r Save mana to amplify the effect of this ability.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.2%|r base damage|n|cffFFFF805%|r chance to doublecast Quillsprays at level |cffFFFF8015|r|n|cffFFFF803%|r chance to triplecast Quillsprays at level |cffFFFF8025|r
                            [target_art] => 
                            [AUTOCAST_autocastType] => AC_TYPE_OFFENSIVE_IMMEDIATE
                            [AUTOCAST_buffType] => 0
                            [AUTOCAST_isExtended] => true
                            [name] => Quillspray
                            [AUTOCAST_targetSelf] => true
                            [short_explain] => This tower releases thorns from it's back, damaging every unit in range.
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BHbn
                    [oeValues] => Array
                        (
                            [EditorName] => Quill Sprayed
                            [Effectsoundlooped] => Array
                                (
                                )

                            [Buffubertip] => This unit has been hit by a Quillspray the next Quillspray will deal increased damage.
                            [TargetArt] => Objects\Spawnmodels\Human\HumanBlood\HumanBloodRifleman.mdl
                            [Bufftip] => Quill Sprayed
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNQuillSpray.blp
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
            [0] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => ProjectileType
                    [name] => sir_boar_proj
                )

            [1] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => sir_boar_debuff
                )

        )

)